mirror of
https://github.com/YunoHost-Apps/ihatemoney_ynh.git
synced 2024-09-03 19:26:15 +02:00
98ea1c8873
Conflicts: conf/nginx.conf sources/budget/run.py sources/budget/utils.py
141 lines
3.9 KiB
HTML
141 lines
3.9 KiB
HTML
{% macro input(field, multiple=False, class=None) -%}
|
|
<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>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|
|
|
|
{% macro submit(field, cancel=False, home=False) -%}
|
|
<div class="actions">
|
|
<button type="submit" class="btn btn-primary">{{ field.name }}</button>
|
|
{% if home %}
|
|
<a href="{{ url_for(".remind_password") }}">{{ _("Can't remember the password?") }}</a>
|
|
{% endif %}
|
|
{% if cancel %}
|
|
<button 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, 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) }}
|
|
<div class="actions">
|
|
<button class="btn btn-primary">{{ _("Edit the project") }}</button>
|
|
<a id="delete-project" style="color:red; margin-left:10px; cursor:pointer; ">{{ _("delete") }}</a>
|
|
</div>
|
|
|
|
{% endmacro %}
|
|
|
|
{% macro add_bill(form, edit=False, title=True) %}
|
|
|
|
<fieldset>
|
|
{% if title %}<legend>{% if edit %}{{ _("Edit this bill") }} {% else %}{{ _("Add a bill") }} {% endif %}</legend>{% 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) }}
|
|
</fieldset>
|
|
<div class="actions">
|
|
{{ form.submit(class="btn btn-primary") }}
|
|
{% if not edit %} {{ form.submit2(class="btn") }}{% endif %}
|
|
</div>
|
|
|
|
{% endmacro %}
|
|
|
|
{% macro add_member(form) %}
|
|
{{ form.hidden_tag() }}
|
|
{{ form.name(placeholder=_("Type user name here")) }}<button class="btn">{{ _("Add") }}</button>
|
|
{% endmacro %}
|
|
|
|
{% 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 %}
|
|
|
|
|
|
{% macro invites(form) %}
|
|
{{ form.hidden_tag() }}
|
|
{{ input(form.emails) }}
|
|
<div class="actions">
|
|
<button class="btn btn-primary">{{ _("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.name) }}
|
|
{{ input(form.start_date) }}
|
|
{{ input(form.end_date) }}
|
|
</fieldset>
|
|
<div class="actions">
|
|
<button class="btn">{{ _("Create the archive") }}</button>
|
|
</div>
|
|
{% endmacro %}
|
|
|
|
{% macro remind_password(form) %}
|
|
|
|
{% include "display_errors.html" %}
|
|
{{ form.hidden_tag() }}
|
|
{{ input(form.id) }}
|
|
{{ submit(form.submit) }}
|
|
|
|
{% endmacro %}
|