2011-07-31 15:39:32 +02:00
|
|
|
{% macro input(field, multiple=False) -%}
|
2011-08-21 01:42:10 +02:00
|
|
|
<div class="clearfix">
|
|
|
|
|
2011-08-05 16:10:21 +02:00
|
|
|
{% if field.type != "SubmitField" %}
|
|
|
|
{{ field.label }}
|
|
|
|
{% endif %}
|
2011-08-21 01:42:10 +02:00
|
|
|
<div class="input">
|
|
|
|
{% if multiple == True %}
|
|
|
|
{{ field(multiple=True) }}
|
|
|
|
{% else %}
|
|
|
|
{{ field }}
|
|
|
|
{% endif %}
|
|
|
|
{% if field.description %}
|
|
|
|
<span class="help-inline">{{ field.description }}</span>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div> <!-- /clearfix -->
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
{% macro submit(field, cancel=False) -%}
|
|
|
|
<div class="actions">
|
|
|
|
<button type="submit" class="btn primary">{{ field.name }}</button>
|
|
|
|
{% if cancel %}
|
|
|
|
<button id="cancel-form" type="reset" class="btn">Cancel</button>
|
2011-07-31 15:39:32 +02:00
|
|
|
{% endif %}
|
2011-08-21 01:42:10 +02:00
|
|
|
</div>
|
2011-07-31 15:39:32 +02:00
|
|
|
{% endmacro %}
|
2011-07-31 23:55:02 +02:00
|
|
|
|
2011-08-21 20:54:20 +02:00
|
|
|
{% macro authenticate(form, home=False) %}
|
2011-07-31 23:55:02 +02:00
|
|
|
|
|
|
|
{% include "display_errors.html" %}
|
|
|
|
{{ form.hidden_tag() }}
|
|
|
|
{{ input(form.id) }}
|
|
|
|
{{ input(form.password) }}
|
2011-08-21 20:54:20 +02:00
|
|
|
{% if not home %}
|
2011-08-21 01:42:10 +02:00
|
|
|
{{ submit(form.submit) }}
|
2011-08-21 20:54:20 +02:00
|
|
|
{% endif %}
|
2011-07-31 23:55:02 +02:00
|
|
|
|
|
|
|
{% endmacro %}
|
|
|
|
|
2011-08-21 20:54:20 +02:00
|
|
|
{% macro create_project(form, home=False) %}
|
2011-07-31 23:55:02 +02:00
|
|
|
|
|
|
|
{% include "display_errors.html" %}
|
|
|
|
{{ form.hidden_tag() }}
|
|
|
|
{{ input(form.name) }}
|
|
|
|
{{ input(form.id) }}
|
|
|
|
{{ input(form.password) }}
|
|
|
|
{{ input(form.contact_email) }}
|
2011-08-21 20:54:20 +02:00
|
|
|
{% if not home %}
|
2011-08-21 01:42:10 +02:00
|
|
|
{{ submit(form.submit) }}
|
2011-08-21 20:54:20 +02:00
|
|
|
{% endif %}
|
2011-07-31 23:55:02 +02:00
|
|
|
|
|
|
|
{% endmacro %}
|
|
|
|
|
2011-09-14 22:03:18 +02:00
|
|
|
{% macro edit_project(form) %}
|
|
|
|
|
|
|
|
{% include "display_errors.html" %}
|
|
|
|
{{ form.hidden_tag() }}
|
|
|
|
{{ input(form.name) }}
|
|
|
|
{{ input(form.password) }}
|
|
|
|
{{ input(form.contact_email) }}
|
|
|
|
{{ submit(form.submit) }}
|
|
|
|
|
|
|
|
{% endmacro %}
|
|
|
|
|
2011-09-09 19:14:19 +02:00
|
|
|
{% macro add_bill(form, edit=False) %}
|
2011-07-31 23:55:02 +02:00
|
|
|
|
2011-08-21 01:42:10 +02:00
|
|
|
<fieldset>
|
2011-09-09 19:14:19 +02:00
|
|
|
<legend>{% if edit %}Edit this {% else %}Add a {% endif %}bill</legend>
|
2011-07-31 23:55:02 +02:00
|
|
|
{% include "display_errors.html" %}
|
|
|
|
{{ form.hidden_tag() }}
|
2011-08-09 18:28:48 +02:00
|
|
|
{{ input(form.date) }}
|
2011-07-31 23:55:02 +02:00
|
|
|
{{ input(form.what) }}
|
|
|
|
{{ input(form.payer) }}
|
|
|
|
{{ input(form.amount) }}
|
2011-08-10 00:20:16 +02:00
|
|
|
{{ input(form.payed_for) }}
|
2011-08-21 01:42:10 +02:00
|
|
|
</fieldset>
|
|
|
|
{{ submit(form.submit, cancel=True) }}
|
2011-07-31 23:55:02 +02:00
|
|
|
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
{% macro add_member(form) %}
|
|
|
|
{{ form.hidden_tag() }}
|
2011-08-21 01:42:10 +02:00
|
|
|
{{ form.name }}
|
|
|
|
<button class="btn">Add a new user</button>
|
2011-07-31 23:55:02 +02:00
|
|
|
|
|
|
|
{% endmacro %}
|
2011-08-21 21:16:32 +02:00
|
|
|
|
|
|
|
{% macro invites(form) %}
|
|
|
|
{{ form.hidden_tag() }}
|
|
|
|
{{ input(form.emails) }}
|
|
|
|
<div class="actions">
|
|
|
|
<button class="btn">Send the invitations</button>
|
2011-09-09 21:21:37 +02:00
|
|
|
<a href="{{ url_for(".list_bills") }}">No, thanks</a>
|
2011-08-21 21:16:32 +02:00
|
|
|
</div>
|
|
|
|
{% endmacro %}
|
2011-09-09 19:14:19 +02:00
|
|
|
|
|
|
|
{% macro create_archive(form) %}
|
|
|
|
<fieldset>
|
|
|
|
<legend>Create an archive</legend>
|
|
|
|
{{ form.hidden_tag() }}
|
|
|
|
{{ input(form.start_date) }}
|
|
|
|
{{ input(form.end_date) }}
|
|
|
|
</fieldset>
|
|
|
|
<div class="actions">
|
|
|
|
<button class="btn">Create the archive</button>
|
|
|
|
</div>
|
|
|
|
{% endmacro %}
|