move code to use generic views

This commit is contained in:
2017-04-27 08:04:44 +02:00
parent b04e642daa
commit dc09be5a43
4 changed files with 83 additions and 9 deletions

View File

@@ -28,9 +28,9 @@
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="{% ifequal request.path '/billard/' %}active{% endifequal %}"><a href="{% url "carom_index" %}">Tische</a></li>
<li class="{% ifequal request.path '/billard/' %}active{% endifequal %}"><a href="{% url "billard:location_list" %}">Standorte</a></li>
{% if perms.billard.change_accounting %}
<li class="{% ifequal request.path '/billard/accounting' %}active{% endifequal %}"><a href="{% url "accounting" %}">Abrechnung</a></li>
<li class="{% ifequal request.path '/billard/accounting' %}active{% endifequal %}"><a href="{% url "billard:location_list" %}">Abrechnung</a></li>
{% endif %}
{% if user.is_superuser %}
<li class="{% ifequal request.path '/logout/' %}active{% endifequal %}"><a href="/admin/">Administration</a></li>

View File

@@ -0,0 +1,30 @@
{% extends 'billard/base.html' %}
{% block title %}Location List{% endblock %}
{% block content %}
{% if location_list %}
<table class="table table-hover">
<tr>
<th>Code</th>
<th>Name</th>
<th>Strasse</th>
<th>Plz</th>
<th>Ort</th>
</tr>
{% for loc in location_list %}
<tr>
<td><a href="{% url 'billard:location_detail' loc.id %}">{{ loc.code }}</a></td>
<td><a href="{% url 'billard:location_detail' loc.id %}">{{ loc.name }}</a></td>
<td><a href="{% url 'billard:location_detail' loc.id %}">{{ loc.street }}</a></td>
<td><a href="{% url 'billard:location_detail' loc.id %}">{{ loc.plz }}</a></td>
<td><a href="{% url 'billard:location_detail' loc.id %}">{{ loc.city }}</a></td>
</tr>
{% endfor %}
</table>
{% else %}
<p>Keine Standorte Zugeordnet.</p>
{% endif %}
{% endblock %}