diff options
author | Bryan Newbold <bnewbold@archive.org> | 2020-08-06 17:47:14 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2020-08-06 19:01:12 -0700 |
commit | 9ba4cb8509b682ab62bb4debfceea41da328eccf (patch) | |
tree | bab3092e028dde9fcd5bc48885e6b49557ad7aa7 | |
parent | 6bfd68b178f68380b5469762de80f7b19a921d20 (diff) | |
download | fatcat-scholar-9ba4cb8509b682ab62bb4debfceea41da328eccf.tar.gz fatcat-scholar-9ba4cb8509b682ab62bb4debfceea41da328eccf.zip |
show language code as a tag
-rw-r--r-- | fatcat_scholar/templates/search.html | 2 | ||||
-rw-r--r-- | fatcat_scholar/templates/search_macros.html | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/fatcat_scholar/templates/search.html b/fatcat_scholar/templates/search.html index 0216f87..b4e6098 100644 --- a/fatcat_scholar/templates/search.html +++ b/fatcat_scholar/templates/search.html @@ -87,7 +87,7 @@ {# search results (rendered via macro) #} {% for paper in hits.results %} - {{ search_macros.fulltext_search_result_row(paper) }} + {{ search_macros.fulltext_search_result_row(paper, locale=locale) }} {% endfor %} {% if hits.count_found > hits.limit %} diff --git a/fatcat_scholar/templates/search_macros.html b/fatcat_scholar/templates/search_macros.html index 6d7814c..ca8ef4d 100644 --- a/fatcat_scholar/templates/search_macros.html +++ b/fatcat_scholar/templates/search_macros.html @@ -15,12 +15,14 @@ <span class="ui label basic orange small" title="Szcezepanski OA Journal List">Szczepanski</span> {% elif tag == "doaj" %} <span class="ui label basic orange small" title="Directory of Open Access Journals">DOAJ</span> + {% elif tag.startswith("lang:") %} + <span class="ui label basic black small" title="ISO Language Code">{{ tag }}</span> {% else %} <span class="ui label small">{{ _(tag) }}</span> {% endif %} {% endmacro %} -{% macro fulltext_search_result_row(paper) -%} +{% macro fulltext_search_result_row(paper, locale=None) -%} <div class="ui grid"> <div class="thirteen wide column"> {# ### TITLE ROW #} @@ -152,6 +154,9 @@ {% for tag in paper.tags %} {{ tag_label(tag) }} {% endfor %} + {% if paper.biblio.lang_code and paper.biblio.lang_code != (locale or 'en') %} + {{ tag_label("lang:" + paper.biblio.lang_code) }} + {% endif %} </div> {# ### COLLAPSED HITS #} |