Fixes links to profiles in mailing list administration.
[platal.git] / templates / lists / admin.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2010 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
24 {if !$details.own}
25 <p class='erreur'>
26 Tu n'es pas administrateur de la liste, mais du site.
27 </p>
28 {/if}
29
30 {include file="lists/header_listes.tpl" on=admin}
31
32 <p>
33 Pour inscrire un utilisateur, il faut remplir les champs prévus à cet effet en saisissant un de
34 ses identifiants, de la forme "prenom.nom", ou "prenom.nom.promo" en cas d'homonymie. Pour inscrire plusieurs utilisateurs, les séparer par des espaces.
35 L'icône {icon name=cross title='retirer membre'} permet de désinscrire de la liste quelqu'un
36 qui y était abonné.
37 </p>
38
39 {if t($unregistered)}
40 {if $unregistered|@count neq 0}
41 <h1>Marketing d'utilisateurs non-inscrits</h1>
42
43 <p>
44 {if $unregistered|@count eq 1}
45 L'utilisateur suivant n'est pas inscrit à Polytechnique.org. Tu peux l'y inciter en lui faisant envoyer un email de marketing. Une fois inscrit à Polytechnique.org, l'inscription à la liste lui sera automatiquement proposée.
46 {else}
47 Les utilisateurs suivants ne sont pas inscrits à Polytechnique.org. Tu peux les y inciter en leur faisant envoyer des
48 emails de marketing. Une fois inscrits à Polytechnique.org, l'inscription à la liste leur sera automatique proposée.
49 {/if}
50 <p>
51
52 <script type="text/javascript">
53   {literal}
54   function showEmail(val, login)
55   {
56       var span = document.getElementById("mk_s_mail[" + login + "]");
57       var state = (val == 'marketu' || val == 'markets') ? '' : 'none';
58       span.style.display = state;
59   }
60   {/literal}
61 </script>
62
63 <form method="post" action='{$smarty.server.REQUEST_URI}'>
64   {xsrf_token_field}
65   <table class="bicol">
66   {foreach from=$unregistered key=login item=it}
67     <tr class="{cycle values="pair,impair"}">
68       <td>{$login}</td>
69       <td>
70         Camarade&nbsp;:
71         <select name="mk_uid[{$login}]">
72         {iterate from=$it item=user}
73           <option value="{$user.uid}">{$user.full_name}</option>
74         {/iterate}
75         </select><br />
76         Action*&nbsp;:
77         <select name="mk_action[{$login}]" onchange="showEmail(this.value, '{$login}');">
78           <option value="none">Aucune</option>
79           <option value="marketu">Envoyer un email en ton nom</option>
80           <option value="markets">Envoyer un email au nom de Polytechnique.org</option>
81           <option value="sub">Lui proposer l'inscription</option>
82         </select><br />
83         <span id="mk_s_mail[{$login}]" style="display: none">
84           Email&nbsp;: <input type="text" name="mk_email[{$login}]" value="" />
85         </span>
86       </td>
87     </tr>
88   {/foreach}
89   </table>
90   <p class="center">
91     <input type="submit" name="send_mark" value="Envoyer les marketings !" />
92   </p>
93 </form>
94
95 <p class="smaller">
96   *La dernière action ajoute simplement la liste de diffusion aux abonnements qui seront proposés au camarade
97   lors de son inscription à Polytechnique.org sans pour autant lui envoyer d'email de marketing. Cette action est
98   automatique si tu choisis l'envoi d'email.
99 </p>
100
101 {/if}
102 {/if}
103
104 <h1>
105   modérateurs de la liste
106 </h1>
107
108 <form method='post' action='{$smarty.server.REQUEST_URI}'>
109   {xsrf_token_field}
110   <table class='tinybicol' cellpadding='0' cellspacing='0'>
111     {foreach from=$owners item=users key=alpha}
112     {foreach from=$users item=user name=all}
113     <tr>
114       <td class='titre' style="width: 20%">
115         {if $smarty.foreach.all.first}
116         {if $alpha}{$alpha}{/if}
117         {/if}
118       </td>
119       <td>
120         {if t($user.x)}
121         {if t($user.b)}{assign var=lostUsers value=true}{/if}
122         {profile user=$user.x promo=false}
123         {elseif t($user.x)}
124         <a href="{$platal->ns}member/{$user.x}">{if $user.n|trim}{$x.n}{else}{$user.l}{/if}</a>
125         {elseif t($user.n)}
126         {$user.n}
127         {else}
128         {$user.l}
129         {/if}
130         <a href='{$platal->pl_self(1)}?del_owner={$user.l}&amp;token={xsrf_token}'>{icon name=cross title='retirer modérateur'}</a>
131       </td>
132     </tr>
133     {/foreach}
134     {/foreach}
135     <tr class="pair">
136       <td class='titre'>Ajouter</td>
137       <td>
138         <input type='text' size='30' name='add_owner' />
139         <input type='submit' value='ajouter' />
140       </td>
141     </tr>
142   </table>
143 </form>
144
145
146 <h1>
147   {$np_m|default:"0"} membre{if $np_m > 1}s{/if} dans la liste
148 </h1>
149
150 <form method='post' action='{$smarty.server.REQUEST_URI}' enctype="multipart/form-data">
151   {xsrf_token_field}
152   <table class='bicol' cellpadding='0' cellspacing='0'>
153     {foreach from=$members item=users key=alpha}
154     {foreach from=$users item=user name=all}
155     <tr>
156       <td class='titre' style="width: 20%">
157         {if $smarty.foreach.all.first}
158         {if $alpha}{$alpha}{/if}
159         {/if}
160       </td>
161       <td>
162         {if t($user.x)}
163         {if t($user.b)}{assign var=lostUsers value=true}{/if}
164         {profile user=$user.x promo=false}
165         {elseif t($user.x)}
166         <a href="{$platal->ns}member/{$user.x}">{if $user.n|trim}{$x.n}{else}{$user.l}{/if}</a>
167         {elseif t($user.n)}
168         {$user.n}
169         {else}
170         {$user.l}
171         {/if}
172         <a href='{$platal->pl_self(1)}?del_member={$user.l}&amp;token={xsrf_token}'>{icon name=cross title='retirer membre'}</a>
173       </td>
174     </tr>
175     {/foreach}
176     {/foreach}
177     <tr>
178       <th colspan="2">Ajouter</th>
179     </tr>
180     <tr class="pair">
181       <td class="titre">Liste</td>
182       <td>
183         <input type='text' size='40' name='add_member' />
184       </td>
185     </tr>
186     <tr class="pair">
187       <td class="titre">ou fichier(*)</td>
188       <td>
189         <input type="file" name="add_member_file" />*
190       </td>
191     </tr>
192     <tr class="pair">
193       <td colspan="2" class="center">
194         <input type='submit' value='ajouter' />
195       </td>
196     </tr>
197   </table>
198 </form>
199
200 <div class="smaller">
201  * Le fichier doit contenir une adresse email par ligne. Les X doivent être identifiés par une adresse
202  @polytechnique.org, @m4x.org ou @melix.net/org.
203 </div>
204
205
206 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}