mirror of
https://github.com/YunoHost-Apps/ihatemoney_ynh.git
synced 2024-09-03 19:26:15 +02:00
- Do not display anymore the identifier field in home. - Let the user enter the id if the slug generated from project name already exists as a project id. - Moved get_billform_for from 'utils' to 'forms', to avoid issue (was 'from forms import ...' into utils, and 'from utils import ...' into forms, which causeed an error).
102 lines
2.7 KiB
HTML
102 lines
2.7 KiB
HTML
{% macro input(field, multiple=False) -%}
|
|
<div class="clearfix">
|
|
|
|
{% if field.type != "SubmitField" %}
|
|
{{ field.label }}
|
|
{% endif %}
|
|
<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, home=False) -%}
|
|
<div class="actions">
|
|
{% if home %}
|
|
<a href="{{ url_for(".home") }}" class="btn">Back Home</a>
|
|
{% endif %}
|
|
<button type="submit" class="btn primary">{{ field.name }}</button>
|
|
{% if cancel %}
|
|
<button id="cancel-form" type="reset" class="btn">Cancel</button>
|
|
{% endif %}
|
|
</div>
|
|
{% 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) }}
|
|
{% 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 add_bill(form, edit=False) %}
|
|
|
|
<fieldset>
|
|
<legend>{% if edit %}Edit this {% else %}Add a {% endif %}bill</legend>
|
|
{% include "display_errors.html" %}
|
|
{{ form.hidden_tag() }}
|
|
{{ input(form.date) }}
|
|
{{ input(form.what) }}
|
|
{{ input(form.payer) }}
|
|
{{ input(form.amount) }}
|
|
{{ input(form.payed_for) }}
|
|
</fieldset>
|
|
{{ submit(form.submit, cancel=True) }}
|
|
|
|
{% endmacro %}
|
|
|
|
{% macro add_member(form) %}
|
|
{{ form.hidden_tag() }}
|
|
{{ form.name }}
|
|
<button class="btn">Add a new user</button>
|
|
|
|
{% endmacro %}
|
|
|
|
{% macro invites(form) %}
|
|
{{ form.hidden_tag() }}
|
|
{{ input(form.emails) }}
|
|
<div class="actions">
|
|
<button class="btn">Send the invitations</button>
|
|
<a href="{{ url_for(".list_bills") }}">No, thanks</a>
|
|
</div>
|
|
{% endmacro %}
|
|
|
|
{% 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 %}
|