{% macro input(field, multiple=False, class=None) -%}
{% if field.type != "SubmitField" %} {{ field.label }} {% endif %}
{% if multiple == True %} {{ field(multiple=True, class=class) }} {% else %} {{ field(class=class) | safe }} {% endif %} {% if field.description %} {{ field.description }} {% endif %}
{% endmacro %} {% macro submit(field, cancel=False, home=False) -%}
{% if home %} {{ _("Can't remember the password?") }} {% endif %} {% if cancel %} {% endif %}
{% endmacro %} {% macro authenticate(form, home=False) %} {% include "display_errors.html" %} {{ form.hidden_tag() }} {{ input(form.id) }} {{ input(form.password) }} {% if not home %} {{ submit(form.submit, home=True) }} {% endif %} {% endmacro %} {% macro create_project(form, home=False) %} {% include "display_errors.html" %} {{ form.hidden_tag() }} {% if not home %} {{ input(form.id) }} {% endif %} {{ input(form.name) }} {{ input(form.password) }} {{ input(form.contact_email) }} {% if not home %} {{ submit(form.submit, home=True) }} {% endif %} {% endmacro %} {% macro edit_project(form) %} {% include "display_errors.html" %} {{ form.hidden_tag() }} {{ input(form.name) }} {{ input(form.password) }} {{ input(form.contact_email) }}
{{ _("delete") }}
{% endmacro %} {% macro add_bill(form, edit=False, title=True) %}
{% if title %}{% if edit %}{{ _("Edit this bill") }} {% else %}{{ _("Add a bill") }} {% endif %}{% endif %} {% include "display_errors.html" %} {{ form.hidden_tag() }} {{ input(form.date, class="datepicker") }} {{ input(form.what) }} {{ input(form.payer) }} {{ input(form.amount) }} {{ input(form.payed_for) }}
{{ form.submit(class="btn primary") }} {% if not edit %} {{ form.submit2(class="btn") }}{% endif %}
{% endmacro %} {% macro add_member(form) %} {{ form.hidden_tag() }} {{ form.name(class="menu-input") }} {% endmacro %} {% macro invites(form) %} {{ form.hidden_tag() }} {{ input(form.emails) }}
{{ _("No, thanks") }}
{% endmacro %} {% macro create_archive(form) %}
{{ _("Create an archive") }} {{ form.hidden_tag() }} {{ input(form.start_date) }} {{ input(form.end_date) }}
{% endmacro %} {% macro remind_password(form) %} {% include "display_errors.html" %} {{ form.hidden_tag() }} {{ input(form.id) }} {{ submit(form.submit) }} {% endmacro %}