From 05fef626d9f2e95d367e68b739f76d92f9a3e89b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Sun, 24 Jan 2010 16:56:25 +0100 Subject: [PATCH] Don't load a User when showing a minifiche, unless necessary MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Had a few vars to the minifiche template too Signed-off-by: Raphaël Barrois --- templates/include/minifiche.tpl | 37 ++++++++++++++++++++-------------- templates/include/plview.minifiche.tpl | 2 +- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/templates/include/minifiche.tpl b/templates/include/minifiche.tpl index 82d41d0..a45f1f3 100644 --- a/templates/include/minifiche.tpl +++ b/templates/include/minifiche.tpl @@ -20,22 +20,29 @@ {* *} {**************************************************************************} -{assign var=profile value=$user->profile()} {assign var=dead value=$profile->deathdate} -{if $user->state neq 'pending'} -{assign var=registered value=true} -{else} -{assign var=registered value=false} -{/if} {if $smarty.session.auth ge AUTH_COOKIE} -{assign var=withAuth value=true} + {assign var=withAuth value=true} + {assign var=user value=$profile->owner()} + {if $user == null} + {assign var=hasowner value=false} + {assign var=registered value=false} + {else} + {if $user->state neq 'pending'} + {assign var=registered value=true} + {else} + {assign var=registered value=false} + {/if} + {/if} {else} -{assign var=withAuth value=false} + {* Without auth, all profiles appear as registered *} + {assign var=registered value=true} + {assign var=withAuth value=false} {/if} -
+
{if $withAuth}
@@ -45,9 +52,9 @@
{if $profile->isFemale()}•{/if} - {if !$dead && (!$registered || $withAuth)}{/if} + {if !$dead && $registered}{/if} {$profile->full_name} - {if !$dead && (!$registered || $withAuth)}{/if} + {if !$dead && $registered}{/if}
@@ -62,7 +69,7 @@ {/if} {$profile->promo()}{* *}{iterate from=$profile->getExtraEducations(4) item=edu}, {education_fmt edu=$edu profile=$profile}{/iterate}{* - *}{if $dead}, {"décédé"|sex:"décédée":$user} le {$orfile->deathdate|date_format}{/if} + *}{if $dead}, {"décédé"|sex:"décédée":$profile} le {$profile->deathdate|date_format}{/if}
@@ -149,7 +156,7 @@ {if !$registered} - {"Ce"|sex:"Cette":$user} camarade n'est pas {"inscrit"|sex:"inscrite":$user}. + {"Ce"|sex:"Cette":$profile} camarade n'est pas {"inscrit"|sex:"inscrite":$profile}. Si tu connais son adresse email, n'hésite pas à nous la transmettre ! @@ -157,7 +164,7 @@ {elseif $user->state neq 'disabled' && $user->lost} - {"Ce"|sex:"Cette":$user} camarade n'a plus d'adresse de redirection valide. + {"Ce"|sex:"Cette":$profile} camarade n'a plus d'adresse de redirection valide. Si tu en connais une, n'hésite pas à nous la transmettre. diff --git a/templates/include/plview.minifiche.tpl b/templates/include/plview.minifiche.tpl index d6ef8c3..f79a413 100644 --- a/templates/include/plview.minifiche.tpl +++ b/templates/include/plview.minifiche.tpl @@ -22,7 +22,7 @@
{foreach from=$set item=res} - {include file="include/minifiche.tpl" user=$res} + {include file="include/minifiche.tpl" profile=$res} {/foreach}
-- 2.1.4