diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/fatcat_web/templates/container_edit.html | 2 | ||||
-rw-r--r-- | python/fatcat_web/templates/edit_macros.html | 10 | ||||
-rw-r--r-- | python/fatcat_web/templates/editgroup_view.html | 5 | ||||
-rw-r--r-- | python/fatcat_web/templates/entity_delete.html | 2 | ||||
-rw-r--r-- | python/fatcat_web/templates/entity_edit_toml.html | 2 | ||||
-rw-r--r-- | python/fatcat_web/templates/file_edit.html | 2 | ||||
-rw-r--r-- | python/fatcat_web/templates/release_edit.html | 2 |
7 files changed, 14 insertions, 11 deletions
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') }} <div class="ui segment"> <h1 class="ui header">Edit Container Entity</h1> 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'] %} <div class="ui {% if has_form %}four{% else %}three{% endif %} item menu"> - <a class="item" href="/{{ entity_type }}/{{ existing_ident }}">View</a> + <a class="item" href="{% if editgroup %}/editgroup/{{ editgroup.editgroup_id }}{% endif %}/{{ entity_type }}/{{ existing_ident }}">View</a> {% if has_form %} - <a class="item {% if view == 'form' %}active{% endif %}" href="/{{ entity_type }}/{{ existing_ident }}/edit">Edit Form</a> + <a class="item {% if view == 'form' %}active{% endif %}" href="{% if editgroup %}/editgroup/{{ editgroup.editgroup_id }}{% endif %}/{{ entity_type }}/{{ existing_ident }}/edit">Edit Form</a> {% endif %} - <a class="item {% if view == 'toml' %}active{% endif %}" href="/{{ entity_type }}/{{ existing_ident }}/edit/toml">Edit TOML</a> - <a class="red item {% if view == 'delete' %}active{% endif %}" href="/{{ entity_type }}/{{ existing_ident }}/delete">Delete</a> + <a class="item {% if view == 'toml' %}active{% endif %}" href="{% if editgroup %}/editgroup/{{ editgroup.editgroup_id }}{% endif %}/{{ entity_type }}/{{ existing_ident }}/edit/toml">Edit TOML</a> + <a class="red item {% if view == 'delete' %}active{% endif %}" href="{% if editgroup %}/editgroup/{{ editgroup.editgroup_id }}{% endif %}/{{ entity_type }}/{{ existing_ident }}/delete">Delete</a> </div> {% 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 @@ <a href="/editgroup/{{ editgroup.editgroup_id }}/{{ entity_type }}/{{ edit.ident }}">[view]</a> <a href="/editgroup/{{ editgroup.editgroup_id }}/diff#{{ entity_type }}_{{ edit.ident }}">[diff]</a> {% if auth_to.edit and not editgroup.changelog_index and not editgroup.submitted %} - <br><a href="/editgroup/{{ editgroup.editgroup_id }}/{{ entity_type }}/{{ edit.ident }}/edit" style="color: green;">[re-edit]</a> + {% if edit.revision or edit.redirect_ident %} + {# show re-edit, unless this is a "deleted" edit #} + <br><a href="/editgroup/{{ editgroup.editgroup_id }}/{{ entity_type }}/{{ edit.ident }}/edit" style="color: green;">[re-edit]</a> + {% endif %} <br> <form id="submit_edit_delete" method="POST" action="/editgroup/{{ editgroup.editgroup_id }}/{{ entity_type }}/edit/{{ edit.edit_id }}/delete" style="display:inline;"> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/> 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 %} <div class="ui segment"> 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') }} <div class="ui segment"> <h1 class="ui header">Edit Entity</h1> 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') }} <div class="ui segment"> <h1 class="ui header">Edit File Entity</h1> 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') }} <div class="ui segment"> <h1 class="ui header">Edit Release Entity</h1> |