aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/templates/file_view.html
blob: 77ecae4e2052d2158735fc9bb1c1c12f2383461a (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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
{% extends "base.html" %}
{% block fullbody %}

<div class="ui stackable mobile reversed grid centered">
<div class="one wide column"></div>
<div class="fifteen wide column">
  <h1 class="ui header">
  <div class="sub header"><code>file {{ file.ident }}</code></div></h1>
</div>
</div>

<div class="ui stackable mobile reversed grid centered">
<div class="one wide column"></div>
<div class="ten wide column" style="font-size: 16px;">

{% if file.extra %}
<h3>Extra Metadata (raw JSON)</h3>
<table class="ui definition single line fixed compact small unstackable table">
<tbody>
{% for (key, value) in file.extra.items() %}
  <tr><td class="three wide right aligned"><code>{{ key }}</code></td>
      <td class="seven wide"><code>{{ value }}</code>
{% endfor %}
</tbody>
</table>
{% endif %}

<h3>Releases</h3>
{% if file.releases != [] %}
<table class="ui very basic celled table">
<tbody>
{% for release in file.releases %}
  <tr><td class="two wide center aligned">
        {% if release.release_date %}{{ release.release_date }}{% elif release.release_year %}{{ release.release_year }}{% endif %}
      <td class="five wide single line">
        <b><a href="/release/{{ release.ident }}">{{ release.title }}</a></b>
        <br>{{ release.release_type or "unknown" }} - {{ release.release_status or "unknown" }}
              {% if release.license_slug %} - {{ release.license_slug }}{% endif %}
        {% if release.doi %}
          <br><a href="https://doi.org/{{ release.doi }}" style="color:green;">doi:{{ release.doi }}</a>
        {% endif %}
{% endfor %}
</tbody>
</table>
{% else %}
<p>
This file is not associated with any fatcat release.
{% endif %}


<h3>URLs</h3>
{% if file.urls != None %}
<table class="ui very basic compact single line fixed table">
<tbody>
  {% for url in file.urls %}
    <tr><td class="two wide right aligned">{{ url.rel }}
        <td class="eight wide"><small><code><a href="{{ url.url }}">
        {% if url.url.count('/') >= 3 %}
          {{ '/'.join(url.url.split('/')[0:2]) }}/<b>{{ ''.join(url.url.split('/')[2]) }}</b>/{{ '/'.join(url.url.split('/')[3:]) }}
        {% else %}
          {{ url.url }}
        {% endif %}
        </a></code></small>
  {% endfor %}
</tbody>
</table>
{% else %}
No known public URL, mirror, or archive for this file.
{% endif %}

<h3>Checksums</h3>
<table class="ui definition single line fixed compact small unstackable table">
  <tbody>
    {% if file.sha1 != None %}
    <tr><td class="one wide right aligned">SHA-1
        <td class="four wide"><small><code>{{ file.sha1 }}</code></small>
    {% endif %}
    {% if file.sha256 != None %}
    <tr><td class="one wide right aligned">SHA-256
        <td><small><code>{{ file.sha256 }}</code></small>
    {% endif %}
    {% if file.md5!= None %}
    <tr><td class="one wide right aligned">MD5
        <td><small><code>{{ file.md5 }}</code></small>
    {% endif %}
</table>

<!--
Raw Object:
{{ file|safe }}
-->

</div>
<div class="five wide column">

{% if file.urls != None and file.urls != [] %}
<a href="{{ file.urls[0].url }}" class="ui top attached fluid huge green button"><i class="file icon"></i>Download File</a>
{% else %}
<span class="ui top attached fluid huge grey button"><i class="file cross icon"></i>No Download Available</span>
{% endif %}

<div class="ui segment attached">

{% if file.size != None %}
<p><b>Size</b> &nbsp;{{ file.size|filesizeformat }} (bytes)
</div><div class="ui segment attached">
{% endif %}

{% if file.mimetype != None %}
<p><b>File Type</b> &nbsp;<code>{{ file.mimetype }}</code>
</div><div class="ui segment attached">
{% endif %}

<b>Fatcat Bits</b>
<p>State is "{{ file.state }}". Revision:
<br><small><code>{{ file.revision }}</code></small>
<br><a href="https://api.{{ config.FATCAT_DOMAIN }}/v0/file/{{ file.ident }}">As JSON object via API</a>

</div>
<div class="two ui buttons bottom attached">
  <a href="/file/{{ file.ident }}/edit" class="ui blue button">Edit Metadata</a>
  <a href="/file/{{ file.ident }}/history" class="ui button">View History</a>
</div>

</div>
</div>


{% endblock %}