Commit f644bdcc authored by Son Nguyen's avatar Son Nguyen Committed by Gerrit Code Review
Browse files

Merge "Tidying up watchlist block - phase 1 (Bug #1444784)"

parents bcb5a507 c92e3d3f
......@@ -43,7 +43,7 @@ class PluginBlocktypeWatchlist extends SystemBlocktype {
$smarty = smarty_core();
$sql = '
SELECT v.id, v.title, v.owner, v.group, v.institution, v.ownerformat, v.urlid
SELECT v.id, v.title, v.owner, v.group, v.institution, v.ownerformat, v.urlid, v.ctime, v.mtime
FROM {view} v
JOIN {usr_watchlist_view} wv ON wv.view = v.id
WHERE wv.usr = ?
......@@ -63,7 +63,7 @@ class PluginBlocktypeWatchlist extends SystemBlocktype {
$r = (object) $r;
}
$smarty->assign('blockid', 'blockinstance_' . $instance->get('id'));
$smarty->assign('loggedin', $USER->is_logged_in());
$smarty->assign('views', array_values($results));
return $smarty->fetch('blocktype:watchlist:watchlist.tpl');
}
......
{if $watchlistempty}
{str tag=nopages section=blocktype.watchlist}
{else}
<table id="watchlistblock" class="viewlist fullwidth">
<div id="watchlistblock" class="viewlist fullwidth listing">
{*
I wanted to put author_link_index in templates/author.tpl, but its
state is non-persistent. So until Dwoo gets smarter...
*}
{assign var='author_link_index' value=1}
{foreach $views as item=view}
<tr>
<td class="{cycle values='r0,r1'}">
<h4 class="title"><a href="{$view->fullurl}" class="watchlist-showview">{$view->title}</a></h4>
</td>
</tr>
<div class="{cycle values='r0,r1'} listrow">
<h3 class="title"><a href="{$view->fullurl}">{$view->title}</a></h3>
{if $view->sharedby}
<div class="groupuserdate">
{if $view->group && $loggedin}
<a href="{group_homepage_url($view->groupdata)}">{$view->sharedby}</a>
{elseif $view>owner && $loggedin}
{if $view->anonymous}
{if $view->staff_or_admin}
{assign var='realauthor' value=$view>sharedby}
{assign var='realauthorlink' value=profile_url($view.user)}
{/if}
{assign var='author' value=get_string('anonymoususer')}
{include file=author.tpl}
{if $view.staff_or_admin}
{assign var='author_link_index' value=$author_link_index+1}
{/if}
{else}
<a href="{profile_url($view->user)}">{$view->sharedby}</a>
{/if}
{else}
{$view->sharedby}
{/if}
<span class="postedon">
- {if $view->mtime == $view->ctime}{str tag=Created}{else}{str tag=Updated}{/if}
{$view->mtime|strtotime|format_date:'strftimedate'}</span>
</div>
{/if}
</div>
{/foreach}
</table>
</div>
<div class="cb"></div>
{/if}
Supports Markdown
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