summaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/templates/release_files.html
blob: c8432cb5ca83625b796731d570dde0fa6c7cf2dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{% set entity = release %}
{% set entity_view = "files" %}
{% set entity_type = "release" %}
{% import "entity_macros.html" as entity_macros %}
{% extends "entity_base.html" %}

{% block entity_main %}

<h3>Known Files and URLs</h3>
{% if entity.files != [] %}
<table class="ui compact fixed table">
<!--
  <thead>
    <tr><th>SHA-1
        <th>Size (bytes)
        <th>File Type
        <th>Links
  </thead>
-->
  <tbody>
  {% for file in entity.files %}
  <tr><td>{% if file.mimetype != None %}{{ file.mimetype }}&nbsp;&nbsp;{% endif %}
          {% if file.size != None %}{{ file.size|filesizeformat }}{% endif %}
      <br><small><code><a href="/file/{{ file.ident }}">
            {% if file.sha1 != None %}sha1:{{ file.sha1[:20] + "..." }}
            {% elif file.sha256!= None %}sha256:{{ file.md5[:20] + "..." }}
            {% elif file.md5 != None %}md5:{{ file.md5[:20] + "..." }}
            {% endif %}
        </a></code></small>
      <td class="single line">
        {% for url in file.urls[:5] %}
          <a href="{{ url.url }}">{{ url.url.split('/')[2] }}</a> ({{ url.rel }})<br>
        {% endfor %}
        {% if file.urls|length > 5 %}
          <a href="/file/{{ file.ident }}">+ {{ file.urls|length - 5 }} more URLs</a>
        {% endif %}
  {% endfor %}
  </tbody>
</table>
{% else %}
<p>There are no known files associated with this release (you could try
<a href="/work/{{ release.work_id }}">other releases for this work?</a>).
{% endif %}


{% if entity.filesets != [] %}
<h3>File Sets</h3>
<table class="ui compact fixed table">
  <tbody>
  {% for fileset in entity.filesets %}
  <tr><td>{{ fileset.manifest|count }} files &nbsp;{{ fileset.total_size|filesizeformat }}
      <br><small><code><a href="/fileset/{{ fileset.ident }}">fileset:{{ fileset.ident }}</a></code></small>
      <td class="single line">
        {% for url in fileset.urls[:5] %}
          {% if url.rel == "dweb" %}
            <a href="{{ url.url }}">{{ url.url }}</a> ({{ url.rel }})<br>
          {% else %}
            <a href="{{ url.url }}">{{ url.url.split('/')[2] }}</a> ({{ url.rel }})<br>
          {% endif %}
        {% endfor %}
        {% if fileset.urls|length > 5 %}
          + {{ file.urls|length - 5 }} more URLs
        {% endif %}
  {% endfor %}
  </tbody>
</table>
{% endif %}


{% if entity.webcaptures != [] %}
<h3>Web Captures</h3>
<table class="ui single line compact fixed table">
  <tbody>
  {% for webcapture in entity.webcaptures %}
  <tr><td><b><a href="{{ webcapture.original_url }}">{{ webcapture.original_url }}</a></b>
      <br>{{ webcapture.timestamp.strftime("%Y-%m-%d %H:%M:%S") }} | {{ webcapture.cdx|count }} resources
      <br><small><code><a href="/webcapture/{{ webcapture.ident }}">webcapture:{{ webcapture.ident }}</a></code></small>
      <td class="single line">
        {% for url in webcapture.archive_urls[:5] %}
          <a href="{{ url.url }}{% if url.rel == "wayback" %}{{ webcapture.wayback_suffix }}{% endif %}">{{ url.url.split('/')[2] }}</a> ({{ url.rel }})<br>
        {% endfor %}
        {% if webcapture.urls|length > 5 %}
          + {{ file.urls|length - 5 }} more URLs
        {% endif %}
  {% endfor %}
  </tbody>
</table>
{% endif %}

{% endblock %}