diff options
Diffstat (limited to 'python/fatcat_web/templates/entity_macros.html')
-rw-r--r-- | python/fatcat_web/templates/entity_macros.html | 108 |
1 files changed, 83 insertions, 25 deletions
diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html index 9b419c41..5f8f6e0a 100644 --- a/python/fatcat_web/templates/entity_macros.html +++ b/python/fatcat_web/templates/entity_macros.html @@ -142,9 +142,9 @@ </form> {%- endmacro %} -{% macro release_search_result_row(paper) -%} +{% macro release_search_result_row(paper, margin_top=True) -%} <div> - <h4 style="margin-top: 1em; margin-bottom: 0px; font-size: 1.1em;"> + <h4 style="{% if margin_top %}margin-top: 1em; {% endif %}margin-bottom: 0px; font-size: 1.1em;"> <a href="/release/{{ paper.ident }}" style="color: #2224c7;"> {% if paper.title %} {{ paper.title[:512] }} @@ -224,7 +224,7 @@ {% endif %} {% if paper.withdrawn_status %} - <b style="color: red; text-transform: uppercase;">{{ paper.withdrawn_status }}</b> + <b style="color: red; text-transform: uppercase;"> [{{ paper.withdrawn_status }}]</b> {% endif %} {# ### IDENTIFIERS #} @@ -257,6 +257,9 @@ {% if paper.wikidata_qid %} <a href="https://wikidata.org/wiki/{{ paper.wikidata_qid }}" style="color: green;">wikidata:{{ paper.wikidata_qid }}</a> {% endif %} + {% if paper.version %} + <span style="color: green;">version:{{ paper.version }}</span> + {% endif %} {# WIP: elastic release work grouping searches <br> @@ -267,23 +270,73 @@ {% 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 %} - {{ entity.container_type }} - {% endif %} - {% if entity.publication_status and entity.publication_status != "active" %} - {{ entity.publication_status }} +{% macro container_search_result_row(entity, show_stats=False) -%} + <div class="ui stackable doubling grid"> + <div class="twelve wide column"> + <h4 style="margin-bottom: 0em; font-size: 1.1em;"> + <a href="/container/{{ entity.ident }}" style="color: #2224c7;">{{ entity['name'] }}</a> + </h4> + {% if entity.original_name %} + <i>{{ entity.original_name }}</i></br> + {% endif %} + {% if entity.publisher %} + <a href="/container/search?q=publisher:%22{{ entity.publisher }}%22" style="color: black; margin-top: 0em;">{{ entity.publisher }}</a> + <br> + {% endif %} + {% if entity.issnl %} + <a href="https://portal.issn.org/resource/ISSN/{{ entity.issnl }}" style="color: green;">issnl:{{ entity.issnl }}</a> + {% endif %} + {% if entity.wikidata_qid %} + <a href="https://wikidata.org/wiki/{{ entity.wikidata_qid }}" style="color: green;">wikidata:{{ entity.wikidata_qid }}</a> + {% endif %} + {% if entity.dblp_prefix %} + <a href="https://dblp.org/db/{{ entity.dblp_prefix }}/index.html" style="color: green;">dblp:{{ entity.dblp_prefix }}</a> + {% endif %} + {% if entity.ia_sim_collection %} + <a href="https://archive.org/details/{{ entity.ia_sim_collection }}" style="color: green;">[archive.org]</a> + {% elif entity.sim_pubid %} + <a href="https://archive.org/search.php?query=sim_pubid%3A{{ entity.sim_pubid }}%20mediatype%3Acollection" style="color: green;">[archive.org]</a> + {% endif %} + {# too much clutter + {% if entity.country_code %} + <span style="color: black;">country:{{ entity.country_code }}</span> + {% endif %} + {% for lang in entity.languages %} + <span style="color: black;">lang:{{ lang }}</span> + {% endfor %} + {% if entity.any_kbart %} + <span style="color: black;">[KBART]</span> + {% endif %} + <br> + #} + {% if entity.in_doaj %} + <span style="color: #c54e00;">[DOAJ]</span> + {% endif %} + {% if entity.in_road %} + <span style="color: #c54e00;">[ROAD]</span> + {% endif %} + {% if entity.is_oa and not (entity.in_doaj or entity.in_road) %} + <span style="color: #c54e00;">[open-access]</span> + {% endif %} + {% if entity.container_type and entity.container_type != "journal" %} + <b>[{{ entity.container_type }}]</b> + {% endif %} + {% if entity.publication_status and entity.publication_status != "active" %} + <span style="color: brown;">{{ entity.publication_status }}</span> + {% endif %} + </div> + + {% if show_stats %} + <div class="four wide right aligned column"> + {% if entity.releases_total %} + <b>~{{ "{:,}".format(entity.releases_total) }}</b> releases + {% elif entity.releases_total == 0 %} + <i>(not indexed)</i> + {% endif %} + {% if entity.releases_total %} + {{ preservation_bar({'bright': entity.preservation_bright, 'dark': entity.preservation_dark, 'none': entity.preservation_none, 'total': entity.releases_total}) }} + {% endif %} + </div> {% endif %} </div> {% endmacro %} @@ -335,31 +388,36 @@ yellow {% set frac_dark = stats.dark/stats.total %} {% set frac_none = stats.none/stats.total %} - <table class="ui very basic very compact collapsing table" style="font-weight: bold; margin-left: 1em;"> + <table class="ui basic very compact collapsing table" style="margin-left: 1em;"> <tbody> <tr> <td style="background-color: #21ba45;"> - <td class="right aligned" >{{ "{:,}".format(stats.bright) }} + <td class="right aligned" style="font-weight: bold;">{{ "{:,}".format(stats.bright) }} <td class="right aligned" >{{ (frac_bright*100)|round(2,method='ceil') }}% <td>preserved and publicly accessible (bright) <tr> <td style="background-color: darkgreen;"> - <td class="right aligned" >{{ "{:,}".format(stats.dark) }} + <td class="right aligned" style="font-weight: bold;">{{ "{:,}".format(stats.dark) }} <td class="right aligned" >{{ (frac_dark*100)|round(2,method='ceil') }}% <td>preserved but not publicly accessible (dark) {% if stats.shadows_only %} {% set frac_shadows_only = stats.shadows_only/stats.total %} <tr> <td style="background-color: darkred;"> - <td class="right aligned" >{{ "{:,}".format(stats.shadows_only) }} + <td class="right aligned" style="font-weight: bold;">{{ "{:,}".format(stats.shadows_only) }} <td class="right aligned" >{{ (frac_shadows_only*100)|round(2,method='ceil') }}% <td>only independently preserved in "shadow" libraries {% endif %} <tr> <td style="background-color: #db2828;"> - <td class="right aligned" >{{ "{:,}".format(stats.none) }} + <td class="right aligned" style="font-weight: bold;">{{ "{:,}".format(stats.none) }} <td class="right aligned" >{{ (frac_none*100)|round(2,method='ceil') }}% <td>no known independent preservation + <tr> + <td style="background-color: grey;"> + <td class="right aligned" style="font-weight: bold;">{{ "{:,}".format(stats.total) }} + <td class="right aligned" > + <td>total </tbody> </table> |