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 %}
2016-07-28 18:05:56 +00:00
{% 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">
2016-07-28 23:38:46 +00:00
{% csrf_token %}
<input type="hidden" name="slot_type" value="{{ slot_type }}">
<button type="submit" name="slot" value="{{ date.isoformat() }}">{% trans %}Choose{% endtrans %}</button>
</form>
2016-07-28 23:38:46 +00:00
{% 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>
<table>
2016-07-28 23:38:46 +00:00
<thead>
<tr>
{% for day in planning.keys() %}
<th>{{ day|date('l') }}</th>
{% endfor %}
</tr>
2016-07-28 23:38:46 +00:00
</thead>
<tbody>
{% for i in range(0, 24) %}
2016-07-28 23:38:46 +00:00
<tr>
{% for hours in planning.values() %}
2016-07-28 23:38:46 +00:00
<td>
{% if hours[i] %}
{{ hours[i]|time(TIME_FORMAT) }} {{ choose(hours[i]) }}
{% endif %}
2016-07-28 23:38:46 +00:00
</td>
{% endfor %}
2016-07-28 23:38:46 +00:00
</tr>
{% endfor %}
2016-07-28 23:38:46 +00:00
</tbody>
</table>
{{ show_slots(user) }}
{{ show_tokens(user) }}
2016-07-28 18:05:56 +00:00
{% endblock %}