1 {% macro renderMenu(title, icon, items, mode) %}
2 {% set my_routes = [] %}
3 {% for item in items %}
4 {% set my_routes = my_routes|merge([item.route.name])|merge(item.route.aliases ?? []) %}
6 {% if mode == "compact" %}
7 <div class="ui{% if cur_route in my_routes %} active-menu{% endif %} dropdown navigation item tooltip" data-html="{{ title }}" data-position="right center">
8 <i class="{{ icon }} icon" aria-hidden="true"></i>
9 <span class="visually-hidden">{{ title }}</span>
10 <i class="dropdown icon" aria-hidden="true"></i>
12 {% for item in items %}
13 {{ _self.renderMenuItem(item.label, item.title ?? null, item.route, item.icon ?? null, null, 'right center') }}
19 <div class="image header title{% if cur_route in my_routes %} active{% endif %}" data-fold="fold-{{ icon|replace({' ': '-'}) }}" tabindex="0">
20 <i class="{{ icon }} icon" aria-hidden="true"></i>
22 <i class="dropdown icon" aria-hidden="true"></i>
24 <div class="content{% if cur_route in my_routes %} active{% endif %}">
25 {% for item in items %}
26 {{ _self.renderMenuItem(item.label, item.title ?? null, item.route, item.icon ?? null, null, null, mode) }}
33 {% macro renderMenuItem(label, title, route, icon, class, tips_position, mode) %}
34 {% if class is empty %}
35 {% if is_current_url(route.name, route.args|default([])) or (cur_route in route.aliases ?? [] and route.sub_select ?? true == true) %}
36 {% set class = "active item" %}
38 {% set class = "item" %}
42 href="{{ url_for(route.name, route.args|default([])) }}"
44 {% if title %}title="{{ title }}"{% endif %}
45 {% if tips_position %}data-position="{{ tips_position }}"{% endif %}
46 {% if mode != "default" %}tabindex="-1"{% endif %}
49 <i class="{{ icon }} icon" aria-hidden="true"></i>
55 {% macro dashboardCard(label, title, route, icon) %}
56 <a class="ui card" href="{{ url_for(route.name, route.args|default([])) }}" title="{{ title }}">
58 <div class="ui header">
59 <em data-emoji="{{ icon }}" class="medium" aria-hidden="true"></em>
68 {% macro drawListAction(title, route, icon, extra_class) %}
70 href="{{ url_for(route.name, route.args|default([])) }}"
71 class="{{ extra_class|default('') }} tooltip"
74 <i class="ui {{ icon }} icon" aria-hidden="true"></i>
75 <span class="visually-hidden">{{ title }}</span>
79 {% macro drawDetailedAction(label, title, route, icon) %}
81 href="{{ url_for(route.name, route.args|default([])) }}"
85 <i class="{{ icon }} icon" aria-hidden="true"></i>
90 {% macro drawBatchActionsList(batch_actions) %}
91 <div class="checkboxes ui basic horizontal segments">
92 <div class="ui basic fitted segment batch-selection">
93 <div class="ui blue tertiary dropdown icon button batch-select-action">
94 <i class="tasks icon" aria-hidden="true"></i>
95 {{ _T('For the selection:') }}
96 <i class="dropdown icon" aria-hidden="true"></i>
98 {% for batch_action in batch_actions %}
99 {{ _self.drawBatchAction(batch_action.name, batch_action.label, batch_action.icon, batch_action.title ?? null) }}
107 {% macro drawBatchAction(name, label, icon, title) %}
108 <span class="ui item batch-action batch-{{ name }}" data-value="{{ name }}"{% if title %} title="{{ title }}"{% endif %}>
109 <i class="{{ icon }} icon" aria-hidden="true"></i> {{ label }}