diff sat_templates/templates/bulma/components/common.html @ 230:0e69b5843c2f

theme: bulma theme first draft: This theme uses the Bulma CSS framework, Brython to handle the menu on touch devices, and Sass to customize Bulma. CSS default fallbacks are disabled as Bulma uses its own naming conventions, and default fallbacks would lead to hard to debug conflicts. `common.js` has been slightly improved to handle custom classed in `tab_select` The theme is not complete yet, but it is functional.
author Goffi <goffi@goffi.org>
date Tue, 19 May 2020 00:02:34 +0200
parents
children 0e4a2e0da438
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sat_templates/templates/bulma/components/common.html	Tue May 19 00:02:34 2020 +0200
@@ -0,0 +1,40 @@
+{% import 'components/menu_labels.html' as ml with context %}
+{# we need to use "with context" to disable cache, needed for i18n #}
+
+{% macro menu(menus, class='') %}
+    <nav class="navbar has-background-primary">
+        <div class="navbar-brand">
+            <a class="navbar-item" href="/">
+              <img src="{{media_path}}icons/apps/64/sat.png">
+            </a>
+            <a role="button" id="main_menu_burger" class="navbar-burger burger" data-target="main_menu">
+                <span aria-hidden="true"></span>
+                <span aria-hidden="true"></span>
+                <span aria-hidden="true"></span>
+            </a>
+        </div>
+        <div id="main_menu" class="navbar-menu">
+            <div class="navbar-start">
+            {% for name, url in menus %}
+                  <a class="navbar-item" {{ {'href': url}|xmlattr }}>
+                    {{name}}
+                  </a>
+            {% endfor %}
+            </div>
+            <div class="navbar-end">
+                <div class="navbar-item has-dropdown x-is-hoverable">
+                    <span class="navbar-link">{{locale.language_name}}</span>
+                    <div class="navbar-dropdown">
+                        {% for l in locales|reject("eq", locale) %}
+                            <a class="navbar-item" href="?{{C.KEY_LANG}}={{l}}">{{l.language_name}}</a>
+                        {% endfor %}
+
+                </div>
+            </div>
+        </div>
+    </nav>
+{% endmacro %}
+
+{% macro action_button(url, label=_("create"), icon="plus-circled", class="is-primary is-rounded") %}
+    <a class="button {{class}}" {{ {"href":url} | xmlattr }}><i class="icon-{{icon}}"></i> {{label}}</a>
+{% endmacro %}