From 61e8e3f308c908b526270648a74823cbcb361308 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 26 Feb 2021 13:58:18 -0800 Subject: web: improve edit form navigation --- python/fatcat_web/templates/container_edit.html | 9 ++------- python/fatcat_web/templates/edit_macros.html | 15 ++++++++++++++- python/fatcat_web/templates/entity_delete.html | 3 +++ python/fatcat_web/templates/entity_edit_toml.html | 7 +++---- python/fatcat_web/templates/file_edit.html | 9 ++------- python/fatcat_web/templates/release_edit.html | 2 ++ 6 files changed, 26 insertions(+), 19 deletions(-) diff --git a/python/fatcat_web/templates/container_edit.html b/python/fatcat_web/templates/container_edit.html index 99f77d53..1885197c 100644 --- a/python/fatcat_web/templates/container_edit.html +++ b/python/fatcat_web/templates/container_edit.html @@ -2,19 +2,14 @@ {% extends "base.html" %} {% block body %} + {% block edit_form_prefix %} +{{ edit_macros.edit_link_bar('container', existing_ident, 'form') }}

Edit Container Entity

-

Experienced users can also use the TOML editing form to access all metadata - fields in a raw format. - {% if not editgroup %} - You can also delete this entity. - {% endif %} {% endblock %}

See the catalog diff --git a/python/fatcat_web/templates/edit_macros.html b/python/fatcat_web/templates/edit_macros.html index d4839373..a7cf725b 100644 --- a/python/fatcat_web/templates/edit_macros.html +++ b/python/fatcat_web/templates/edit_macros.html @@ -1,4 +1,17 @@ +{% macro edit_link_bar(entity_type, existing_ident, view) -%} + {% set has_form = entity_type in ['release', 'file', 'container'] %} +

+{% endmacro %} + + {% macro form_field_errors(field) -%} {% if field.errors %}
@@ -71,7 +84,7 @@