registrations_table.html 3.75 KB
Newer Older
Thom Wiggers's avatar
Thom Wiggers committed
1
2
3
4
5
6
7
8
9
10
11
{% load i18n %}
<div class="results">
    <table id="result_list">
        <thead>
            <tr>
                <th scope="col">{% trans "name"|capfirst %}</th>
                <th scope="col">{% trans "date"|capfirst %}</th>
                {% for field in fields %}
                <th scope="col">{{ field.name }}</th>
                {% endfor %}
                <th>{% trans "present"|capfirst %}</th>
12
13
14
                <th>{% trans "not paid"|capfirst %}</th>
                <th>{% trans "paid cash"|capfirst %}</th>
                <th>{% trans "paid card"|capfirst %}</th>
15
16
17
                {% if registrations|length > 0 and registrations.0.date_cancelled is not None %}
                    <th>{% trans "late"|capfirst %}</th>
                {% endif %}
Thom Wiggers's avatar
Thom Wiggers committed
18
19
                <th>
                {% if addlink != 0 %}
20
                    <a class="addlink" href="{% url 'admin:events_registration_add' %}?event_pk={{ event.pk }}&next={{ request.get_full_path | urlencode }}">{% trans "add"|capfirst %}</a>
Thom Wiggers's avatar
Thom Wiggers committed
21
                {% endif %}
22
                </th>
Thom Wiggers's avatar
Thom Wiggers committed
23
24
25
26
27
28
29
30
31
32
33
            </tr>
        </thead>
        <tbody>
            {% for registration in registrations %}
            <tr class="{% if forloop.first %}row1 {% endif %}">
                {% if registration.member %}
                <td><a href="{{ registration.member.get_absolute_url }}">{{ registration.member.get_full_name }}</a></td>
                {% else %}
                <td>{{ registration.name }}</td>
                {% endif %}
                <td>{{ registration.date }}</td>
34
                {% for field in registration.information_fields %}
Thom Wiggers's avatar
Thom Wiggers committed
35
36
37
38
39
40
41
42
                    {% if not field.value %}
                    <td></td>
                    {% elif field.field.type == 'checkbox' %}
                    <td>{{ field.value|yesno }}</td>
                    {% else %}
                    <td>{{ field.value }}</td>
                    {% endif %}
                {% endfor %}
43
                <td><input type="checkbox" {{ registration.present|yesno:'checked="checked",' }} data-id="{{ registration.id }}" class="present-check" /></td>
44
45
46
                <td><input type="radio" name="payment-{{ registration.id }}" {% if registration.payment == registration.PAYMENT_NONE %}checked="checked"{% endif %} data-value="{{ registration.PAYMENT_NONE }}" data-id="{{ registration.id }}" class="payment-radio" /></td>
                <td><input type="radio" name="payment-{{ registration.id }}" {% if registration.payment == registration.PAYMENT_CASH %}checked="checked"{% endif %} data-value="{{ registration.PAYMENT_CASH }}" data-id="{{ registration.id }}" class="payment-radio" /></td>
                <td><input type="radio" name="payment-{{ registration.id }}" {% if registration.payment == registration.PAYMENT_CARD %}checked="checked"{% endif %} data-value="{{ registration.PAYMENT_CARD }}" data-id="{{ registration.id }}" class="payment-radio" /></td>
47
48
49
                {% if registration.date_cancelled is not None %}
                    <td>{{ registration.is_late_cancellation|yesno }}</td>
                {% endif %}
Thom Wiggers's avatar
Thom Wiggers committed
50
51
52
53
                <td><a class="changelink" href="{% url 'admin:events_registration_change' registration.pk %}?next={{ request.get_full_path|urlencode }}">{% trans "change" %}</a></td>
            </tr>
            {% empty %}
            <tr class="model-events">
54
55
                {% trans "registered" as registered %}
                <td scope="row">{% blocktrans with verb=verb|default:registered %}Nobody {{ verb }} yet{% endblocktrans %}</td>
Thom Wiggers's avatar
Thom Wiggers committed
56
57
58
59
60
61
62
63
64
65
66
67
                {% for field in fields %}
                <td>&nbsp;</td>
                {% endfor %}
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>