Load jquery.js on all pages.
[platal.git] / templates / lists / moderate.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2008 Polytechnique.org                             *}
4 {*  http://opensource.polytechnique.org/                                  *}
5 {*                                                                        *}
6 {*  This program is free software; you can redistribute it and/or modify  *}
7 {*  it under the terms of the GNU General Public License as published by  *}
8 {*  the Free Software Foundation; either version 2 of the License, or     *}
9 {*  (at your option) any later version.                                   *}
10 {*                                                                        *}
11 {*  This program is distributed in the hope that it will be useful,       *}
12 {*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
13 {*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
14 {*  GNU General Public License for more details.                          *}
15 {*                                                                        *}
16 {*  You should have received a copy of the GNU General Public License     *}
17 {*  along with this program; if not, write to the Free Software           *}
18 {*  Foundation, Inc.,                                                     *}
19 {*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
20 {*                                                                        *}
21 {**************************************************************************}
22
23 {include file="lists/header_listes.tpl" on=moderate}
24
25 <h1>
26   Inscriptions en attente de modération
27 </h1>
28
29 {if $subs|@count}
30 <table class='bicol' cellpadding='0' cellspacing='0'>
31   <tr>
32     <th>Nom</th>
33     <th>Adresse</th>
34     <th></th>
35   </tr>
36   {foreach from=$subs item=s}
37   <tr class='{cycle values="pair,impair"}'>
38     <td>{$s.name}{if $s.login}
39       <a href="profile/{$s.login}" class="popup2">{*
40         *}{icon name=user_suit title="Afficher la fiche"}</a>
41       {/if}
42     </td>
43     <td>{$s.addr}</td>
44     <td class='action'>
45       <a href='{$platal->pl_self(1)}?sadd={$s.id}'>{icon name=add title="Valider l'inscription"}</a>
46       <a href='{$platal->pl_self(1)}?sid={$s.id}'>{icon name=delete title="Refuser l'inscription"}</a>
47     </td>
48   </tr>
49   {/foreach}
50 </table>
51 {else}
52 <p>Il n'y a pas d'inscriptions en attente de modération.</p>
53 {/if}
54
55 <h1>
56   Mails en attente de modération
57 </h1>
58
59 {if $mails|@count}
60 <ul>
61   <li>
62   <strong>{icon name=add}accepter&nbsp;:</strong> le mail est immédiatement libéré, et envoyé à la
63   liste.
64   </li>
65   <li>
66   <strong>{icon name=magnifier}refuser&nbsp;:</strong> pour refuser un mail, suivre le lien {icon name=magnifier} et
67   remplir le formulaire en bas de page.
68   </li>
69   <li>
70   <strong>{icon name=delete}spam&nbsp;:</strong> le mail est effacé sans autre forme de procès.
71   N'utiliser <strong>QUE</strong> pour les virus et les courriers indésirables. <br/>
72   </li>
73 </ul>
74 <p>
75   S'il y a trop d'indésirables, il est probablement plus rapide pour la suite de les
76   jeter directement et non de les modérer en modifant le réglage de
77   l'<a href="{$platal->ns}lists/options/{$platal->argv[1]}#antispam">antispam</a>.
78 </p>
79
80 <script type="text/javascript">//<![CDATA[
81 {literal}
82 var toggleState = false;
83 function toggleAll() {
84   toggleState = !toggleState;
85   var boxes = $(":checkbox.moderate_email");
86   if (toggleState) {
87     boxes.attr("checked", "checked");
88   } else {
89     boxes.removeAttr("checked");
90   }
91 }
92 {/literal}
93 //]]></script>
94
95 <form method="post" action="{$platal->pl_self(1)}">
96 {if $with_fromx}
97 <table class="bicol" style="margin-bottom: 1ex">
98   <tr>
99     <th colspan="2"></th>
100     <th>Mail</th>
101     <th>Infos</th>
102     <th colspan="2"></th>
103   </tr>
104   <tr>
105     <th class="smaller" colspan="6">
106       Les mails suivants proviennent d'adresses identifiées comme étant celles de camarades.
107     </th>
108   </tr>
109   {foreach from=$mails item=m name=mail}
110   {if $m.fromx}
111   <tr class='{cycle values="pair,impair"}'>
112     <td class="checkboxToggle">
113       <input type="checkbox" name="select_mails[{$m.id}]" {if $smarty.foreach.mail.total eq 1}checked="checked"{/if}/>
114     </td>
115     <td class="checkboxToggle">
116       <strong>De&nbsp;:</strong><br />
117       <strong>Sujet&nbsp;:</strong>
118     </td>
119     <td class="checkboxToggle">
120       {$m.sender}<br />
121       {$m.subj|hdc|smarty:nodefaults}
122     </td>
123     <td class='right checkboxToggle'>
124       <small>le {$m.stamp|date_format:"%x"} à {$m.stamp|date_format:"%X"}<br />
125       {$m.size} octets</small>
126     </td>
127     <td class='action'>
128       <a href='{$platal->pl_self(1)}?mid={$m.id}&amp;mok=1'>{icon name=add title="Accepter le message"}</a>
129     </td>
130     <td class='action'>
131       <a href='{$platal->pl_self(1)}?mid={$m.id}'>{icon name=magnifier title="Voir le message"}</a><br/>
132       <a href='{$platal->pl_self(1)}?mid={$m.id}&amp;mdel=1'>{icon name=delete title="Spam !"}</a>
133     </td>
134   </tr>
135   {/if}
136   {/foreach}
137 </table>
138 {/if}
139
140 {if $with_nonfromx}
141 <table class='bicol' cellpadding='0' cellspacing='0'>
142   <tr>
143     <th>
144       <a href="javascript:toggleAll()">{icon name="arrow_refresh" title="Tout (dé)cocher"}</a>
145     </th>
146     <th></th>
147     <th>Mail</th>
148     <th>Infos</th>
149     <th colspan="2"></th>
150   </tr>
151   {foreach from=$mails item=m name=mail}
152   {if !$m.fromx}
153   <tr class='{cycle values="pair,impair"}'>
154     <td class="checkboxToggle">
155       <input type="checkbox" class="moderate_email" name="select_mails[{$m.id}]" {if $smarty.foreach.mail.total eq 1}checked="checked"{/if}/>
156     </td>
157     <td class='checkboxToggle'>
158       <strong>De&nbsp;:</strong><br />
159       <strong>Sujet&nbsp;:</strong>
160     </td>
161     <td class='checkboxToggle'>
162       {$m.sender}<br />
163       {$m.subj|hdc|smarty:nodefaults}
164     </td>
165     <td class='right checkboxToggle'>
166       <small>le {$m.stamp|date_format:"%x"} à {$m.stamp|date_format:"%X"}<br />
167       {$m.size} octets</small>
168     </td>
169     <td class='action'>
170       <a href='{$platal->pl_self(1)}?mid={$m.id}&amp;mok=1'>{icon name=add title="Accepter le message"}</a>
171     </td>
172     <td class='action'>
173       <a href='{$platal->pl_self(1)}?mid={$m.id}'>{icon name=magnifier title="Voir le message"}</a><br/>
174       <a href='{$platal->pl_self(1)}?mid={$m.id}&amp;mdel=1'>{icon name=delete title="Spam !"}</a>
175     </td>
176   </tr>
177   {/if}
178   {/foreach}
179 </table>
180 {/if}
181
182 <script type="text/javascript">//<![CDATA[
183 {literal}
184 $('.checkboxToggle').click(function (event)
185   {
186     // Don't uncheck the checkbox when clicking it
187     if (event.target.tagName === 'INPUT') {
188       return;
189     }
190     
191     var checkbox = $(this).parent().find(':checkbox');
192     
193     checkbox = checkbox.attr('checked', !checkbox.attr('checked'));
194     
195     event.stopPropagation();
196   });
197 {/literal}
198 //]]></script>
199
200 <p class="center desc">
201   Utilise ces boutons pour appliquer une action à tous les mails sélectionnés.<br />
202   <input type="hidden" name="moderate_mails" value="1" />
203   <input type="submit" name="mok" value="Accepter" />
204   <input type="submit" name="mdel" value="Spam !" />
205 </p>
206 </form>
207 {else}
208 <p>Il n'y a pas de mails en attente de modération.</p>
209 {/if}
210
211
212 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}