move code to use generic views
This commit is contained in:
@@ -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>
|
||||
|
30
billard/templates/billard/location_list.html
Normal file
30
billard/templates/billard/location_list.html
Normal 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 %}
|
Reference in New Issue
Block a user