diff sat_templates/templates/default/components/common.html @ 166:178f55b825b7

small refactoring/redesign, better BEM integration: - blog has been redesigned, and almost all blog CSS has been made generic and moved to main styles.css file. - better noscript handling, dynamic elements are created using "magic" classes (dom_update.js) - using better icons for older/newer messages - better state handling, classes now use "state_XXX" - more classes now use BEM convention - menu labels have been moved to a separate template (components/menu_labels.html), so it can be overriden easily by other sites - better styles.css organisation
author Goffi <goffi@goffi.org>
date Wed, 03 Oct 2018 21:00:24 +0200
parents e9f0a4215e46
children 240bbac435f4
line wrap: on
line diff
--- a/sat_templates/templates/default/components/common.html	Fri Sep 14 19:49:15 2018 +0200
+++ b/sat_templates/templates/default/components/common.html	Wed Oct 03 21:00:24 2018 +0200
@@ -1,26 +1,10 @@
-{# menu labels, map from menu names to labels #}
-{% set ml = {
-    'login': _('Session') if profile else _('Log in'),
-    'blog': _('Blog'),
-    'forums': _('Forums'),
-    'merge-requests': _('Merge requests'),
-    'merge-request_new': _('Create new merge request'),
-    'tickets': _('Tickets'),
-    'tickets_list': _('List tickets'),
-    'ticket_new': _('Create new ticket'),
-    'chat': _('Chat'),
-    'files': _('Files sharing'),
-    'events': _('Events'),
-    'event_new': _('Create an event'),
-    'photos': _('Photos albums'),
-    'app': _('Application'),
-} %}
+{% import 'components/menu_labels.html' as ml %}
 
 {% macro menu(menus, class='') %}
     <nav class="menu {{class}}">
         <ul>
         {% for name,url in menus %}
-            <li><a class="menu_item menu_item--{{name}}" {{ {'href': url}|xmlattr }}>{{ml[name]}}</a></li>
+            <li><a class="menu_item menu_item--{{name}}" {{ {'href': url}|xmlattr }}>{{ml.label[name]}}</a></li>
         {% endfor %}
         </ul>
     </nav>