Krolyxon
Commit 4e844bb

ferreniumtemplatesrepo_nav.html

37 lines · 2.0 KB · HTML

1<div class="repo-bar">
2 <nav class="bracket-nav" aria-label="Repository">
3 <a class="label{% if nav.active == "summary" %} active{% endif %}" href="{{ nav.url }}"{% if nav.active == "summary" %} aria-current="page"{% endif %}>Summary</a>
4 <a class="label{% if nav.active == "tree" %} active{% endif %}" href="{{ nav.tree_url }}"{% if nav.active == "tree" %} aria-current="page"{% endif %}>Tree</a>
5 <a class="label{% if nav.active == "log" %} active{% endif %}" href="{{ nav.log_url }}"{% if nav.active == "log" %} aria-current="page"{% endif %}>Log</a>
6 <a class="label{% if nav.active == "refs" %} active{% endif %}" href="{{ nav.refs_url }}"{% if nav.active == "refs" %} aria-current="page"{% endif %}>Refs</a>
7 </nav>
8 {%- if let Some(picker) = nav.picker %}
9 <details class="ref-picker">
10 <summary>
11 <svg class="icon" aria-hidden="true"><use href="{{ layout.static_base }}icons/sprite.svg#git-branch"></use></svg>
12 <span class="label dim">{{ picker.kind }}</span>
13 <span class="ref-current">{{ picker.current }}</span>
14 <svg class="icon chevron" aria-hidden="true"><use href="{{ layout.static_base }}icons/sprite.svg#chevron-down"></use></svg>
15 </summary>
16 <div class="ref-menu">
17 {%- if !picker.branches.is_empty() %}
18 <p class="label ref-group">Branches</p>
19 <ul>
20 {%- for item in picker.branches %}
21 <li><a href="{{ item.url }}"{% if item.active %} class="active" aria-current="true"{% endif %}>{{ item.name }}</a></li>
22 {%- endfor %}
23 </ul>
24 {%- endif %}
25 {%- if !picker.tags.is_empty() %}
26 <p class="label ref-group">Tags</p>
27 <ul>
28 {%- for item in picker.tags %}
29 <li><a href="{{ item.url }}"{% if item.active %} class="active" aria-current="true"{% endif %}>{{ item.name }}</a></li>
30 {%- endfor %}
31 </ul>
32 {%- endif %}
33 <a class="label ref-all" href="{{ nav.refs_url }}">{% if picker.more_tags %}All refs{% else %}Refs{% endif %} &rarr;</a>
34 </div>
35 </details>
36 {%- endif %}
37</div>