change backoffice chain list to a table
This commit is contained in:
parent
78e68a2299
commit
30a687181e
|
@ -10,26 +10,36 @@ Select Chain | {{ block.super }}
|
|||
<p><a href="{% url "backoffice:index" camp_slug=camp.slug %}">Back to Backoffice Index</a></p>
|
||||
|
||||
{% if chain_list %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Chains</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="list-group">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Chain Name</th>
|
||||
<th>Notes</th>
|
||||
<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 %}
|
||||
<a href="{% url 'backoffice:chain_detail' camp_slug=camp.slug chain_slug=chain.slug %}" class="list-group-item">
|
||||
<h4 class="list-group-item-heading">
|
||||
<b>{{ chain.name }}</b> ({{ chain.credebtors.count }} credebtors)
|
||||
</h4>
|
||||
<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>
|
||||
{% if chain.notes %}
|
||||
<p><b>Notes:</b> {{ chain.notes }}</p>
|
||||
{% endif %}
|
||||
</a>
|
||||
<tr>
|
||||
<td>{{ chain.name }}</td>
|
||||
<td>{{ chain.notes|default:"N/A" }}</td>
|
||||
<td class="text-center"><span class="badge">{{ chain.credebtors.count }}</span></td>
|
||||
<td class="text-center"><span class="badge">{{ chain.expenses.count }}</span></td>
|
||||
<td class="text-center">{{ chain.expenses_total }}</td>
|
||||
<td class="text-center"><span class="badge">{{ chain.revenues.count }}</span></td>
|
||||
<td class="text-center">{{ chain.revenues_total }}</td>
|
||||
<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 %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p class="lead"><i>No Chains found.</i></p>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in a new issue