2015-03-27 21:57:37 +01:00
{% extends 'layout.html' %}
{% set active_page = "orders" -%}
2015-03-27 23:24:41 +01:00
{% import "bootstrap/wtf.html" as wtf %}
2015-03-28 23:06:36 +01:00
{% import "utils.html" as util -%}
2015-03-27 21:57:37 +01:00
{% block container %}
< div class = "row" >
2015-03-27 23:24:41 +01:00
< div class = "col-md-5" >
2015-03-27 21:57:37 +01:00
< h3 > Open orders:< / h3 >
2015-03-28 23:06:36 +01:00
{% for order in orders %}
{{ util.render_order(order) }}
{% endfor %}
2015-03-27 21:57:37 +01:00
< / div >
2015-03-28 20:38:15 +01:00
{% if not current_user.is_anonymous() %}
2015-03-31 00:55:50 +02:00
< div class = "col-md-push-1 col-md-6" >
2015-03-28 23:06:36 +01:00
< h3 > Create new order:< / h3 >
2015-03-31 00:55:50 +02:00
< div class = "row darker" >
< div class = "col-sm-12" >
< form method = "post" action = "{{ url_for('.order_create') }}" >
{{ form.csrf_token }}
< div class = "form-group select2 {{ 'has-errors' if form.courrier_id.errors else ''}}" >
{{ form.courrier_id.label(class='control-label') }}< br >
{{ form.courrier_id(class='form-control select') }}
{{ util.render_form_field_errors(form.courrier_id) }}
< / div >
< div class = "form-group select2 {{ 'has-errors' if form.location_id.errors else ''}}{{ ' required' if form.location_id.flags.required }}" >
{{ form.location_id.label(class='control-label') }}
{{ form.location_id(class='form-control select') }}
{{ util.render_form_field_errors(form.location_id) }}
< / div >
{% 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') }}
2015-03-30 00:01:07 +02:00
< div class = 'input-group date' class = 'datetimepicker' >
2015-03-31 00:55:50 +02:00
{{ form.stoptime(class='form-control datetimepicker') }}
2015-03-30 00:01:07 +02:00
< span class = "input-group-addon" >
< span class = "glyphicon glyphicon-calendar" > < / span >
< / span >
< / div >
2015-03-31 00:55:50 +02:00
{{ util.render_form_field_errors(form.stoptime) }}
2015-03-30 00:01:07 +02:00
< / div >
2015-03-31 00:55:50 +02:00
< div class = "form-group" >
{{ form.submit_button(class='btn btn-primary') }}
2015-03-30 00:01:07 +02:00
< / div >
2015-03-31 00:55:50 +02:00
< / form >
< / div >
< / div >
2015-03-27 23:24:41 +01:00
< / div >
2015-03-28 20:38:15 +01:00
{% endif %}
2015-03-27 21:57:37 +01:00
< / div >
< / div >
2015-03-30 00:01:07 +02:00
{% endblock %}
{% block styles -%}
{{ super() }}
< link href = "//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0-rc.2/css/select2.min.css" rel = "stylesheet" / >
< link rel = "stylesheet" href = "{{ url_for('static', filename='css/bootstrap-datetimepicker.min.css') }}" >
2015-03-30 18:37:39 +02:00
< link rel = "stylesheet" href = "{{ url_for('static', filename='css/select2-bootstrap.min.css') }}" >
2015-03-30 00:01:07 +02:00
{%- endblock %}
{% block scripts -%}
{{ super() }}
< script src = "//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0-rc.2/js/select2.min.js" > < / script >
< script src = "{{ url_for('static', filename='js/moment.min.js') }}" > < / script >
< script src = "{{ url_for('static', filename='js/bootstrap-datetimepicker.min.js') }}" > < / script >
< script type = "text/javascript" >
$.ready(function(){
$('.select').select2();
$('.datetimepicker').datetimepicker({
format: 'DD-MM-YYYY HH:mm'
});
}());
< / script >
{%- endblock %}