Can set events as being important
[platal.git] / templates / events / index.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 {if $ask_naissance}
24
25 {include file='include/form_naissance.tpl'}
26
27 {else}
28
29 <h1 id='pagetop'>
30 Bienvenue {$smarty.session.prenom}
31 {if $birthday}
32   et joyeux anniversaire de {$birthday} ans de la part de toute l'équipe !
33 {else}
34 :o)
35 {/if}
36 </h1>
37
38 {if $smarty.session.host}
39 <div class="smaller">
40   Ta connexion précédente date du
41   <strong>{$smarty.session.lastlogin|date_format:"%x, %X"}</strong>
42   depuis la machine <strong>{$smarty.session.host}</strong>
43 </div>
44 {/if}
45
46 {if $smarty.session.no_redirect}
47 <p class="erreur">
48   Tu n'as plus de redirection valide ce qui rend ton adresse Polytechnique.org
49   inutilisable. Rend-toi au plus vite sur <a href="emails/redirect">la page de 
50   gestion des emails</a> pour corriger ce problème.
51 </p>
52 {/if}
53
54 {if $smarty.session.mx_failures|@count}
55 <fieldset>
56   <legend>{icon name=error}Des problèmes sont actuellement recontrés sur tes redirections suivantes</legend>
57   {foreach from=$smarty.session.mx_failures item=mail}
58   <div>
59     <span class="erreur">{$mail.mail}</span>
60     <div class="explication">{$mail.text}</div>
61   </div>
62 {/foreach}
63 </fieldset>
64 {/if}
65
66   
67 {if $fiche_incitation}
68   <p>La dernière mise à jour de ta
69   <a href="profile/{$smarty.session.forlife}" class="popup2">fiche</a>
70   date du {$fiche_incitation|date_format}.
71   Il est possible qu'elle ne soit pas à jour.
72   Si tu souhaites la modifier, <a href="profile/edit">clique ici !</a>
73   </p>
74 {/if}
75
76 {if $photo_incitation}
77   <p>
78     Tu n'as pas mis de photo de toi sur ta fiche, c'est dommage.
79     Clique <a href="photo/change">ici</a> si tu souhaites en ajouter une.
80   </p>
81 {/if}
82
83 {if $geoloc_incitation > 0}
84   <p>
85     Parmi tes adresses, il y en a {$geoloc_incitation} que nous n'avons pas pu localiser.
86     Clique <a href="profile/edit/adresses">ici</a> pour rectifier.
87   </p>
88 {/if}
89
90 {include file="include/tips.tpl" full=true}
91   
92   <table class="bicol">
93     <tr>
94       <th>
95         {if $smarty.session.core_rss_hash}
96         <a href='rss/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}/rss.xml' style="display:block;float:right">
97           {icon name=feed title='fil rss'}
98         </a>
99         {else}
100         <a href='prefs/rss?referer=events'  style="display:block;float:right">
101           {icon name=feed_add title='Activer mon fil rss'}
102         </a>
103        {/if}
104         Sommaire des informations événementielles
105       </th>
106     </tr>
107     {foreach from=$events name=events key=category item=evenement}
108     {if $smarty.foreach.events.total neq 1}
109     <tr class="pair" style="height: 18px">
110       <td class="half titre" style="height: 18px; padding-top: 1px; padding-bottom: 1px;">
111         {if $category eq 'important'}
112           {icon name=error} Informations prioritaires&nbsp;:
113         {elseif $category eq 'news'}
114           {icon name=bell} Nouvelles annonces&nbsp;:
115         {elseif $category eq 'end'}
116           {icon name=clock} Dernières minutes&nbsp;:
117         {else}
118           {icon name=magnifier} Mais encore...
119         {/if}
120       </td>
121     </tr>
122     {/if}
123     {iterate item=ev from=$evenement.summary}
124     <tr class="impair">
125       <td class="half">
126         &bull;
127         <a href="events{if !$ev.nonlu}/unread/{$ev.id}{else}#newsid{$ev.id}{/if}" id="link-evt{$ev.id}">
128         {if $ev.nonlu}<strong>{/if}
129          {tidy}
130            {$ev.titre|nl2br}
131          {/tidy}
132         {if $ev.nonlu}</strong>{/if}
133         </a>
134       </td>
135     </tr>
136     {assign var="has_evts" value=true}
137     {/iterate}
138     {/foreach}
139     {if !$has_evts}
140     <tr>
141       <td class="half">Aucun article actuellement</td>
142     </tr>
143     {/if}
144   </table>
145
146   <script type="text/javascript">
147   {literal}
148   function readEvent(id) {
149         document.getElementById('content-evt'+id).style.display='none';
150         var link = document.getElementById('link-evt'+id);
151         link.setAttribute('href','events/unread/'+id);
152         for (var i=0; i < link.childNodes.length; i++)
153         if (link.childNodes[i].nodeName == 'STRONG') {
154                 link.replaceChild(link.childNodes[i].firstChild,link.childNodes[i]);
155         }
156         Ajax.update_html(null, 'events/read/'+id);
157         return false;
158   }
159   {/literal}
160   </script>
161  
162   {foreach from=$events key=category item=evenement}
163   {iterate item=ev from=$evenement.events}
164   <div id="content-evt{$ev.id}">
165   <br />
166
167   <table class="bicol">
168     <tr>
169       <th>
170         <div style="float: left">
171           {if $category eq 'important'}
172             {icon name=error title="Important"}
173           {elseif $category eq 'news'}
174             {icon name=bell title="Nouvelle annonce"}
175           {elseif $category eq 'end'}
176             {icon name=clock title="Bientôt fini"}
177           {else}
178             {icon name=magnifier title="Annonce"}
179           {/if}
180         </div>
181         <div style="float:right">
182           {if $smarty.session.perms->hasFlag('admin')}
183           <a href="admin/events/edit/{$ev.id}">{icon name=page_edit title="Editer cet article"}</a>
184           {/if}
185           <a href="events/read/{$ev.id}{if $previd}/newsid{$previd}{/if}" onclick="return readEvent('{$ev.id}')">{icon name=cross title="Cacher cet article"}</a>
186         </div>
187         {assign var="previd" value=$ev.id}
188         <a id="newsid{$ev.id}"></a>
189          {tidy}
190            {$ev.titre|nl2br}
191          {/tidy}
192       </th>
193     </tr>
194     <tr class="{cycle values="impair,pair"}">
195       <td class="half">
196         {tidy}
197           {$ev.texte|smarty:nodefaults|nl2br}
198         {/tidy}
199         <br />
200         <p class="smaller"><a href="events#pagetop" style="display:block;float:right"><img alt="Sommaire" title="Remonter tout en haut" src="images/up.png"/></a>Annonce proposée par
201         <a href="profile/{$ev.forlife}" class="popup2">
202           {$ev.prenom} {$ev.nom} X{$ev.promo}
203         </a>
204         </p>
205       </td>
206     </tr>
207   </table>
208   </div>
209   {/iterate}
210   {/foreach}
211
212   <p class="smaller">
213   Nota Bene : les informations présentées ici n'engagent que leurs auteurs
214   respectifs et sont publiées à leur initiative. L'association Polytechnique.org
215   ne pourrait en aucun cas être tenue responsable de la nature des propos relatés
216   sur cet espace d'expression et d'information. Elle se réserve le droit de
217   refuser ou de retirer toute information de nature diffamante ou pouvant être
218   interprétée comme polémique par un membre de la communauté polytechnicienne.
219   </p>
220
221   <p class="center">
222     {icon name=page_edit}&nbsp;
223     <a href="events/submit">Proposer une information événementielle</a>&nbsp;&bull;
224     <a href="nl/submit">Proposer un article pour la Lettre mensuelle</a>
225   </p>
226 {/if}
227
228 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}