Skip to content

Commit

Permalink
file-details: small tweaks (#17072)
Browse files Browse the repository at this point in the history
Co-authored-by: Mike Fiedler <miketheman@gmail.com>
  • Loading branch information
woodruffw and miketheman authored Nov 13, 2024
1 parent 60187ca commit 932cbbd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 26 deletions.
34 changes: 17 additions & 17 deletions warehouse/locale/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ msgstr ""
#: warehouse/templates/base.html:321 warehouse/templates/base.html:331
#: warehouse/templates/base.html:344
#: warehouse/templates/includes/accounts/profile-callout.html:18
#: warehouse/templates/includes/file-details.html:84
#: warehouse/templates/includes/file-details.html:94
#: warehouse/templates/index.html:100 warehouse/templates/index.html:104
#: warehouse/templates/manage/account.html:228
#: warehouse/templates/manage/account.html:234
Expand Down Expand Up @@ -2707,51 +2707,51 @@ msgstr ""
msgid "Public profile"
msgstr ""

#: warehouse/templates/includes/file-details.html:17
#: warehouse/templates/includes/file-details.html:27
msgid "File details"
msgstr ""

#: warehouse/templates/includes/file-details.html:28
#: warehouse/templates/includes/file-details.html:38
#, python-format
msgid "Upload date: %(upload_time)s"
msgstr ""

#: warehouse/templates/includes/file-details.html:29
#: warehouse/templates/includes/file-details.html:39
#, python-format
msgid "Size: %(size)s"
msgstr ""

#: warehouse/templates/includes/file-details.html:30
#: warehouse/templates/includes/file-details.html:40
#, python-format
msgid "Tags: %(tags)s"
msgstr ""

#: warehouse/templates/includes/file-details.html:32
#: warehouse/templates/includes/file-details.html:42
#, python-format
msgid "Uploaded using Trusted Publishing? %(is_tp)s"
msgstr ""

#: warehouse/templates/includes/file-details.html:37
#: warehouse/templates/includes/file-details.html:47
#, python-format
msgid "Uploaded via: %(uploaded_via)s"
msgstr ""

#: warehouse/templates/includes/file-details.html:45
#: warehouse/templates/includes/file-details.html:55
#, python-format
msgid "Hashes for %(filename)s"
msgstr ""

#: warehouse/templates/includes/file-details.html:48
#: warehouse/templates/includes/file-details.html:58
msgid "Algorithm"
msgstr ""

#: warehouse/templates/includes/file-details.html:49
#: warehouse/templates/includes/file-details.html:59
msgid "Hash digest"
msgstr ""

#: warehouse/templates/includes/file-details.html:58
#: warehouse/templates/includes/file-details.html:67
#: warehouse/templates/includes/file-details.html:76
#: warehouse/templates/includes/file-details.html:68
#: warehouse/templates/includes/file-details.html:77
#: warehouse/templates/includes/file-details.html:86
#: warehouse/templates/manage/account.html:206
#: warehouse/templates/manage/account/recovery_codes-provision.html:58
#: warehouse/templates/manage/account/totp-provision.html:57
Expand All @@ -2761,9 +2761,9 @@ msgstr ""
msgid "Copy to clipboard"
msgstr ""

#: warehouse/templates/includes/file-details.html:59
#: warehouse/templates/includes/file-details.html:68
#: warehouse/templates/includes/file-details.html:77
#: warehouse/templates/includes/file-details.html:69
#: warehouse/templates/includes/file-details.html:78
#: warehouse/templates/includes/file-details.html:87
#: warehouse/templates/manage/account.html:207
#: warehouse/templates/manage/account/recovery_codes-provision.html:59
#: warehouse/templates/manage/account/totp-provision.html:58
Expand All @@ -2772,7 +2772,7 @@ msgstr ""
msgid "Copy"
msgstr ""

#: warehouse/templates/includes/file-details.html:84
#: warehouse/templates/includes/file-details.html:94
#, python-format
msgid ""
"<a href=\"%(href)s\" title=\"%(title)s\" target=\"_blank\" "
Expand Down
24 changes: 15 additions & 9 deletions warehouse/templates/includes/file-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
# limitations under the License.
-#}

{% macro publisher(publ) -%}
{% if publ.kind == "GitHub" %}
<p>
Publisher: <a href="https://github.com/{{ publ.repository }}/blob/HEAD/.github/workflows/{{ publ.workflow }}">
<i class="fa-brands fa-github" aria-hidden="true"></i>
<code>{{ publ.workflow }}</code> on {{ publ.repository }}
</a>
</p>
{% endif %}
{%- endmacro %}

<div id="{{ file.filename }}" data-project-tabs-target="content" class="vertical-tabs__content" role="tabpanel" aria-labelledby="file-tab mobile-file-tab" tabindex="-1">
<h2 class="page-title">{% trans %}File details{% endtrans %}</h2>
Expand Down Expand Up @@ -102,24 +112,20 @@ <h3>Provenance</h3>
</div>

<div class="card file__card">
Publisher: {{ bundle.publisher.kind }}
<ul>
<li>Repository: {{ bundle.publisher.repository }}</li>
<li>Workflow: {{ bundle.publisher.workflow }}</li>
</ul>
{{ publisher(bundle.publisher )}}
Attestations:
<ul>
{% for attestation in bundle.attestations %}
<li>
{% set statement = attestation.statement %}
Statement type: {{ statement._type }}
Statement type: <a href="{{ statement._type }}"><code>{{ statement._type }}</code></a>
<ul>
<li>Predicate type: <code>{{ statement.predicateType }}</code></li>
<li>Predicate type: <a href="{{ statement.predicateType }}"><code>{{ statement.predicateType }}</code></a></li>
<li>Subject name: <code>{{ statement.subject[0].name }}</code></li>
<li>Subject digest: <code>{{ statement.subject[0].digest.sha256 }}</code></li>
{% set tlog_entry = attestation.verification_material.transparency_entries[0] %}
<li>Transparency log index: <a href="https://search.sigstore.dev/?logIndex={{ tlog_entry.logIndex }}">{{ tlog_entry.logIndex }}</a> </li>
<li>Transparency log integration time: {{ humanize(tlog_entry.integratedTime | int | ctime, time="true") }} </li>
<li>Sigstore transparency entry: <a href="https://search.sigstore.dev/?logIndex={{ tlog_entry.logIndex }}">{{ tlog_entry.logIndex }}</a> </li>
<li>Sigstore integration time: {{ humanize(tlog_entry.integratedTime | int | ctime, time="true") }} </li>
</ul>
</li>
{% endfor %}
Expand Down

0 comments on commit 932cbbd

Please sign in to comment.