diff --git a/ihatemoney/messages.pot b/ihatemoney/messages.pot index 18782fed..58c3b727 100644 --- a/ihatemoney/messages.pot +++ b/ihatemoney/messages.pot @@ -204,6 +204,9 @@ msgstr "" msgid "The bill has been deleted" msgstr "" +msgid "UNDO" +msgstr "" + msgid "The bill has been modified" msgstr "" diff --git a/ihatemoney/templates/list_bills_post_delete.html b/ihatemoney/templates/list_bills_post_delete.html new file mode 100644 index 00000000..66b0dd20 --- /dev/null +++ b/ihatemoney/templates/list_bills_post_delete.html @@ -0,0 +1,185 @@ +{% extends "sidebar_table_layout.html" %} + +{% block title %} - {{ g.project.name }}{% endblock %} +{% block js %} + {% if add_bill %} $('#new-bill > a').click(); {% endif %} + + // 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; + }); + }); + + var highlight_owers = function(){ + var ower_ids = $(this).attr("owers").split(','); + var payer_id = $(this).attr("payer"); + $.each(ower_ids, function(i, val){ + $('#bal-member-'+val).addClass("ower_line"); + }); + $("#bal-member-"+payer_id).addClass("payer_line"); + }; + + var unhighlight_owers = function(){ + $('[id^="bal-member-"]').removeClass("ower_line payer_line"); + }; + + $('#bill_table tbody tr').hover(highlight_owers, unhighlight_owers); + +{% endblock %} + +{% block sidebar %} +
+ +{% endblock %} + +{% block content %} + + + {{ _("Undo delete") }} + + + + + {{ static_include("images/plus.svg") | safe }} + {{ _("Add a new bill") }} + + +{{ _("When?") }} | {{ _("Who paid?") }} | {{ _("For what?") }} | {{ _("For whom?") }} | {{ _("How much?") }} | {{ _("Actions") }} | |
---|---|---|---|---|---|---|
+ + {{ bill.date }} + + | +{{ bill.payer }} | +{{ bill.what }} | +{% if bill.owers|length == g.project.members|length -%} + {{ _("Everyone") }} + {%- elif bill.owers|length > g.project.members|length / 2 + 1 -%} + {{ _("Everyone but %(excluded)s", excluded=g.project.members|reject('in', bill.owers)|join(', ', 'name')) }} + {%- else -%} + {{ bill.owers|join(', ', 'name') }} + {%- endif %} | +{{ "%0.2f"|format(bill.amount) }} ({{ "%0.2f"|format(bill.pay_each()) }} {{ _("each") }}) | ++ {{ _('edit') }} + {{ _('delete') }} + {% if bill.external_link %} + {{ _('see') }} + {% endif %} + | +
+ {{ _("Nothing to list yet.")}}
+ {{ _("You probably want to") }}
+ {%- if g.project.members %}
+ {{- _("add a bill") -}}
+ ?
+ {% else %}
+ {{- _('add participants') -}}
+ ?
+ {%- endif -%}
+