2011-10-16 23:38:27 +02:00
|
|
|
{% macro input(field, multiple=False, class=None) -%}
|
2012-04-05 15:40:09 +02:00
|
|
|
<div class="control-group">
|
|
|
|
{% if field.type != "SubmitField" %}
|
|
|
|
{{ field.label(class="control-label") }}
|
|
|
|
{% endif %}
|
|
|
|
<div class="controls">
|
|
|
|
{% if multiple == True %}
|
|
|
|
{{ field(multiple=True, class=class) }}
|
|
|
|
{% else %}
|
|
|
|
{{ field(class=class) | safe }}
|
|
|
|
{% endif %}
|
|
|
|
{% if field.description %}
|
|
|
|
<p class="help-inline">{{ field.description }}</p>
|
2011-08-05 16:10:21 +02:00
|
|
|
{% endif %}
|
2011-08-21 01:42:10 +02:00
|
|
|
</div>
|
2012-04-05 15:40:09 +02:00
|
|
|
</div>
|
2011-08-21 01:42:10 +02:00
|
|
|
{% endmacro %}
|
|
|
|
|
2011-09-11 05:25:42 +02:00
|
|
|
{% macro submit(field, cancel=False, home=False) -%}
|
2011-08-21 01:42:10 +02:00
|
|
|
<div class="actions">
|
2012-04-05 15:40:09 +02:00
|
|
|
<button type="submit" class="btn btn-primary">{{ field.name }}</button>
|
2011-09-11 05:25:42 +02:00
|
|
|
{% if home %}
|
2011-10-15 01:19:19 +02:00
|
|
|
<a href="{{ url_for(".remind_password") }}">{{ _("Can't remember the password?") }}</a>
|
2011-09-11 05:25:42 +02:00
|
|
|
{% endif %}
|
2011-08-21 01:42:10 +02:00
|
|
|
{% if cancel %}
|
2012-04-05 15:40:09 +02:00
|
|
|
<button 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" %}
|
2011-10-08 15:52:12 +02:00
|
|
|
|
2011-07-31 23:55:02 +02:00
|
|
|
{{ form.hidden_tag() }}
|
|
|
|
{{ input(form.id) }}
|
|
|
|
{{ input(form.password) }}
|
2011-08-21 20:54:20 +02:00
|
|
|
{% if not home %}
|
2011-09-14 01:16:25 +02:00
|
|
|
{{ submit(form.submit, home=True) }}
|
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() }}
|
2011-09-11 05:25:42 +02:00
|
|
|
{% if not home %}
|
2011-07-31 23:55:02 +02:00
|
|
|
{{ input(form.id) }}
|
2011-09-11 05:25:42 +02:00
|
|
|
{% endif %}
|
|
|
|
{{ input(form.name) }}
|
2011-07-31 23:55:02 +02:00
|
|
|
{{ input(form.password) }}
|
|
|
|
{{ input(form.contact_email) }}
|
2011-08-21 20:54:20 +02:00
|
|
|
{% if not home %}
|
2011-09-11 05:25:42 +02:00
|
|
|
{{ submit(form.submit, home=True) }}
|
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) }}
|
2011-11-02 12:16:01 +01:00
|
|
|
<div class="actions">
|
2012-04-05 15:40:09 +02:00
|
|
|
<button class="btn btn-primary">{{ _("Edit the project") }}</button>
|
2011-11-02 12:16:01 +01:00
|
|
|
<a id="delete-project" style="color:red; margin-left:10px; cursor:pointer; ">{{ _("delete") }}</a>
|
|
|
|
</div>
|
2011-09-14 22:03:18 +02:00
|
|
|
|
|
|
|
{% endmacro %}
|
|
|
|
|
2011-11-28 00:22:10 +01:00
|
|
|
{% macro add_bill(form, edit=False, title=True) %}
|
2011-07-31 23:55:02 +02:00
|
|
|
|
2011-08-21 01:42:10 +02:00
|
|
|
<fieldset>
|
2011-11-28 00:22:10 +01:00
|
|
|
{% if title %}<legend>{% if edit %}{{ _("Edit this bill") }} {% else %}{{ _("Add a bill") }} {% endif %}</legend>{% endif %}
|
2011-07-31 23:55:02 +02:00
|
|
|
{% include "display_errors.html" %}
|
2015-08-20 12:02:04 +02:00
|
|
|
{{ form.hidden_tag() }}
|
|
|
|
{{ input(form.date, class="datepicker") }}
|
|
|
|
{{ input(form.what) }}
|
|
|
|
{{ input(form.payer) }}
|
|
|
|
{{ input(form.amount) }}
|
|
|
|
{{ input(form.payed_for) }}
|
2011-08-21 01:42:10 +02:00
|
|
|
</fieldset>
|
2011-11-28 01:42:02 +01:00
|
|
|
<div class="actions">
|
2012-04-05 15:40:09 +02:00
|
|
|
{{ form.submit(class="btn btn-primary") }}
|
2011-11-28 01:42:02 +01:00
|
|
|
{% if not edit %} {{ form.submit2(class="btn") }}{% endif %}
|
|
|
|
</div>
|
2011-07-31 23:55:02 +02:00
|
|
|
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
{% macro add_member(form) %}
|
2012-04-05 15:40:09 +02:00
|
|
|
{{ form.hidden_tag() }}
|
|
|
|
{{ form.name(placeholder=_("Type user name here")) }}<button class="btn">{{ _("Add") }}</button>
|
2011-07-31 23:55:02 +02:00
|
|
|
{% endmacro %}
|
2011-08-21 21:16:32 +02:00
|
|
|
|
2015-08-22 01:19:27 +02:00
|
|
|
{% macro edit_member(form, title=True) %}
|
|
|
|
<fieldset>
|
|
|
|
{% if title %}<legend>{{ _("Edit this member") }}</legend>{% endif %}
|
|
|
|
{% include "display_errors.html" %}
|
|
|
|
{{ form.hidden_tag() }}
|
|
|
|
{{ input(form.name) }}
|
|
|
|
{{ input(form.weight) }}
|
|
|
|
</fieldset>
|
|
|
|
<div class="actions">
|
|
|
|
{{ form.submit(class="btn btn-primary") }}
|
|
|
|
</div>
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
|
2011-08-21 21:16:32 +02:00
|
|
|
{% macro invites(form) %}
|
|
|
|
{{ form.hidden_tag() }}
|
|
|
|
{{ input(form.emails) }}
|
|
|
|
<div class="actions">
|
2012-04-05 15:40:09 +02:00
|
|
|
<button class="btn btn-primary">{{ _("Send the invitations") }}</button>
|
2011-10-15 01:19:19 +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>
|
2011-10-15 01:19:19 +02:00
|
|
|
<legend>{{ _("Create an archive") }}</legend>
|
2011-09-09 19:14:19 +02:00
|
|
|
{{ form.hidden_tag() }}
|
2012-11-26 21:52:25 +01:00
|
|
|
{{ input(form.name) }}
|
2011-09-09 19:14:19 +02:00
|
|
|
{{ input(form.start_date) }}
|
|
|
|
{{ input(form.end_date) }}
|
|
|
|
</fieldset>
|
|
|
|
<div class="actions">
|
2011-10-15 01:19:19 +02:00
|
|
|
<button class="btn">{{ _("Create the archive") }}</button>
|
2011-09-09 19:14:19 +02:00
|
|
|
</div>
|
|
|
|
{% endmacro %}
|
2011-10-08 15:52:12 +02:00
|
|
|
|
|
|
|
{% macro remind_password(form) %}
|
|
|
|
|
|
|
|
{% include "display_errors.html" %}
|
|
|
|
{{ form.hidden_tag() }}
|
|
|
|
{{ input(form.id) }}
|
|
|
|
{{ submit(form.submit) }}
|
|
|
|
|
|
|
|
{% endmacro %}
|