Changeset View
Changeset View
Standalone View
Standalone View
swh/web/templates/includes/show-metadata.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 'metadata' in swh_object_metadata and swh_object_metadata.metadata != '{}' %} | {% if 'metadata' in swh_object_metadata and swh_object_metadata.metadata != '{}' %} | ||||
<button id="swh-metadata-toggler" class="btn btn-default btn-sm swh-popover-toggler" | <button id="swh-metadata-toggler" class="btn btn-default btn-sm swh-popover-toggler" | ||||
data-toggle="popover" data-popover-content="#swh-metadata-popover"> | data-toggle="popover" data-popover-content="#swh-metadata-popover"> | ||||
<i class="mdi mdi-table mdi-fw" aria-hidden="true"></i> | <i class="mdi mdi-table mdi-fw" aria-hidden="true"></i> | ||||
{% if user.is_staff %} | |||||
Legacy extrinsic metadata | |||||
{% else %} | |||||
Show metadata | Show metadata | ||||
{% endif %} | |||||
anlambert: You can rename to `Intrinsic metadata` for consistency. | |||||
Done Inline Actionshmm actually it doesn't show intrinsic metadata, I need to rename it entirely vlorentz: hmm actually it doesn't show intrinsic metadata, I need to rename it entirely | |||||
</button> | </button> | ||||
<div id="swh-metadata-popover" style="display:none;"> | <div id="swh-metadata-popover" style="display:none;"> | ||||
<div class="popover-heading">{{ swh_object_name }} metadata</div> | <div class="popover-heading">{{ swh_object_name }} metadata</div> | ||||
<div class="popover-body"> | <div class="popover-body"> | ||||
<pre class="bg-white">{{ swh_object_metadata.metadata | escape }}</pre> | <pre class="bg-white">{{ swh_object_metadata.metadata | escape }}</pre> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
{% endif %} | {% endif %} | ||||
{% if user.is_staff %} | |||||
{% if swhids_info %} | |||||
<div class="btn-group"> | |||||
<button class="btn btn-default btn-sm dropdown-toggle" type="button" data-toggle="dropdown"> | |||||
<i class="mdi mdi-table mdi-fw" aria-hidden="true"></i> | |||||
Not Done Inline ActionsMaybe this could be simply named Extrinsic metadata ? anlambert: Maybe this could be simply named `Extrinsic metadata` ? | |||||
Extrinsic metadata | |||||
</button> | |||||
<div class="dropdown-menu swh-extrinsic-metadata-menu"> | |||||
{% for swhid_info in swhids_info %} | |||||
<a href="{% url 'api-1-raw-extrinsic-metadata-swhid-authorities' swhid_info.swhid %}" class="dropdown-item" role="button"> | |||||
<i class="{{ swh_object_icons|key_value:swhid_info.object_type }} mdi-fw" aria-hidden="true"></i> | |||||
{{swhid_info.object_type}} | |||||
</a> | |||||
{% endfor %} | |||||
</div> | |||||
</div> | |||||
{% endif %} | |||||
{% endif %} | |||||
<script> | <script> | ||||
swh.webapp.setBrowsedSwhObjectMetadata({{ swh_object_metadata|jsonify }}) | swh.webapp.setBrowsedSwhObjectMetadata({{ swh_object_metadata|jsonify }}) | ||||
</script> | </script> |
You can rename to Intrinsic metadata for consistency.