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