Use 'Animateur' instead of 'Administrateur' to describe the group-level administratio...
[platal.git] / templates / emails / redirect.tpl
index 6277330..83cf386 100644 (file)
       var remove = $(".active_email:checked");
       if (remove.length <= 1) {
         remove.attr("disabled", "disabled");
+        remove.parent('td').parent('tr').children('td').children('.remove_email').hide();
       } else {
         remove.removeAttr("disabled");
+        $('.remove_email').show();
       }
     }
 
           $.get(link.href, {},function() {
             $('tr[@id=line_' + email.replace('@', '_at_') + ']').remove();
             showRemove();
+            activeEnable();
           });
         }
         return false;
         }
     }
 
+    function updateRedirect(checked, email)
+    {
+        activeEnable();
+        Ajax.update_html(null, 'emails/redirect/' + (checked ? '' : 'in') + 'active/' + email, redirectUpdate);
+    }
+
     {/literal}
   //]]></script>
   {javascript name="jquery"}
           <input type="checkbox" value="{$e->email}" {if $e->sufficient}class="active_email"{/if}
                  {if $e->active}checked="checked"{/if}
                  {if $smarty.foreach.redirect.total eq 1}disabled="disabled"{/if}
-                 onchange="Ajax.update_html(null,'{$globals->baseurl}/emails/redirect/'+(this.checked?'':'in')+'active/{$e->email}', redirectUpdate)" /></td>
+                 onchange="updateRedirect(this.checked, '{$e->email}')" /></td>
         <td>
           {if $e->has_rewrite()}
           <select onchange="Ajax.update_html(null,'emails/redirect/rewrite/{$e->email}/'+this.value, redirectUpdate)">
         </td>
       </tr>
       {/foreach}
-      <script type="text/javascript">activeEnable(); showRemove();</script>
       <tr class="{cycle values="pair,impair"}"><td colspan="4">
         <form action="emails/redirect" method="post">
         <div>
           Ajouter une adresse email&nbsp;:
           <input type="text" size="35" maxlength="60" name="email" value="" />
           &nbsp;&nbsp;<input type="submit" value="ajouter" name="emailop" />
+          {xsrf_token_field}
         </div>
         </form>
       </td></tr>
     </table>
+    <script type="text/javascript">showRemove(); activeEnable();</script>
   </div>
 {if $panne}
 <p class="smaller">
     {if $googleapps eq 'active'}
     <td>
       <a href="googleapps">
-        <strong>Compte GMail / Google Apps</strong>
+        <strong>Compte Google Apps / Polytechnique.org</strong>
       </a><br />Hébergé par Google
     </td>
     <td style="text-align: center; vertical-align: middle">
       {if $googleapps eq 'disabled'}
       Ton compte Google Apps est actuellement inactif.<br />
       {else}
-      Tu n'as pas encore de compte Google Apps sur Polytechnique.org.<br />
+      Tu n'as pas encore de compte Google Apps pour Polytechnique.org.<br />
       {/if}
       <a href="googleapps">Plus d'informations &hellip;</a>
     </td>