1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ihatemoney_ynh.git synced 2024-09-03 19:26:15 +02:00
ihatemoney_ynh/budget/templates/forms.html

127 lines
3.5 KiB
HTML
Raw Normal View History

{% macro input(field, multiple=False, class=None) -%}
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, class=class) }}
2011-08-21 01:42:10 +02:00
{% else %}
{{ field(class=class) | safe }}
2011-08-21 01:42:10 +02:00
{% endif %}
{% if field.description %}
<span class="help-inline">{{ field.description }}</span>
{% endif %}
</div>
</div> <!-- /clearfix -->
{% endmacro %}
{% macro submit(field, cancel=False, home=False) -%}
2011-08-21 01:42:10 +02:00
<div class="actions">
<button type="submit" class="btn primary">{{ field.name }}</button>
{% if home %}
<a href="{{ url_for(".remind_password") }}">{{ _("Can't remember the password?") }}</a>
{% endif %}
2011-08-21 01:42:10 +02:00
{% if cancel %}
<button id="cancel-form" type="reset" class="btn">{{ _("Cancel") }}</button>
{% endif %}
2011-08-21 01:42:10 +02:00
</div>
{% endmacro %}
2011-07-31 23:55:02 +02:00
{% macro authenticate(form, home=False) %}
2011-07-31 23:55:02 +02:00
{% include "display_errors.html" %}
2011-07-31 23:55:02 +02:00
{{ form.hidden_tag() }}
{{ input(form.id) }}
{{ input(form.password) }}
{% if not home %}
{{ submit(form.submit, home=True) }}
{% endif %}
2011-07-31 23:55:02 +02:00
{% endmacro %}
{% macro create_project(form, home=False) %}
2011-07-31 23:55:02 +02:00
{% include "display_errors.html" %}
{{ form.hidden_tag() }}
{% if not home %}
2011-07-31 23:55:02 +02:00
{{ input(form.id) }}
{% endif %}
{{ input(form.name) }}
2011-07-31 23:55:02 +02:00
{{ input(form.password) }}
{{ input(form.contact_email) }}
{% if not home %}
{{ submit(form.submit, home=True) }}
{% endif %}
2011-07-31 23:55:02 +02:00
{% endmacro %}
{% 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">
<button class="btn primary">{{ _("Edit the project") }}</button>
<a id="delete-project" style="color:red; margin-left:10px; cursor:pointer; ">{{ _("delete") }}</a>
</div>
{% 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>
<legend>{% if edit %}{{ _("Edit this bill") }} {% else %}{{ _("Add a bill") }} {% endif %}</legend>
2011-07-31 23:55:02 +02:00
{% include "display_errors.html" %}
{{ form.hidden_tag() }}
{{ input(form.date, class="datepicker") }}
2011-07-31 23:55:02 +02:00
{{ input(form.what) }}
{{ input(form.payer) }}
{{ input(form.amount) }}
{{ 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() }}
{{ form.name(class="menu-input") }}
<button class="btn">{{ _("Add") }}</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 primary">{{ _("Send the invitations") }}</button>
<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>
2011-09-09 19:14:19 +02:00
{{ form.hidden_tag() }}
{{ input(form.start_date) }}
{{ input(form.end_date) }}
</fieldset>
<div class="actions">
<button class="btn">{{ _("Create the archive") }}</button>
2011-09-09 19:14:19 +02:00
</div>
{% endmacro %}
{% macro remind_password(form) %}
{% include "display_errors.html" %}
{{ form.hidden_tag() }}
{{ input(form.id) }}
{{ submit(form.submit) }}
{% endmacro %}