Add a field macro to the event creation form

This commit is contained in:
2018-07-13 11:22:28 +02:00
parent a133218906
commit d06cfaa02e
7 changed files with 49 additions and 74 deletions

View File

@@ -1,41 +1,24 @@
{% extends 'base.html' %}
{% from '_macros.html' import field %}
{% block content %}
<h2>Create event</h2>
<form method="post">
{{ form.hidden_tag() }}
{{ form.errors }}
{% if form.errors %}
{% for error in form.errors %}
{{ error }}
{% endfor %}
<br>
{% endif %}
{{ form.title.errors }}
{{ form.title.label }}
{{ form.title }}
<br>
{{ form.time_zone.errors }}
{{ form.time_zone.label }}
{{ form.time_zone }}
<br>
{{ form.start_time.errors }}
{{ form.start_time.label }}
{{ form.start_time }}
<br>
{{ form.end_time.errors }}
{{ form.end_time.label }}
{{ form.end_time }}
<br>
{{ form.all_day.errors }}
{{ form.all_day.label }}
{{ form.all_day }}
<br>
{{ form.description.errors }}
{{ form.description.label }}
{{ form.description }}
<br>
{{ field(form.title) }}
{{ field(form.time_zone) }}
{{ field(form.start_time) }}
{{ field(form.end_time) }}
{{ field(form.all_day) }}
{{ field(form.description) }}
<button type="submit">{% trans %}Save{% endtrans %}</button>
<a href="{{ url_for('hello') }}">Cancel</a>