git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit 65baa2be authored by Jonas Haraldsson's avatar Jonas Haraldsson

User header

Rename maxiprofile.tpl to user-header.tpl
Instead of doing $smarty->assign(headerfile, '<header>.tpl') in php
files, we add the tpl file as a subheader parameter when including header.tpl
in page template.
It makes it easier to keep track of what templates are loaded when
modifying a theme.

Change header.tpl to also take a showbio parameter, if true it will
display a users bio.
parent a1ea2a1b
......@@ -42,10 +42,10 @@
<div id="main-container">
<div id="main" class="wrapper clearfix">
<article>
<header>
{if isset($headerfile)}
{include file="$headerfile"}
<article>
<header>
{if isset($subheader)}
{include file="$subheader"}
{/if}
{if isset($pageheading)}
<h1 id="page-title" class="asset-name">{$pageheading}</h1>
......
{include file='header.tpl'}
{include file='header.tpl' subheader='user-header.tpl'}
<center><h3><a href='{$base_url}/user-edit.php'>{t}Edit your profile{/t}</a> | {t}Connections to other services{/t}</h3></center>
......
{include file='header.tpl'}
{include file='header.tpl' subheader='user-header.tpl'}
<center><h3>Edit your profile | <a href='{$base_url}/user-connections.php'>Connections to other services</a></h3></center>
......
......@@ -13,4 +13,12 @@
{/if}
<p>
{if $showbio == true}
{if $me->bio}
<div id='bio'>
<blockquote>{$me->bio|escape:'html':'UTF-8'}</blockquote>
</div>
{/if}
{/if}
</div>
{include file='header.tpl'}
{include file='header.tpl' subheader='user-header.tpl' showbio=true}
{if $me->bio}
<div id='bio'>
<blockquote>{$me->bio|escape:'html':'UTF-8'}</blockquote>
</div>
{/if}
<br />
{if $nowplaying|@count > 0}
<h3>{t}Now Playing:{/t}</h3>
{section name=i loop=$nowplaying}
......
{include file='header.tpl'}
{include file='header.tpl' subheader='user-header.tpl'}
<div about="[_:seq1]" typeof="rdf:Seq" rev="rss:items">
<h3 typeof="rss:channel" property="rss:title" rel="rss:link" resource="#latest_plays" id="latest_plays" content="{$me->name|escape:'html':'UTF-8'}'s Latest Plays">{t plays=$scrobbles|@count}Latest %1 Plays:{/t}</h3>
......
{include file='header.tpl'}
{include file='header.tpl' subheader='user-header.tpl'}
<center>
<h4>
......
{include file='header.tpl'}
{include file='header.tpl' subheader='user-header.tpl'}
<script type="text/javascript" src="{$base_url}/js/stats/user.js"></script>
<script type="text/javascript" src="{$base_url}/js/jquery.jqplot.min.js"></script>
<script type="text/javascript" src="{$base_url}/js/plugins/jqplot.barRenderer.min.js"></script>
......
......@@ -106,5 +106,4 @@ $submenu = user_menu($this_user, 'Edit');
$smarty->assign('submenu', $submenu);
$smarty->assign('me', $this_user);
$smarty->assign('headerfile', 'maxiprofile.tpl');
$smarty->display('user-connections.tpl');
......@@ -180,7 +180,6 @@ if (isset($this_user->name)) {
$submenu = user_menu($this_user, 'Edit');
$smarty->assign('submenu', $submenu);
$smarty->assign('me', $this_user);
$smarty->assign('headerfile', 'maxiprofile.tpl');
$smarty->assign('errors', $errors);
$smarty->display('user-edit.tpl');
......
......@@ -89,7 +89,6 @@ if (isset($user->name)) {
$submenu = user_menu($user, 'Overview');
$smarty->assign('submenu', $submenu);
$smarty->assign('headerfile', 'maxiprofile.tpl');
$smarty->display('user-profile.tpl');
} else {
......
......@@ -57,7 +57,6 @@ try {
$smarty->assign('isme', ($this_user->name == $user->name));
$smarty->assign('me', $user);
$smarty->assign('profile', true);
$smarty->assign('pagetitle', $user->name . '\'s recent tracks');
$smarty->assign('extra_head_links', array(
......@@ -77,6 +76,5 @@ $smarty->assign('extra_head_links', array(
$submenu = user_menu($user, 'Recent Tracks');
$smarty->assign('submenu', $submenu);
$smarty->assign('headerfile', 'maxiprofile.tpl');
$smarty->display('user-recent-tracks.tpl');
......@@ -59,7 +59,6 @@ if (isset($user->name)) {
$submenu = user_menu($user, 'Radio Stations');
$smarty->assign('submenu', $submenu);
$smarty->assign('type', $type);
$smarty->assign('headerfile', 'maxiprofile.tpl');
$smarty->display('user-station.tpl');
} else {
......
......@@ -109,7 +109,6 @@ if (isset($user->name)) {
$submenu = user_menu($user, 'Stats');
$smarty->assign('submenu', $submenu);
$smarty->assign('headerfile', 'maxiprofile.tpl');
$smarty->assign('stats', true);
$smarty->display('user-stats.tpl');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment