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