Changeset 297c77d in Klonkt for src/views/partials/topnav.ejs


Ignore:
Timestamp:
06/26/2026 02:14:00 PM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
c27c945
Parents:
1ecbf71
Message:

refactor(fedi): English URL paths + equal-width tabs + back-to-site in top nav

  • Renamed all fediverse routes to English: /tijdlijn->/timeline, /volgend->/following, /meldingen->/notifications, /blokkeren->/blocking (+ all sub-routes, form actions, redirects, links, RESERVED_SLUGS). UI labels stay i18n.
  • fedi-tabs: all 5 tabs share the content width equally (flex:1) and always fit (ellipsis) instead of varying widths.
  • Moved 'back to site' from a big in-content button into the top nav (like admin pages), via on-special; removed the in-content button. Archive link hidden on fedi pages too.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/partials/topnav.ejs

    r1ecbf71 r297c77d  
    1414const _siteUrlBase = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : '';
    1515const _isAdmin     = typeof bodyClass !== 'undefined' && bodyClass.indexOf('on-admin') >= 0;
     16// Fediverse pages (on-special) get the same top-nav "back to site" treatment as admin.
     17const _isSpecial   = typeof bodyClass !== 'undefined' && bodyClass.indexOf('on-special') >= 0;
    1618const _hasSearch   = !site || site.show_search === undefined || site.show_search;
    1719const _canPost     = user && (typeof canMutate === 'undefined' || canMutate)
     
    2426    <!-- Brand block (always visible) -->
    2527    <div class="masthead-brand">
    26       <% if (_isAdmin) { %>
     28      <% if (_isAdmin || _isSpecial) { %>
    2729        <a href="<%= _siteUrlBase %>/" class="nav-link nav-link-admin"><%= t('nav.back_to_site') %></a>
    2830      <% } else if (typeof tenancy !== 'undefined' && tenancy === 'hub') { %>
     
    5759    <nav class="top-nav top-nav-desktop" aria-label="Hoofdnavigatie">
    5860
    59       <% if (!_isAdmin) { %>
     61      <% if (!_isAdmin && !_isSpecial) { %>
    6062        <a class="nav-link" href="<%= _siteUrlBase %>/archive"
    6163           hx-get="<%= _siteUrlBase %>/archive?partial=1" hx-target="#pcms-main"
     
    100102
    101103      <% if (user && typeof canManageFedi !== 'undefined' && canManageFedi) { %>
    102         <a class="nav-btn nav-notif" href="/meldingen" aria-label="<%= t('notif.title') %>" title="<%= t('notif.title') %>"
    103            hx-get="/meldingen?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="/meldingen" hx-indicator="#pcms-loading">
     104        <a class="nav-btn nav-notif" href="/notifications" aria-label="<%= t('notif.title') %>" title="<%= t('notif.title') %>"
     105           hx-get="/notifications?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="/notifications" hx-indicator="#pcms-loading">
    104106          <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 0 1-3.46 0"/></svg>
    105107          <% if (typeof notifUnread !== 'undefined' && notifUnread > 0) { %><span class="notif-badge"><%= notifUnread > 9 ? '9+' : notifUnread %></span><% } %>
     
    156158              <% } %>
    157159              <% if (typeof canManageFedi !== 'undefined' && canManageFedi) { %>
    158                 <a href="/tijdlijn" role="menuitem" class="udi"
    159                    hx-get="/tijdlijn?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
    160                    hx-push-url="/tijdlijn" hx-indicator="#pcms-loading">
     160                <a href="/timeline" role="menuitem" class="udi"
     161                   hx-get="/timeline?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
     162                   hx-push-url="/timeline" hx-indicator="#pcms-loading">
    161163                  <svg class="udi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"/><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"/></svg>
    162164                  <span><%= t('nav.fediverse') %></span>
Note: See TracChangeset for help on using the changeset viewer.