From 0880e0ecca4e65fd00a4ffafec948873be45193e Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 26 Feb 2021 12:02:08 -0800 Subject: web: refactor container SERP rows into macro --- python/fatcat_web/templates/container_search.html | 1 + python/fatcat_web/templates/entity_macros.html | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'python/fatcat_web') 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) }}

{{ entity['name'] }} 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 @@

{% endmacro %} + +{% macro container_search_result_row(entity) -%} +
+

+ {{ entity['name'] }} + {% if entity.is_oa %}{% endif %} +

+ {% if entity.publisher %} +
{{ entity.publisher }}
+ {% endif %} + {% if entity.issnl %} + issn:{{ entity.issnl }} + {% endif %} + {% if entity.container_type %} +  {{ entity.container_type }} + {% endif %} +
+{% endmacro %} + + {% macro progress_color(frac) -%} {% if frac >= 1 %} green -- cgit v1.2.3