]> git.ipfire.org Git - people/ms/westferry.git/blame - src/templates/modules/tabs.html
demo: Add tabs to form examples
[people/ms/westferry.git] / src / templates / modules / tabs.html
CommitLineData
cdcc050f 1{% import westferry.ui.forms %}
19514d9c
MT
2{% import westferry.ui.graphs %}
3
4{#
5 Render the tab navigation bar
6#}
7<ul class="tabs" data-tabs id="{{ tabs.id }}">
8 {% for i, tab in enumerate(tabs) %}
9 {#
10 Select the first tab
11 #}
12 {% set selected = i == 0 %}
13
14 <li class="tabs-title {% if selected %}is-active{% end %}">
15 <a href="#{{ tab.id }}" {% if selected %}aria-selected="true"{% end %}>
16 {{ tab.title }}
17 </a>
18 </li>
19 {% end %}
20</ul>
21
22<div class="tabs-content" data-tabs-content="{{ tabs.id }}">
23 {% for i, tab in enumerate(tabs) %}
24 {#
25 Select the first tab
26 #}
27 {% set selected = i == 0 %}
28
29 <div class="tabs-panel {% if selected %}is-active{% end %}" id="{{ tab.id }}">
30 {% for item in tab.items %}
cdcc050f
MT
31 {% if isinstance(item, westferry.ui.forms.Form) %}
32 {% module Form(item) %}
33 {% elif isinstance(item, westferry.ui.graphs.Graph) %}
ba5eadb9 34 {% module GraphBox(item, show_title=False) %}
19514d9c
MT
35 {% else %}
36 {% module WarningBox(_("Unknown UI Element"),
37 _("A UI element which was supposed to be at this place could not be rendered: %r") % item) %}
38 {% end %}
39 {% end %}
40 </div>
41 {% end %}
42</div>