f0bfd77a1c78427cdd251626d45462342b0d87e4
[platal.git] / templates / profile / jobs.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 <script type="text/javascript">//<![CDATA[
24 {literal}
25
26 function removeJob(id, pref)
27 {
28   document.getElementById(id + '_cont').style.display = 'none';
29   if (document.forms.prof_annu[pref + '[new]'].value == '0') {
30     document.getElementById(id + '_grayed').style.display = '';
31     document.getElementById(id + '_grayed_name').innerHTML =
32       document.forms.prof_annu[pref + "[name]"].value.replace('<', '&lt;');
33   }
34   document.forms.prof_annu[pref + "[removed]"].value = "1";
35 }
36
37 function restoreJob(id, pref)
38 {
39   document.getElementById(id + '_cont').style.display = '';
40   document.getElementById(id + '_grayed').style.display = 'none';
41   document.forms.prof_annu[pref + "[removed]"].value = "0";
42 }
43
44 function updateSecteur(nb, id, pref, sel)
45 {
46   var secteur = document.forms.prof_annu[pref + '[secteur]'].value;
47   if (secteur == '') {
48     secteur = '-1';
49   }
50   Ajax.update_html(id + '_ss_secteur', 'profile/ajax/secteur/' +nb + '/' + secteur + '/' + sel);
51 }
52
53 function makeAddJob(id)
54 {
55   return function(data)
56          {
57            $('#add_job').before(data);
58            updateSecteur('job_' + id, 'job[' + id + ']', '');
59          };
60 }
61
62 function addJob()
63 {
64   var i = 0;
65   while (document.getElementById('job_' + i) != null) {
66     ++i;
67   }
68   $.get(platal_baseurl + 'profile/ajax/job/' + i, makeAddJob(i));
69 }
70
71 {/literal}
72 //]]></script>
73
74 {foreach from=$entreprises item=job key=i}
75 {include file="profile/jobs.job.tpl" i=$i job=$job new=false}
76 <script type="text/javascript">updateSecteur({$i}, '{"job_`$i`"}', '{"job[`$i`]"}', '{$job.ss_secteur}');</script>
77 {/foreach}
78 {if $jobs|@count eq 0}
79 {include file="profile/jobs.job.tpl" i=0 job=0 new=true}
80 <script type="text/javascript">updateSecteur(0, 'job_0', 'job[0]', '-1');</script></script>
81 {/if}
82
83 <div id="add_job" class="center">
84   <a href="javascript:addJob()">
85     {icon name=add title="Ajouter un emploi"} Ajouter un emploi
86   </a>
87 </div>
88
89 <table class="bicol" summary="CV" style="margin-top: 1.5em">
90   <tr>
91     <th>
92       Curriculum vitae
93     </th>
94   </tr>
95   <tr>
96     <td>
97       <div style="float: left; width: 25%">
98         <div class="flags">
99           <span class="rouge"><input type="checkbox" name="accesCV" checked="checked" disabled="disabled" /></span>
100           <span class="texte">privé</span>
101         </div>
102         <div class="smaller" style="margin-top: 30px">
103           <a href="Xorg/FAQ?display=light#cv" class="popup_800x480">
104             {icon name="lightbulb" title="Astuce"}Comment remplir mon CV&nbsp;?
105           </a><br />
106           <a href="wiki_help" class="popup3">
107             {icon name=information title="Syntaxe wiki"} Voir la syntaxe wiki
108           </a>
109           <div class="center">
110             <input type="submit" name="preview" value="Aperçu du CV"
111                    onclick="previewWiki('cv',  'cv_preview', true, 'cv_preview'); return false;" />
112           </div>
113         </div>
114       </div>
115       <div style="float: right">
116         <div id="cv_preview" style="display: none"></div>
117         <textarea name="cv" id="cv" rows="15" cols="55">{$cv}</textarea>
118       </div>
119     </td>
120   </tr>
121 </table>
122
123 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}