Commit 50a6aac8 authored by Nigel McNie's avatar Nigel McNie
Browse files

Tidied up display of bar at top of views.

- Made it easier to style the name and author differently.
- Added back link back in
- Made sure image size always matches bar size
- Bolden edit link
parent eded22b2
......@@ -37,6 +37,7 @@ $string['editaccessforview'] = 'Edit Access for View "%s"';
$string['next'] = 'Next';
$string['back'] = 'Back';
$string['title'] = 'View Title';
$string['viewtitle'] = '<span id="vt-title">%s</span> <span id="vt-by">by %s</span>';
$string['description'] = 'View Description';
$string['startdate'] = 'Access Start Date/Time';
$string['stopdate'] = 'Access End Date/Time';
......
......@@ -325,17 +325,36 @@ div.rbuttons form div {
/* Top of page elements */
.viewheader {
padding: .5em;
border-bottom: 1px dotted #666;
border-bottom: 1px solid #666;
background-color: #fff;
height: 32px;
}
#dropshadow {
background-image: url(../images/dropshadow.png);
background-repeat: repeat-x;
z-index: 1;
height: 15px;
width: 100%;
float: left;
}
.viewheader .small-logo img {
height: 2.6em;
height: 32px;
padding: 0;
}
.viewheader .lbuttons {
.viewheader .rbuttons {
padding: .5em;
}
.viewheader h1 {
font-size: 1.2em;
margin: 0;
padding: .5em;
}
.viewheader h1 #vt-title {
font-weight: bold;
}
.viewheader h1 #vt-by {
font-size: .9em;
}
.sitemessage {
background-color: #f99;
font-weight: bold;
......
......@@ -3,15 +3,17 @@
{include file="header/head.tpl"}
<body>
<div class="viewheader center rel">
<div class="rbuttons">
<div class="lbuttons">
<a class="small-logo" href="{$WWWROOT}"><img src="{theme_url filename='images/site-logo.png'}" alt="{$sitename|escape}"></a>
{if $mnethost}&nbsp;&nbsp;<a href="{$mnethost.url}">{str tag=backto arg1=$mnethost.name}</a>{/if}
{if $mnethost}<a href="{$mnethost.url|escape}">{str tag=backto arg1=$mnethost.name}</a>{/if}
{if $backurl}<a class="btn-reply" href="{$backurl|escape}">{str tag=back}</a>{/if}
</div>
{if $can_edit}
<div class="lbuttons"><a href="blocks.php?id={$viewid}&amp;new={$new}">{str tag=edit}</a></div>
{if $edit_url}
<div class="rbuttons"><strong><a href="{$edit_url|escape}" class="btn-edit">{str tag=edit}</a></strong></div>
{/if}
{if !$new}<a href="{$WWWROOT}view/view.php?id={$viewid}">{/if}{$viewtitle|escape}{if !$new}</a>{/if}{if $ownername} {str tag=by section=view} <a href="{$WWWROOT}{$ownerlink}">{$ownername|escape}</a>{/if}
<h1>{$viewtitle}</h1>
</div>
<div id="dropshadow"></div>
<div id="containerX">
<div id="loading-box" style="display: none;"></div>
<div id="top-wrapper">
......
......@@ -307,6 +307,14 @@ $smarty->assign('institutions', get_institution_string_for_user($userid));
$smarty->assign('canmessage', can_send_message($loggedinid, $userid));
$smarty->assign('NAME',$name);
$smarty->assign('USERID', $userid);
$smarty->assign('viewid', $view->get('id'));
$smarty->assign('viewtitle', 'This is the profile of ' . display_name($user) . ' at ' . get_config('sitename'));
if ($loggedinid && $loggedinid == $userid) {
$smarty->assign('edit_url', get_config('wwwroot') . 'view/blocks.php?profile=' . $userid);
}
if (isset($_SERVER['HTTP_REFERER']) && false === strpos($_SERVER['HTTP_REFERER'], get_config('wwwroot') . 'user/view.php?id=' . $userid)) {
$smarty->assign('backurl', $_SERVER['HTTP_REFERER']);
}
$smarty->assign('viewcontent', $view->build_columns());
$smarty->assign('PAGEHEADING', hsc(TITLE));
$smarty->display('user/view.tpl');
......
......@@ -178,6 +178,10 @@ $smarty->assign('profile', $profile);
$smarty->assign('view', $view->get('id'));
$smarty->assign('groupid', $group);
$smarty->assign('institution', $institution);
$smarty->assign('viewurl', (!empty($profile))
? get_config('wwwroot') . 'user/view.php?id=' . $view->get('owner')
: 'view.php?id=' . $view->get('id') . '&new=' . $new
);
$smarty->assign('can_change_layout', (!$USER->get_account_preference('addremovecolumns') || ($view->get('numcolumns') > 1 && $view->get('numcolumns') < 5)));
$blockid = $view->get_blockinstance_currently_being_configured();
......
......@@ -151,18 +151,21 @@ $smarty = smarty(
$smarty->assign('INLINEJAVASCRIPT', $javascript);
$smarty->assign('new', $new);
$smarty->assign('viewid', $viewid);
$smarty->assign('viewtitle', $view->get('title'));
$owner = $view->get('owner');
if ($owner && $USER->get('id') == $owner && !$submittedgroup && !$view->is_submitted()) {
$smarty->assign('edit_url', get_config('wwwroot') . 'view/blocks.php?id=' . $viewid . '&new=' . $new);
}
$ownerlink = '';
if ($owner) {
$smarty->assign('ownerlink', 'user/view.php?id=' . $owner);
if ($USER->get('id') == $owner) {
$smarty->assign('can_edit', !$submittedgroup && !$view->is_submitted());
}
$ownerlink = 'user/view.php?id=' . $owner;
}
else if ($group) {
$smarty->assign('ownerlink', 'group/view.php?id=' . $group);
$ownerlink = 'group/view.php?id=' . $group;
}
$smarty->assign('viewtitle', get_string('viewtitle', 'view',
$view->get('title'),
'<a href="' . get_config('wwwroot') . hsc($ownerlink) . '">' . display_name($owner) . '</a>'
));
// Provide a link for roaming teachers to return
if ($mnetviewlist = $SESSION->get('mnetviewaccess')) {
......@@ -177,6 +180,9 @@ if ($mnetviewlist = $SESSION->get('mnetviewaccess')) {
}
}
}
else if (isset($_SERVER['HTTP_REFERER']) && false === strpos($_SERVER['HTTP_REFERER'], get_config('wwwroot') . 'view/view.php?id=' . $viewid)) {
$smarty->assign('backurl', $_SERVER['HTTP_REFERER']);
}
$smarty->assign('ownername', $view->formatted_owner());
$smarty->assign('viewdescription', $view->get('description'));
......
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