From 4a08a4ef405e451db0a8251c05a193874b64cddb Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 1 Apr 2019 22:09:48 -0700 Subject: basic release editing --- python/fatcat_web/templates/edit_macros.html | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 python/fatcat_web/templates/edit_macros.html (limited to 'python/fatcat_web/templates/edit_macros.html') diff --git a/python/fatcat_web/templates/edit_macros.html b/python/fatcat_web/templates/edit_macros.html new file mode 100644 index 00000000..ad563066 --- /dev/null +++ b/python/fatcat_web/templates/edit_macros.html @@ -0,0 +1,36 @@ + +{% macro form_field_errors(field) -%} + {% if field.errors %} +
+ {% for err in field.errors %} + {{ err }} + {% endfor %} +
+ {% endif %} +{%- endmacro %} + +{% macro form_field_basic(field, div_classes="") -%} +
+ {{ field.label }} + {{ field() }} + {{ form_field_errors(field) }} +
+{%- endmacro %} + +{% macro form_field_inline(field, div_classes="") -%} +
+
+
+ {{ field.label }} +
+
+
+
+ {{ field() }} + {{ form_field_errors(field) }} +
+
+
+
+
+{%- endmacro %} -- cgit v1.2.3 From e192f20bb7f950bbbd4ea88724340eb1f5b66357 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 2 Apr 2019 18:34:22 -0700 Subject: editgroup_dropdown() macro refactor --- python/fatcat_web/templates/container_edit.html | 19 ++----------------- python/fatcat_web/templates/edit_macros.html | 20 ++++++++++++++++++++ python/fatcat_web/templates/release_edit.html | 18 +----------------- 3 files changed, 23 insertions(+), 34 deletions(-) (limited to 'python/fatcat_web/templates/edit_macros.html') diff --git a/python/fatcat_web/templates/container_edit.html b/python/fatcat_web/templates/container_edit.html index 4dbcfbd5..2a3f6f5f 100644 --- a/python/fatcat_web/templates/container_edit.html +++ b/python/fatcat_web/templates/container_edit.html @@ -10,23 +10,8 @@ {% endblock %} {{ form.hidden_tag() }} -
-
-

Editgroup Meta

-
-
- {% if editgroup_id %} -

You have an editgroup in progress, and this edit will be included by - default. You can override this below. - {% else %} -

No existing editgroup is in progress (or at least, not is selected). - An existing ID can be pasted in, or if you leave that blank but give a - description, a new editgroup will be created for this edit. - {% endif %} - {{ edit_macros.form_field_inline(form.editgroup_id) }} - {{ edit_macros.form_field_inline(form.editgroup_description) }} -

-
+
+ {{ edit_macros.editgroup_dropdown(form) }}

The Basics


diff --git a/python/fatcat_web/templates/edit_macros.html b/python/fatcat_web/templates/edit_macros.html index ad563066..9bd14596 100644 --- a/python/fatcat_web/templates/edit_macros.html +++ b/python/fatcat_web/templates/edit_macros.html @@ -34,3 +34,23 @@ {%- endmacro %} + +{% macro editgroup_dropdown(form) -%} +
+
+

Editgroup Meta

+
+
+ {% if editgroup_id %} +

You have an editgroup in progress, and this edit will be included by + default. You can override this below. + {% else %} +

No existing editgroup is in progress (or at least, not is selected). + An existing ID can be pasted in, or if you leave that blank but give a + description, a new editgroup will be created for this edit. + {% endif %} + {{ form_field_inline(form.editgroup_id) }} + {{ form_field_inline(form.editgroup_description) }} +

+
+{%- endmacro %} diff --git a/python/fatcat_web/templates/release_edit.html b/python/fatcat_web/templates/release_edit.html index 518a499d..16c189ab 100644 --- a/python/fatcat_web/templates/release_edit.html +++ b/python/fatcat_web/templates/release_edit.html @@ -11,23 +11,7 @@ {{ form.hidden_tag() }}
-
-
-

Editgroup Meta

-
-
- {% if editgroup_id %} -

You have an editgroup in progress, and this edit will be included by - default. You can override this below. - {% else %} -

No existing editgroup is in progress (or at least, not is selected). - An existing ID can be pasted in, or if you leave that blank but give a - description, a new editgroup will be created for this edit. - {% endif %} - {{ edit_macros.form_field_inline(form.editgroup_id) }} - {{ edit_macros.form_field_inline(form.editgroup_description) }} -

-
+ {{ edit_macros.editgroup_dropdown(form) }}

The Basics

-- cgit v1.2.3