Mentor page
[platal.git] / templates / profile / skill.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2007 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 <script type="text/javascript">//<![CDATA[
25 {literal}
26
27 function update(cat)
28 {
29   var val  = document.forms.prof_annu[cat + '_sel'].value;
30   var show = true;
31   if (val == '') {
32     show = false;
33   }
34   if (document.getElementById(cat + '_' + val) != null) {
35     show = false;
36   }
37   document.getElementById(cat + '_add').style.display = show ? '' : 'none';
38 }
39
40 function add(cat)
41 {
42   var sel  = document.forms.prof_annu[cat + '_sel'];
43   var val  = sel.value;
44   var text = sel.options[sel.selectedIndex].text;
45   $.get(platal_baseurl + 'profile/ajax/skill/' + cat + '/' + val,
46         function(data) {
47           $('#' + cat).append(data);
48           document.getElementById(cat + '_' + val + '_title').innerHTML = text;
49           update(cat);
50         });
51 }
52
53 function remove(cat, id)
54 {
55   $('#' + cat + '_' + id).remove();
56   update(cat);
57 }
58
59 {/literal}
60 //]]></script>
61
62 <table class="bicol" style="margin-bottom: 1em">
63   <tr>
64     <th>
65       Compétences professionnelles
66     </th>
67   </tr>
68   <tr>
69     <td>
70       <div class="flags">
71         <span class="rouge"><input type="checkbox" name="accesX" checked="checked" disabled="disabled" /></span>
72         <span class="texte">privé</span>
73       </div>
74       <div>
75         <span class="titre">Domaine&nbsp;:</span>
76         <select name="competences_sel" onchange="update('competences')">
77           <option value=""></option>
78           {assign var=ingroup value=false}
79           {iterate from=$comp_list item=comp}
80           {if $comp.title}
81           {if $ingroup}</optgroup>{/if}
82           <optgroup label="{$comp.text_fr}">
83           {assign var=ingroup value=true}
84           {/if}
85           <option value="{$comp.id}">{$comp.text_fr}</option>
86           {/iterate}
87           {if $ingroup}</optgroup>{/if}
88         </select>
89         <span id="competences_add" style="display: none">
90           <a href="javascript:add('competences')">{icon name=add title="Ajouter cette compétence"}</a>
91         </span>
92       </div>
93     </td>
94   </tr>
95   <tr class="pair">
96     <td id="competences">
97       {foreach from=$competences item=competence key=id}
98       {include file="profile/skill.skill.tpl" cat='competences' skill=$competence id=$id levels=$comp_level}
99       {/foreach}
100     </td>
101   </tr>
102 </table>
103
104 <table class="bicol">
105   <tr>
106     <th>Compétences linguistiques</th>
107   </tr>
108   <tr>
109     <td>
110       <div class="flags">
111         <span class="rouge"><input type="checkbox" name="accesX" checked="checked" disabled="disabled" /></span>
112         <span class="texte">privé</span>
113       </div>
114       <div>
115         <span class="titre">Domaine&nbsp;:</span>
116         <select name="langues_sel" onchange="update('langues')">
117           <option value=""></option>
118           {iterate from=$lang_list item=lang}
119           <option value="{$lang.id}">{$lang.langue_fr}</option>
120           {/iterate}
121         </select>
122         <span id="langues_add" style="display: none">
123           <a href="javascript:add('langues')">{icon name=add title="Ajouter cette langue"}</a>
124         </span>
125       </div>
126     </td>
127   </tr>
128   <tr class="pair">
129     <td id="langues">
130       {foreach from=$langues item=langue key=id}
131       {include file="profile/skill.skill.tpl" cat='langues' skill=$langue id=$id levels=$lang_level}
132       {/foreach}
133     </td>
134   </tr>
135  </table>
136
137 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}