Changeset fe6aac9 in Klonkt


Ignore:
Timestamp:
06/23/2026 04:27:27 PM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
475eeda
Parents:
d5e78f7
Message:

feat: Updates page shows the last 5 changes (git log)

Admin -> Updates now shows a 'Recent changes' card with the 5 newest commits
on main (message + date), so you can see what you're getting before updating.
i18n NL/EN/DE (aupd.changes_heading).

Co-Authored-By: Claude <noreply@…>

Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/routes/admin-updates.js

    rd5e78f7 rfe6aac9  
    3737}
    3838
     39// Laatste 5 commits op main = de "laatste wijzigingen" die je bij bijwerken krijgt.
     40function recentChanges() {
     41  const out = git(['log', '-5', '--format=%s%x1f%cd', '--date=short', 'main']);
     42  if (!out) return [];
     43  return out.split('\n').map((l) => {
     44    const i = l.indexOf('\x1f');
     45    return i >= 0 ? { msg: l.slice(0, i), date: l.slice(i + 1) } : { msg: l, date: '' };
     46  });
     47}
     48
    3949router.get('/', requireGod, (req, res) => {
    4050  const cur = currentSha();
     
    5161    canCheck: !!latest,
    5262    behind: (cur && latest && cur !== latest) ? git(['rev-list', '--count', cur + '..main']) : null,
     63    changes: recentChanges(),
    5364    success: req.query.success || null,
    5465    error: req.query.error || null,
  • src/services/i18n.js

    rd5e78f7 rfe6aac9  
    605605    'anews.recipients': 'ontvanger(s)',
    606606    'aupd.title': 'Updates',
     607    'aupd.changes_heading': 'Laatste wijzigingen',
    607608    'aupd.back_admin': 'Beheer',
    608609    'aupd.version_heading': 'Versie van deze Klonkt',
     
    15921593    'anews.recipients': 'recipient(s)',
    15931594    'aupd.title': 'Updates',
     1595    'aupd.changes_heading': 'Recent changes',
    15941596    'aupd.back_admin': 'Admin',
    15951597    'aupd.version_heading': 'Version of this Klonkt',
     
    25782580    'anews.recipients': 'Empfänger',
    25792581    'aupd.title': 'Updates',
     2582    'aupd.changes_heading': 'Letzte Änderungen',
    25802583    'aupd.back_admin': 'Verwaltung',
    25812584    'aupd.version_heading': 'Version dieses Klonkt',
  • src/views/pages/admin-updates.ejs

    rd5e78f7 rfe6aac9  
    5151    </p>
    5252  </section>
     53
     54  <% if (changes && changes.length) { %>
     55  <section class="set-card" style="margin-top:1rem">
     56    <h2><%= t('aupd.changes_heading') %></h2>
     57    <ul class="upd-changes">
     58      <% changes.forEach(function (c) { %>
     59        <li><span class="upd-ch-date"><%= c.date %></span> <span class="upd-ch-msg"><%= c.msg %></span></li>
     60      <% }) %>
     61    </ul>
     62  </section>
     63  <% } %>
    5364</div>
    5465
     
    7283.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
    7384.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
     85.upd-changes { list-style: none; padding: 0; margin: 0; }
     86.upd-changes li { display: flex; gap: .7rem; padding: .45rem 0; border-bottom: 1px solid var(--rule); font-size: .9rem; align-items: baseline; }
     87.upd-changes li:last-child { border-bottom: 0; }
     88.upd-ch-date { color: var(--ink-muted); flex-shrink: 0; font-size: .8rem; font-variant-numeric: tabular-nums; }
     89.upd-ch-msg { word-break: break-word; }
    7490</style>
Note: See TracChangeset for help on using the changeset viewer.