Skip to content
invitation_form.html 1.87 KiB
Newer Older
Bengfort's avatar
Bengfort committed
{% extends "base.html" %}
{% load static i18n bootstrap4 %}

{% block title %}{% translate "Schedule appointment" %}{% endblock %}

{% block content %}
    <h1>{% blocktranslate with schedule=object.schedule %}Schedule appointment for {{ schedule }}{% endblocktranslate %}</h1>

    <form method="post">
        {% csrf_token %}

        {% bootstrap_form_errors form %}
Bengfort's avatar
Bengfort committed
        <p>{% translate 'Please select one of the available timeslots to make an appointment. You will still be able to change your selection later.' %}</p>
Bengfort's avatar
Bengfort committed
        <div class="full-width my-2">
            <table class="table table-hover" data-js="multi-datetime">
                <thead>
Bengfort's avatar
Bengfort committed
                        <th></th>
                        {% for time in table.times %}
                            <th data-value="{{ time|date:'H:i' }}">{{ time }}</th>
                        {% endfor %}
                    </tr>
Bengfort's avatar
Bengfort committed
                </thead>
                <tbody>
                    {% for date, row in table.timeslots.items %}
                        <tr>
                            <th>{{ date }}</th>
                            {% for time, id in row.items %}
                                <td>
                                    {% if id %}
                                        <input type="radio" name="timeslot" value="{{ id }}" {% if id == form.timeslot.value %}checked{% endif %}>
                                    {% endif %}
                                </td>
                            {% endfor %}
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
Bengfort's avatar
Bengfort committed

        <div class="d-print-none mb-3">
            <button class="btn btn-secondary" name="timeslot" value="">{% translate 'Reset' %}</button>
Bengfort's avatar
Bengfort committed
            <button class="btn btn-primary">{% translate 'Save' %}</button>
        </div>
    </form>
{% endblock %}