2016-07-28 18:05:56 +00:00
|
|
|
{% extends "core/base.jinja" %}
|
2016-09-07 21:06:38 +00:00
|
|
|
{% from "core/macros.jinja" import show_slots, show_tokens %}
|
2016-07-28 18:05:56 +00:00
|
|
|
|
|
|
|
{% block title %}
|
2024-07-23 22:16:31 +00:00
|
|
|
{% trans %}Launderette{% endtrans %}
|
2016-07-28 18:05:56 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
2016-07-28 23:38:46 +00:00
|
|
|
{% macro choose(date) %}
|
2024-07-23 22:16:31 +00:00
|
|
|
<form method="post" action="{{ url('launderette:book_slot', launderette_id=launderette.id) }}" class="inline" style="display:inline">
|
2016-07-28 23:38:46 +00:00
|
|
|
{% csrf_token %}
|
2016-07-29 11:00:32 +00:00
|
|
|
<input type="hidden" name="slot_type" value="{{ slot_type }}">
|
|
|
|
<button type="submit" name="slot" value="{{ date.isoformat() }}">{% trans %}Choose{% endtrans %}</button>
|
2024-07-23 22:16:31 +00:00
|
|
|
</form>
|
2016-07-28 23:38:46 +00:00
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
|
2016-07-28 18:05:56 +00:00
|
|
|
{% block content %}
|
2024-07-23 22:16:31 +00:00
|
|
|
<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>
|
|
|
|
<table>
|
2016-07-28 23:38:46 +00:00
|
|
|
<thead>
|
2024-07-23 22:16:31 +00:00
|
|
|
<tr>
|
|
|
|
{% for day in planning.keys() %}
|
|
|
|
<th>{{ day|date('l') }}</th>
|
|
|
|
{% endfor %}
|
|
|
|
</tr>
|
2016-07-28 23:38:46 +00:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2024-07-23 22:16:31 +00:00
|
|
|
{% for i in range(0, 24) %}
|
2016-07-28 23:38:46 +00:00
|
|
|
<tr>
|
2024-07-23 22:16:31 +00:00
|
|
|
{% for hours in planning.values() %}
|
2016-07-28 23:38:46 +00:00
|
|
|
<td>
|
2024-07-23 22:16:31 +00:00
|
|
|
{% if hours[i] %}
|
2016-07-29 11:00:32 +00:00
|
|
|
{{ hours[i]|time(TIME_FORMAT) }} {{ choose(hours[i]) }}
|
2024-07-23 22:16:31 +00:00
|
|
|
{% endif %}
|
2016-07-28 23:38:46 +00:00
|
|
|
</td>
|
2024-07-23 22:16:31 +00:00
|
|
|
{% endfor %}
|
2016-07-28 23:38:46 +00:00
|
|
|
</tr>
|
2024-07-23 22:16:31 +00:00
|
|
|
{% endfor %}
|
2016-07-28 23:38:46 +00:00
|
|
|
</tbody>
|
2024-07-23 22:16:31 +00:00
|
|
|
</table>
|
|
|
|
{{ show_slots(user) }}
|
|
|
|
{{ show_tokens(user) }}
|
2016-07-28 18:05:56 +00:00
|
|
|
{% endblock %}
|