newviews.tpl 1.79 KB
Newer Older
1
{if $views}
2
  <div class="viewlist fullwidth listing">
3
4
5
6
7
  {*
     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
  {foreach from=$views item=view}
9
10
    <div class="{cycle values='r0,r1'} listrow">
            <h3 class="title"><a href="{$view.fullurl}">{$view.title}</a></h3>
11
            <div class="detail">{$view.description|str_shorten_html:100:true|strip_tags|safe}</div>
Evonne Cheung's avatar
Evonne Cheung committed
12
            {if $view.sharedby}
13
            <div class="groupuserdate">
Evonne Cheung's avatar
Evonne Cheung committed
14
                {if $view.group && $loggedin}
15
                  <a href="{group_homepage_url($view.groupdata)}">{$view.sharedby}</a>
Evonne Cheung's avatar
Evonne Cheung committed
16
                {elseif $view.owner && $loggedin}
17
18
19
20
21
22
23
24
25
26
27
28
29
                  {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}
Evonne Cheung's avatar
Evonne Cheung committed
30
31
32
                {else}
                  {$view.sharedby}
                {/if}
33
34
35
36
             	<span class="postedon">
                  - {if $view.mtime == $view.ctime}{str tag=Created}{else}{str tag=Updated}{/if}
                  {$view.mtime|strtotime|format_date:'strftimedate'}</span>
            </div>
Evonne Cheung's avatar
Evonne Cheung committed
37
            {/if}
38
        </div>
39
  {/foreach}
40
  </div>
41
42
{else}
  {str tag=noviews section=view}
43
{/if}