comparison 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
comparison
equal deleted inserted replaced
165:9e8d9d754337 166:178f55b825b7
1 {# menu labels, map from menu names to labels #} 1 {% import 'components/menu_labels.html' as ml %}
2 {% set ml = {
3 'login': _('Session') if profile else _('Log in'),
4 'blog': _('Blog'),
5 'forums': _('Forums'),
6 'merge-requests': _('Merge requests'),
7 'merge-request_new': _('Create new merge request'),
8 'tickets': _('Tickets'),
9 'tickets_list': _('List tickets'),
10 'ticket_new': _('Create new ticket'),
11 'chat': _('Chat'),
12 'files': _('Files sharing'),
13 'events': _('Events'),
14 'event_new': _('Create an event'),
15 'photos': _('Photos albums'),
16 'app': _('Application'),
17 } %}
18 2
19 {% macro menu(menus, class='') %} 3 {% macro menu(menus, class='') %}
20 <nav class="menu {{class}}"> 4 <nav class="menu {{class}}">
21 <ul> 5 <ul>
22 {% for name,url in menus %} 6 {% for name,url in menus %}
23 <li><a class="menu_item menu_item--{{name}}" {{ {'href': url}|xmlattr }}>{{ml[name]}}</a></li> 7 <li><a class="menu_item menu_item--{{name}}" {{ {'href': url}|xmlattr }}>{{ml.label[name]}}</a></li>
24 {% endfor %} 8 {% endfor %}
25 </ul> 9 </ul>
26 </nav> 10 </nav>
27 {% endmacro %} 11 {% endmacro %}