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