aboutsummaryrefslogtreecommitdiff
path: root/app/templates/macros/forms.html
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-05-27 21:31:11 +0100
committerrubenwardy <rw@rubenwardy.com>2018-05-27 21:31:11 +0100
commit63af1535b90358f1a26248cae217f4a74fdc1f84 (patch)
tree55ce4339a5bea144b7b25ecb6b8e97486b94ed6b /app/templates/macros/forms.html
parent82159d488d87d204390dc58fdd30ca2167156b79 (diff)
downloadcheatdb-63af1535b90358f1a26248cae217f4a74fdc1f84.tar.xz
Add dependencies
Diffstat (limited to 'app/templates/macros/forms.html')
-rw-r--r--app/templates/macros/forms.html19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/templates/macros/forms.html b/app/templates/macros/forms.html
index 430c4e8..940c4a2 100644
--- a/app/templates/macros/forms.html
+++ b/app/templates/macros/forms.html
@@ -58,6 +58,25 @@
</div>
{% endmacro %}
+{% macro render_deps_field(field, label=None, label_visible=true, right_url=None, right_label=None) -%}
+ <div class="form-group {% if field.errors %}has-error{% endif %} {{ kwargs.pop('class_', '') }}">
+ {% if field.type != 'HiddenField' and label_visible %}
+ {% if not label %}{% set label=field.label.text %}{% endif %}
+ <label for="{{ field.id }}" class="control-label">{{ label|safe }}</label>
+ {% endif %}
+ <div class="deps_selector bulletselector">
+ <input type="text" placeholder="Start typing to see suggestions">
+ <div class="clearboth"></div>
+ </div>
+ {{ field(class_='form-control', **kwargs) }}
+ {% if field.errors %}
+ {% for e in field.errors %}
+ <p class="help-block">{{ e }}</p>
+ {% endfor %}
+ {% endif %}
+ </div>
+{% endmacro %}
+
{% macro render_checkbox_field(field, label=None) -%}
{% if not label %}{% set label=field.label.text %}{% endif %}
<div class="checkbox">