index.html 6.91 KB
Newer Older
1
{% extends "base.html" %}
2
{% load static i18n thumbnail bootstrap4 member_card alert %}
3

4
{% block title %}{% trans "members"|capfirst %} — {{ block.super }}{% endblock %}
5
{% block opengraph_title %}{% trans "members"|capfirst %} — {{ block.super }}{% endblock %}
6
7

{% block body %}
8
9
10
11
    {% with keys=keywords|join:" " %}
        <section class="page-section" id="members-directory">
            <div class="container">
                <h1 class="text-center section-title">{% trans "members"|capfirst %}</h1>
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
12

13
14
15
16
17
18
19
                <p class="text-center">
                    {% blocktrans trimmed %}
                        Ever wondered what the name of that person in the back row of the lecture room is?
                        There is a high probability that this person is a member of Thalia,
                        and thus you can use this directory to find him or her.
                    {% endblocktrans %}
                </p>
20

21
                <form class="search-form form-inline col-12 col-lg-6 offset-lg-3" method="get"
22
23
                      action="{% url 'members:index' %}#members-directory">
                    <input type="hidden" name="filter" value="{{ filter }}"/>
Thijs de Jong's avatar
Thijs de Jong committed
24
                    <input class="form-control col-12 col-md-9" name="keywords" type="text" value="{{ keys }}"
25
                           placeholder="{% trans "Who are you looking for?" %}"/>
Thijs de Jong's avatar
Thijs de Jong committed
26
                    <input class="btn btn-lg btn-primary col-12 mt-2 mt-md-0 col-md-3" name="submit" type="submit"
27
28
                           value="{% trans "Search" %}"/>
                </form>
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
29

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
                <ul class="nav nav-tabs justify-content-center mt-4">
                    <li class="nav-item">
                        <a class="nav-link{% if not filter or filter == "all" %} active{% endif %}"
                           href="{% url 'members:index' %}?filter=all{% if keywords %}&keywords={{ keys }}{% endif %}{% if page %}&page={{ page }}{% endif %}#members-directory">
                            {% trans "All members" %}
                        </a>
                    </li>
                    {% for year in year_range %}
                        <li class="nav-item">
                            <a class="nav-link{% if filter == year|stringformat:"i" %} active{% endif %}"
                               href="{% url 'members:index' %}?filter={{ year }}{% if keywords %}&keywords={{ keys }}{% endif %}{% if page %}&page={{ page }}{% endif %}#members-directory">
                                {{ year }}
                            </a>
                        </li>
                    {% endfor %}
                    <li class="nav-item">
46
                        <a class="nav-link{% if filter == "older" %}active{% endif %}"
47
                           href="{% url 'members:index' %}?filter=older{% if keywords %}&keywords={{ keys }}{% endif %}{% if page %}&page={{ page }}{% endif %}#members-directory">
48
49
50
                            {% trans "Older" %}
                        </a>
                    </li>
51
52
53
54
55
56
                    <li class="nav-item">
                        <a class="nav-link{% if filter == "benefactors" %} active{% endif %}"
                           href="{% url 'members:index' %}?filter=benefactors{% if keywords %}&keywords={{ keys }}{% endif %}{% if page %}&page={{ page }}{% endif %}#members-directory">
                            {% trans "Benefactors" %}
                        </a>
                    </li>
57
                    <li class="nav-item">
58
                        <a class="nav-link{% if filter == "honorary" %} active{% endif %}"
59
                           href="{% url 'members:index' %}?filter=honorary{% if keywords %}&keywords={{ keys }}{% endif %}{% if page %}&page={{ page }}{% endif %}#members-directory">
60
61
62
63
                            {% trans "Honorary Members" %}
                            </a>
                    </li>
                    <li class="nav-item">
64
                        <a class="nav-link{% if filter == "former" %} active{% endif %}"
65
                           href="{% url 'members:index' %}?filter=former{% if keywords %}&keywords={{ keys }}{% endif %}{% if page %}&page={{ page }}{% endif %}#members-directory">
66
67
68
69
                            {% trans "Former Members" %}
                        </a>
                    </li>
                </ul>
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
70

71
                {% if not members %}
72
73
74
75
                    <div class="mt-4">
                        {% trans 'No members found' as info_text %}
                        {% alert 'info' info_text dismissable=False %}
                    </div>
76
77
78
79
80
81
82
                {% else %}
                    <div class="row mt-4">
                        {% for member in members %}
                            <div class="col-4 col-md-3 my-3">
                                {% member_card member %}
                            </div>
                        {% endfor %}
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
83
84
                    </div>

85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
                    <nav>
                        <ul class="pagination justify-content-center mt-4">
                            {% if members.has_previous %}
                                <li class="page-item">
                                    <a class="page-link"
                                       href="{% url 'members:index' %}?page={{ members.previous_page_number }}{% if filter %}&filter={{ filter }}{% endif %}{% if keywords %}&keywords={{ keys }}{% endif %}#members-directory">
                                        <span aria-hidden="true">&laquo;</span>
                                        <span class="sr-only">Previous</span>
                                    </a>
                                </li>
                            {% endif %}
                            {% for page in page_range %}
                                <li class="page-item{% if page == members.number %} active{% endif %}">
                                    <a class="page-link"
                                       href="{% url 'members:index' %}?page={{ page }}{% if filter %}&filter={{ filter }}{% endif %}{% if keywords %}&keywords={{ keys }}{% endif %}#members-director">
                                        {{ page }}
                                    </a>
                                </li>
                            {% endfor %}
                            {% if members.has_next %}
                                <li class="page-item">
                                    <a class="page-link"
                                       href="{% url 'members:index' %}?page={{ members.next_page_number }}{% if filter %}&filter={{ filter }}{% endif %}{% if keywords %}&keywords={{ keys }}{% endif %}">
                                        <span aria-hidden="true">&raquo;</span>
                                        <span class="sr-only">Next</span>
                                    </a>
                                </li>
                            {% endif %}
                        </ul>
                    </nav>
                {% endif %}
            </div>
        </section>
    {% endwith %}
119
{% endblock %}