Use upper cased role names on index page.
[mailman-postorious.git] / src / postorius / templates / postorius / index.html
blob0b0fbe92e6352ef21588b8cca22f510a230e0de4
1 {% extends "postorius/base.html" %}
2 {% load i18n %}
3 {% load pagination %}
5 {% block head_title %}
6 {% trans 'List Index' %} - {{ block.super }}
7 {% endblock %}
9 {% block content %}
11 <div class="page-header">
12 <h1>{% trans 'Mailing Lists' %}</h1>
13 </div>
15 <div class="row">
16 {% if user.is_authenticated %}
17 <div class="dropdown page-left col-md-4">
18 <button class="btn btn-outline-secondary dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
19 {% trans 'Filter by Role' %}
20 <span class="caret"></span>
21 </button>
22 <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
23 <li><a href="?role=owner" class="dropdown-item">{% trans 'Owner' %}</a></li>
24 <li><a href="?role=moderator" class="dropdown-item">{% trans 'Moderator' %}</a></li>
25 <li><a href="?role=member" class="dropdown-item">{% trans 'Member' %}</a></li>
26 <li><a href="?role=nonmember" class="dropdown-item">{% trans 'Non-member' %}</a></li>
27 <li><a href="?all-lists" class="dropdown-item">{% trans 'All' %}</a></li>
28 </ul>
29 </div>
30 <div class="col-md-4">
31 {% if role %}
32 <h4>{% trans 'Role: ' %}
33 {% if role == 'owner' %} {% trans 'Owner' %}
34 {% elif role == 'moderator' %} {% trans 'Moderator' %}
35 {% elif role == 'member' %} {% trans 'Member' %}
36 {% elif role == 'nonmember' %} {% trans 'Non-member' %}
37 {% endif %}
38 </h4>
39 {% endif %}
40 </div>
41 {% endif %}
42 {% if user.is_superuser %}
43 <div class="col-md-4">
44 <p class="text-right">
45 {% if domain_count < 1 %}
46 <a class="btn btn-success" href="{% url 'domain_new' %}">{% trans 'Create New Domain' %}</a>
47 {% else %}
48 <a class="btn btn-success" href="{% url 'list_new' %}">{% trans 'Create New List' %}</a>
49 {% endif %}
50 </p>
51 </div>
52 {% endif %}
53 </div>
55 {% if lists|length > 0 %}
56 <div class="table-responsive">
57 <table class="table table-bordered table-striped">
58 <thead>
59 <tr>
60 <th>{% trans 'List name' %}</th>
61 <th>{% trans 'Post address' %}</th>
62 <th>{% trans 'Description' %}</th>
63 </tr>
64 </thead>
65 <tbody>
66 {% for list in lists %}
67 <tr>
68 <td>
69 <a href="{% url 'list_summary' list_id=list.list_id %}">{{ list.display_name }}</a>
70 {% if check_advertised %}
71 {% if user.is_superuser and not list.advertised %}
72 ({% trans 'unadvertised' %}*)
73 {% endif %}
74 {% endif %}
75 </td>
76 <td>{{ list.fqdn_listname }}</td>
77 <td>{{ list.description }}</td>
78 </tr>
79 {% endfor %}
80 </tbody>
81 </table>
82 </div>
83 {% if not all_lists and not role %}
84 <small>* {% trans 'Only lists that you are owner, moderator or subscriber for are shown here. Click to <a href="?all-lists"> see all lists</a>.' %}</small>
85 <br/>
86 {% endif %}
87 {% if user.is_superuser %}
88 <small>* {% trans 'Only admins see unadvertised lists in the list index.' %}</small>
89 {% endif %}
90 {% if not user.is_authenticated or "all-lists" in request.GET %}
91 {% paginator lists %}
92 {% endif %}
93 {% else %}
94 <p>{% trans 'There are currently no mailing lists.' %}</p>
95 {% endif %}
97 {% endblock content %}