Convert uses of XDB::(..., $flags->flags()) to XDB::(..., $flags)
[platal.git] / templates / lists / moderate.tpl
index a8ecdd2..7bd86d0 100644 (file)
@@ -49,7 +49,7 @@
   {/foreach}
 </table>
 {else}
-<p>pas d'inscriptions en attente de modération</p>
+<p>Il n'y a pas d'inscriptions en attente de modération.</p>
 {/if}
 
 <h1>
@@ -77,7 +77,6 @@
   l'<a href="{$platal->ns}lists/options/{$platal->argv[1]}#antispam">antispam</a>.
 </p>
 
-{javascript name="jquery"}
 <script type="text/javascript">//<![CDATA[
 {literal}
 var toggleState = false;
@@ -110,18 +109,18 @@ function toggleAll() {
   {foreach from=$mails item=m name=mail}
   {if $m.fromx}
   <tr class='{cycle values="pair,impair"}'>
-    <td>
+    <td class="checkboxToggle">
       <input type="checkbox" name="select_mails[{$m.id}]" {if $smarty.foreach.mail.total eq 1}checked="checked"{/if}/>
     </td>
-    <td>
+    <td class="checkboxToggle">
       <strong>De&nbsp;:</strong><br />
       <strong>Sujet&nbsp;:</strong>
     </td>
-    <td>
+    <td class="checkboxToggle">
       {$m.sender}<br />
       {$m.subj|hdc|smarty:nodefaults}
     </td>
-    <td class='right'>
+    <td class='right checkboxToggle'>
       <small>le {$m.stamp|date_format:"%x"} à {$m.stamp|date_format:"%X"}<br />
       {$m.size} octets</small>
     </td>
@@ -152,18 +151,18 @@ function toggleAll() {
   {foreach from=$mails item=m name=mail}
   {if !$m.fromx}
   <tr class='{cycle values="pair,impair"}'>
-    <td>
+    <td class="checkboxToggle">
       <input type="checkbox" class="moderate_email" name="select_mails[{$m.id}]" {if $smarty.foreach.mail.total eq 1}checked="checked"{/if}/>
     </td>
-    <td>
+    <td class='checkboxToggle'>
       <strong>De&nbsp;:</strong><br />
       <strong>Sujet&nbsp;:</strong>
     </td>
-    <td>
+    <td class='checkboxToggle'>
       {$m.sender}<br />
       {$m.subj|hdc|smarty:nodefaults}
     </td>
-    <td class='right'>
+    <td class='right checkboxToggle'>
       <small>le {$m.stamp|date_format:"%x"} à {$m.stamp|date_format:"%X"}<br />
       {$m.size} octets</small>
     </td>
@@ -180,6 +179,24 @@ function toggleAll() {
 </table>
 {/if}
 
+<script type="text/javascript">//<![CDATA[
+{literal}
+$('.checkboxToggle').click(function (event)
+  {
+    // Don't uncheck the checkbox when clicking it
+    if (event.target.tagName === 'INPUT') {
+      return;
+    }
+    
+    var checkbox = $(this).parent().find(':checkbox');
+    
+    checkbox = checkbox.attr('checked', !checkbox.attr('checked'));
+    
+    event.stopPropagation();
+  });
+{/literal}
+//]]></script>
+
 <p class="center desc">
   Utilise ces boutons pour appliquer une action à tous les mails sélectionnés.<br />
   <input type="hidden" name="moderate_mails" value="1" />
@@ -188,7 +205,7 @@ function toggleAll() {
 </p>
 </form>
 {else}
-<p>pas de mails en attente de modération</p>
+<p>Il n'y a pas de mails en attente de modération.</p>
 {/if}