Alle hyllekart vises nå på én og samme side.
Denne visningen erstatter den tidligere listen over hyllekart. Visning av enkelthyller er fortsatt tilgjengelig, men lenkes ikke til.
This commit is contained in:
parent
6782053f3c
commit
00ae89ce63
|
@ -58,7 +58,9 @@ def PersonIndex(request):
|
||||||
return render_to_response('person/index.html', {'persons': Person.objects.all().order_by('last_name')})
|
return render_to_response('person/index.html', {'persons': Person.objects.all().order_by('last_name')})
|
||||||
|
|
||||||
def MapIndex(request):
|
def MapIndex(request):
|
||||||
return render_to_response('map/index.html', {'shelves': Placement.get_all_shelves()})
|
shelves = Placement.get_all_shelves()
|
||||||
|
shelf_lists = [(shelf, Placement.shelf_as_list_row_then_col(shelf)) for shelf in shelves]
|
||||||
|
return render_to_response('map/index.html', {'shelf_lists': shelf_lists})
|
||||||
|
|
||||||
def MapView(request,shelf_identifier):
|
def MapView(request,shelf_identifier):
|
||||||
if shelf_identifier not in Placement.get_all_shelves():
|
if shelf_identifier not in Placement.get_all_shelves():
|
||||||
|
|
|
@ -4,12 +4,25 @@
|
||||||
Hyllekart
|
Hyllekart
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>Hyller</h2>
|
{% for shelf in shelf_lists %}
|
||||||
<ul>
|
<table border="1">
|
||||||
{% for shelf_name in shelves %}
|
{% for row in shelf.1 %}
|
||||||
|
<tr>
|
||||||
|
{% for column in row %}
|
||||||
|
<td>
|
||||||
|
<table>
|
||||||
|
{% for category in column %}
|
||||||
|
<tr><td><a href="/kategori/{{ category.id }}">{{ category }}</a></td></tr>
|
||||||
|
{% endfor %}
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
{% endfor %}
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</table>
|
||||||
<li><a href="/kart/{{ shelf_name }}">{{ shelf_name }}</a></li>
|
<li><a href="/kart/{{ shelf_name }}">{{ shelf_name }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
Reference in New Issue