summaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/templates
diff options
context:
space:
mode:
Diffstat (limited to 'python/fatcat_web/templates')
-rw-r--r--python/fatcat_web/templates/entity_macros.html14
-rw-r--r--python/fatcat_web/templates/release_view.html4
-rw-r--r--python/fatcat_web/templates/webcapture_view.html18
3 files changed, 21 insertions, 15 deletions
diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html
index 90c8e952..cefb0378 100644
--- a/python/fatcat_web/templates/entity_macros.html
+++ b/python/fatcat_web/templates/entity_macros.html
@@ -73,16 +73,22 @@
{%- endmacro %}
-{% macro url_list(urls) -%}
+{% macro url_list(urls, wayback_suffix="") -%}
<table class="ui very basic compact single line fixed table">
<tbody>
{% for url in urls %}
+ {% if url.rel == "wayback" %}
+ {% set suffix = wayback_suffix %}
+ {% else %}
+ {% set suffix = "" %}
+ {% endif %}
+ {% set entity = release %}
<tr><td class="two wide right aligned">{{ url.rel }}
- <td class="eight wide"><small><code><a href="{{ url.url }}">
+ <td class="eight wide"><small><code><a href="{{ url.url }}{{ suffix }}">
{% if url.url.count('/') >= 3 and url.rel != "dweb" %}
- {{ '/'.join(url.url.split('/')[0:2]) }}/<b>{{ ''.join(url.url.split('/')[2]) }}</b>/{{ '/'.join(url.url.split('/')[3:]) }}
+ {{ '/'.join(url.url.split('/')[0:2]) }}/<b>{{ ''.join(url.url.split('/')[2]) }}</b>/{{ '/'.join(url.url.split('/')[3:]) }}{{ suffix }}
{% else %}
- {{ url.url }}
+ {{ url.url }}{{ suffix }}
{% endif %}
</a></code></small>
{% endfor %}
diff --git a/python/fatcat_web/templates/release_view.html b/python/fatcat_web/templates/release_view.html
index 4849842c..403af653 100644
--- a/python/fatcat_web/templates/release_view.html
+++ b/python/fatcat_web/templates/release_view.html
@@ -267,7 +267,7 @@
<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.original_url }}{% endif %}">{{ url.url.split('/')[2] }}</a> ({{ url.rel }})<br>
+ <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
@@ -318,7 +318,7 @@
{% if entity.files != [] and entity.files[0].urls != [] %}
<a href="{{ entity.files[0].urls[0].url }}" class="ui top attached fluid huge green button"><i class="file pdf outline icon"></i>Download Full Text</a>
{% elif entity.webcaptures != [] and entity.webcaptures[0].archive_urls != [] and entity.webcaptures[0].archive_urls[0].rel == "wayback" %}
-<a href="{{ entity.webcaptures[0].archive_urls[0].url }}*/{{ entity.webcaptures[0].original_url }}" class="ui top attached fluid huge green button"><i class="file archive outline icon"></i>View Web Archive</a>
+<a href="{{ entity.webcaptures[0].archive_urls[0].url }}{{ entity.webcaptures[0].wayback_suffix }}" class="ui top attached fluid huge green button"><i class="file archive outline icon"></i>View Web Archive</a>
{% else %}
<span class="ui top attached fluid huge grey button"><i class="file cross icon"></i>No Full Text Available</span>
{% endif %}
diff --git a/python/fatcat_web/templates/webcapture_view.html b/python/fatcat_web/templates/webcapture_view.html
index 1dd179f6..919f31e1 100644
--- a/python/fatcat_web/templates/webcapture_view.html
+++ b/python/fatcat_web/templates/webcapture_view.html
@@ -33,6 +33,14 @@
This Web Capture is not associated with any fatcat release.
{% endif %}
+<br>
+<h3>Archive URLs</h3>
+{% if webcapture.archive_urls != None %}
+ {{ entity_macros.url_list(webcapture.archive_urls, webcapture.wayback_suffix) }}
+{% else %}
+No known public archive for this webcapture.
+{% endif %}
+
<h3>CDX Rows ({{ webcapture.cdx|count }})</h3>
{% if webcapture.cdx %}
@@ -57,15 +65,7 @@
{% endfor %}
</div>
{% else %}
-This File Set is empty (contains no files).
-{% endif %}
-
-<br>
-<h3>Archive URLs</h3>
-{% if webcapture.archive_urls != None %}
- {{ entity_macros.url_list(webcapture.archive_urls) }}
-{% else %}
-No known public archive for this webcapture.
+This web capture is empty (contains no resources).
{% endif %}
</div>