From 526e291f71b4f7018708de61b9e698b0ee9d894c Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 11 Feb 2022 12:25:52 -0800 Subject: containers: iterate on browse interface, showing year/volume/issue --- .../templates/container_view_browse.html | 74 ++++++++++++++++------ 1 file changed, 54 insertions(+), 20 deletions(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/container_view_browse.html b/python/fatcat_web/templates/container_view_browse.html index aa88b666..f6a74a2d 100644 --- a/python/fatcat_web/templates/container_view_browse.html +++ b/python/fatcat_web/templates/container_view_browse.html @@ -4,25 +4,50 @@ {% import "entity_macros.html" as entity_macros %} {% extends "entity_base.html" %} -{% macro browse_year_volume_table(entity, data) %} +{% macro browse_year_volume_issue_table(entity, data) %} + + + + {% for year in data.keys()|sort|reverse %} + {% set year_loop = loop %} {% for volume in data[year].keys()|sort|reverse %} - - {% if loop.first %} - - {% endif %} - {% if volume == '000_unknown' %} - - - + {% set volume_loop = loop %} + {% for issue in data[year][volume].keys()|sort|reverse %} + {% set issue_loop = loop %} + + {% if volume_loop.first and issue_loop.first %} + {% set year_rowspan = data[year].values()|map('length')|sum %} + + {% endif %} + + {% if issue_loop.first %} + + {% endif %} + + + + + + {% endfor %} {% endfor %} {% endfor %} @@ -30,15 +55,24 @@ {% endmacro %} {% macro browse_releases(found) %} +

+ Browsing: + {% if request.args.volume %}Volume {{ request.args.volume }}  {% endif %} + {% if request.args.issue %}Issue {{ request.args.issue }}  {% endif %} + {% if request.args.year %}Year {{ request.args.year }}  {% endif %} +

+
{% for release_doc in found.results %}
- {% if release_doc.pages %} - {{ release_doc.pages }} - {# + {% if request.args.volume %} + {% if release_doc.pages %} + {{ release_doc.pages }} + {% else %} + {# blank #} + {% endif %} {% elif release_doc.release_date %} {{ release_doc.release_date }} - #} {% endif %}
@@ -55,7 +89,7 @@ {% elif entity._browse_volume_year %}

Contents by Year and Volume

- {{ browse_year_volume_table(entity, entity._browse_volume_year) }} + {{ browse_year_volume_issue_table(entity, entity._browse_volume_year) }}
{% endif %} -- cgit v1.2.3
Year + Volume + Issue + Indexed Content +
- {{ year }} - {% if data[year]|length > 1 %}n/a{% endif %}{{ data[year][volume] }} releases - {% else %} - Vol. {{ volume }}{{ data[year][volume] }} releases - {% endif %} -
+ {{ year }} + + {% if volume != '000_unknown' %} + Vol. {{ volume }} + {% endif %} + + {% if issue != '000_unknown' %} + Issue {{ issue }} + {% endif %} + + {{ data[year][volume][issue] }} releases +