1 {% extends
"postorius/base.html" %}
3 {% load bootstrap_tags %}
6 {% load membership_helpers %}
8 {% trans 'List members' %} | {{ list.fqdn_listname}} - {{ block.super }}
13 {% list_nav 'list_members' page_title page_subtitle %}
15 {% if role != 'member' and user.is_poweruser %}
16 <form action=
"{% url 'list_members' list.list_id role %}" method=
"post" class=
"row gx-3 gy-2 align-items-end mb-2">
18 <div class=
"form-group col-4 {% if member_form.email.errors %}has-error{% endif %}">
19 {% if member_form.email.errors %}
20 <div class=
"alert alert-danger">{{ member_form.email.errors }}
</div>
22 {{ member_form.email.label_tag }}
23 {{ member_form.email|add_form_control }}
25 <div class=
"form-group col-4 {% if member_form.display_name.errors %}has-error{% endif %}">
26 {% if member_form.display_name.errors %}
27 <div class=
"alert alert-danger">{{ member_form.display_name.errors }}
</div>
29 {{ member_form.display_name.label_tag }}
30 {{ member_form.display_name|add_form_control }}
32 <button type=
"submit" class=
"btn btn-primary col-auto">{{ form_action }}
</button>
37 {% if form.choices.errors %}
38 <div class=
"alert alert-danger">{{ form.choices.errors }}
</div>
40 <!-- Member search form -->
41 <div class=
"pull-left margin-bottom">
42 <form action=
"{% url 'list_members' list.list_id role %}" method=
"get" class=
"form-inline">
43 <div class=
"input-group">
44 <input type=
"text" name=
"q" value=
"{{ query }}" class=
"form-control" placeholder=
"{% trans 'Search members...' %}" aria-label=
"Search box" />
45 <span class=
"input-group-btn">
46 <button class=
"btn btn-outline-primary" type=
"submit" aria-label=
"Search"><span class=
"fa fa-search"></span></button>
53 {% if members|length
> 0 %}
54 {% if role == 'member' and user.is_poweruser %}
55 <form action=
"{% url 'list_members' list.list_id role %}" method=
"post" id=
"unsubscribe-form">
57 <input type=
"submit" class=
"d-none" />
58 <div class=
"pull-right">
59 <a href=
"{% url 'csv_view' list.list_id %}" class=
"btn btn-primary">
60 {% trans 'CSV Export' %}
62 <button class=
"btn btn-info" id=
"unsubscribe-selected-btn">{% trans 'Remove Selected' %}
</button>
63 <a href=
"{% url 'unsubscribe_all' list.list_id %}" class=
"btn btn-danger">{% trans 'Remove ALL members' %}
</a>
66 <div class=
"table-responsive" style=
"clear:both">
67 <table class=
"table table-bordered table-striped">
70 {% if role == 'member' %}
71 {% if user.is_poweruser %}
73 <input type=
"checkbox" id=
"all-members-checkbox" aria-label=
"Select all members" />
80 {% if role == 'member' or role == 'nonmember' %}
82 {% trans 'Delivery Mode' %}
85 {% trans 'Moderation Action' %}
88 {% if role == 'member' %}
90 {% trans 'Bounce Score' %}
93 {# Extra column here for the
"Delete" button of Non-members, owners and mods. #}
94 {% if role != 'member' %}
95 {% if user.is_poweruser %}
102 {% for member in members %}
104 {% if role == 'member' %}
105 {% if user.is_poweruser %}
107 <input type=
"checkbox" class=
"member-checkbox" name=
"choices" id=
"id_choices_{{ forloop.counter0 }}" value=
"{{ member.email }}"/>
111 <label for=
"id_choices_{{ forloop.counter0 }}">
112 {% if user.is_poweruser %}
113 <a href=
"{% url 'list_member_options' list.list_id member.email %}?role=member" title=
"Member options">
115 {% if not user.is_list_moderator and not user.is_poweruser and member.preferences.hide_address %}
116 {% trans 'Masked per the user request' %}
118 {% if member.display_name %}
119 "{{ member.display_name }}" <{{ member.email }}
>
124 {% if user.is_poweruser %}
130 {{ member.delivery_mode | delivery_mode }}
133 {{ member.moderation_action | moderation_action }}
136 {{ member.bounce_score }}
138 {% elif role == 'nonmember' %}
140 {% if user.is_poweruser %}
141 <a href=
"{% url 'list_member_options' list.list_id member.email %}?role=nonmember" title=
"NonMember options">
143 {% if member.display_name %}
144 "{{ member.display_name }}" <{{ member.email }}
>
148 {% if user.is_poweruser %}
153 {{ member.delivery_mode | delivery_mode }}
156 {{ member.moderation_action | moderation_action }}
158 {% if user.is_poweruser %}
159 <td><a href=
"{% url 'remove_role' list.list_id role member.email %}" class=
"btn btn-xs btn-danger">{% trans 'Delete' %}
</a></td>
163 {% if member.display_name %}
164 "{{ member.display_name }}" <{{ member.email }}
>
169 {% if user.is_poweruser %}
170 <td><a href=
"{% url 'remove_role' list.list_id role member.email %}" class=
"btn btn-xs btn-danger">{% trans 'Delete' %}
</a></td>
178 {% if role == 'member' and user.is_poweruser %}
181 {% paginator members %}
183 <p>{{ empty_error }}
</p>
186 {% endblock content %}
187 {% block additionaljs %}
189 /* When the select all "Checkbox" in the header of the table is clicked, select all the subs on the page. */
190 $('#all-members-checkbox').change(function() {
191 $('.member-checkbox').prop('checked', this.checked
);
194 /* Move the focus to the search box when the page loads. This makes sure the user doesn't need to navigate
195 from the top back moving the entire menu item.
197 function focus_searchbox() {
198 const queryString
= window
.location
.search
;
199 const urlParams
= new URLSearchParams(queryString
);
200 const searchTerm
= urlParams
.get('q');
201 if (searchTerm
!= null) {
202 $('input[name^="q"]')[0].focus();