Changeset View
Changeset View
Standalone View
Standalone View
swh/web/templates/includes/show-swh-ids.html
{% comment %} | {% comment %} | ||||
Copyright (C) 2017-2020 The Software Heritage developers | Copyright (C) 2017-2020 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 %} | ||||
{% if swhids_info %} | {% if swhids_info %} | ||||
<div id="swh-identifiers" style="display: none;"> | <div id="swh-identifiers" style="display: none;"> | ||||
{% if swhids_info|length > 1 %} | {% if swhids_info|length > 1 %} | ||||
<a id="right-handle" class="handle ui-slideouttab-handle ui-slideouttab-handle-rounded"><i class="fa fa-link fa-rotate-90 fa-fw"></i>Permalinks</a> | <a id="right-handle" class="handle ui-slideouttab-handle ui-slideouttab-handle-rounded"><i class="mdi mdi-link-variant mdi-fw" aria-hidden="true"></i>Permalinks</a> | ||||
{% else %} | {% else %} | ||||
<a id="right-handle" class="handle ui-slideouttab-handle ui-slideouttab-handle-rounded"><i class="fa fa-link fa-rotate-90 fa-fw"></i>Permalink</a> | <a id="right-handle" class="handle ui-slideouttab-handle ui-slideouttab-handle-rounded"><i class="mdi mdi-link-variant mdi-fw" aria-hidden="true"></i>Permalink</a> | ||||
{% endif %} | {% endif %} | ||||
<div id="swh-identifiers-content"> | <div id="swh-identifiers-content"> | ||||
<p> | <p> | ||||
To reference or cite the objects present in the Software Heritage archive, permalinks based on <a href="https://docs.softwareheritage.org/devel/swh-model/persistent-identifiers.html">persistent identifiers</a> | To reference or cite the objects present in the Software Heritage archive, permalinks based on <a href="https://docs.softwareheritage.org/devel/swh-model/persistent-identifiers.html">persistent identifiers</a> | ||||
must be used instead of copying and pasting the url from the address bar of the browser (as there is no guarantee the current URI | must be used instead of copying and pasting the url from the address bar of the browser (as there is no guarantee the current URI | ||||
scheme will remain the same over time). | scheme will remain the same over time). | ||||
<br/> | <br/> | ||||
<br/> | <br/> | ||||
Select below a type of object currently browsed in order to display its associated persistent identifier and permalink. | Select below a type of object currently browsed in order to display its associated persistent identifier and permalink. | ||||
</p> | </p> | ||||
<ul class="nav nav-pills ml-auto p-2"> | <ul class="nav nav-pills ml-auto p-2"> | ||||
{% for swhid_info in swhids_info %} | {% for swhid_info in swhids_info %} | ||||
{% if forloop.first %} | {% if forloop.first %} | ||||
<li class="nav-item"> | <li class="nav-item"> | ||||
<a class="nav-link active" href="#swh-id-tab-{{ swhid_info.object_type }}" data-toggle="tab" onclick="swh.browse.swhIdObjectTypeToggled(event)"> | <a class="nav-link active" href="#swh-id-tab-{{ swhid_info.object_type }}" data-toggle="tab" onclick="swh.browse.swhIdObjectTypeToggled(event)"> | ||||
<i class="{{ swh_object_icons|key_value:swhid_info.object_type }} fa-fw"></i>{{ swhid_info.object_type }} | <i class="{{ swh_object_icons|key_value:swhid_info.object_type }} mdi-fw" aria-hidden="true"></i>{{ swhid_info.object_type }} | ||||
</a> | </a> | ||||
</li> | </li> | ||||
{% else %} | {% else %} | ||||
<li class="nav-item"> | <li class="nav-item"> | ||||
<a class="nav-link" href="#swh-id-tab-{{ swhid_info.object_type }}" data-toggle="tab" onclick="swh.browse.swhIdObjectTypeToggled(event)"> | <a class="nav-link" href="#swh-id-tab-{{ swhid_info.object_type }}" data-toggle="tab" onclick="swh.browse.swhIdObjectTypeToggled(event)"> | ||||
<i class="{{ swh_object_icons|key_value:swhid_info.object_type }} fa-fw"></i>{{ swhid_info.object_type }} | <i class="{{ swh_object_icons|key_value:swhid_info.object_type }} mdi-fw" aria-hidden="true"></i>{{ swhid_info.object_type }} | ||||
</a> | </a> | ||||
</li> | </li> | ||||
{% endif %} | {% endif %} | ||||
{% endfor %} | {% endfor %} | ||||
</ul> | </ul> | ||||
<div class="tab-content"> | <div class="tab-content"> | ||||
{% for swhid_info in swhids_info %} | {% for swhid_info in swhids_info %} | ||||
Show All 26 Lines | <div id="swh-identifiers-content"> | ||||
<label class="form-check-label" for="swh-id-context-option-{{ swhid_info.object_type }}">Add contextual information</label> | <label class="form-check-label" for="swh-id-context-option-{{ swhid_info.object_type }}">Add contextual information</label> | ||||
</div> | </div> | ||||
</form> | </form> | ||||
</div> | </div> | ||||
{% endif %} | {% endif %} | ||||
<div class="float-right"> | <div class="float-right"> | ||||
<button type="button" class="btn btn-default btn-sm btn-swh-id-copy" | <button type="button" class="btn btn-default btn-sm btn-swh-id-copy" | ||||
title="Copy persistent identifier to clipboard"> | title="Copy persistent identifier to clipboard"> | ||||
<i class="fa fa-clipboard fa-fw" aria-hidden="true"></i>Copy identifier | <i class="mdi mdi-content-copy mdi-fw" aria-hidden="true"></i>Copy identifier | ||||
<button type="button" class="btn btn-default btn-sm btn-swh-id-url-copy" | <button type="button" class="btn btn-default btn-sm btn-swh-id-url-copy" | ||||
title="Copy url resolving the persistent identifier to clipboard"> | title="Copy url resolving the persistent identifier to clipboard"> | ||||
<i class="fa fa-clipboard fa-fw" aria-hidden="true"></i>Copy permalink | <i class="mdi mdi-content-copy mdi-fw" aria-hidden="true"></i>Copy permalink | ||||
</button> | </button> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
{% endfor %} | {% endfor %} | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<script> | <script> | ||||
swh.webapp.setSwhIdsContext({{ swhids_info|jsonify }}); | swh.webapp.setSwhIdsContext({{ swhids_info|jsonify }}); | ||||
</script> | </script> | ||||
{% endif %} | {% endif %} |