~homeworkprod/byceps

ref: 6bdc5ae248266f5dcd14a3d9f16dd1d57e92de12 byceps/byceps/blueprints/admin/core/templates/macros/admin.html -rw-r--r-- 1.4 KiB
6bdc5ae2 — Jochen Kupperschmidt Introduce CSS class `main-tab` 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{% from 'macros/icons.html' import render_icon %}


{% macro render_navigation(navigation, current_page) %}
  <nav class="main">
    <ol>
      {%- for item in navigation.get_items() %}
      <li><a href="{{ item.endpoint }}" title="{{ item.label }}" class="nav-item{% if (item.id is not none) and (item.id == current_page) %} nav-item--current{% endif %}">
        {%- if item.icon %}<span class="nav-item-icon">{{ render_icon(item.icon) }}</span>{% endif -%}
        <span class="nav-item-label">{{ item.label }}</span>
      </a></li>
      {%- endfor %}
    </ol>
  </nav>
{% endmacro %}


{% macro render_main_tabs(navigation, current_tab) -%}
  <nav class="main-tabs">
    <ol>
    {%- for item in navigation.get_items() %}
      {%- with is_current = (item.id is not none) and (item.id == current_tab) %}
      <li><a href="{{ item.endpoint }}" class="main-tab{% if is_current %} current{% endif %}">{% if item.icon %}{{ render_icon(item.icon) }} {% endif %}{{ item.label }}</a></li>
      {%- endwith %}
    {%- endfor %}
    </ol>
  </nav>
{%- endmacro %}


{% macro render_extra_in_heading(value) -%}
  <small>{{ value }}</small>
{%- endmacro %}


{% macro render_backlink(url, label) -%}
  <nav style="margin-bottom: 0.5rem;">
    <a class="button button--clear button--compact" href="{{ url }}">{{ render_icon('arrow-left') }} <span>{{ label }}</span></a>
  </nav>
{%- endmacro %}