The skill 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           {/if}
84           <option value="{$comp.id}">{$comp.text_fr}</option>
85           {/iterate}
86           {if $ingroup}</optgroup>{/if}
87         </select>
88         <span id="competences_add" style="display: none">
89           <a href="javascript:add('competences')">{icon name=add title="Ajouter cette compétence"}</a>
90         </span>
91       </div>
92     </td>
93   </tr>
94   <tr class="pair">
95     <td id="competences">
96       {foreach from=$competences item=competence key=id}
97       {include file="profile/skill.skill.tpl" cat='competences' skill=$competence id=$id levels=$comp_level}
98       {/foreach}
99     </td>
100   </tr>
101 </table>
102
103 <table class="bicol">
104   <tr>
105     <th>Compétences linguistiques</th>
106   </tr>
107   <tr>
108     <td>
109       <div class="flags">
110         <span class="rouge"><input type="checkbox" name="accesX" checked="checked" disabled="disabled" /></span>
111         <span class="texte">privé</span>
112       </div>
113       <div>
114         <span class="titre">Domaine&nbsp;:</span>
115         <select name="langues_sel" onchange="update('langues')">
116           <option value=""></option>
117           {iterate from=$lang_list item=lang}
118           <option value="{$lang.id}">{$lang.langue_fr}</option>
119           {/iterate}
120         </select>
121         <span id="langues_add" style="display: none">
122           <a href="javascript:add('langues')">{icon name=add title="Ajouter cette langue"}</a>
123         </span>
124       </div>
125     </td>
126   </tr>
127   <tr class="pair">
128     <td id="langues">
129       {foreach from=$langues item=langue key=id}
130       {include file="profile/skill.skill.tpl" cat='langues' skill=$langue id=$id levels=$lang_level}
131       {/foreach}
132     </td>
133   </tr>
134  </table>
135
136 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}