add table column templates

This commit is contained in:
Robert Einsle 2019-02-09 21:48:58 +01:00
parent eaaa019b85
commit 456917499a
4 changed files with 34 additions and 31 deletions

View File

@ -10,8 +10,8 @@
<div class="alert alert-danger">Keine Tische angelegt!</div>
</div>
{% endif %}
<div class="col col-12">
<div class="alert alert-warning">
{{ location|display_daily_sale }}
</div>
<div class="col col-12">
<div class="alert alert-warning">
{{ location|display_daily_sale }}
</div>
</div>

View File

@ -1,4 +1,5 @@
{% extends '_base.html' %}
{% load render_table from django_tables2 %}
{% block title %}Standortliste{% endblock %}
@ -8,36 +9,33 @@
{% block content %}
{% if location_list %}
<h2>Bitte Standort auswählen:</h2>
<table class="table table-hover">
<h2>Bitte Standort auswählen:</h2>
<table class="table table-hover">
<tr>
<th>Code</th>
<th>Name</th>
<th>Strasse</th>
<th>Plz</th>
<th>Ort</th>
{% if perms.billard.change_accounting %}
<th>Accounting</th>
{% endif %}
</tr>
{% for loc in location_list %}
<tr>
<th>Code</th>
<th>Name</th>
<th>Strasse</th>
<th>Plz</th>
<th>Ort</th>
<td><a href="{% url 'billard:location_detail' loc.id %}"
class="btn btn-outline-primary btn-sm">{{ loc.code|default_if_none:"" }}</a></td>
<td>{{ loc.name|default_if_none:"" }}</td>
<td>{{ loc.street|default_if_none:"" }}</td>
<td>{{ loc.plz|default_if_none:"" }}</td>
<td>{{ loc.city|default_if_none:"" }}</td>
{% if perms.billard.change_accounting %}
<th>Accounting</th>
<td><a href="{% url 'billard:accounting_detail' loc.id %}"
class="btn btn-outline-danger btn-sm">Abrechnen</a></td>
{% endif %}
</tr>
{% for loc in location_list %}
<tr>
<td><a href="{% url 'billard:location_detail' loc.id %}"
class="btn btn-outline-primary btn-sm">{{ loc.code|default_if_none:"" }}</a></td>
<td>{{ loc.name|default_if_none:"" }}</td>
<td>{{ loc.street|default_if_none:"" }}</td>
<td>{{ loc.plz|default_if_none:"" }}</td>
<td>{{ loc.city|default_if_none:"" }}</td>
{% if perms.billard.change_accounting %}
<td><a href="{% url 'billard:accounting_detail' loc.id %}"
class="btn btn-outline-danger btn-sm">Abrechnen</a></td>
{% endif %}
</tr>
{% endfor %}
</table>
{% else %}
<p>Keine Standorte Zugeordnet.</p>
{% endif %}
{% endfor %}
</table>
{% render_table table %}
{% endblock %}

View File

@ -0,0 +1,2 @@
{% load static from staticfiles %}
<a href="{% url 'billard:accounting_detail' record.id %}" class="btn btn-outline-danger btn-sm">Abrechnen</a>

View File

@ -0,0 +1,3 @@
{% load static from staticfiles %}
<a href="{% url 'billard:location_detail' record.id %}"
class="btn btn-outline-primary btn-sm">{{ record.code|default_if_none:"" }}</a>