filelist.tpl 11.1 KB
Newer Older
1
{if $filelist}
2
<div class="filelist-container">
3 4 5 6 7 8 9 10 11
    <table id="{$prefix}_filelist" class="tablerenderer filelist table table-hover">
        <thead>
            <tr>
                <th class="icon-cell"></th>
                <th>{str tag=Name section=artefact.file}</th>
                <th class="hidden-xs">{str tag=Description section=artefact.file}</th>
                <th class="filesize">
                    {str tag=Size section=artefact.file}
                </th>
12
                {if !$showtags && !$editmeta}
13 14 15
                <th class="filedate">
                    {str tag=Date section=artefact.file}
                </th>
16
                {/if}
17
                {if !$selectable}
18 19
                <th class="right nowrap">
                </th>
20
                {/if}
21
                {if ($showtags && $editmeta) || $selectable}
22 23
                <th class="right nowrap"></th>
                {/if}
24 25
            </tr>
        </thead>
26

27 28
        <tbody>
        {foreach from=$filelist item=file}
Pat Kira's avatar
Pat Kira committed
29 30 31 32 33
            {if !$publishing || !$file->permissions || $file->can_republish}
                {assign var=publishable value=1}
            {else}
                {assign var=publishable value=0}
            {/if}
34

Pat Kira's avatar
Pat Kira committed
35
            <tr id="file:{$file->id}" class="file-item {if $file->isparent} parentfolder{/if}{if $highlight && $highlight == $file->id} active{/if}{if $file->artefacttype == 'folder'} folder{else}{if !$publishable } disabled {/if}{if $file->artefacttype == 'profileicon'} profileicon{/if}{/if}{if $edit == $file->id} hidden{/if}{if $selectable && ($file->artefacttype != 'folder' || $selectfolders) && $publishable && !$file->isparent} js-file-select {else} no-hover{/if}{if $file->locked} warning{/if}" {if $selectable && ($file->artefacttype != 'folder' || $selectfolders) && $publishable && !$file->isparent} data-id="{$file->id}" data-select="select-file" {/if} {if !$publishable && $file->artefacttype != 'folder'} title="{str tag=notpublishable section=artefact.file}"{/if}>
36

Pat Kira's avatar
Pat Kira committed
37
            {assign var=displaytitle value=$file->title|safe}
38
            <td class="icon-cell">
39

40 41 42
                {if $file->isparent}
                    {if $file->artefacttype == 'folder'}
                        <a href="{$querybase|safe}folder={$file->id}{if $owner}&owner={$owner}{if $ownerid}&ownerid={$ownerid}{/if}{/if}" id="changefolder-icon:{$file->id}" class="changefolder">
43
                            <span class="icon-level-up icon icon-lg text-default" role="presentation" aria-hidden="true">
44 45 46 47 48 49 50 51 52 53 54 55 56 57
                            </span>
                            <span class="sr-only">
                                {str tag=folder section=artefact.file}:{$displaytitle}
                            </span>
                        </a>
                    {/if}
                {else}
                    {if $editable}
                    <div class="icon-drag" id="drag:{$file->id}" tabindex="0">
                        <span class="sr-only">{str tag=clickanddragtomovefile section=artefact.file arg1=$file->title}</span>
                    {/if}
                    {if $file->artefacttype == 'folder'}
                        {if $selectable}
                        <a href="{$querybase|safe}folder={$file->id}{if $owner}&owner={$owner}{if $ownerid}&ownerid={$ownerid}{/if}{/if}" id="changefolder:{$file->id}" class="changefolder" title="{str tag=folder section=artefact.file} {$displaytitle}">
58
                            <span class="icon icon-plus expand-indicator" role="presentation" aria-hidden="true"></span><span class="icon-folder-open icon icon-lg" role="presentation" aria-hidden="true"></span>
59 60
                        </a>
                        {else}
61
                            <span class="icon-folder-open icon icon-lg " role="presentation" aria-hidden="true"></span>
62 63
                        {/if}
                    {else}
64
                        {if $file->icon}
65
                            <img role="presentation" aria-hidden="true" src="{$file->icon}" title="{str tag=clickanddragtomovefile section=artefact.file arg1=$file->title}" alt="{$file->title}">
66
                        {else}
67
                            <span class="icon icon-{$file->artefacttype} icon-lg" role="presentation" aria-hidden="true"></span>
68
                        {/if}
69
                    {/if}
70 71
                {/if}
            </td>
72

73 74 75 76 77 78 79
            <td class="filename">
                {if $file->artefacttype == 'folder'}
                    <a href="{$querybase|safe}folder={$file->id}{if $owner}&owner={$owner}{if $ownerid}&ownerid={$ownerid}{/if}{/if}" id="changefolder:{$file->id}" class="inner-link changefolder">
                        <span class="sr-only">{str tag=folder section=artefact.file}:</span>
                        <span class="display-title {if $file->isparent}accessible-hidden{/if}">{$displaytitle}</span>
                    </a>
                {elseif !$publishable}
80
                    <span class="display-title">{$displaytitle}</span>
81
                {else}
82
                    <a href="{$WWWROOT}artefact/file/download.php?file={$file->id}" title="{str tag=downloadfile section=artefact.file arg1=$displaytitle}" class="file-download-link inner-link {if $file->artefacttype == 'image' || $file->artefacttype == 'profileicon'}img-modal-preview{/if}">
83
                        <span class="display-title">{$displaytitle}</span>
84
                    </a>
85 86
                {/if}
            </td>
87 88 89 90
            <td class="filedescription hidden-xs">
                {$file->description}
                {if $showtags}
                    {if $file->tags}
91
                    <div class="tags filetags text-small">
92 93 94 95
                        <strong>{str tag=tags}:</strong>
                        <span>
                            {list_tags tags=$file->tags owner=$showtags}
                        </span>
96
                    </div>
97 98 99
                    {/if}
                {/if}
            </td>
100

101 102 103
            {if $showtags && $editmeta}
            <td class="filesize">{tif $file->size ?: ''}</td>
            {/if}
104 105 106 107
            {if !$showtags && !$editmeta}
            <td class="filesize">{tif $file->size ?: ''}</td>
            <td class="filedate">{tif $file->mtime ?: ''}</td>
            {/if}
108
            {if $editmeta || $selectable}
109
            <td class="right s nowrap text-right">
110 111 112 113
                <div class="btn-group">
                {if $selectable && ($file->artefacttype != 'folder' || $selectfolders) && $publishable && !$file->isparent}
                    <button type="submit" class="btn btn-xs btn-default" name="{$prefix}_select[{$file->id}]" id="{$prefix}_select_{$file->id}" title="{str tag=select}">
                        <span class="icon icon-check icon-lg" role="presentation" aria-hidden="true"></span>
114
                        <span class="sr-only">{str tag=selectspecific section=artefact.file arg1=$displaytitle|escape:html|safe}</span>
115 116
                    </button>
                {/if}
117 118 119 120 121 122 123
                {if $editmeta}
                    {if $file->locked}
                        <span class="dull text-muted">{str tag=Submitted section=view}</span>
                    {elseif !$file->isparent}
                        {if !isset($file->can_edit) || $file->can_edit !== 0}
                        <button name="{$prefix}_edit[{$file->id}]" class="btn btn-default btn-xs" title="{str tag=edit}">
                            <span class="icon icon-pencil icon-lg" role="presentation" aria-hidden="true"></span>
124 125 126 127 128
                            {if $file->artefacttype == 'folder'}
                                <span class="sr-only">{str tag=editfolderspecific section=artefact.file arg1=$displaytitle|escape:html|safe}</span>
                            {else}
                                <span class="sr-only">{str tag=editfilespecific section=artefact.file arg1=$displaytitle|escape:html|safe}</span>
                            {/if}
129 130 131
                        </button>
                        {/if}
                    {/if}
132
                {/if}
133
                </div>
134 135 136 137
            </td>
            {/if}
            <!-- Ensure space for 3 buttons (in the case of a really long single line string in a user input field -->
            {if $editable && !$file->isparent}
138
            <td class="text-right control-buttons {if $file->artefacttype == 'archive'}includes-unzip{/if}">
139 140 141 142 143 144 145 146
                {if $file->locked}
                    <span class="dull text-muted">
                        {str tag=Submitted section=view}
                    </span>
                {elseif !isset($file->can_edit) || $file->can_edit != 0}
                    <div class="btn-group">
                        {if $file->artefacttype == 'archive'}
                        <a href="{$WWWROOT}artefact/file/extract.php?file={$file->id}" title="{str tag=Decompress section=artefact.file}" class="btn btn-default btn-xs">
147
                            <span class="icon icon-file-archive-o icon-lg" role="presentation" aria-hidden="true"></span>
148 149 150 151 152
                            <span class="sr-only">
                                {str(tag=decompressspecific section=artefact.file arg1=$displaytitle)|escape:html|safe}
                            </span>
                        </a>
                        {/if}
153

154 155 156 157 158 159 160
                        {if $file->artefacttype == 'folder'}
                            {assign var=edittext value=str(tag=editfolderspecific section=artefact.file arg1=$displaytitle)}
                            {assign var=deletetext value=str(tag=deletefolderspecific section=artefact.file arg1=$displaytitle)}
                        {else}
                            {assign var=edittext value=str(tag=editspecific arg1=$displaytitle)}
                            {assign var=deletetext value=str(tag=deletespecific arg1=$displaytitle)}
                        {/if}
161

162
                        <button name="{$prefix}_edit[{$file->id}]" class="btn btn-default btn-xs">
163
                            <span class="icon icon-pencil icon-lg" role="presentation" aria-hidden="true"></span>
164 165
                            <span class="sr-only">{$edittext|escape:html|safe}</span>
                        </button>
166

167
                        <button name="{$prefix}_delete[{$file->id}]" class="btn btn-default btn-xs">
168
                            <span class="icon icon-trash text-danger icon-lg" role="presentation" aria-hidden="true"></span>
169 170 171 172 173 174
                            <span class="sr-only">{$deletetext|escape:html|safe}</span>
                        </button>
                    </div>
                {/if}
            </td>
            {/if}
175
        </tr>
176 177 178
        {if $edit == $file->id}
            {include file="artefact:file:form/editfile.tpl" prefix=$prefix fileinfo=$file groupinfo=$groupinfo}
        {/if}
179

180 181 182 183
        {/foreach}
        </tbody>
    </table>
</div>
184
{if !$selectable && $downloadfolderaszip}
185
    <a id="downloadfolder" class="panel-footer text-small" href="{$WWWROOT}artefact/file/downloadfolder.php?{$folderparams|safe}">
186
        <span class="icon icon-download" role="presentation" aria-hidden="true"></span>
187 188 189 190 191
        <span>{str tag=downloadfolderziplink section=artefact.file}</span>
    </a>
{/if}

{else}
Naomi Guyer's avatar
Naomi Guyer committed
192
<div class="panel-body">
193
    <p class="no-results">
194 195
        {str tag=nofilesfound section=artefact.file}
    </p>
Naomi Guyer's avatar
Naomi Guyer committed
196 197
</div>
{/if}