Happy New Year !
[platal.git] / templates / include / minifiche.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2013 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 {assign var=dead    value=$profile->deathdate}
24 {if $smarty.session.auth ge AUTH_COOKIE}
25   {assign var=withAuth value=true}
26   {assign var=user value=$profile->owner()}
27   {if $user == null}
28     {assign var=hasowner value=false}
29     {assign var=registered value=false}
30   {else}
31     {assign var=hasowner value=true}
32     {if $user->state neq 'pending'}
33       {assign var=registered value=true}
34     {else}
35       {assign var=registered value=false}
36     {/if}
37   {/if}
38 {else}
39   {* Without auth, all profiles appear as registered and with owner *}
40   {assign var=hasowner value=true}
41   {assign var=registered value=true}
42   {assign var=withAuth value=false}
43 {/if}
44
45
46 <div class="contact {if !$registered || $dead }grayed{/if}"
47      {if $profile->last_change}title="fiche mise à jour le {$profile->last_change|date_format}"{/if}>
48   <div class="identity">
49     {if $withAuth}
50     <div class="photo">
51       <img src="photo/{$profile->hrid()}" alt="{$profile->directory_name}" />
52     </div>
53     {/if}
54
55     <div class="nom">
56       {if $profile->isFemale()}&bull;{/if}
57       {if !$dead && ($withAuth || $registered)}<a href="profile/{$profile->hrid()}" class="popup2">{/if}
58       {$profile->directory_name}
59       {if !$dead && ($withAuth || $registered)}</a>{/if}
60     </div>
61
62     <div class="edu">
63       {foreach from=$profile->nationalities() item=country key=code}
64       <img src='images/flags/{$code}.gif' alt='{$code}' height='11' title='{$country}' />&nbsp;
65       {/foreach}
66       {$profile->promo()}{*
67       *}{foreach from=$profile->getExtraEducations(4) item=edu}, {display_education edu=$edu profile=$profile full=false}{/foreach}{*
68       *}{if $dead}, {"décédé"|sex:"décédée":$profile} le {$profile->deathdate|date_format}{/if}
69     </div>
70   </div>
71
72   {if $withAuth}
73   <div class="noprint bits">
74     {if $registered || (!$dead && $hasowner)}
75     <div>
76       {if !$registered && !$dead && $hasowner}
77         {if hasPerm('directory_private')}
78         {if !$smarty.session.user->isWatchedUser($profile)}
79     <a href="carnet/notifs/add_nonins/{$user->login()}?token={xsrf_token}">{*
80     *}{icon name=add title="Ajouter à la liste de mes surveillances"}</a>
81         {else}
82     <a href="carnet/notifs/del_nonins/{$user->login()}?token={xsrf_token}">{*
83     *}{icon name=cross title="Retirer de la liste de mes surveillances"}</a>
84         {/if}
85         {/if}
86       {elseif $registered}
87     <a href="profile/{$profile->hrid()}" class="popup2">{*
88     *}{icon name=user_suit title="Afficher la fiche"}</a>
89         {if !$dead}
90     <a href="vcard/{$profile->hrid()}.vcf">{*
91     *}{icon name=vcard title="Afficher la carte de visite"}</a>
92     <a href="mailto:{$user->bestEmail()}">{*
93     *}{icon name=email title="Envoyer un email"}</a>
94           {if hasPerm('directory_private')}
95           {if !$smarty.session.user->isContact($profile)}
96     <a href="carnet/contacts?action=ajouter&amp;user={$profile->hrid()}&amp;token={xsrf_token}">{*
97     *}{icon name=add title="Ajouter à mes contacts"}</a>
98           {else}
99     <a href="carnet/contacts?action=retirer&amp;user={$profile->hrid()}&amp;token={xsrf_token}">{*
100     *}{icon name=cross title="Retirer de mes contacts"}</a>
101           {/if}
102           {/if}
103         {/if}
104       {/if}
105     </div>
106     {elseif hasPerm('directory_private') && $hasowner && $dead}
107     <div>
108       {if $smarty.session.user->isWatchedUser($profile)}
109       <a href="carnet/notifs/del_nonins/{$user->login()}?token={xsrf_token}">{*
110       *}{icon name=cross title="Retirer de la liste de mes surveillances"}</a>
111       {elseif $smarty.session.user->isContact($profile)}
112       <a href="carnet/contacts?action=retirer&amp;user={$profile->hrid()}&amp;token={xsrf_token}">{*
113       *}{icon name=cross title="Retirer de mes contacts"}</a>
114       {/if}
115     </div>
116     {/if}
117
118     {if hasPerm('admin') || ($smarty.session.user->canEdit($profile) && !$smarty.session.user->isMe($user))}
119     <div>
120       [{if hasPerm('admin') && $hasowner}{if !$registered && !$dead}
121       <a href="marketing/private/{$user->login()}">{*
122         *}{icon name=email title="marketter user"}</a>
123       {/if}
124       <a href="admin/user/{$user->login()}">{*
125       *}{icon name=wrench title="administrer user"}</a>{/if}{*
126       *}{if hasPerm('admin') || $smarty.session.user->canEdit($profile)}{*
127       *}<a href="profile/edit/{$user->login()}">{*
128       *}{icon name=user_edit title="modifier la fiche"}</a>{/if}{*
129       *}{if hasPerm('admin,edit_directory')}{*
130       *}<a href="profile/ax/{$user->login()}">{*
131       *}{icon name=user_gray title="fiche AX"}</a>{/if}]
132     </div>
133     {/if}
134   </div>
135   {/if}
136
137   <div class="long">
138   {if !$dead}
139     {assign var=address value=$profile->getMainAddress()}
140     {assign var=web     value=$profile->getWebSite()}
141     {assign var=job     value=$profile->getMainJob()}
142     {if $web || $profile->mobile || ($address && $address->country) || $job || !$registered || $user->lost}
143     <table cellspacing="0" cellpadding="0">
144       {if $web}
145       <tr>
146         <td class="lt">{$web.name}&nbsp;:</td>
147         <td class="rt"><a href="{$web.address}">{$web.address}</a></td>
148       </tr>
149       {/if}
150       {if $address && $address->country}
151       <tr>
152         <td class="lt">Géographie&nbsp;:</td>
153         <td class="rt">{if $address->locality}{$address->locality}, {/if}{$address->country}</td>
154       </tr>
155       {/if}
156       {if $profile->mobile && !$dead}
157       <tr>
158         <td class="lt">Mobile&nbsp;:</td>
159         <td class="rt">{$profile->mobile}</td>
160       </tr>
161       {/if}
162       {if $job}
163       <tr>
164         <td class="lt">Profession&nbsp;:</td>
165         <td class="rt">
166           {if $job->company->url|default:$job->user_site}<a href="{$job->company->url|default:$job->user_site}">{$job->company->name}</a>{else}{$job->company->name}{/if}
167           {if $job->description}<br />{$job->description}{/if}
168         </td>
169       </tr>
170       {/if}
171       {if $withAuth}
172       {if !$registered && $hasowner}
173       <tr>
174         <td class="smaller" colspan="2">
175           {"Ce"|sex:"Cette":$profile} camarade n'est pas {"inscrit"|sex:"inscrite":$profile}.
176           <a href="marketing/public/{$user->login()}" class='popup'>Si tu connais son adresse email,
177           <strong>n'hésite pas à nous la transmettre !</strong></a>
178         </td>
179       </tr>
180       {elseif $user->state neq 'disabled' && $user->lost}
181       <tr>
182         <td class="smaller" colspan="2">
183           {"Ce"|sex:"Cette":$profile} camarade n'a plus d'adresse de redirection valide.
184           <a href="marketing/broken/{$user->login()}">
185             Si tu en connais une, <strong>n'hésite pas à nous la transmettre</strong>.
186           </a>
187         </td>
188       </tr>
189       {/if}
190       {/if}
191     </table>
192     {/if}
193   {/if}
194   </div>
195 </div>
196
197 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}