Allows research on NL subscription using UFC_NLSubscribed.
[platal.git] / templates / xnetgrp / membres-add.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2011 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     $('#search_result').updateHtml('{/literal}{$platal->ns}{literal}member/new/ajax?login='
33                                   + $('#email').val());
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     $('#search_result').updateHtml('{/literal}{$platal->ns}{literal}member/new/ajax?prenom=' + prenom + '&nom=' + nom + '&promo=' + promo);
50 }
51 {/literal}
52 //]]></script>
53
54 <h1>{$asso->nom}&nbsp;: Ajout d'un membre</h1>
55
56 <form method="post" action="{$platal->ns}member/new/">
57   {xsrf_token_field}
58   <ul class='descr'>
59     <li>
60       Pour ajouter un X dans ton groupe, il suffit d'entrer ici une de ses
61       adresses email @polytechnique.org. S'il n'est pas inscrit à Polytechnique.org
62       coche la case qui se trouve sous le formulaire et indique ses noms, prénoms et
63       promotions.
64     </li>
65     <li>
66       Pour ajouter un extérieur dans ton groupe, il suffit d'entrer ici son
67       adresse email, tu seras ensuite redirigé vers une page te permettant
68       d'éditer son profil (nom, prenom&hellip;).
69     </li>
70   </ul>
71   <table class="tinybicol">
72     <tr>
73       <td class="center" colspan="2">
74         <input type="text" id="email" name="email" size="40" value="{if t($platal->argv[1])}{$platal->argv[1]}{/if}" />
75         <input type="hidden" name="force_continue" value="{if t($force_continue)}1{else}0{/if}" />
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         {* TODO: adapts text for masters and doctorates when required. *}
84         <label for="x">Coche cette case s'il s'agit d'un X ou un master ou doctorant de l'X non inscrit à Polytechnique.org.</label>
85       </td>
86     </tr>
87     <tr id="xnom" style="display: none">
88       <td class="titre">Nom&nbsp;:</td>
89       <td><input type="text" id="nom" name="nom" size="20" value="" onkeyup="searchX();" /></td>
90     </tr>
91     <tr id="xprenom" style="display: none">
92       <td class="titre">Prénom&nbsp;:</td>
93       <td><input type="text" id="prenom" name="prenom" size="20" value="" onkeyup="searchX();" /></td>
94     </tr>
95     <tr id="xpromo" style="display: none">
96       <td class="titre">Promotion&nbsp;:</td>
97       {* TODO: add examples for masters and doctorates when required. *}
98       <td><input type="text" id="promo" name="promo" size="4" value="" onkeyup="searchX();" /> <small>(X2004)</small></td>
99     </tr>
100     <tr id="xsearch" style="display: none" class="pair">
101       <td colspan="2" id="search_result">
102         {include file="xnetgrp/membres-new-search.tpl"}
103       </td>
104     </tr>
105   </table>
106 </form>
107
108 {literal}
109 <script type="text/javascript">
110   $("#email").focus();
111 </script>
112 {/literal}
113
114 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}