From 29593e492b632c8884c31993230d258d646e3d8c Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 30 Jul 2020 20:31:56 -0700 Subject: routes: handle case of viewing deleted entity in editgroup context Eg, consider deleting an entity. When viewing the editgroup, want to be able to click the deleted entity and see the "deleted entity" page instead of a generic 404. --- python/fatcat_web/templates/entity_macros.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'python/fatcat_web/templates/entity_macros.html') diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html index 718c071c..0ce646bf 100644 --- a/python/fatcat_web/templates/entity_macros.html +++ b/python/fatcat_web/templates/entity_macros.html @@ -33,7 +33,7 @@ {% if entity.state %} State is "{{ entity.state }}". {% endif %} - {% if entity.state != "deleted" %} + {% if entity.revision %} Revision:
{{ entity.revision }} {% endif %} @@ -43,11 +43,13 @@ {%- else -%} https://api.{{ config.FATCAT_DOMAIN }} {%- endif -%} - /v0/{{ entity_type }} - {%- if entity.ident -%} - /{{ entity.ident }} + /v0 + {%- if editgroup and entity.ident -%} + /editgroup/{{ editgroup.editgroup_id }}{# /{{ entity_type }}/{{ entity.ident }} #} + {%- elif entity.ident -%} + /{{ entity_type }}/{{ entity.ident }} {%- elif entity.revision -%} - /rev/{{ entity.revision }} + /{{ entity_type }}/rev/{{ entity.revision }} {% endif %} {% if expand %}?expand={{ expand}}{% endif %}"> As JSON object via API -- cgit v1.2.3