Javascript cleanup again.
[platal.git] / templates / events / index.tpl
index 94fd518..06b936e 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2010 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
 {*                                                                        *}
 {**************************************************************************}
 
-{if $ask_naissance}
+{if t($ask_naissance)}
 
 {include file='include/form_naissance.tpl'}
 
 {else}
 
 <h1 id='pagetop'>
-Bienvenue {$smarty.session.yourself_name}{if $birthday}
-  &nbsp;et joyeux anniversaire de la part de toute l'équipe !
+Bienvenue {$smarty.session.user->displayName()}{if t($birthday)}
+  &nbsp;et joyeux anniversaire de la part de toute l'équipe&nbsp;!
 {else},
 {/if}
 </h1>
 
-{if $smarty.session.host}
+{if $smarty.session.user->host}
 <div class="smaller">
-  {if $birthday}T{else}t{/if}a connexion précédente date du
-  <strong>{$smarty.session.lastlogin|date_format:"%x, %X"}</strong>
-  depuis la machine <strong>{$smarty.session.host}</strong>.
+  {if t($birthday)}T{else}t{/if}a connexion précédente date du
+  <strong>{$smarty.session.user->lastlogin|date_format:"%x, %X"}</strong>
+  depuis la machine <strong>{$smarty.session.user->host}</strong>.
 </div>
 {/if}
 
-{if $smarty.session.no_redirect}
-<div class="errors">
-  <ul>
-    <li>
-      Tu n'as plus de redirection valide ce qui rend ton adresse Polytechnique.org
-      inutilisable. Rends-toi au plus vite sur <a href="emails/redirect">la page de 
-      gestion des emails</a> pour corriger ce problème.
-    </li>
-  </ul>
-</div>
-{/if}
-
-{if $smarty.session.mx_failures|@count}
-<div class="warnings">
-  {icon name=error} Des problèmes sont actuellement recontrés sur tes redirections suivantes :
-  <ul>
-    {foreach from=$smarty.session.mx_failures item=mail}
-    <li>
-      <span class="erreur">{$mail.mail}</span> :
-      <span class="explication">{$mail.text}</span>
-    </li>
-    {/foreach}
-  </ul>
-  <div style="text-align: center"><a href="emails/redirect">Gérer mes adresses de redirection</a></div>
-</div>
-{/if}
-
-{if $fiche_incitation || $photo_incitation || ($geoloc_incitation > 0)}
-<div class="warnings">
-  <ul>
-{if $fiche_incitation}
-  <li>
-    La dernière mise à jour de ta
-    <a href="profile/{$smarty.session.hruid}" class="popup2">fiche</a>
-    date du {$fiche_incitation|date_format}.
-    Il est possible qu'elle ne soit pas à jour.
-    Si tu souhaites la modifier, <a href="profile/edit">clique ici !</a>
-  </li>
-{/if}
-
-{if $photo_incitation}
-  <li>
-    Tu n'as pas mis de photo de toi sur ta fiche, c'est dommage.
-    Clique <a href="photo/change">ici</a> si tu souhaites en ajouter une.
-  </li>
-{/if}
-
-{if $geoloc_incitation > 0}
-  <li>
-    Parmi tes adresses, il y en a {$geoloc_incitation} que nous n'avons pas pu localiser.
-    Clique <a href="profile/edit/adresses">ici</a> pour rectifier.
-  </li>
-{/if}
-  </ul>
-</div>
+{if t($reminder)}
+{include file="reminder/base.tpl"}
+{else}
+{include file="include/tips.tpl" full=true}
 {/if}
 
-{include file="include/tips.tpl" full=true}
-  
   <table class="tinybicol" id="menu-evts">
     {foreach from=$events name=events key=category item=evenement}
     <tr class="pair" style="height: 18px">
       <td class="half titre" style="height: 18px; padding-top: 1px; padding-bottom: 1px;">
         {if $smarty.foreach.events.first}
-        {if $smarty.session.core_rss_hash}
-        <a href="rss/{$smarty.session.hruid}/{$smarty.session.core_rss_hash}/rss.xml" style="display:block;float:right" title="Annonces">
+        {if $smarty.session.user->token}
+        <a href="rss/{$smarty.session.hruid}/{$smarty.session.user->token}/rss.xml" style="display:block;float:right" title="Annonces">
           {icon name=feed title='fil rss'}
         </a>
         {else}
@@ -122,7 +69,7 @@ Bienvenue {$smarty.session.yourself_name}{if $birthday}
         {elseif $category eq 'end'}
           {icon name=clock} Dernières minutes&nbsp;:
         {else}
-          {icon name=magnifier} Mais encore...
+          {icon name=magnifier} Mais encore&hellip;
         {/if}
       </td>
     </tr>
@@ -145,8 +92,8 @@ Bienvenue {$smarty.session.yourself_name}{if $birthday}
     {if !$has_evts}
     <tr>
       <td class="half">
-        {if $smarty.session.core_rss_hash}
-        <a href="rss/{$smarty.session.hruid}/{$smarty.session.core_rss_hash}/rss.xml" style="display:block;float:right" title="Annonces">
+        {if $smarty.session.user->token}
+        <a href="rss/{$smarty.session.hruid}/{$smarty.session.user->token}/rss.xml" style="display:block;float:right" title="Annonces">
           {icon name=feed title='fil rss'}
         </a>
         {else}
@@ -171,13 +118,13 @@ Bienvenue {$smarty.session.yourself_name}{if $birthday}
        if (link.childNodes[i].nodeName == 'STRONG') {
                link.replaceChild(link.childNodes[i].firstChild,link.childNodes[i]);
        }
-       Ajax.update_html(null, 'events/read/'+id);
+    $.xget('events/read/'+id);
        return false;
   }
   -->
   {/literal}
   </script>
+
   {foreach from=$events key=category item=evenement}
   {foreach item=ev from=$evenement}
   {if $ev.nonlu}
@@ -202,7 +149,7 @@ Bienvenue {$smarty.session.yourself_name}{if $birthday}
           {if hasPerm('admin')}
           <a href="admin/events/edit/{$ev.id}">{icon name=page_edit title="Editer cet article"}</a>
           {/if}
-          <a href="events/read/{$ev.id}{if $previd}/newsid{$previd}{/if}" onclick="return readEvent('{$ev.id}')">{icon name=cross title="Cacher cet article"}</a>
+          <a href="events/read/{$ev.id}{if t($previd)}/newsid{$previd}{/if}" onclick="return readEvent('{$ev.id}')">{icon name=cross title="Cacher cet article"}</a>
         </div>
         {assign var="previd" value=$ev.id}
         <a id="newsid{$ev.id}"></a>
@@ -242,10 +189,7 @@ Bienvenue {$smarty.session.yourself_name}{if $birthday}
             <img alt="Sommaire" title="Remonter tout en haut" src="images/up.png"/>
           </a>
         </div>
-        Annonce proposée par
-        <a href="profile/{$ev.hruid}" class="popup2">
-          {$ev.prenom} {$ev.nom} {$ev.promo_display}
-        </a>
+        Annonce proposée par {profile user=$ev.uid sex=false promo=true}
       </td>
     </tr>
   </table>