| Author | Dave Jarvis <email> |
|---|---|
| Date | 2026-02-10 19:23:55 GMT-0800 |
| Commit | 77e38cfd4b0582cda22b3bce18a77b0bc489d579 |
| Parent | 8e01bd8 |
| echo '<tr>'; | ||
| + // 1. Name | ||
| echo '<td class="tag-name">'; | ||
| - echo '<a href="' . $filesUrl . '">'; | ||
| - echo '<i class="fas fa-tag"></i> ' . htmlspecialchars($name); | ||
| - echo '</a>'; | ||
| + echo '<a href="' . $filesUrl . '"><i class="fas fa-tag"></i> ' . htmlspecialchars($name) . '</a>'; | ||
| echo '</td>'; | ||
| + // 2. Message | ||
| echo '<td class="tag-message">'; | ||
| - if ($message !== '') { | ||
| - $firstLine = strtok($message, "\n"); | ||
| - echo htmlspecialchars($firstLine); | ||
| - } else { | ||
| - echo '<span style="color: #484f58; font-style: italic;">No description</span>'; | ||
| - } | ||
| + echo ($message !== '') ? htmlspecialchars(strtok($message, "\n")) : '<span style="color: #484f58; font-style: italic;">No description</span>'; | ||
| echo '</td>'; | ||
| - | ||
| - echo '<td class="tag-meta">'; | ||
| - if ($author !== '') { | ||
| - echo htmlspecialchars($author) . ' • '; | ||
| - } | ||
| + // 3. Author | ||
| + echo '<td class="tag-author">' . htmlspecialchars($author) . '</td>'; | ||
| + // 4. Timestamp | ||
| + echo '<td class="tag-time">'; | ||
| $this->renderTime($timestamp); | ||
| + echo '</td>'; | ||
| - echo ' • <a href="' . $commitUrl . '" class="commit-hash">' . substr($sha, 0, 7) . '</a>'; | ||
| + // 5. Hash | ||
| + echo '<td class="tag-hash">'; | ||
| + echo '<a href="' . $commitUrl . '" class="commit-hash">' . substr($sha, 0, 7) . '</a>'; | ||
| echo '</td>'; | ||
| echo '</tr>'; | ||
| } | ||
| public function renderTime(int $timestamp): void { | ||
| - if (!$timestamp) { | ||
| - echo 'never'; | ||
| - return; | ||
| - } | ||
| - | ||
| + if (!$timestamp) { echo 'never'; return; } | ||
| $diff = time() - $timestamp; | ||
| - | ||
| - if ($diff < 5) { | ||
| - echo 'just now'; | ||
| - return; | ||
| - } | ||
| + if ($diff < 5) { echo 'just now'; return; } | ||
| $tokens = [ | ||
| return; | ||
| } | ||
| - | ||
| - echo 'just now'; | ||
| } | ||
| } | ||
| echo '<h2>Tags</h2>'; | ||
| - | ||
| echo '<table class="tag-table">'; | ||
| - | ||
| echo '<thead>'; | ||
| echo '<tr>'; | ||
| echo '<th>Name</th>'; | ||
| echo '<th>Message</th>'; | ||
| - echo '<th style="text-align: right;">Created</th>'; | ||
| + echo '<th>Author</th>'; | ||
| + echo '<th>Age</th>'; | ||
| + echo '<th style="text-align: right;">Commit</th>'; | ||
| echo '</tr>'; | ||
| echo '</thead>'; | ||
| - | ||
| echo '<tbody>'; | ||
| if (empty($tags)) { | ||
| - echo '<tr><td colspan="3"><div class="empty-state"><p>No tags found.</p></div></td></tr>'; | ||
| + echo '<tr><td colspan="5"><div class="empty-state"><p>No tags found.</p></div></td></tr>'; | ||
| } else { | ||
| foreach ($tags as $tag) { | ||
| vertical-align: middle; | ||
| color: #c9d1d9; | ||
| -} | ||
| - | ||
| -.tag-table tr:last-child td { | ||
| - border-bottom: none; | ||
| + font-size: 0.9rem; | ||
| } | ||
| .tag-table tr:hover td { | ||
| background: #161b22; | ||
| -} | ||
| - | ||
| -.tag-table .tag-name { | ||
| - width: 15%; | ||
| - font-family: 'SFMono-Regular', Consolas, monospace; | ||
| - font-size: 0.9rem; | ||
| - white-space: nowrap; | ||
| } | ||
| .tag-table .tag-name a { | ||
| color: #58a6ff; | ||
| text-decoration: none; | ||
| - display: inline-flex; | ||
| - align-items: center; | ||
| - gap: 8px; | ||
| + font-family: 'SFMono-Regular', Consolas, monospace; | ||
| } | ||
| -.tag-table .tag-name a:hover { | ||
| - text-decoration: underline; | ||
| +.tag-table .tag-message { | ||
| + font-weight: 500; | ||
| } | ||
| -.tag-table .tag-message { | ||
| - width: 50%; | ||
| +.tag-table .tag-author { | ||
| color: #c9d1d9; | ||
| - font-weight: 500; | ||
| } | ||
| -.tag-table .tag-meta { | ||
| - width: 35%; | ||
| - text-align: right; | ||
| +.tag-table .tag-time { | ||
| color: #8b949e; | ||
| - font-size: 0.85em; | ||
| white-space: nowrap; | ||
| } | ||
| -/* Ensures the commit hash is blue */ | ||
| +.tag-table .tag-hash { | ||
| + text-align: right; | ||
| +} | ||
| + | ||
| .tag-table .commit-hash { | ||
| font-family: 'SFMono-Regular', Consolas, monospace; | ||
| color: #58a6ff; | ||
| text-decoration: none; | ||
| - margin-left: 5px; | ||
| } | ||
| .tag-table .commit-hash:hover { | ||
| text-decoration: underline; | ||
| } | ||
| - | ||
| Delta | 28 lines added, 58 lines removed, 30-line decrease |
|---|