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 %}
|
|
|
|
{% 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 %}
|
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>
|
2016-07-28 23:38:46 +00:00
|
|
|
</form>
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
|
2016-07-28 18:05:56 +00:00
|
|
|
{% block content %}
|
2016-07-29 11:00:32 +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>
|
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] %}
|
2016-07-29 11:00:32 +00:00
|
|
|
{{ hours[i]|time(TIME_FORMAT) }} {{ choose(hours[i]) }}
|
2016-07-28 23:38:46 +00:00
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
{% endfor %}
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2016-09-07 21:06:38 +00:00
|
|
|
{{ show_slots(user) }}
|
|
|
|
{{ show_tokens(user) }}
|
2016-07-28 18:05:56 +00:00
|
|
|
{% endblock %}
|