From 7f6a03c31d2bae482896243e7468bc1290b1678b Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 16 Feb 2022 20:04:58 -0800 Subject: web editing: fix links between edit tabs for re-editing behavior --- python/fatcat_web/templates/container_edit.html | 2 +- python/fatcat_web/templates/edit_macros.html | 10 +++++----- python/fatcat_web/templates/editgroup_view.html | 5 ++++- python/fatcat_web/templates/entity_delete.html | 2 +- python/fatcat_web/templates/entity_edit_toml.html | 2 +- python/fatcat_web/templates/file_edit.html | 2 +- python/fatcat_web/templates/release_edit.html | 2 +- 7 files changed, 14 insertions(+), 11 deletions(-) (limited to 'python') diff --git a/python/fatcat_web/templates/container_edit.html b/python/fatcat_web/templates/container_edit.html index 1c6f32e4..5a9d9a71 100644 --- a/python/fatcat_web/templates/container_edit.html +++ b/python/fatcat_web/templates/container_edit.html @@ -4,7 +4,7 @@ {% block body %} {% block edit_form_prefix %} -{{ edit_macros.edit_link_bar('container', existing_ident, 'form') }} +{{ edit_macros.edit_link_bar('container', existing_ident, editgroup, 'form') }}

Edit Container Entity

diff --git a/python/fatcat_web/templates/edit_macros.html b/python/fatcat_web/templates/edit_macros.html index a7cf725b..0d20c6db 100644 --- a/python/fatcat_web/templates/edit_macros.html +++ b/python/fatcat_web/templates/edit_macros.html @@ -1,13 +1,13 @@ -{% macro edit_link_bar(entity_type, existing_ident, view) -%} +{% macro edit_link_bar(entity_type, existing_ident, editgroup, view) -%} {% set has_form = entity_type in ['release', 'file', 'container'] %} {% endmacro %} diff --git a/python/fatcat_web/templates/editgroup_view.html b/python/fatcat_web/templates/editgroup_view.html index 0142a46b..cdbde277 100644 --- a/python/fatcat_web/templates/editgroup_view.html +++ b/python/fatcat_web/templates/editgroup_view.html @@ -6,7 +6,10 @@ [view] [diff] {% if auth_to.edit and not editgroup.changelog_index and not editgroup.submitted %} -
[re-edit] + {% if edit.revision or edit.redirect_ident %} + {# show re-edit, unless this is a "deleted" edit #} +
[re-edit] + {% endif %}
diff --git a/python/fatcat_web/templates/entity_delete.html b/python/fatcat_web/templates/entity_delete.html index 80568a3e..48493188 100644 --- a/python/fatcat_web/templates/entity_delete.html +++ b/python/fatcat_web/templates/entity_delete.html @@ -3,7 +3,7 @@ {% block body %} -{{ edit_macros.edit_link_bar(entity_type, existing_ident, 'delete') }} +{{ edit_macros.edit_link_bar(entity_type, existing_ident, editgroup, 'delete') }} {% block edit_form_prefix %}
diff --git a/python/fatcat_web/templates/entity_edit_toml.html b/python/fatcat_web/templates/entity_edit_toml.html index 3980d6e4..cc3e56cf 100644 --- a/python/fatcat_web/templates/entity_edit_toml.html +++ b/python/fatcat_web/templates/entity_edit_toml.html @@ -4,7 +4,7 @@ {% block body %} {% block edit_form_prefix %} - {{ edit_macros.edit_link_bar(entity_type, existing_ident, 'toml') }} + {{ edit_macros.edit_link_bar(entity_type, existing_ident, editgroup, 'toml') }}

Edit Entity

diff --git a/python/fatcat_web/templates/file_edit.html b/python/fatcat_web/templates/file_edit.html index eeb25a9d..50f4ae3f 100644 --- a/python/fatcat_web/templates/file_edit.html +++ b/python/fatcat_web/templates/file_edit.html @@ -4,7 +4,7 @@ {% block body %} {% block edit_form_prefix %} -{{ edit_macros.edit_link_bar('file', existing_ident, 'form') }} +{{ edit_macros.edit_link_bar('file', existing_ident, editgroup, 'form') }}

Edit File Entity

diff --git a/python/fatcat_web/templates/release_edit.html b/python/fatcat_web/templates/release_edit.html index 3f5c10f6..c708da27 100644 --- a/python/fatcat_web/templates/release_edit.html +++ b/python/fatcat_web/templates/release_edit.html @@ -4,7 +4,7 @@ {% block body %} {% block edit_form_prefix %} -{{ edit_macros.edit_link_bar('release', existing_ident, 'form') }} +{{ edit_macros.edit_link_bar('release', existing_ident, editgroup, 'form') }}

Edit Release Entity

-- cgit v1.2.3