change backoffice chain list to a table

This commit is contained in:
Thomas Steen Rasmussen 2019-03-30 11:12:02 +01:00
parent 78e68a2299
commit 30a687181e

View file

@ -10,26 +10,36 @@ Select Chain | {{ block.super }}
<p><a href="{% url "backoffice:index" camp_slug=camp.slug %}">Back to Backoffice Index</a></p> <p><a href="{% url "backoffice:index" camp_slug=camp.slug %}">Back to Backoffice Index</a></p>
{% if chain_list %} {% if chain_list %}
<div class="panel panel-default"> <table class="table table-hover">
<div class="panel-heading"> <thead>
<h3 class="panel-title">Chains</h3> <tr>
</div> <th>Chain Name</th>
<div class="panel-body"> <th>Notes</th>
<div class="list-group"> <th class="text-center">Credebtors</th>
<th class="text-center">Expenses</th>
<th class="text-center">Expenses Total</th>
<th class="text-center">Revenues</th>
<th class="text-center">Revenues Total</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for chain in chain_list %} {% for chain in chain_list %}
<a href="{% url 'backoffice:chain_detail' camp_slug=camp.slug chain_slug=chain.slug %}" class="list-group-item"> <tr>
<h4 class="list-group-item-heading"> <td>{{ chain.name }}</td>
<b>{{ chain.name }}</b> ({{ chain.credebtors.count }} credebtors) <td>{{ chain.notes|default:"N/A" }}</td>
</h4> <td class="text-center"><span class="badge">{{ chain.credebtors.count }}</span></td>
<p>{{ chain.name }} has <b>{{ chain.expenses.count }} expenses</b> for a total of <b>{{ chain.expenses_total|default:"0" }} DKK</b>, and <b>{{ chain.revenues.count }} revenues</b> for a total of <b>{{ chain.revenues_total|default:"0" }} DKK</b></p> <td class="text-center"><span class="badge">{{ chain.expenses.count }}</span></td>
{% if chain.notes %} <td class="text-center">{{ chain.expenses_total }}</td>
<p><b>Notes:</b> {{ chain.notes }}</p> <td class="text-center"><span class="badge">{{ chain.revenues.count }}</span></td>
{% endif %} <td class="text-center">{{ chain.revenues_total }}</td>
</a> <td>
<a class="btn btn-primary" href="{% url 'backoffice:chain_detail' camp_slug=camp.slug chain_slug=chain.slug %}"><i class="fas fa-search"></i> Details</a>
</td>
</tr>
{% endfor %} {% endfor %}
</div> </tbody>
</div> </table>
</div>
{% else %} {% else %}
<p class="lead"><i>No Chains found.</i></p> <p class="lead"><i>No Chains found.</i></p>
{% endif %} {% endif %}