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