newviews.tpl 2.16 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
<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}
8
    
Naomi Guyer's avatar
Naomi Guyer committed
9
10
    {foreach from=$views item=view}
    <div class="list-group-item">
11
12
        <h4 class="list-group-item-heading">
            <a href="{$view.fullurl}">{$view.title}</a>
13
            {if $view.collid}({str tag=nviews section=view arg1=$view.numpages}){/if}
14
15
16
17
18
19
20
21
        </h4>
        
        {if $view.description}
        <p>
            {$view.description|str_shorten_html:100:true|strip_tags|safe}
        </p>
        {/if}
        
Naomi Guyer's avatar
Naomi Guyer committed
22
        {if $view.sharedby}
23
24
25
26
27
        <div class="groupuserdate text-small">
            {if $view.group && $loggedin}
            <a href="{group_homepage_url($view.groupdata)}" class="text-link">
                {$view.sharedby}
            </a>
Naomi Guyer's avatar
Naomi Guyer committed
28
            {elseif $view.owner && $loggedin}
29
30
31
32
33
34
35
36
37
38
39
40
41
                {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}
Naomi Guyer's avatar
Naomi Guyer committed
42
            {else}
43
44
45
                <a href="{profile_url($view.user)}" class="text-link">
                    {$view.sharedby}
                </a>
Naomi Guyer's avatar
Naomi Guyer committed
46
            {/if}
47
        {else}
Naomi Guyer's avatar
Naomi Guyer committed
48
49
            {$view.sharedby}
        {/if}
50
51
52
53
54
55
56
57
58
            <span class="postedon  text-muted">
                - {if $view.mtime == $view.ctime}
                    {str tag=Created}
                {else}
                    {str tag=Updated}
                {/if}
                {$view.mtime|strtotime|format_date:'strftimedate'}
            </span>
        </div>
Naomi Guyer's avatar
Naomi Guyer committed
59
60
61
    </div>
    {/foreach}
</div>
Naomi Guyer's avatar
Naomi Guyer committed
62
{else}
63
<div class="panel-body">
Naomi Guyer's avatar
Naomi Guyer committed
64
    <p class="lead text-small">{str tag=noviews section=view}</p>
65
</div>
Naomi Guyer's avatar
Naomi Guyer committed
66
{/if}