Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/treetrek.git

Removes table for empty tags page

Author Dave Jarvis <email>
Date 2026-02-16 02:33:44 GMT-0800
Commit 64884df80e9a91e50839147cf141a050524027d5
Parent c8b214f
pages/TagsPage.php
$this->renderLayout( function() {
$this->renderBreadcrumbs( $this->currentRepo, ['Tags'] );
-
echo '<h2>Tags</h2>';
- echo '<table class="tag-table">';
- echo '<thead>';
- echo '<tr>';
- echo '<th>Name</th>';
- echo '<th>Message</th>';
- echo '<th>Author</th>';
- echo '<th class="tag-age-header">Age</th>';
- echo '<th class="tag-commit-header">Commit</th>';
- echo '</tr>';
- echo '</thead>';
- echo '<tbody>';
$tags = [];
-
$this->git->eachTag( function( Tag $tag ) use ( &$tags ) {
$tags[] = $tag;
} );
usort( $tags, function( Tag $a, Tag $b ) {
return $a->compare( $b );
} );
-
- $renderer = new HtmlTagRenderer( $this->currentRepo['safe_name'] );
if( empty( $tags ) ) {
- echo '<tr><td colspan="5"><div class="empty-state">' .
- '<p>No tags found.</p></div></td></tr>';
+ echo '<div class="empty-state"><p>No tags found.</p></div>';
} else {
- $count = count( $tags );
+ $renderer = new HtmlTagRenderer( $this->currentRepo['safe_name'] );
+
+ echo '<table class="tag-table">';
+ echo '<thead>';
+ echo '<tr>';
+ echo '<th>Name</th><th>Message</th><th>Author</th>';
+ echo '<th class="tag-age-header">Age</th>';
+ echo '<th class="tag-commit-header">Commit</th>';
+ echo '</tr>';
+ echo '</thead>';
+ echo '<tbody>';
+ $count = count( $tags );
for( $i = 0; $i < $count; $i++ ) {
$tag = $tags[$i];
$prevTag = $tags[$i + 1] ?? null;
-
$tag->render( $renderer, $prevTag );
}
- }
- echo '</tbody>';
- echo '</table>';
+ echo '</tbody>';
+ echo '</table>';
+ }
}, $this->currentRepo );
}
Delta 16 lines added, 22 lines removed, 6-line decrease