summaryrefslogtreecommitdiffstats
path: root/python/fatcat_web
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-09-03 14:15:44 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-09-03 14:15:44 -0700
commit466953355f3e2a18cbdb93ca39d077103703f049 (patch)
treee642bd2986659e954101d8e23f9e5501755c0ea1 /python/fatcat_web
parent7690ee86e58d258b8f14ad33927037d7f06e2c67 (diff)
downloadfatcat-466953355f3e2a18cbdb93ca39d077103703f049.tar.gz
fatcat-466953355f3e2a18cbdb93ca39d077103703f049.zip
webface include webarchive_urls for containers
Diffstat (limited to 'python/fatcat_web')
-rw-r--r--python/fatcat_web/templates/container_view.html5
-rw-r--r--python/fatcat_web/templates/entity_macros.html2
2 files changed, 6 insertions, 1 deletions
diff --git a/python/fatcat_web/templates/container_view.html b/python/fatcat_web/templates/container_view.html
index 182589c7..1998bc68 100644
--- a/python/fatcat_web/templates/container_view.html
+++ b/python/fatcat_web/templates/container_view.html
@@ -12,6 +12,11 @@
<div style="text-overflow: ellipsis; overflow: hidden; width: 100%;">
<a href="{{ container.extra['urls'][0] }}"><code>{{ container.extra['urls'][0] }}</code></a>
</div>
+{% elif (container.extra != None) and (container.extra['webarchive_urls'] != None) and (container.extra['webarchive_urls']|length > 0) %}
+{# fallback to a webarchive URL if no valid/live homepage URL #}
+ <div style="text-overflow: ellipsis; overflow: hidden; width: 100%;">
+ <a href="{{ container.extra['webarchive_urls'][0] }}"><code>{{ container.extra['webarchive_urls'][0] }}</code></a>
+ </div>
{% endif %}
<p>
{% if container.publisher != None %}
diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html
index 4d6e80f2..0e3943dd 100644
--- a/python/fatcat_web/templates/entity_macros.html
+++ b/python/fatcat_web/templates/entity_macros.html
@@ -70,7 +70,7 @@
<tr><td class="three wide right aligned"><code>{{ key }}.{{ inner_key }}</code></td>
<td class="seven wide"><code>{{ inner_value }}</code>
{% endfor %}
- {% elif key in ("urls") and value and value is iterable and value is not string and value[0] is string %}
+ {% elif key in ("urls", "webarchive_urls") and value and value is iterable and value is not string and value[0] is string %}
<tr><td class="three wide right aligned"><code>{{ key }}</code></td>
<td class="seven wide">
<code>