aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_web
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-02-26 12:02:08 -0800
committerBryan Newbold <bnewbold@robocracy.org>2021-02-26 12:03:32 -0800
commit0880e0ecca4e65fd00a4ffafec948873be45193e (patch)
tree405812f25ba93006c68eef158cd446ba663916e7 /python/fatcat_web
parentfc9edfb1b65260f41f204d11bf130ceb35cb84e0 (diff)
downloadfatcat-0880e0ecca4e65fd00a4ffafec948873be45193e.tar.gz
fatcat-0880e0ecca4e65fd00a4ffafec948873be45193e.zip
web: refactor container SERP rows into macro
Diffstat (limited to 'python/fatcat_web')
-rw-r--r--python/fatcat_web/templates/container_search.html1
-rw-r--r--python/fatcat_web/templates/entity_macros.html20
2 files changed, 21 insertions, 0 deletions
diff --git a/python/fatcat_web/templates/container_search.html b/python/fatcat_web/templates/container_search.html
index bd92dc2b..0c7823b1 100644
--- a/python/fatcat_web/templates/container_search.html
+++ b/python/fatcat_web/templates/container_search.html
@@ -35,6 +35,7 @@
{{ search_macros.top_results(query, found) }}
{% for entity in found.results %}
+ {{ entity_macros.container_search_result_row(entity) }}
<div>
<h4 style="margin-top: 1em; margin-bottom: 4px; font-size: 1.1em;">
<a href="/container/{{ entity.ident }}" style="color: #2224c7;">{{ entity['name'] }}</a>
diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html
index 204347cd..45f00362 100644
--- a/python/fatcat_web/templates/entity_macros.html
+++ b/python/fatcat_web/templates/entity_macros.html
@@ -265,6 +265,26 @@
</div>
{% endmacro %}
+
+{% macro container_search_result_row(entity) -%}
+ <div>
+ <h4 style="margin-top: 1em; margin-bottom: 4px; font-size: 1.1em;">
+ <a href="/container/{{ entity.ident }}" style="color: #2224c7;">{{ entity['name'] }}</a>
+ {% if entity.is_oa %}<i class="icon unlock orange small"></i>{% endif %}
+ </h4>
+ {% if entity.publisher %}
+ <h5 style="margin-top: 4px; margin-bottom: 0px; font-size: 1em;">{{ entity.publisher }}</h5>
+ {% endif %}
+ {% if entity.issnl %}
+ <a href="https://portal.issn.org/resource/ISSN/{{entity.issnl }}" style="color: green;">issn:{{ entity.issnl }}</a>
+ {% endif %}
+ {% if entity.container_type %}
+ &nbsp;{{ entity.container_type }}
+ {% endif %}
+ </div>
+{% endmacro %}
+
+
{% macro progress_color(frac) -%}
{% if frac >= 1 %}
green