2011-03-10 03:37:21 +01:00
{% extends "layout.html" %}
2011-07-29 17:14:33 +02:00
{% block top_menu %}
< ul >
2011-07-31 00:41:28 +02:00
< li > < a class = "awesome button" href = "{{ url_for('add_bill', project_id=project.id) }}" > Add a bill< / a > < / li >
2011-07-29 17:14:33 +02:00
< / ul >
{% endblock %}
2011-03-10 03:37:21 +01:00
{% block content %}
2011-07-31 23:55:18 +02:00
< div id = "leftmenu" class = "span-4" >
2011-07-23 20:36:13 +02:00
< ul >
2011-07-31 23:55:18 +02:00
{% set balance = project.get_balance() %}
{% for member in project.active_members %}
< li > {{ member.name }} {{ balance[member] }} < a href = "{{ url_for(" remove_member " , project_id = project.id, member_id = member.id) } } " > x< / a > < / li >
2011-07-23 20:36:13 +02:00
{% endfor %}
< / ul >
2011-07-31 23:55:18 +02:00
< form action = "{{ url_for(" add_member " , project_id = project.id) } } " method = "post" >
{{ forms.add_member(member_form) }}
< / form >
2011-07-23 20:36:13 +02:00
< / div >
2011-07-31 23:55:18 +02:00
< div id = "content" class = "uniForm span-20 last" >
< form id = "add_bill" action = "{{ url_for('add_bill', project_id=project.id) }}" method = "post" style = "width: 400px; display: none" >
{{ forms.add_bill(bill_form) }}
< / form >
2011-07-23 20:36:13 +02:00
{% if bills.count() > 0 %}
< table >
2011-08-05 17:05:33 +02:00
< thead > < tr > < th > When?< / th > < th > Who paid?< / th > < th > For what?< / th > < th > Owers< / th > < th > How much?< / th > < th > Actions< / th > < / tr > < / thead >
2011-07-23 20:36:13 +02:00
< tbody >
{% for bill in bills %}
< tr class = "{{ loop.cycle(" odd " , " even " ) } } " >
< td > {{ bill.date }}< / td >
< td > {{ bill.payer }}< / td >
< td > {{ bill.what }}< / td >
< td > {% for ower in bill.owers %}{{ ower.name }} {% endfor %}< / td >
< td > {{ bill.amount }} ({{ bill.pay_each() }} each)< / td >
< td > < a href = "{{ url_for(" delete_bill " , bill_id = bill.id, project_id = project.id) } } " > delete< / a > < / td >
< / tr >
{% endfor %}
< / tbody >
< / table >
2011-03-10 03:37:21 +01:00
2011-07-23 20:36:13 +02:00
< a class = "awesome large green button fleft" href = "{{ url_for(" compute_bills " , project_id = project.id) } } " > Compute bills< / a >
< p > Periodically (probably at the end of each month, you can compute the balance of each people, in order to reset all the debts. You can also let this "as-is" and try to find a good balance, that's up to you< / p >
2011-03-10 03:37:21 +01:00
2011-07-23 20:36:13 +02:00
{% else %}
< p > Nothing to list yet. You probably want to < a href = "{{ url_for(" add_bill " , project_id = project.id) } } " > add a bill< / a > ?< / p >
{% endif %}
< / div >
2011-03-10 03:37:21 +01:00
{% endblock %}