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

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

{% block content %}
Bengfort's avatar
Bengfort committed
    <h1>{{ object.schedule }}</h1>
Bengfort's avatar
Bengfort committed

    <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>

        <table class="table table-hover" data-js="multi-datetime">
            <thead>
                <tr>
                    <th></th>
                    {% for time in table.times %}
                        <th data-value="{{ time|date:'H:i' }}">{{ time }}</th>
                    {% endfor %}
                </tr>
            </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>
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 %}