summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-06-23 19:49:36 -0700
committerBryan Newbold <bnewbold@robocracy.org>2021-07-23 10:55:09 -0700
commitc2395869ff7860bb2c7f080fd6c097e299ea58bf (patch)
tree3749d2e7a5bf4db7d0dbe38fd04ae9e3bca5cc69
parent570074b514259bf6345c376faea8128f279bd0b4 (diff)
downloadfatcat-c2395869ff7860bb2c7f080fd6c097e299ea58bf.tar.gz
fatcat-c2395869ff7860bb2c7f080fd6c097e299ea58bf.zip
fixes for newer ref index
-rw-r--r--python/fatcat_tools/references.py2
-rw-r--r--python/fatcat_web/templates/release_view_fuzzy_refs.html59
2 files changed, 11 insertions, 50 deletions
diff --git a/python/fatcat_tools/references.py b/python/fatcat_tools/references.py
index 7e1f4f71..976967d4 100644
--- a/python/fatcat_tools/references.py
+++ b/python/fatcat_tools/references.py
@@ -68,7 +68,7 @@ class BiblioRef(BaseModel):
# skipped: target_wikipedia_article
# crossref, pubmed, grobid, etc
- match_provenance: str
+ match_provenance: Optional[str]
# strong, weak, etc
match_status: Optional[str]
# TODO: "match_strength"?
diff --git a/python/fatcat_web/templates/release_view_fuzzy_refs.html b/python/fatcat_web/templates/release_view_fuzzy_refs.html
index 9ceb6060..ee39d15b 100644
--- a/python/fatcat_web/templates/release_view_fuzzy_refs.html
+++ b/python/fatcat_web/templates/release_view_fuzzy_refs.html
@@ -33,56 +33,17 @@
{% endif %}
{% endif %}
<br><b>{{ ref.ref.match_status }}</b>
- <br>{{ ref.ref.match_provenance }}
+ {% if ref.ref.match_provenance %}
+ <br>{{ ref.ref.match_provenance }}
+ {% endif %}
<td class="">
- <b><a href="/release/{{ release.ident }}">{{ release.title }}</a></b>
- {% if release.release_type not in ["article-journal", "conference-paper"] %}
- <b>[{{ release.release_type or "unknown-type" }}]</b>
- {% endif %}
- <br>
- {% for contrib in release.contribs[:5] %}
- {% if contrib.creator %}
- {{ contrib.creator.display_name }}
- {% else %}
- {{ contrib.raw_name }}
- {% endif %}
- {% if not loop.last %}, {% endif %}
- {% endfor %}
- {% if release.contribs | length > 5 %}(+ more) {%endif %}
- <br>
- {% if release.release_year %}{{ release.release_year }} &nbsp;{% endif %}
- {% if release.container %}
- <i>{{ release.container.name }}</i>
- {% elif release.extra and release.extra.container_name %}
- <i>{{ release.extra.container_name }}</i>
- {% endif %}
- {% if release.release_stage != "published" %}
- &nbsp;<span style="color: brown; font-weight: bold;">{{ release.release_stage or "unpublished" }}</span>
- {% endif %}
- </small>
- <br>
- {% if release.version %}
- <span style="color:green">version:{{ release.release_year }}</span>&nbsp;
- {% endif %}
- {% if release.number %}
- <span style="color:green">number:{{ release.number }}</span>&nbsp;
- {% endif %}
- {% if release.ext_ids.doi %}
- <a href="https://doi.org/{{ release.ext_ids.doi }}" style="color:green;">doi:{{ release.ext_ids.doi }}</a>&nbsp;
- {% endif %}
- {# TODO: links #}
- {% if release.ext_ids.arxiv %}
- <a href="#" style="color:green;">arXiv:{{ release.ext_ids.arxiv }}</a>&nbsp;
- {% endif %}
- {% if release.ext_ids.pmcid %}
- <a href="#" style="color:green;">pmcid:{{ release.ext_ids.pmcid }}</a>&nbsp;
- {% endif %}
- {% if release.ext_ids.pmid %}
- <a href="#" style="color:green;">pmid:{{ release.ext_ids.pmid }}</a>&nbsp;
- {% endif %}
- {% if release.ext_ids.dblp %}
- <a href="#" style="color:green;">dblp:{{ release.ext_ids.dblp }}</a>&nbsp;
- {% endif %}
+ {% if release %}
+ {% entity_macros.release_summary(release) %}
+ {% elif ref.ref.target_unstructured %}
+ <code>{{ ref.ref.target_unstructured }}</code>
+ {% else %}
+ <i>blank</i>
+ {% endif %}
<td class="">
{% if ref.access %}
<a href="{{ ref.access[0].access_url}}" class="ui tiny green active button">{{ ref.access[0].access_type.name }}</a>