newviews.tpl 1.7 KB
Newer Older
Naomi Guyer's avatar
Naomi Guyer committed
1
{if $views}
Naomi Guyer's avatar
Naomi Guyer committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<div class="list-group">
    {*
    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 from=$views item=view}
    <div class="list-group-item">
        <h4 class="list-group-item-heading"><a href="{$view.fullurl}">{$view.title}</a></h4>
        <div class="list-group-item-text">{$view.description|str_shorten_html:100:true|strip_tags|safe}</div>
        {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>
Naomi Guyer's avatar
Naomi Guyer committed
29
            {/if}
Naomi Guyer's avatar
Naomi Guyer committed
30
31
32
33
34
35
36
37
38
39
40
            {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}
</div>
Naomi Guyer's avatar
Naomi Guyer committed
41
{else}
42
43
44
<div class="panel-body">
    <p class="lead text-small">{str tag=noviews section=view}</p>
</div>
Naomi Guyer's avatar
Naomi Guyer committed
45
{/if}