samjeston / openhub Public
Sam Jeston Working vertical 9aa3c45 · History
19 lines· 1.3 KB ·HTML
Raw
1<details class="dropdown ref-selector">
2 <summary class="btn" title="Switch branches or tags">{{ crate::web::fmt::icon(refsel.icon())|safe }}<span class="ref-name">{{ refsel.current }}</span>{{ crate::web::fmt::icon("chevron-down")|safe }}</summary>
3 <div class="dropdown-menu dropdown-wide">
4 <div class="dropdown-header">Switch branches/tags</div>
5 <div class="dropdown-filter"><input class="input input-sm" type="search" placeholder="Filter branches and tags" data-filter aria-label="Filter"></div>
6 <div class="dropdown-scroll">
7 <div class="dropdown-section">Branches</div>
8 {% for b in refsel.branches %}
9 <a class="dropdown-item{% if b.selected %} selected{% endif %}" href="{{ b.href }}" data-filter-item>{% if b.selected %}{{ crate::web::fmt::icon("check")|safe }}{% else %}<span class="icon-spacer"></span>{% endif %}<span class="truncate">{{ b.name }}</span></a>
10 {% endfor %}
11 {% if !refsel.tags.is_empty() %}
12 <div class="dropdown-section">Tags</div>
13 {% for t in refsel.tags %}
14 <a class="dropdown-item{% if t.selected %} selected{% endif %}" href="{{ t.href }}" data-filter-item>{% if t.selected %}{{ crate::web::fmt::icon("check")|safe }}{% else %}<span class="icon-spacer"></span>{% endif %}<span class="truncate">{{ t.name }}</span></a>
15 {% endfor %}
16 {% endif %}
17 </div>
18 </div>
19</details>