Sith/launderette/templates/launderette/launderette_book.jinja

59 lines
2.2 KiB
Django/Jinja
Raw Normal View History

2016-07-28 18:05:56 +00:00
{% extends "core/base.jinja" %}
{% from "core/macros.jinja" import show_slots, show_tokens %}
2016-07-28 18:05:56 +00:00
{% block title %}
{% trans %}Launderette{% endtrans %}
{% endblock %}
2016-07-28 23:38:46 +00:00
{% macro choose(date) %}
<form method="post" action="{{ url('launderette:book_slot', launderette_id=launderette.id) }}" class="inline" style="display:inline">
{% csrf_token %}
<input type="hidden" name="slot_type" value="{{ slot_type }}">
<button type="submit" name="slot" value="{{ date.isoformat() }}">{% trans %}Choose{% endtrans %}</button>
2016-07-28 23:38:46 +00:00
</form>
{% endmacro %}
2016-07-28 18:05:56 +00:00
{% block content %}
<h3>{{ launderette }}</h3>
<p>
<form method="post" action="{{ url('launderette:book_slot', launderette_id=launderette.id) }}"
class="inline" style="display:inline">
{% csrf_token %}
<button type="submit" name="slot_type" value="BOTH" {% if slot_type == "BOTH" -%}style="background: #FF0"{% endif %}>{% trans %}Washing and drying{% endtrans %}</button>
</form>
<form method="post" action="{{ url('launderette:book_slot', launderette_id=launderette.id) }}" class="inline" style="display:inline">
{% csrf_token %}
<button type="submit" name="slot_type" value="WASHING" {% if slot_type == "WASHING" -%}style="background: #FF0"{% endif %}>{% trans %}Washing{% endtrans %}</button>
</form>
<form method="post" action="{{ url('launderette:book_slot', launderette_id=launderette.id) }}" class="inline" style="display:inline">
{% csrf_token %}
<button type="submit" name="slot_type" value="DRYING" {% if slot_type == "DRYING" -%}style="background: #FF0"{% endif %}>{% trans %}Drying{% endtrans %}</button>
</form>
</p>
2016-07-28 23:38:46 +00:00
<table>
<thead>
<tr>
{% for day in planning.keys() %}
<th>{{ day|date('l') }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for i in range(0, 24) %}
<tr>
{% for hours in planning.values() %}
<td>
{% if hours[i] %}
{{ hours[i]|time(TIME_FORMAT) }} {{ choose(hours[i]) }}
2016-07-28 23:38:46 +00:00
{% endif %}
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{{ show_slots(user) }}
{{ show_tokens(user) }}
2016-07-28 18:05:56 +00:00
{% endblock %}