aboutsummaryrefslogtreecommitdiff
path: root/app/templates/macros/forms.html
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-12-22 11:23:58 +0000
committerrubenwardy <rw@rubenwardy.com>2018-12-22 12:00:20 +0000
commit692628653c2dfbe3d3c12ccb233d70e77d95a5e8 (patch)
tree63a90de039bd9a2772810ff70c641b05d23e6a01 /app/templates/macros/forms.html
parent35f798c8626d722c9e06d5720776057891f2535b (diff)
downloadcheatdb-692628653c2dfbe3d3c12ccb233d70e77d95a5e8.tar.xz
Improve package creation form
Diffstat (limited to 'app/templates/macros/forms.html')
-rw-r--r--app/templates/macros/forms.html24
1 files changed, 13 insertions, 11 deletions
diff --git a/app/templates/macros/forms.html b/app/templates/macros/forms.html
index 66f305b..e53beec 100644
--- a/app/templates/macros/forms.html
+++ b/app/templates/macros/forms.html
@@ -2,7 +2,7 @@
<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>
+ <label for="{{ field.id }}">{{ label|safe }}</label>
{% endif %}
{{ field(class_='form-control', **kwargs) }}
{% if field.errors %}
@@ -13,9 +13,8 @@
</div>
{%- endmacro %}
-{% macro form_includes() -%}
+{% macro form_scripts() -%}
<link href="/static/jquery-ui.min.css" rel="stylesheet" type="text/css">
- <script src="/static/jquery.min.js"></script>
<script src="/static/jquery-ui.min.js"></script>
<script src="/static/tagselector.js"></script>
{% endmacro %}
@@ -58,16 +57,17 @@
<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>
+ <label for="{{ field.id }}">{{ label|safe }}</label>
{% endif %}
- <div class="multichoice_selector bulletselector">
+ <div class="multichoice_selector bulletselector form-control">
<input type="text" placeholder="Start typing to see suggestions">
<div class="clearboth"></div>
</div>
+ <div class="invalid-remaining invalid-feedback"></div>
{{ field(class_='form-control', **kwargs) }}
{% if field.errors %}
{% for e in field.errors %}
- <p class="help-block">{{ e }}</p>
+ <div class="invalid-feedback">{{ e }}</div>
{% endfor %}
{% endif %}
</div>
@@ -77,13 +77,14 @@
<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>
+ <label for="{{ field.id }}">{{ label|safe }}</label>
{% endif %}
- <div class="metapackage_selector bulletselector">
+ <div class="metapackage_selector bulletselector form-control">
<input type="text" placeholder="Comma-seperated values">
<div class="clearboth"></div>
</div>
{{ field(class_='form-control', **kwargs) }}
+ <div class="invalid-remaining invalid-feedback"></div>
{% if field.errors %}
{% for e in field.errors %}
<p class="help-block">{{ e }}</p>
@@ -96,13 +97,14 @@
<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>
+ <label for="{{ field.id }}">{{ label|safe }}</label>
{% endif %}
- <div class="deps_selector bulletselector">
+ <div class="deps_selector bulletselector form-control">
<input type="text" placeholder="Comma-seperated values">
<div class="clearboth"></div>
</div>
{{ field(class_='form-control', **kwargs) }}
+ <div class="invalid-remaining invalid-feedback"></div>
{% if field.errors %}
{% for e in field.errors %}
<p class="help-block">{{ e }}</p>
@@ -134,7 +136,7 @@
{% macro render_submit_field(field, label=None, tabindex=None) -%}
{% if not label %}{% set label=field.label.text %}{% endif %}
{#<button type="submit" class="form-control btn btn-default btn-primary">{{label}}</button>#}
- <input type="submit" value="{{label}}"
+ <input type="submit" value="{{label}}" class="btn btn-primary"
{% if tabindex %}tabindex="{{ tabindex }}"{% endif %}
>
{%- endmacro %}