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