#592: User can unsubscribe from a group
[platal.git] / templates / xnet / groupe / membres-add.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2006 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 <script type="text/javascript">//<![CDATA[
24 {literal}
25 function xStateChange(box)
26 {
27     var state = (box.checked ? '' : 'none');
28     document.getElementById('xnom').style.display = state;
29     document.getElementById('xprenom').style.display = state;
30     document.getElementById('xpromo').style.display = state;
31     document.getElementById('xsearch').style.display = state;
32 }
33
34 var nom;
35 var prenom;
36 var promo;
37 function searchX()
38 {
39     if (document.getElementById('nom').value == nom
40        && document.getElementById('prenom').value == prenom
41        && document.getElementById('promo').value == promo) {
42        return;
43     }
44     var nom = document.getElementById('nom').value;
45     var prenom = document.getElementById('prenom').value;
46     var promo = document.getElementById('promo').value;
47     Ajax.update_html('search_result',
48       '{/literal}{$platal->ns}{literal}member/new/ajax?prenom=' + prenom + '&nom=' + nom + '&promo=' + promo);
49 }
50 {/literal}
51 //]]></script>
52
53 <h1>{$asso.nom} : Ajout d'un membre</h1>
54
55 <form method="post" action="{$platal->ns}member/new/">
56   <ul class='descr'>
57     <li>
58       Pour ajouter un X dans ton groupe, il suffit d'entrer ici une de ses
59       adresses mail @polytechnique.org. Si il n'est pas inscrit à Polytechnique.org
60       coche la case qui se trouve sous le formulaire et indique ses noms, prénoms et
61       promotions.
62     </li>
63     <li>
64       Pour ajouter un extérieur dans ton groupe, il suffit d'entrer ici son
65       adresse mail, tu seras ensuite redirigé vers une page te permettant
66       d'éditer son profil (nom, prenom, ...)
67     </li>
68   </ul>
69   <table class="tinybicol">
70     <tr>
71       <td class="center" colspan="2">
72         <input type="text" name="email" size="40" value="{$platal->argv[1]}" />
73         <input type='submit' value='Ajouter'
74           onclick='this.form.action += this.form.email.value' />
75       </td>
76     </tr>
77     <tr>
78       <td colspan="2">
79         <input type="checkbox" name="x" onchange="xStateChange(this);" />
80         Coche cette case si il s'agit d'un X non inscrit à Polytechnique.org
81       </td>
82     </tr>
83     <tr id="xnom" style="display: none">
84       <td class="titre">Nom :</td>
85       <td><input type="text" id="nom" name="nom" size="20" value="" onkeyup="searchX();" /></td>
86     </tr>
87     <tr id="xprenom" style="display: none">
88       <td class="titre">Prénom :</td>
89       <td><input type="text" id="prenom" name="prenom" size="20" value="" onkeyup="searchX();" /></td>
90     </tr>
91     <tr id="xpromo" style="display: none">
92       <td class="titre">Promotion :</td>
93       <td><input type="text" id="promo" name="promo" size="4" value="" onkeyup="searchX();" /></td>
94     </tr>
95     <tr id="xsearch" style="display: none" class="pair">
96       <td colspan="2" id="search_result">
97         {include file="xnet/groupe/membres-new-search.tpl"}
98       </td>
99     </tr>
100   </table>
101 </form>
102
103 {* vim:set et sw=2 sts=2 sws=2: *}