The skill page
[platal.git] / templates / profile / skill.tpl
CommitLineData
0337d704 1{**************************************************************************}
2{* *}
5ddeb07c 3{* Copyright (C) 2003-2007 Polytechnique.org *}
0337d704 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
f25e1a56 24<script type="text/javascript">//<![CDATA[
0337d704 25{literal}
0337d704 26
f25e1a56
FB
27function 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}
0337d704 39
f25e1a56
FB
40function 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
53function remove(cat, id)
54{
55 $('#' + cat + '_' + id).remove();
56 update(cat);
57}
0337d704 58
0337d704 59{/literal}
f25e1a56 60//]]></script>
0337d704 61
f25e1a56
FB
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')">
0337d704 77 <option value=""></option>
f25e1a56
FB
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}
0337d704 87 </select>
f25e1a56
FB
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>
0337d704 102
f25e1a56
FB
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')">
0337d704 116 <option value=""></option>
f25e1a56
FB
117 {iterate from=$lang_list item=lang}
118 <option value="{$lang.id}">{$lang.langue_fr}</option>
119 {/iterate}
0337d704 120 </select>
f25e1a56
FB
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>
0337d704 135
a7de4ef7 136{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}