summaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/templates/edit_macros.html
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-04-04 11:21:41 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-04-04 11:21:41 -0700
commitc4591cd12298cc03cd96af829a9a007d83d4e537 (patch)
tree1a5e47037bb2294a34841f0a7f7b04da3fccc369 /python/fatcat_web/templates/edit_macros.html
parent005236655dec1cb3f7409724a711a19b52aa9108 (diff)
parentedb9c1b85f367a50957dc0423c3104b900c7e92c (diff)
downloadfatcat-c4591cd12298cc03cd96af829a9a007d83d4e537.tar.gz
fatcat-c4591cd12298cc03cd96af829a9a007d83d4e537.zip
Merge branch 'bnewbold-forms'
Diffstat (limited to 'python/fatcat_web/templates/edit_macros.html')
-rw-r--r--python/fatcat_web/templates/edit_macros.html56
1 files changed, 56 insertions, 0 deletions
diff --git a/python/fatcat_web/templates/edit_macros.html b/python/fatcat_web/templates/edit_macros.html
new file mode 100644
index 00000000..9bd14596
--- /dev/null
+++ b/python/fatcat_web/templates/edit_macros.html
@@ -0,0 +1,56 @@
+
+{% macro form_field_errors(field) -%}
+ {% if field.errors %}
+ <div class="ui pointing red label">
+ {% for err in field.errors %}
+ {{ err }}
+ {% endfor %}
+ </div>
+ {% endif %}
+{%- endmacro %}
+
+{% macro form_field_basic(field, div_classes="") -%}
+<div class="field {{ div_classes }} {% if field.errors %}error{% endif %}">
+ {{ field.label }}
+ {{ field() }}
+ {{ form_field_errors(field) }}
+</div>
+{%- endmacro %}
+
+{% macro form_field_inline(field, div_classes="") -%}
+<div class="ui grid">
+ <div class="three wide column middle aligned right aligned" {# style="padding-right: 0.5rem;" #}>
+ <div class="field inline {{ div_classes }} {% if field.errors %}error{% endif %}">
+ {{ field.label }}
+ </div>
+ </div>
+ <div class="twelve wide column" {# style="padding-left: 0.5rem;" #}>
+ <div class="field {{ div_classes }} {% if field.errors %}error{% endif %}">
+ {{ field() }}
+ {{ form_field_errors(field) }}
+ </div>
+ </div>
+ <div class="one wide column">
+ </div>
+</div>
+{%- endmacro %}
+
+{% macro editgroup_dropdown(form) -%}
+ <div class="ui accordion">
+ <div class="{% if not editgroup_id %}active{% endif %} title">
+ <h3><i class="dropdown icon"></i>Editgroup Meta</h3>
+ </div>
+ <div class="{% if not editgroup_id %}active{% endif %} content">
+ {% if editgroup_id %}
+ <p>You have an editgroup in progress, and this edit will be included by
+ default. You can override this below.
+ {% else %}
+ <p>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) }}
+ </div>
+ </div>
+{%- endmacro %}