sympa-docker/whitelist-1.1/web_tt2/search.tt2

448 lines
15 KiB
Plaintext

<!-- review.tt2 -->
[% IF !page || page.match('^\d*$') ~%]
[% PROCESS ReviewMembers ~%]
[%~ ELSIF page == 'owner' ~%]
[% PROCESS ReviewUsers
role = page
users = owners %]
[%~ ELSIF page == 'editor' ~%]
[% PROCESS ReviewUsers
role = page
users = editors %]
[%~ END %]
[%~ BLOCK ReviewMembers # (members) ~%]
[% IF is_owner %]
<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>
<a class="actionMenuLinks" href="[% path_cgi %]/lca/modlist/[% list %]">[%|loc%]Modlist[%END%]</a>
<a class="actionMenuLinks" href="[% path_cgi %]/lca/whitelist/[% list %]">[%|loc%]Whitelist[%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>
[% END %]
<a class="actionMenuLinks" href="[% 'show_exclude' | url_rel([list]) %]">[%|loc%]Exclude[%END%]</a>
<br />
[% IF may_sync %]
<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 %]"/>
</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 %]" />
</form>
<hr>
[%# 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>
<div>
<input id="quietly" type="checkbox" name="quiet" />
<label for="quietly">
[%|loc%]Quiet (don't send welcome email)[%END%]
</label>
</div>
<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 %]
[% END %]
<h3>[%|loc%]Search for a User[%END%]</h3>
<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>
<hr>
<h3>[%|loc%]Subscriber Table[%END%]</h3>
<form class="toggleContainer" data-toggle-selector="input[name='email']"
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 %]
[% 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 %]
[% END %]
[% IF total != 0 %]
[% IF is_owner %]
<div>
<input class="MainMenuLinks toggleButton" type="button"
value="[%|loc%]Toggle Selection[%END%]" />
</div>
<div>
<input class="MainMenuLinks" 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 #ReviewMembers %]
[%~ BLOCK ReviewUsers # (role,users) ~%]
[% 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'
~%]
<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"
value="[%|loc%]Update[%END%]" />
[% END ~%]
</fieldset>
</form>
[%# AJAX modal dialog ~%]
<div id="edit" class="reveal medium" data-reveal
aria-labelledby="[%|loc%]View user[%END%]" aria-hidden="true"
role="dialog">
[%# empty div that will display a content by AJAX. ~%]
</div>
[%~ END#ReviewUsers ~%]
<!-- end review.tt2 -->