filelist.tpl 3.76 KB
Newer Older
1
{if !$filelist}
2
3
<p>{str tag=nofilesfound section=artefact.file}</p>
{else}
4
<table id="filelist" class="tablerenderer filelist">
5
6
7
8
9
 <thead>
  <tr>
   <th></th>
   <th>{str tag=Name section=artefact.file}</th>
   <th>{str tag=Description section=artefact.file}</th>
10
  {if !$showtags && !$editmeta}
11
12
   <th>{str tag=Size section=artefact.file}</th>
   <th>{str tag=Date section=artefact.file}</th>
13
14
  {/if}
  {if $showtags}
Evonne Cheung's avatar
Evonne Cheung committed
15
   <th><div>{str tag=tags}</div></th>
16
17
18
19
  {/if}
  {if $editmeta}
   <th></th>
  {/if}
20
21
22
23
24
   <th></th>
  </tr>
 </thead>
 <tbody>
  {foreach from=$filelist item=file}
25
    {if !$publishing || !$file->permissions || $file->can_republish}{assign var=publishable value=1}{else}{assign var=publishable value=0}{/if}
26
  <tr id="file:{$file->id}" class="{cycle values='r0,r1'} directory-item{if $file->isparent} parentfolder{/if}{if $file->artefacttype == 'folder'} folder{/if}{if $highlight && $highlight == $file->id} highlight-file{/if}{if $edit == $file->id} hidden{/if}{if !$publishable && $file->artefacttype != 'folder'} disabled{/if}" {if !$publishable && $file->artefacttype != 'folder'} title="{str tag=notpublishable section=artefact.file}"{/if}>
27
    <td>
28
      {if $editable}
29
      <div{if !$file->isparent} class="icon-drag" id="drag:{$file->id}"{/if}>
30
        <img src="{$file->icon}"{if !$file->isparent} title="{str tag=clickanddragtomovefile section=artefact.file arg1=$file->title}"{/if}>
31
      </div>
32
      {else}
33
        <img src="{$file->icon}">
34
      {/if}
35
36
    </td>
    <td class="filename">
37
    {assign var=displaytitle value=$file->title|str_shorten_text:34|safe}
38
    {if $file->artefacttype == 'folder'}
39
      <a href="{$querybase}folder={$file->id}{if $owner}&owner={$owner}{if $ownerid}&ownerid={$ownerid}{/if}{/if}" class="changefolder" title="{str tag=gotofolder section=artefact.file arg1=$displaytitle}">{$displaytitle}</a>
40
41
    {elseif !$publishable}
      {$displaytitle}
42
    {else}
43
      <a href="{$WWWROOT}artefact/file/download.php?file={$file->id}" target="_blank" title="{str tag=downloadfile section=artefact.file arg1=$displaytitle}">{$displaytitle}</a>
44
45
    {/if}
    </td>
46
    <td>{$file->description}</td>
47
    {if !$showtags && !$editmeta}
48
49
    <td>{tif $file->size ?: ''}</td>
    <td>{tif $file->mtime ?: ''}</td>
50
51
    {/if}
    {if $showtags}
Evonne Cheung's avatar
Evonne Cheung committed
52
    <td>{if $file->tags}<span>{list_tags tags=$file->tags owner=$showtags}</span>{/if}</td>
53
54
    {/if}
    {if $editmeta}
Evonne Cheung's avatar
Evonne Cheung committed
55
    <td class="right">
56
57
58
      {if $file->locked}
        <span class="s dull">{str tag=Submitted section=view}</span>
      {elseif !$file->isparent}
Evonne Cheung's avatar
Evonne Cheung committed
59
        {if !isset($file->can_edit) || $file->can_edit !== 0}<input type="submit" class="icon btn-edit tag-edit submit" name="{$prefix}_edit[{$file->id}]" value="{str tag=edit}" />{/if}
60
61
62
      {/if}
    </td>
    {/if}
63
    <td class="right">
64
    {if $editable && !$file->isparent}
65
      {if $file->artefacttype == 'archive'}<a href="{$WWWROOT}artefact/file/extract.php?file={$file->id}">{str tag=Unzip section=artefact.file}</a>{/if}
66
67
      {if $file->locked}
        <span class="s dull">{str tag=Submitted section=view}</span>
Evonne Cheung's avatar
Evonne Cheung committed
68
69
      {elseif !isset($file->can_edit) || $file->can_edit !== 0}<input type="submit" class="icon btn-edit s" name="{$prefix}_edit[{$file->id}]" value="{str tag=edit}" />
      <input type="submit" class="icon btn-del s" name="{$prefix}_delete[{$file->id}]" value="{str tag=delete}" />{/if}
70
    {/if}
71
    {if $selectable && ($file->artefacttype != 'folder' || $selectfolders) && $publishable && !$file->isparent}
72
      <input type="submit" class="select small" name="{$prefix}_select[{$file->id}]" id="{$prefix}_select_{$file->id}" value="{str tag=select}" />
73
    {/if}
74
75
76
    </td>
  </tr>
  {if $edit == $file->id}
77
    {include file="artefact:file:form/editfile.tpl" prefix=$prefix fileinfo=$file groupinfo=$groupinfo}
78
79
80
81
82
  {/if}
  {/foreach}
 </tbody>
</table>
{/if}