better form layout orders page

This commit is contained in:
Feliciaan De Palmenaer 2015-03-31 00:55:50 +02:00
parent 8c992beed7
commit 00613a7db8

View file

@ -13,46 +13,50 @@
{% endfor %} {% endfor %}
</div> </div>
{% if not current_user.is_anonymous() %} {% if not current_user.is_anonymous() %}
<div class="col-md-push-1 col-md-6 darker"> <div class="col-md-push-1 col-md-6">
<h3>Create new order:</h3> <h3>Create new order:</h3>
<form method="post" action="{{ url_for('.order_create') }}"> <div class="row darker">
{{ form.csrf_token }} <div class="col-sm-12">
<div class="form-group select2 {{ 'has-errors' if form.courrier_id.errors else ''}}"> <form method="post" action="{{ url_for('.order_create') }}">
{{ form.courrier_id.label(class='control-label') }}<br> {{ form.csrf_token }}
{{ form.courrier_id(class='form-control select') }} <div class="form-group select2 {{ 'has-errors' if form.courrier_id.errors else ''}}">
{{ util.render_form_field_errors(form.courrier_id) }} {{ form.courrier_id.label(class='control-label') }}<br>
</div> {{ form.courrier_id(class='form-control select') }}
<div class="form-group select2 {{ 'has-errors' if form.location_id.errors else ''}}{{ ' required' if form.location_id.flags.required }}"> {{ util.render_form_field_errors(form.courrier_id) }}
{{ form.location_id.label(class='control-label') }} </div>
{{ form.location_id(class='form-control select') }} <div class="form-group select2 {{ 'has-errors' if form.location_id.errors else ''}}{{ ' required' if form.location_id.flags.required }}">
{{ util.render_form_field_errors(form.location_id) }} {{ form.location_id.label(class='control-label') }}
</div> {{ form.location_id(class='form-control select') }}
{% if current_user.is_admin() %} {{ util.render_form_field_errors(form.location_id) }}
<div class="form-group{{ ' has-error' if form.starttime.errors }}{{ ' required' if form.starttime.flags.required }}{{ ' hidden' if not current_user.is_admin() }}"> </div>
{{ form.starttime.label(class='control-label') }} {% if current_user.is_admin() %}
<div class="form-group{{ ' has-error' if form.starttime.errors }}{{ ' required' if form.starttime.flags.required }}{{ ' hidden' if not current_user.is_admin() }}">
{{ form.starttime.label(class='control-label') }}
<div class='input-group date' class='datetimepicker'>
{{ form.starttime(class='form-control datetimepicker') }}
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
{{ util.render_form_field_errors(form.starttime) }}
</div>
{% endif %}
<div class="form-group{{ ' has-error' if form.stoptime.errors }}{{ ' required' if form.stoptime.flags.required }}{{ ' hidden' if not current_user.is_admin() }}">
{{ form.stoptime.label(class='control-label') }}
<div class='input-group date' class='datetimepicker'> <div class='input-group date' class='datetimepicker'>
{{ form.starttime(class='form-control datetimepicker') }} {{ form.stoptime(class='form-control datetimepicker') }}
<span class="input-group-addon"> <span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span> <span class="glyphicon glyphicon-calendar"></span>
</span> </span>
</div> </div>
{{ util.render_form_field_errors(form.starttime) }} {{ util.render_form_field_errors(form.stoptime) }}
</div> </div>
{% endif %} <div class="form-group">
<div class="form-group{{ ' has-error' if form.stoptime.errors }}{{ ' required' if form.stoptime.flags.required }}{{ ' hidden' if not current_user.is_admin() }}"> {{ form.submit_button(class='btn btn-primary') }}
{{ form.stoptime.label(class='control-label') }}
<div class='input-group date' class='datetimepicker'>
{{ form.stoptime(class='form-control datetimepicker') }}
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div> </div>
{{ util.render_form_field_errors(form.stoptime) }} </form>
</div> </div>
<div class="form-group"> </div>
{{ form.submit_button(class='btn btn-primary') }}
</div>
</form>
</div> </div>
{% endif %} {% endif %}
</div> </div>