e42a14ade88de4cc487c33e13f51f3a70ca62b1d
[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, 'jobs[' + 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 function validGeoloc(id, pref)
72 {
73   document.getElementById(id + '_geoloc').style.display = 'none';
74   document.getElementById(id + '_geoloc_error').style.display = 'none';
75   document.getElementById(id + '_geoloc_valid').style.display = 'none';
76   document.forms.prof_annu[pref + "[parsevalid]"].value = "1";
77   document.forms.prof_annu[pref + "[text]"].value = document.forms.prof_annu[pref + "[geoloc]"].value;
78   document.forms.prof_annu[pref + "[cityid]"].value = document.forms.prof_annu[pref + "[geoloc_cityid]"].value;
79   attachEvent(document.forms.prof_annu[pref + "[text]"], "click",
80               function() { document.forms.prof_annu[pref + "[text]"].blur(); });
81   document.forms.prof_annu[pref + "[text]"].className = '';
82 }
83
84 function validAddress(id, pref)
85 {
86   document.getElementById(id + '_geoloc').style.display = 'none';
87   document.getElementById(id + '_geoloc_error').style.display = 'none';
88   document.getElementById(id + '_geoloc_valid').style.display = 'none';
89   document.forms.prof_annu[pref + "[parsevalid]"].value = "1";
90   attachEvent(document.forms.prof_annu[pref + "[text]"], "click",
91               function() { document.forms.prof_annu[pref + "[text]"].blur(); });
92   document.forms.prof_annu[pref + "[text]"].className = '';
93 }
94
95 {/literal}
96 //]]></script>
97
98 {foreach from=$jobs item=job key=i}
99 {include file="profile/jobs.job.tpl" i=$i job=$job new=false}
100 <script type="text/javascript">updateSecteur({$i}, '{"job_`$i`"}', '{"jobs[`$i`]"}', '{$job.ss_secteur}');</script>
101 {/foreach}
102 {if $jobs|@count eq 0}
103 {include file="profile/jobs.job.tpl" i=0 job=0 new=true}
104 <script type="text/javascript">updateSecteur(0, 'job_0', 'jobs[0]', '-1');</script></script>
105 {/if}
106
107 <div id="add_job" class="center">
108   <a href="javascript:addJob()">
109     {icon name=add title="Ajouter un emploi"} Ajouter un emploi
110   </a>
111 </div>
112
113 <table class="bicol" summary="CV" style="margin-top: 1.5em">
114   <tr>
115     <th>
116       Curriculum vitae
117     </th>
118   </tr>
119   <tr>
120     <td>
121       <div style="float: left; width: 25%">
122         <div class="flags">
123           <span class="rouge"><input type="checkbox" name="accesCV" checked="checked" disabled="disabled" /></span>
124           <span class="texte">privé</span>
125         </div>
126         <div class="smaller" style="margin-top: 30px">
127           <a href="Xorg/FAQ?display=light#cv" class="popup_800x480">
128             {icon name="lightbulb" title="Astuce"}Comment remplir mon CV&nbsp;?
129           </a><br />
130           <a href="wiki_help" class="popup3">
131             {icon name=information title="Syntaxe wiki"} Voir la syntaxe wiki
132           </a>
133           <div class="center">
134             <input type="submit" name="preview" value="Aperçu du CV"
135                    onclick="previewWiki('cv',  'cv_preview', true, 'cv_preview'); return false;" />
136           </div>
137         </div>
138       </div>
139       <div style="float: right">
140         <div id="cv_preview" style="display: none"></div>
141         <textarea name="cv" {if $errors.cv}class="error"{/if} id="cv" rows="15" cols="55">{$cv}</textarea>
142       </div>
143     </td>
144   </tr>
145 </table>
146
147 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}