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