[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Librefm-commits] [1054] Clean-up of profile templates.
From: |
Toby Inkster |
Subject: |
[Librefm-commits] [1054] Clean-up of profile templates. |
Date: |
Thu, 30 Apr 2009 11:23:06 +0000 |
Revision: 1054
http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1054
Author: tobyink
Date: 2009-04-30 11:23:05 +0000 (Thu, 30 Apr 2009)
Log Message:
-----------
Clean-up of profile templates. Just passing a $me object instead of a bunch of
variables.
Modified Paths:
--------------
trunk/nixtape/themes/librefm/templates/maxiprofile.tpl
trunk/nixtape/themes/librefm/templates/user-journal.tpl
trunk/nixtape/themes/librefm/templates/user-profile.tpl
trunk/nixtape/user-journal.php
trunk/nixtape/user-profile.php
Modified: trunk/nixtape/themes/librefm/templates/maxiprofile.tpl
===================================================================
--- trunk/nixtape/themes/librefm/templates/maxiprofile.tpl 2009-04-30
10:41:59 UTC (rev 1053)
+++ trunk/nixtape/themes/librefm/templates/maxiprofile.tpl 2009-04-30
11:23:05 UTC (rev 1054)
@@ -1,37 +1,38 @@
-<div about="{$id|escape:'html':'UTF-8'}" typeof="foaf:Agent" class="user
vcard">
+<div about="{$me->id|escape:'html':'UTF-8'}" typeof="foaf:Agent" class="user
vcard">
<div class="avatar" rel="foaf:depiction">
- <img src="{$avatar|escape:'html':'UTF-8'}" alt="avatar"
class="photo" width="64" height="64" />
+ <img src="{$me->getAvatar()|escape:'html':'UTF-8'}"
alt="avatar" class="photo" width="64" height="64" />
</div>
{if $isme}
- <a class="edit" href="{$base_url}/user-edit.php">[edit]</a>
+ <a class="edit"
href="{$me->getURL('edit')|escape:'html':'UTF-8'}">[edit]</a>
{/if}
<dl>
<dt>
- <span class="fn"
property="foaf:name">{$fullname|escape:'html':'UTF-8'}</span>
- <span rel="foaf:holdsAccount" rev="sioc:account_of">
- <span about="{$acctid|escape:'html':'UTF-8'}"
typeof="sioc:User">
- (<span class="nickname"
property="foaf:accountName">{$user|escape:'html':'UTF-8'}</span>)
+ <span class="fn"
property="foaf:name">{$me->fullname|escape:'html':'UTF-8'}</span>
+ <span property="foaf:nick"
content="{$me->name|escape:'html':'UTF-8'}" rel="foaf:holdsAccount"
rev="sioc:account_of">
+ <span
about="{$me->acctid|escape:'html':'UTF-8'}" typeof="sioc:User">
+ (<span class="nickname"
property="foaf:accountName">{$me->name|escape:'html':'UTF-8'}</span>)
<span rel="foaf:accountServiceHomepage"
resource="{$base_url}"></span>
- <span rel="foaf:accountProfilePage"
rev="foaf:topic" resource="{$base_url}/user/{$name}"></span>
+ <span rel="foaf:accountProfilePage"
rev="foaf:topic" resource="{$me->getURL()|escape:'html':'UTF-8'}"></span>
</span>
</span>
</dt>
- {if $homepage}
+ {if $me->homepage}
<dd>
- <a href="{$homepage|escape:'html':'UTF-8'}" rel="me
foaf:homepage" class="url">{$homepage|escape:'html':'UTF-8'}</a>
+ <a href="{$me->homepage|escape:'html':'UTF-8'}" rel="me
foaf:homepage" class="url">{$me->homepage|escape:'html':'UTF-8'}</a>
</dd>
{/if}
- {if $laconica_profile}
+ {if $me->laconica_profile}
<dd>
- <a href="{$laconica_profile|escape:'html':'UTF-8'}"
rel="foaf:homepage" class="url">{$laconica_profile|escape:'html':'UTF-8'}
(microblog)</a>
+ <a href="{$me->laconica_profile|escape:'html':'UTF-8'}"
rel="foaf:homepage" class="url">{$me->laconica_profile|escape:'html':'UTF-8'}
(microblog)</a>
</dd>
{/if}
+ {if $me->location}
<dd rel="foaf:based_near">
- <span {if $location_uri}
about="{$location_uri|escape:'html':'UTF-8'}"{/if}>
- <span class="label"
property="rdfs:comment">{$location|escape:'html':'UTF-8'}</span>
+ <span {if $me->location_uri}
about="{$me->location_uri|escape:'html':'UTF-8'}"{/if}>
+ <span class="label"
property="rdfs:comment">{$me->location|escape:'html':'UTF-8'}</span>
{if $geo.latitude}
<small class="geo">
[<span class="latitude"
property="geo:lat">{$geo.latitude|string_format:"%0.3f"}</span>;
@@ -45,13 +46,16 @@
{/if}
</span>
</dd>
- <dd class="note"
property="bio:olb">{$bio|escape:'html':'UTF-8'}</dd>
+ {/if}
+ {if $me->bio}
+ <dd class="note"
property="bio:olb">{$me->bio|escape:'html':'UTF-8'}</dd>
+ {/if}
</dl>
<div style="text-align:right;clear:right;font-size:80%">
<!-- These shouldn't be hard-coded. Will fix soon. -->
<a rel="rdfs:seeAlso"
href="{$base_url}/user/{$user}">profile</a>
- {if $journal_rss} · <a rel="rdfs:seeAlso"
href="{$base_url}/user/{$user}/journal">journal</a>{/if}
+ {if $me->journal_rss} · <a rel="rdfs:seeAlso"
href="{$me->getURL('journal')|escape:'html':'UTF-8'}">journal</a>{/if}
</div>
<hr style="border: 1px solid transparent; clear: both;" rel="foaf:page"
rev="foaf:primaryTopic" resource="" />
Modified: trunk/nixtape/themes/librefm/templates/user-journal.tpl
===================================================================
--- trunk/nixtape/themes/librefm/templates/user-journal.tpl 2009-04-30
10:41:59 UTC (rev 1053)
+++ trunk/nixtape/themes/librefm/templates/user-journal.tpl 2009-04-30
11:23:05 UTC (rev 1054)
@@ -4,7 +4,7 @@
{include file='maxiprofile.tpl'}
-<ul about="{$id}" rel="foaf:made" rev="foaf:maker" class="hfeed">
+<ul about="{$me->id}" rel="foaf:made" rev="foaf:maker" class="hfeed">
{foreach from=$items item=i}
<li {if $i.subject_uri}about="{$i.subject_uri|escape:'html':'UTF-8'}"
{/if}typeof="sioc:Item rss:item" class="hentry">
<b class="entry-title"
property="dc:title">{$i.title|escape:'html':'UTF-8'}</b><br />
@@ -18,7 +18,7 @@
</div></div><div class="yui-u" id="sidebar"><div style="padding: 10px;">
<h3>{$user}'{if $user|substr:-1 != 's'}s{/if} top artists</h3>
-<ul class="tagcloud" about="{$id}">
+<ul class="tagcloud" about="{$me->id}">
{section name=i loop=$user_tagcloud}
<li style="font-size:{$user_tagcloud[i].size}"><a
href="{$user_tagcloud[i].pageurl|escape:'html':'UTF-8'}" rel="{if
$user_tagcloud[i].size|substr:-5 ==
Modified: trunk/nixtape/themes/librefm/templates/user-profile.tpl
===================================================================
--- trunk/nixtape/themes/librefm/templates/user-profile.tpl 2009-04-30
10:41:59 UTC (rev 1053)
+++ trunk/nixtape/themes/librefm/templates/user-profile.tpl 2009-04-30
11:23:05 UTC (rev 1054)
@@ -20,7 +20,7 @@
<h3 typeof="rss:channel" property="rss:title" rel="rss:link"
resource="#latest_plays" id="latest_plays"
content="{$user|escape:'html':'UTF-8'}'s Latest Plays">Latest
{$scrobbles|@count} Plays:</h3>
</div>
-<ul class="gobbles" about="{$id|escape:'html':'UTF-8'}" rev="gob:user">
+<ul class="gobbles" about="{$me->id|escape:'html':'UTF-8'}" rev="gob:user">
{section name=i loop=$scrobbles}
<li class="play {if $scrobbles[i].license > 0}libre{/if}"
about="{$scrobbles[i].id|escape:'html':'UTF-8'}" typeof="rss:item
gob:ScrobbleEvent" rel="gob:track_played">
@@ -65,7 +65,7 @@
</div></div><div class="yui-u" id="sidebar"><div style="padding: 10px;">
<h3>{$user}'s top artists</h3>
-<ul class="tagcloud" about="{$id}">
+<ul class="tagcloud" about="{$me->id}">
{section name=i loop=$user_tagcloud}
<li style="font-size:{$user_tagcloud[i].size}"><a
href="{$user_tagcloud[i].pageurl|escape:'html':'UTF-8'}" rel="{if
$user_tagcloud[i].size|substr:-5 ==
Modified: trunk/nixtape/user-journal.php
===================================================================
--- trunk/nixtape/user-journal.php 2009-04-30 10:41:59 UTC (rev 1053)
+++ trunk/nixtape/user-journal.php 2009-04-30 11:23:05 UTC (rev 1054)
@@ -66,26 +66,13 @@
}
}
-$smarty->assign("id", $user->id);
-$smarty->assign("acctid", $user->acctid);
-$smarty->assign('user', $user->name);
-$smarty->assign('email', $user->email);
-$smarty->assign('fullname', $user->fullname);
-$smarty->assign('bio', $user->bio);
-$smarty->assign('homepage', $user->homepage);
-$smarty->assign('laconica_profile', $user->laconica_profile);
-$smarty->assign('journal_rss', $user->journal_rss);
-$smarty->assign('has_identica', $user->has_identica);
-$smarty->assign('location', $user->location);
-$smarty->assign('location_uri', $user->location_uri);
-$smarty->assign('geo', Server::getLocationDetails($user->location_uri));
-$smarty->assign('userlevel', $user->userlevel);
-$smarty->assign('avatar', $user->getAvatar());
$aUserTagCloud = TagCloud::GenerateTagCloud('Scrobbles', 'artist', 40,
$user->name);
if (!PEAR::isError ($aUserTagCloud)) {
$smarty->assign('user_tagcloud',$aUserTagCloud);
}
$smarty->assign('isme', ($_SESSION['user']->name == $user->name));
+$smarty->assign('me', $user);
+$smarty->assign('geo', Server::getLocationDetails($user->location_uri));
$smarty->assign('profile', true);
$smarty->assign('items', $items);
$smarty->assign('extra_head_links', array(
Modified: trunk/nixtape/user-profile.php
===================================================================
--- trunk/nixtape/user-profile.php 2009-04-30 10:41:59 UTC (rev 1053)
+++ trunk/nixtape/user-profile.php 2009-04-30 11:23:05 UTC (rev 1054)
@@ -35,18 +35,7 @@
$user = new User($_GET['user']);
if(isset($user->name)) {
- $smarty->assign("id", $user->id);
- $smarty->assign("acctid", $user->acctid);
- $smarty->assign('user', $user->name);
- $smarty->assign('email', $user->email);
- $smarty->assign('fullname', $user->fullname);
- $smarty->assign('bio', $user->bio);
- $smarty->assign('homepage', $user->homepage);
- $smarty->assign('journal_rss', $user->journal_rss);
- $smarty->assign('laconica_profile', $user->laconica_profile);
- $smarty->assign('has_identica', $user->has_identica);
- $smarty->assign('location', $user->location);
- $smarty->assign('location_uri', $user->location_uri);
+
$smarty->assign('geo', Server::getLocationDetails($user->location_uri));
$aUserScrobbles = $user->getScrobbles(20);
if (!PEAR::isError ($aUserScrobbles)) {
@@ -63,6 +52,7 @@
$smarty->assign('user_tagcloud',$aUserTagCloud);
}
$smarty->assign('isme', ($_SESSION['user']->name == $user->name));
+ $smarty->assign('me', $user);
$smarty->assign('profile', true);
$smarty->assign('extra_head_links', array(
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Librefm-commits] [1054] Clean-up of profile templates.,
Toby Inkster <=