Changeset View
Changeset View
Standalone View
Standalone View
swh/web/templates/includes/top-navigation.html
{% comment %} | {% comment %} | ||||
Copyright (C) 2017-2019 The Software Heritage developers | Copyright (C) 2017-2019 The Software Heritage developers | ||||
See the AUTHORS file at the top-level directory of this distribution | See the AUTHORS file at the top-level directory of this distribution | ||||
License: GNU Affero General Public License version 3, or any later version | License: GNU Affero General Public License version 3, or any later version | ||||
See top-level LICENSE file for more information | See top-level LICENSE file for more information | ||||
{% endcomment %} | {% endcomment %} | ||||
{% load swh_templatetags %} | {% load swh_templatetags %} | ||||
<div class="swh-browse-top-navigation"> | <div class="swh-browse-top-navigation"> | ||||
{% if snapshot_context %} | {% if snapshot_context %} | ||||
{% if snapshot_context.branch or snapshot_context.release %} | {% if snapshot_context.branch or snapshot_context.release %} | ||||
<div class="dropdown float-left" id="swh-branches-releases-dd"> | <div class="dropdown float-left" id="swh-branches-releases-dd"> | ||||
<button class="btn btn-block btn-default btn-sm dropdown-toggle" type="button" data-toggle="dropdown"> | <button class="btn btn-block btn-default btn-sm dropdown-toggle" type="button" data-toggle="dropdown"> | ||||
{% if snapshot_context.branch %} | {% if snapshot_context.branch %} | ||||
<i class="{{ swh_object_icons.branch }} fa-fw" aria-hidden="true"></i> | <i class="{{ swh_object_icons.branch }} mdi-fw" aria-hidden="true"></i> | ||||
Branch: <strong>{{ snapshot_context.branch }}</strong> | Branch: <strong>{{ snapshot_context.branch }}</strong> | ||||
{% else %} | {% else %} | ||||
<i class="{{ swh_object_icons.release }} fa-fw" aria-hidden="true"></i> | <i class="{{ swh_object_icons.release }} mdi-fw" aria-hidden="true"></i> | ||||
Release: <strong>{{ snapshot_context.release }}</strong> | Release: <strong>{{ snapshot_context.release }}</strong> | ||||
{% endif %} | {% endif %} | ||||
<span class="caret"></span> | <span class="caret"></span> | ||||
</button> | </button> | ||||
<ul class="scrollable-menu dropdown-menu swh-branches-releases"> | <ul class="scrollable-menu dropdown-menu swh-branches-releases"> | ||||
<ul class="nav nav-tabs"> | <ul class="nav nav-tabs"> | ||||
<li class="nav-item"><a class="nav-link active swh-branches-switch" data-toggle="tab">Branches</a></li> | <li class="nav-item"><a class="nav-link active swh-branches-switch" data-toggle="tab">Branches</a></li> | ||||
<li class="nav-item"><a class="nav-link swh-releases-switch" data-toggle="tab">Releases</a></li> | <li class="nav-item"><a class="nav-link swh-releases-switch" data-toggle="tab">Releases</a></li> | ||||
</ul> | </ul> | ||||
<div class="tab-content"> | <div class="tab-content"> | ||||
<div class="tab-pane active" id="swh-tab-branches"> | <div class="tab-pane active" id="swh-tab-branches"> | ||||
{% for b in snapshot_context.branches %} | {% for b in snapshot_context.branches %} | ||||
<li class="swh-branch"> | <li class="swh-branch"> | ||||
<a href="{{ b.url | safe }}"> | <a href="{{ b.url | safe }}"> | ||||
<i class="{{ swh_object_icons.branch }} fa-fw" aria-hidden="true"></i> | <i class="{{ swh_object_icons.branch }} mdi-fw" aria-hidden="true"></i> | ||||
{% if b.name == snapshot_context.branch %} | {% if b.name == snapshot_context.branch %} | ||||
<i class="fa fa-check fa-fw" aria-hidden="true"></i> | <i class="mdi mdi-check-bold mdi-fw" aria-hidden="true"></i> | ||||
{% else %} | {% else %} | ||||
<i class="fa fa-fw" aria-hidden="true"></i> | <i class="mdi mdi-fw" aria-hidden="true"></i> | ||||
{% endif %} | {% endif %} | ||||
{{ b.name }} | {{ b.name }} | ||||
</a> | </a> | ||||
</li> | </li> | ||||
{% endfor %} | {% endfor %} | ||||
{% if snapshot_context.branches|length < snapshot_context.snapshot_sizes.revision %} | {% if snapshot_context.branches|length < snapshot_context.snapshot_sizes.revision %} | ||||
<li> | <li> | ||||
<i class="fa fa-warning fa-fw" aria-hidden="true"></i> | <i class="mdi mdi-alert mdi-fw" aria-hidden="true"></i> | ||||
Branches list truncated to {{ snapshot_context.branches|length }} entries, | Branches list truncated to {{ snapshot_context.branches|length }} entries, | ||||
{{ snapshot_context.branches|length|mul:-1|add:snapshot_context.snapshot_sizes.revision }} | {{ snapshot_context.branches|length|mul:-1|add:snapshot_context.snapshot_sizes.revision }} | ||||
were omitted. | were omitted. | ||||
</li> | </li> | ||||
{% endif %} | {% endif %} | ||||
</div> | </div> | ||||
<div class="tab-pane" id="swh-tab-releases"> | <div class="tab-pane" id="swh-tab-releases"> | ||||
{% if snapshot_context.releases %} | {% if snapshot_context.releases %} | ||||
{% for r in snapshot_context.releases %} | {% for r in snapshot_context.releases %} | ||||
{% if r.target_type == 'revision' %} | {% if r.target_type == 'revision' %} | ||||
<li class="swh-release"> | <li class="swh-release"> | ||||
<a href="{{ r.url | safe }}"> | <a href="{{ r.url | safe }}"> | ||||
<i class="{{ swh_object_icons.release }} fa-fw" aria-hidden="true"></i> | <i class="{{ swh_object_icons.release }} mdi-fw" aria-hidden="true"></i> | ||||
{% if r.name == snapshot_context.release %} | {% if r.name == snapshot_context.release %} | ||||
<i class="fa fa-check fa-fw" aria-hidden="true"></i> | <i class="mdi mdi-check-bold mdi-fw" aria-hidden="true"></i> | ||||
{% else %} | {% else %} | ||||
<i class="fa fa-fw" aria-hidden="true"></i> | <i class="mdi mdi-fw" aria-hidden="true"></i> | ||||
{% endif %} | {% endif %} | ||||
{{ r.name }} | {{ r.name }} | ||||
</a> | </a> | ||||
</li> | </li> | ||||
{% endif %} | {% endif %} | ||||
{% endfor %} | {% endfor %} | ||||
{% if snapshot_context.releases|length < snapshot_context.snapshot_sizes.release %} | {% if snapshot_context.releases|length < snapshot_context.snapshot_sizes.release %} | ||||
<li> | <li> | ||||
<i class="fa fa-warning fa-fw" aria-hidden="true"></i> | <i class="mdi mdi-alert mdi-fw" aria-hidden="true"></i> | ||||
Releases list truncated to {{ snapshot_context.releases|length }} entries, | Releases list truncated to {{ snapshot_context.releases|length }} entries, | ||||
{{ snapshot_context.releases|length|mul:-1|add:snapshot_context.snapshot_sizes.release }} | {{ snapshot_context.releases|length|mul:-1|add:snapshot_context.snapshot_sizes.release }} | ||||
were omitted. | were omitted. | ||||
</li> | </li> | ||||
{% endif %} | {% endif %} | ||||
{% else %} | {% else %} | ||||
<span>No releases to show</span> | <span>No releases to show</span> | ||||
{% endif %} | {% endif %} | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</ul> | </ul> | ||||
</div> | </div> | ||||
{% endif %} | {% endif %} | ||||
{% endif %} | {% endif %} | ||||
<div class="btn-group float-right swh-actions-dropdown flex d-flex flex-wrap"> | <div class="btn-group float-right swh-actions-dropdown flex d-flex flex-wrap"> | ||||
{% if top_right_link %} | {% if top_right_link %} | ||||
<a href="{{ top_right_link.url | safe }}" class="btn btn-default btn-sm swh-tr-link" role="button"> | <a href="{{ top_right_link.url | safe }}" class="btn btn-default btn-sm swh-tr-link" role="button"> | ||||
{% if top_right_link.icon %} | {% if top_right_link.icon %} | ||||
<i class="{{ top_right_link.icon }} fa-fw"></i> | <i class="{{ top_right_link.icon }} mdi-fw" aria-hidden="true"></i> | ||||
{% endif %} | {% endif %} | ||||
{{ top_right_link.text }} | {{ top_right_link.text }} | ||||
</a> | </a> | ||||
{% endif %} | {% endif %} | ||||
{% if available_languages %} | {% if available_languages %} | ||||
<select data-placeholder="Select Language" class="language-select chosen-select"> | <select data-placeholder="Select Language" class="language-select chosen-select"> | ||||
<option value=""></option> | <option value=""></option> | ||||
{% for lang in available_languages %} | {% for lang in available_languages %} | ||||
<option value="{{ lang }}">{{ lang }}</option> | <option value="{{ lang }}">{{ lang }}</option> | ||||
{% endfor %} | {% endfor %} | ||||
</select> | </select> | ||||
{% endif %} | {% endif %} | ||||
{% if show_actions_menu %} | {% if show_actions_menu %} | ||||
<button class="btn btn-default btn-sm dropdown-toggle" type="button" data-toggle="dropdown"> | <button class="btn btn-default btn-sm dropdown-toggle" type="button" data-toggle="dropdown"> | ||||
<i class="fa fa-bars fa-fw" aria-hidden="true"></i>Actions | <i class="mdi mdi-menu mdi-fw" aria-hidden="true"></i>Actions | ||||
<span class="caret"></span> | <span class="caret"></span> | ||||
</button> | </button> | ||||
<ul class="dropdown-menu dropdown-menu-right swh-browse-actions-menu"> | <ul class="dropdown-menu dropdown-menu-right swh-browse-actions-menu"> | ||||
{% if not snapshot_context or not snapshot_context.is_empty %} | {% if not snapshot_context or not snapshot_context.is_empty %} | ||||
{% include "includes/vault-create-tasks.html" %} | {% include "includes/vault-create-tasks.html" %} | ||||
{% endif %} | {% endif %} | ||||
{% include "includes/show-metadata.html" %} | {% include "includes/show-metadata.html" %} | ||||
{% include "includes/take-new-snapshot.html" %} | {% include "includes/take-new-snapshot.html" %} | ||||
Show All 25 Lines |