Fix profile view when not logged in.
[platal.git] / templates / profile / profile.tpl
index ea76a36..91af9a1 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2011 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2014 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -50,9 +50,14 @@ $($.closeOnEsc);
       <h2>À l'X&hellip;</h2>
       {if $profile->section}<div><em class="intitule">Section&nbsp;: </em><span>{$profile->section}</span></div>{/if}
 
-      {assign var=binets value=$profile->getBinets()}
+      {assign var=binets value=$profile->getFullBinets()}
       {if $binets|@count}<div><em class="intitule">Binet{if count($binets) > 1}s{/if}&nbsp;: </em>
-      <span>{', '|implode:$profile->getBinetsNames()}</span></div>{/if}
+      <span> <br />
+      {foreach from=$binets item=binet name=binets}
+        {if !$smarty.foreach.binets.first}, {/if}
+        <span title="{$binet.text}">{if $binet.url}<a href="{$binet.url}">{/if}{$binet.text}{if $binet.url}</a>{/if}</span>
+      {/foreach}
+      </span></div>{/if}
 
       {if $owner && $view->isVisible(#Visibility::EXPORT_AX#)}
         {assign var=groups value=$owner->groups(true,true)}
@@ -60,7 +65,7 @@ $($.closeOnEsc);
         <span><br/>
         {foreach from=$groups item=group name=groups}
           {if !$smarty.foreach.groups.first}, {/if}
-          <span title="{$group.nom}"><a href="{if $group.site}{$group.site}{else}http://www.polytechnique.net/{$group.nom}{/if}">{$group.nom}</a></span>
+          <span title="{$group.nom}"><a href="{if $group.site}{$group.site}{else}http://www.polytechnique.net/{$group.diminutif}{/if}">{$group.nom}</a></span>
         {/foreach}
         </span></div>{/if}
       {/if}
@@ -81,6 +86,14 @@ $($.closeOnEsc);
       {/foreach}
     {/if}
 
+    {assign var=hobbies value=$profile->getHobbies()}
+    {if count($hobbies) > 0}
+      <h2>Hobbies...</h2>
+      {foreach from=$hobbies key=type item=text}
+        <div><em class="intitule">{$type} : </em>{$text}</div>
+      {/foreach}
+    {/if}
+
     {if $profile->freetext}
       <h2>Commentaires&nbsp;:</h2>
       <span>{$profile->freetext|miniwiki|smarty:nodefaults}</span>
@@ -91,7 +104,10 @@ $($.closeOnEsc);
   <div id="fiche_identite" class="part">
     <div class="civilite">
       {if $profile->isFemale()}&bull;{/if}
-        {if $view->isVisible(#Visibility::EXPORT_PRIVATE#)}{$profile->private_name}{else}{$profile->public_name}{/if}
+      {if $view->isVisible(#Visibility::EXPORT_PRIVATE#)}{$profile->private_name}{else}{$profile->public_name}{/if}
+      {if $logged && ( hasPerm('admin') || $smarty.session.user->canEdit($profile)) && $view->isVisible(#Visibility::EXPORT_PRIVATE#)}
+        <span title="Identifiant AX, uniquement visible par les administrateurs du site" style="font-weight:normal;font-style:italic;"> ({$profile->ax_id})</span>
+      {/if}
 
       {if $logged}
         &nbsp;{if !$profile->isDead()}<a href="vcard/{$owner->login()}.vcf">{*
@@ -142,7 +158,7 @@ $($.closeOnEsc);
         Cette personne n'est pas inscrite à Polytechnique.org,<br />
         <a href="marketing/public/{$owner->login()}" class="popup">clique ici si tu connais son adresse email&nbsp;!</a>
         {else}
-        {if $virtualalias && $view->isVisible(#Visibility::EXPORT_PRIVATE#)}
+        {if $virtualalias && $view->isVisible(#Visibility::EXPORT_PRIVATE#) && $virtualalias neq $owner->bestEmail()}
         <a href="mailto:{$virtualalias}">{$virtualalias}</a><br />
         {/if}
         <a href="mailto:{$owner->bestEmail()}">{$owner->bestEmail()}</a>
@@ -257,7 +273,7 @@ $($.closeOnEsc);
       <div class="medal_frame">
         <img src="profile/medal/thumb/{$m.mid}" height="50px" alt="{$m.text}" title="{$m.text}" style='float: left;' />
         <div class="medal_text">
-          {$m.text}<br />{$m.grade}
+          {$m.text}{if $m.level} ({$m.level}){/if}<br />{$m.grade}
         </div>
       </div>
       {/foreach}
@@ -290,4 +306,4 @@ $($.closeOnEsc);
   <div class="spacer"></div>
 </div>
 
-{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
+{* vim:set et sw=2 sts=2 sws=2 fenc=utf-8: *}