Source

django-pim / pcbank / templates / pcbank / roommate_detail.html

Full commit
{% extends "pcbank/base.html" %}
{% load pcbank_extras %}

{% block body %}
<table class="table table-condensed">
<tr><td><b>Name:</b></td><td>{{object.name}}</td></tr>
<tr><td><b>Total given:</b></td><td>${{object.total_given|floatformat:2}}</td></tr>
<tr><td><b>Active:</b></td><td>{{object.active}}</td></tr>
<tr><td><b>Added on:</b></td><td>{{object.added_on}}</td></tr>
</table>
<a href="{{object.get_edit_url}}" class="btn">Edit Roommate</a><br/>
{% if object.roommatebill_set.all %}
<table class="table table-striped table-condensed table-bordered">
<thead>
<tr><th>Bill</th><th>Amount</th><th>Paid</th></tr>
</thead><tbody>
{% for bill in object.roommatebill_set.all %}
<tr><td><a href="{{bill.get_absolute_url}}">{{bill}}</a></td><td>${{bill.amount|floatformat:2}}</td><td>{{bill.paid}}</td></tr>
{% endfor %}
</tbody></table>
{% endif %}
<form action="{{object.add_bill}}" method="post">{% csrf_token %}
<b>Add Bill:</b> {% bill_list %}
<input type="submit" value="Add" class="btn btn-primary" />
</form>
{% if object.transactions.all %}
<table class="table table-striped table-condensed table-bordered">
<thead>
<tr><th>Date</th><th>To</th><th>Amount</th></tr>
</thead><tbody>
{% for transaction in object.transactions.all %}
<tr><td>{{transaction.date}}</td><td><a href="{{transaction.content_object.get_absolute_url}}">{{transaction.content_object}}</a></td><td>${{transaction.amount|floatformat:2}}</td></tr>
{% endfor %}
</tbody></table>
{% endif %}
{% endblock %}