You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.9 KiB
HTML

{% extends 'base.html' %}
{% block content %}
<form action="{% url 'mensaviewer:home' %}" method="get">
<input type="hidden" name="filterform" value="filter">
<div class="type-filters">
{% for name, id in types %}
<label>
{{ name }}
<input type="checkbox"
name="type"
value={{ id }}
{% if id in checked_types %} checked{% endif %}>
</label>
{% endfor %}
</div>
<div class="status-filter">
{% for status_value in status_values %}
<label>
{{ status_value }}
<input type="radio"
name="status"
value="{{ status_value }}"
{% if status == status_value %} checked{% endif %}>
</label>
{% endfor %}
</div>
<div class="location-filter">
{% for location in locations %}
<label>
{{ location.name }}
<input type="checkbox"
name="location"
value="{{ location.mensa_id }}"
{% if location.mensa_id in selected_locations %} checked{% endif %}>
</label>
{% endfor %}
</div>
<a href="{% url 'mensaviewer:location_create' %}">New Location</a>
<button type="submit">Filter</button>
</form>
<div class="container">
{% for day, menus in menu_data.items %}
<div class="column">
<h2>{{ day }}</h2>
{% for menu in menus %}
<div class="menu {% if menu.mensa_id == 1 %}a-mensa{% elif menu.mensa_id == 6 %}b-mensa{% endif %}">
<a href="{% url 'mensaviewer:menu_detail' menu.pk %}">{{ menu.name }}</a>
<p>{{ menu.art }}</p>
<p>{{ menu.price }}</p>
<p>{{ menu.types }}</p>
<p>{{ menu.allergens }}</p>
<p>{{ menu.likes }}</p>
<a href="{% url 'mensaviewer:like' menu.pk %}?next={{ request.path }}">Like</a>
<a href="{% url 'mensaviewer:dislike' menu.pk %}?next={{ request.path }}">Dislike</a>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
{% endblock %}