1
0
mirror of https://github.com/moepman/bk-dss synced 2024-12-22 06:54:26 +01:00

Improve forms.

This commit is contained in:
Markus 2016-03-21 21:43:25 +01:00
parent 1c93fb0846
commit 6dc0f4c98f
4 changed files with 7 additions and 7 deletions

View File

@ -1,3 +1,3 @@
{% macro render_field(field) %}
<div class="form-group {% if field.errors %}has-error{% endif %}">{{ field.label(class_="control-label") }}{{ field(class_="form-control") }}{% for error in field.errors %}[ {{ error }} ]{% endfor %}</div>
<div class="form-group {% if field.errors %}has-error{% endif %}">{{ field.label(class_="control-label col-sm-2") }}<div class="col-sm-4">{{ field(class_="form-control") }}</div>{% for error in field.errors %}[ {{ error }} ]{% endfor %}</div>
{%- endmacro %}

View File

@ -4,7 +4,7 @@
<div class="page-header">
<h1>Create user</h1>
</div>
<form method="POST">
<form class="form-horizontal" method="POST">
{{ form.hidden_tag() }}
{{ render_field(form.user) }}
{{ render_field(form.uid) }}
@ -12,6 +12,6 @@
{{ render_field(form.gn) }}
{{ render_field(form.pwd1) }}
{{ render_field(form.pwd2) }}
<div class="form-group">{{ form.submit(class_="btn btn-primary") }}</div>
<div class="form-group"><div class="col-sm-offset-2 col-sm-10">{{ form.submit(class_="btn btn-primary") }}</div></div>
</form>
{% endblock %}

View File

@ -4,11 +4,11 @@
<div class="page-header">
<h1>Edit</h1>
</div>
<form method="POST">
<form class="form-horizontal" method="POST">
{{ form.hidden_tag() }}
{{ render_field(form.user) }}
{{ render_field(form.pwd1) }}
{{ render_field(form.pwd2) }}
<div class="form-group">{{ form.submit(class_="btn btn-primary") }}</div>
<div class="form-group"><div class="col-sm-offset-2 col-sm-10">{{ form.submit(class_="btn btn-primary") }}</div></div>
</form>
{% endblock %}

View File

@ -1,10 +1,10 @@
{% from "_helpers.html" import render_field %}
{% extends "_base.html" %}
{% block content %}
<form class="form-login" method="POST">
<form class="form-horizontal" method="POST">
{{ form.hidden_tag() }}
{{ render_field(form.user) }}
{{ render_field(form.pswd) }}
<div class="form-group">{{ form.submit(class_="btn btn-primary") }}</div>
<div class="form-group"><div class="col-sm-offset-2 col-sm-10">{{ form.submit(class_="btn btn-primary") }}</div></div>
</form>
{% endblock %}