{% extends "sidebar_table_layout.html" %} {%- macro weighted_bill_amount(bill, weights, currency=bill.original_currency, amount=bill.amount) %} {{ amount|currency(currency) }} {%- if weights != 1.0 %} ({{ _("%(amount)s each", amount=(amount / weights)|currency(currency)) }}) {%- endif -%} {% endmacro -%} {% block title %} - {{ g.project.name }}{% endblock %} {% block js %} {% if add_bill %} $('#new-bill > a').click(); {% endif %} // focus on first field when adding a bill $("#bill-form").on('shown.bs.modal', function(){ $(this).find('#what').focus(); }); // ask for confirmation before removing an user $('.action.delete').each(function(){ var link = $(this).find('button'); link.click(function(){ if ($(this).hasClass("confirm")){ return true; } $(this).html("{{_("you sure?")}}"); $(this).addClass("confirm"); return false; }); }); {% include "helpers.js" %} confirm_action(".delete-bill", { exclude_classes: "action delete", add_classes: "btn btn-sm" }); {% endblock %} {% block head %} {% endblock %} {% block sidebar %}
{% if g.lang == 'fr' %} {{ static_include("images/read.svg") | safe }} Voir la BD explicative {% endif %} {{ static_include("images/paper-plane.svg") | safe }} {{ _("Invite people") }}
{% endblock %} {% block content %}
{% if bills.pages > 1 %} {% endif %} {{ static_include("images/plus.svg") | safe }} {{ _("Add a new bill") }}
{% if bills.total > 0 %} {% for (weights, bill) in bills.items %} {% endfor %}
{{ _("When?") }} {{ _("Who paid?") }} {{ _("For what?") }} {{ _("For whom?") }} {{ _("How much?") }} {{ _("Actions") }}
{{ bill.date }} {{ bill.payer }} {{ bill.what }} {% set owers_label = bill.get_owers_label(g.project.active_members) -%} {% if owers_label[0] == "everyone" -%} {{ _("Everyone") }} {%- elif owers_label[0] == "everyone_but" -%} {{ _("Everyone but %(excluded)s", excluded=owers_label[1]|join(', ', 'name')) }} {%- else -%} {{ bill.owers|join(', ', 'name') }} {%- endif %} {{ weighted_bill_amount(bill, weights) }} {{ _('edit') }}
{{ csrf_form.csrf_token }}
{% if bill.external_link %} {{ _('show') }} {% endif %}
{% else %}
{{ static_include("images/bill.svg") | safe }}

{{ _('No bills')}}

{{ _("Nothing to list yet.")}}
{%- if g.project.members %} {{- _("Add your first bill") -}} {% else %} {{- _("Add the first participant") -}} {%- endif -%}

{% endif %} {% endblock %}