From 570074b514259bf6345c376faea8128f279bd0b4 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 15 Apr 2021 23:48:06 -0700 Subject: web: inbound/outbound refs as links (temporarily); change URL names --- python/fatcat_web/ref_routes.py | 4 ++-- python/fatcat_web/templates/entity_base.html | 4 ++++ python/fatcat_web/templates/release_view_fuzzy_refs.html | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'python') diff --git a/python/fatcat_web/ref_routes.py b/python/fatcat_web/ref_routes.py index dc39299f..bd8ae550 100644 --- a/python/fatcat_web/ref_routes.py +++ b/python/fatcat_web/ref_routes.py @@ -18,7 +18,7 @@ from fatcat_web.forms import * from fatcat_web.entity_helpers import * -@app.route('/release//refs/inbound', methods=['GET']) +@app.route('/release//inbound-refs', methods=['GET']) def release_view_refs_inbound(ident): # lookup release ident, ensure it exists @@ -35,7 +35,7 @@ def release_view_refs_inbound(ident): return render_template('release_view_fuzzy_refs.html', direction="inbound", entity=release, hits=hits, enriched_refs=enriched_refs), 200 -@app.route('/release//refs/outbound', methods=['GET']) +@app.route('/release//outbound-refs', methods=['GET']) def release_view_refs_outbound(ident): # lookup release ident, ensure it exists diff --git a/python/fatcat_web/templates/entity_base.html b/python/fatcat_web/templates/entity_base.html index 36280f5d..c23dbef2 100644 --- a/python/fatcat_web/templates/entity_base.html +++ b/python/fatcat_web/templates/entity_base.html @@ -86,6 +86,10 @@ {% elif entity_type == "release" and entity.state != 'deleted' %} {{ entity_tab("contribs", "Authors", "/contribs", entity._authors|count ) }} {{ entity_tab("references", "References", "/references", entity.refs|count) }} + {% if entity.state == 'active' %} + {{ entity_tab("inbound-refs", "Inbound", "/inbound-refs") }} + {{ entity_tab("outbound-refs", "Outbound", "/outbound-refs") }} + {% endif %} {% endif %} {{ entity_tab("metadata", "Metadata", "/metadata") }} diff --git a/python/fatcat_web/templates/release_view_fuzzy_refs.html b/python/fatcat_web/templates/release_view_fuzzy_refs.html index bc1fa171..9ceb6060 100644 --- a/python/fatcat_web/templates/release_view_fuzzy_refs.html +++ b/python/fatcat_web/templates/release_view_fuzzy_refs.html @@ -1,5 +1,5 @@ {% set release = entity %} -{% set entity_view = "references" %} +{% set entity_view = "{{ direction }}-refs" %} {% set entity_type = "release" %} {% import "entity_macros.html" as entity_macros %} {% extends "entity_base.html" %} -- cgit v1.2.3