review.tt2 21.6 KB
Newer Older
1
<!-- review.tt2 -->
2

IKEDA Soji's avatar
IKEDA Soji committed
3
[% IF !page || page.match('^\d*$') ~%]
Luc Didry's avatar
Luc Didry committed
4
    [% PROCESS ReviewMembers ~%]
5
[%~ ELSIF page == 'owner' ~%]
Luc Didry's avatar
Luc Didry committed
6
7
8
    [% PROCESS ReviewUsers
        role = page
        users = owners %]
9
[%~ ELSIF page == 'editor' ~%]
Luc Didry's avatar
Luc Didry committed
10
11
12
    [% PROCESS ReviewUsers
        role = page
        users = editors %]
13
14
15
16
[%~ END %]

[%~ BLOCK ReviewMembers # (members) ~%]

17
[% IF is_owner %]
Luc Didry's avatar
Luc Didry committed
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
    <h2>
        [%|loc%]Manage list members[%END%]
        <a class="openInNewWindow" href="[% 'nomenu/help' | url_rel(['admin-members.html']) %]" target="wws_help">
            <i class="fa fa-info-circle" title="[%|loc%]Help[%END%]" aria-hidden="true"></i>
        </a>
    </h2>

    <h3>[%|loc%]Administrative Options[%END%]</h3>

    <a class="actionMenuLinks" href="[% 'subindex' | url_rel([list]) %]">
        [%|loc%]Pending subscriptions[%END%]
    </a>
    <a class="actionMenuLinks" href="[% 'sigindex' | url_rel([list]) %]">
        [%|loc%]Pending unsubscriptions[%END%]
    </a>
    [% IF conf.use_blacklist != 'none' %]
        <a class="actionMenuLinks" href="[% 'blacklist' | url_rel([list]) %]">
            [%|loc%]Blacklist[%END%]
        </a>
    [% END %]
    <a class="actionMenuLinks" href="[% 'reviewbouncing' | url_rel([list]) %]">
        [%|loc%]Bounces[%END%]
    </a>
    [% IF action == 'search' %]
        <a class="actionMenuLinks" href="[% 'export_member' | url_rel([list],{filter=>filter}) %]">
            [%|loc%]Dump[%END%]
        </a>
    [% ELSE %]
        <a class="actionMenuLinks" href="[% 'export_member' | url_rel([list,'light']) %]">
            [%|loc%]Dump[%END%]
        </a>
49
50
51
        <a class="actionMenuLinks" href="[% 'export_member' | url_rel([list]) %]">
            [%|loc%]Dump with names[%END%]
        </a>
Luc Didry's avatar
Luc Didry committed
52
53
54
55
56
57
    [% END %]
    <a class="actionMenuLinks" href="[% 'show_exclude' | url_rel([list]) %]">
        [%|loc%]Exclude[%END%]
    </a>
    <br />

58
    [% IF may_include.member %]
Luc Didry's avatar
Luc Didry committed
59
60
61
62
63
        <br />
        <form name="synchronize_list_members" action="[% path_cgi %]" method="post">
            <input class="MainMenuLinks heavyWork" type="submit" name="action_sync_include"
                   value="[%|loc%]Synchronize members with data sources[%END%]" />
            <input type="hidden" name="list" value="[% list %]"/>
64
            <input type="hidden" name="role" value="member"/>
Luc Didry's avatar
Luc Didry committed
65
66
67
68
69
70
71
72
73
74
        </form>
    [% END %]
    <hr>

    <h3>[%|loc%]Subscription reminder message[%END%]</h3>

    <form class="noborder" name="synchronize_list_members" action="[% path_cgi %]" method="post">
        <input class="MainMenuLinks" type="submit" name="action_remind" value="[%|loc%]Remind all[%END%]" />
        <input type="hidden" name="previous_action" value="[% action %]" />
        <input type="hidden" name="list" value="[% list %]" />
75
    </form>
76
    <hr>
Luc Didry's avatar
Luc Didry committed
77
78
79
80
81
82
83
84
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
119

    [%# If a list is not 'open' and allow_subscribe_if_pending has been set to
    'off', add cannot be performed. ~%]
    [% IF list_status == 'open' || conf.allow_subscribe_if_pending == 'on' ~%]
        <h3>[%|loc%]Add Subscribers[%END%]</h3>

        <form action="[% path_cgi %]" method="POST">
            <h4>[%|loc%]To add an individual user:[%END%]</h4>
            <fieldset>
                <input type="hidden" name="previous_action" value="review" />
                <input type="hidden" name="list" value="[% list %]" />
                <input type="hidden" name="action" value="add" />
                <div>
                    <label for="email_search">[%|loc%]Email address:[%END%]</label>
                    <input id="email_search" type="text" name="email" size="35" />
                </div>
                [% IF conf.quiet_subscription == 'optional' %]
                    <div>
                        <input id="quietly" type="checkbox" name="quiet" />
                        <label for="quietly">
                            [%|loc%]Quiet (don't send welcome email)[%END%]
                        </label>
                    </div>
                [% END ~%]
                <div>
                    <input class="MainMenuLinks" type="submit"
                           name="action_add" value="[%|loc%]Add[%END%]" />
                </div>
            </fieldset>
        </form>
        <h4>[%|loc%]To add multiple users:[%END%]</h4>
        <p>
            [%|loc%]Click the Multiple Add button below to bulk-add users using a form.  (Alternatively, consider using a data-source such as SQL or an Active Directory Group).[%END%]
        </p>
        <div>
            <p>
                <a class="button" href="[% 'import' | url_rel([list]) %]">
                    [%|loc%]Multiple add[%END%]
                </a>
            </p>
        </div>
        <hr>
    [%~ END %]
120
[% END %]
salaun's avatar
salaun committed
121

122
123
<h3>[%|loc%]Search for a User[%END%]</h3>

Luc Didry's avatar
Luc Didry committed
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<form action="[% path_cgi %]" method="post">
    <fieldset>
        <input type="hidden" name="previous_action" value="review" />
        <input type="hidden" name="list" value="[% list %]" />
        <input type="hidden" name="action" value="search" />
        <label for="filter">
            [%|loc%]Search for a user by email address, name or part of them: [%END%]
        </label>
        <input title="[%|loc%]Enter a name, email or part of them[%END%]" type="text"
               size="18" id="filter" name="filter" value="[% filter %]" />
        <input class="MainMenuLinks" type="submit" name="action_search" value="[%|loc%]Search[%END%]" />

        [% IF action == 'search' %]
            [% IF too_many_select %]
                [%|loc%]Selection too wide, unable to display selection[%END%]
            [% END %]
        [% END %]
    </fieldset>
</form>
143
<hr>
Luc Didry's avatar
Luc Didry committed
144

145
<h3>[%|loc%]Subscriber Table[%END%]</h3>
146

147
<form class="toggleContainer" data-toggle-selector="input[name='email']"
Luc Didry's avatar
Luc Didry committed
148
149
150
151
152
153
154
155
      name="myform" action="[% path_cgi %]" method="POST">
    <fieldset>
        <input type="hidden" name="previous_action" value="[% action %]" />
        <input type="hidden" name="previous_list" value="[% list %]" />
        <input type="hidden" name="list" value="[% list %]" />
        [% IF action == 'search' %]
            <h2>[%|loc(occurrence)%]%1 occurrence(s) found[%END%]</h2>
        [% END %]
salaun's avatar
salaun committed
156

Luc Didry's avatar
Luc Didry committed
157
158
159
160
161
162
163
164
        [% SET thosesubscribers = members %]
        [% PROCESS subscriber_table.tt2 %]
        [% IF action == 'search' %]
            [% IF similar_subscribers_occurence != 0 %]
                <h2> [%|loc(similar_subscribers_occurence)%] Other similar subscriber's email(s) (%1)[%END%]</h2>
                [% SET thosesubscribers = similar_subscribers %]
                [% PROCESS subscriber_table.tt2 %]
            [% END %]
165
166
        [% END %]

Luc Didry's avatar
Luc Didry committed
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
        [% IF total != 0 %]
            [% IF is_owner %]
                <div>
                    <input class="MainMenuLinks disableUnlessChecked"
                           data-selector="input[name='email']"
                           type="submit" name="action_del"
                           value="[%|loc%]Delete selected email addresses[%END%]" />
                </div>
                <div>
                    <input type="checkbox" id="quiet" name="quiet" />
                    <label for="quiet">
                        [%|loc%]Quiet (don't send deletion email)[%END%]
                    </label>
                </div>
            [% END %]
            <hr>

            [% IF action == 'search' %]
                 <h4>[%|loc%]Excluded users[%END%]</h4>
                 <table  class="responsive listOfItems">
                     <caption>[%|loc%]List of exclude[%END%]</caption>
                     <tr>
                         <th>[%|loc%]Email[%END%]</th>
                         <th>[%|loc%]Since[%END%]</th>
                     </tr>

                     [% IF user.email %]
                         [% IF exclude_users %]
                             [% FOREACH exc = exclude_users %]
                                 <tr class="color0">
                                     <td>&nbsp;[% exc.email %]&nbsp;</td>
                                     <td>&nbsp;[% exc.since %]&nbsp;</td>
                                 </tr>
                             [% END %]
                         [% END %]
                     [% END %]
                 </table>
            [% END %]
    </fieldset>
</form>

            [% IF action != 'search' %]
                <div class="search_form">
                    <form class="noborder" action="[% path_cgi %]">
                        <fieldset>
                            <label for="size">[%|loc%]Page size[%END%]</label>
                            <input type="hidden" name="sortby" value="[% sortby %]" />
                            <input type="hidden" name="action" value="review" />
                            <input type="hidden" name="list" value="[% list %]" />
                            [% SET mysize = (size || 0) ~%]
                            <select id="size" name="size" class="submitOnChange">
                                [% FOREACH s = [25, 50, 100, 500] ~%]
                                    [% IF 0 < mysize && mysize < s ~%]
                                        <option value="[% size %]" selected>[% size %]</option>
                                        <option value="[% s %]">[% s %]</option>
                                        [%~ mysize = 0 ~%]
                                    [%~ ELSIF mysize == s ~%]
                                        <option value="[% size %]" selected>[% size %]</option>
                                        [%~ mysize = 0 ~%]
                                    [%~ ELSIF s < mysize && loop.last() ~%]
                                        <option value="[% s %]">[% s %]</option>
                                        <option value="[% size %]" selected>[% size %]</option>
                                    [%~ ELSE ~%]
                                        <option value="[% s %]">[% s %]</option>
                                    [%~ END %]
                                [%~ END %]
                            </select>
                            <noscript>
                                <input type="submit" class="MainMenuLinks"
                                       name="action_review" value="[%|loc%]Change[%END%]" />
                            </noscript>
                        </fieldset>
                    </form>
                    [% IF prev_page ~%]
                        <a href="[% 'review' | url_rel([list,prev_page,size,sortby]) %]">
                            <i class="fa fa-caret-left fa-lg" title="[%|loc%]Previous page[%END%]"></i>
                        </a>
                    [%~ END %]
                    [% IF page ~%]
                        [%|loc(page,total_page)%]page %1 / %2[%END%]
                    [%~ END %]
                    [% IF next_page ~%]
                        <a href="[% 'review' | url_rel([list,next_page,size,sortby]) %]">
                            <i class="fa fa-caret-right fa-lg" title="[%|loc%]Next page[%END%]"></i>
                        </a>
                    [%~ END %]
                </div>
            [% END %]
        [% END %] [%# end of the IF total != 0 %]
256
257
258

[%~ END #ReviewMembers %]

259
[%~ BLOCK ReviewUsers # (role,users) ~%]
Luc Didry's avatar
Luc Didry committed
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
    [% PROCESS config_common.tt2 ~%]

    [% SET pS = config_schema.0 ~%]
    [% SET pV = config_values.${pS.name} ~%]
    [% SET pF = {
        email      => 'small-6 medium-4 columns',
        gecos      => 'small-6 medium-4 columns',
        reception  => 'medium-2 columns show-for-medium',
        visibility => 'medium-2 columns show-for-medium',
        info       => 'columns',
    } ~%]

    [% PROCESS EditListHeading
        ppaths = [pS.name]
        pitem  = pS
        helem  = 'h2'
    ~%]
277

Luc Didry's avatar
Luc Didry committed
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
    <form action="[% path_cgi %]" method="POST">
        <fieldset role="table">
            <input type="hidden" name="list" value="[% list %]" />
            <input type="hidden" name="action" value="review" />
            <input type="hidden" name="page" value="[% pS.name %]" /> [%~# FIXME ~%]

            <div class="row" role="row">
                <div class="small-10 medium-11 columns">
                    [% FOREACH kS = pS.format ~%]
                        [% NEXT UNLESS pF.${kS.name} ~%]
                        [% NEXT UNLESS kS.privilege == 'read' || kS.privilege == 'write' ~%]

                        <div class="[% pF.${kS.name} %]" role="columnheader">
                            <label>
                                [% IF kS.title ~%]
                                  [% kS.title %]
                                [%~ ELSE ~%]
                                    [% kS.name %]
                                [%~ END %]
                            </label>
                        </div>
                    [%~ END %]

                    <div class="columns" role="separator">
                        <hr>
                    </div>
                </div>

                [% IF pS.privilege == 'write' && is_privileged_owner ~%]
                    <div class="small-2 medium-1 columns" role="columnheader">
                        <label title="[%|loc%]Delete[%END%]">
                            <i class="fa fa-user-times"></i>
                        </label>
                    </div>
                [%~ END %]
            </div>

            [% SET oI = 0 ~%]
            [% IF pV.size() ~%]
                [% FOREACH oV = pV ~%]
                    <div class="row" role="row">
                        <div class="small-10 medium-11 columns" id="item.[% pS.name %].[% oI %]">
                            [% FOREACH kS = pS.format ~%]
                                [% NEXT UNLESS pF.${kS.name} ~%]
                                [% NEXT UNLESS kS.privilege == 'read' || kS.privilege == 'write' ~%]

                                <div class="[% pF.${kS.name} %]" role="cell">
                                    [% IF kS.name == 'email' ~%]
                                        <span class="show-for-medium">
                                            [%~ IF pS.name == 'owner' && oV.profile == 'privileged' ~%]
                                                <i class="fa fa-fw fa-star" title="[%|loc%]Privileged owner[%END%]"></i>
                                            [%~ ELSIF pS.name == 'owner' ~%]
                                                <i class="fa fa-fw" title="[%|loc%]Owner[%END%]"></i>
                                            [%~ ELSIF pS.name == 'editor' ~%]
                                                <i class="fa fa-fw" title="[%|loc%]Moderator[%END%]"></i>
                                            [%~ END %]
                                        </span>
                                        [% IF pS.privilege == 'write' && is_privileged_owner ~%]
                                            <a href="[% 'ajax/edit' | url_rel([list,role],{email=>oV.email,previous_action=>action}) %]"
                                               data-reveal-id="edit" data-reveal-ajax="true" class="MainMenuLinks">
                                               [% oV.email %]
                                            </a>
                                        [%~ ELSE ~%]
                                            [% oV.email %]
                                        [%~ END %]
                                    [%~ ELSIF kS.name == 'reception' || kS.name == 'visibility' ~%]
                                        [% oV.${kS.name} | optdesc %]
                                    [%~ ELSE ~%]
                                        [% oV.${kS.name} || '&nbsp;' %]
                                    [%~ END %]
                                </div>
                            [%~ END %]

                            <div class="columns" role="separator">
                                <hr>
                            </div>
                        </div>

                        <div class="small-2 medium-1 columns" role="cell">
                            [% IF is_privileged_owner && oV.subscribed ~%]
                                [% PROCESS EditListArrayDel
                                    ppaths   = [pS.name,oI]
                                    pitem    = pS
                                    labelled = 0
                                    val      = oV.email
                                ~%]
                            [%~ ELSE ~%]
                                &nbsp;
                            [%~ END %]
                        </div>
                    </div>

                    [%~ SET oI = oI + 1 %]
                [%~ END %]
            [%~ ELSE ~%]
                <p class="small-12 medium-8 medium-centered columns alert-box info text-center">
                    [% IF pS.name == 'owner' ~%]
                        [%|loc%]List has no owners[%END%]
                    [%~ ELSIF pS.name == 'editor' ~%]
                        [%|loc%]List has no moderators[%END%]
                    [%~ END %]
                </p>
            [%~ END %]

            [% FOREACH kS = pS.format;
                IF kS.name == 'email' && kS.privilege == 'write';
                    SET is_writable = 1;
                    LAST;
                END;
            END ~%]
            [% IF is_writable && is_privileged_owner ~%]
                <h3>
                    [% IF pS.name == 'owner' ~%]
                    [%|loc%]Add owners[%END%]
                    [%~ ELSIF pS.name == 'editor' ~%]
                        [%|loc%]Add moderators[%END%]
                    [%~ END %]
                </h3>

                <div class="row" id="item.[% pS.name %].[% oI %]" role="row">
                    <div class="small-10 medium-11 columns">
                        [% IF pS.name == 'owner' ~%]
                            <div class="columns show-for-medium" role="cell">
                                <input type="checkbox"
                                       name="single_param.[% pS.name %].[% oI %].profile"
                                       id="param.[% pS.name %].[% oI %].profile"
                                       value="privileged" />
                                <label for="param.[% pS.name %].[% oI %].profile">
                                    [% 'privileged' | optdesc %]
                                </label>
                            </div>
                        [%~ END %]

                        [% FOREACH kS = pS.format ~%]
                            [% NEXT UNLESS pF.${kS.name} ~%]
                            [% NEXT UNLESS kS.privilege == 'read' || kS.privilege == 'write'  ~%]

                            <div class="[% pF.${kS.name} %]" role="cell">
                                [% UNLESS kS.privilege == 'write' ~%]
                                    &nbsp;
                                [%~ ELSIF kS.name == 'reception' ~%]
                                    <input type="checkbox"
                                           name="single_param.[% pS.name %].[% oI %].reception"
                                           id="param.[% pS.name %].[% oI %].reception"
                                           value="nomail" />
                                    <label for="param.[% pS.name %].[% oI %].reception">
                                        [% 'nomail' | optdesc %]
                                    </label>
                                [%~ ELSIF kS.name == 'visibility' ~%]
                                    <input type="checkbox"
                                           name="single_param.[% pS.name %].[% oI %].visibility"
                                           id="param.[% pS.name %].[% oI %].visibility"
                                           value="conceal" />
                                    <label for="param.[% pS.name %].[% oI %].visibility">
                                        [% 'conceal' | optdesc %]
                                    </label>
                                [%~ ELSE ~%]
                                    <label for="param.[% pS.name %].[% oI %].[kS.name ]">
                                        [% IF kS.title ~%]
                                            [% kS.title %]
                                        [%~ ELSE ~%]
                                            [% kS.name %]
                                        [%~ END %]
                                    </label>
                                    <input type="text"
                                           name="single_param.[% pS.name %].[% oI %].[% kS.name %]"
                                           id="param.[% pS.name %].[% oI %].[% kS.name %]" />
                                [%~ END %]
                            </div>
                        [% END ~%]
                    </div>
                </div>
            [%~ END %]

            [% IF pS.privilege == 'write' && is_privileged_owner ~%]
                <input type="hidden" name="submit" value="submit" />
                <input class="MainMenuLInks" type="submit" name="action_review"
455
                       value="[%|loc%]Apply modifications[%END%]" />
Luc Didry's avatar
Luc Didry committed
456
457
458
            [% END ~%]
        </fieldset>
    </form>
459

460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
    [% IF may_include.$role ~%]
        <br />
        <form name="sync_include" action="[% path_cgi %]" method="post">
            <input class="MainMenuLinks heavyWork" type="submit"
                   name="action_sync_include"
                   value="[% IF role == 'owner' ~%]
                       [%|loc%]Synchronize owners with data sources[%END%]
                   [%~ ELSE ~%]
                       [%|loc%]Synchronize moderators with data sources[%END%]
                   [%~ END %]" />
            <input type="hidden" name="list" value="[% list %]"/>
            <input type="hidden" name="role" value="[% role %]"/>
        </form>
    [%~ END %]

Luc Didry's avatar
Luc Didry committed
475
476
477
478
    [%# AJAX modal dialog ~%]
    <div id="edit" class="reveal medium" data-reveal role="dialog"
         aria-labelledby="[%|loc%]View user[%END%]" aria-hidden="true">
        [%# empty div that will display a content by AJAX. ~%]
479
    </div>
Luc Didry's avatar
Luc Didry committed
480
[%~ END #ReviewUsers ~%]
481

482
<!-- end review.tt2 -->