summaryrefslogtreecommitdiffstats
path: root/apps/files/templates
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/templates')
-rw-r--r--apps/files/templates/index.php29
-rw-r--r--apps/files/templates/part.list.php32
2 files changed, 44 insertions, 17 deletions
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php
index 360874103f8..2f7e0af4f28 100644
--- a/apps/files/templates/index.php
+++ b/apps/files/templates/index.php
@@ -10,7 +10,7 @@
data-type='file'><p><?php p($l->t('Text file'));?></p></li>
<li style="background-image:url('<?php p(OCP\mimetype_icon('dir')) ?>')"
data-type='folder'><p><?php p($l->t('Folder'));?></p></li>
- <li style="background-image:url('<?php p(OCP\image_path('core', 'actions/public.png')) ?>')"
+ <li style="background-image:url('<?php p(OCP\image_path('core', 'filetypes/web.svg')) ?>')"
data-type='web'><p><?php p($l->t('From link'));?></p></li>
</ul>
</div>
@@ -59,21 +59,24 @@
<div id="emptyfolder"><?php p($l->t('Nothing in here. Upload something!'))?></div>
<?php endif; ?>
-<table id="filestable" data-allow-public-upload="<?php p($_['publicUploadEnabled'])?>">
+<table id="filestable" data-allow-public-upload="<?php p($_['publicUploadEnabled'])?>" data-preview-x="36" data-preview-y="36">
<thead>
<tr>
<th id='headerName'>
- <input type="checkbox" id="select_all" />
- <span class='name'><?php p($l->t( 'Name' )); ?></span>
- <span class='selectedActions'>
- <?php if($_['allowZipDownload']) : ?>
- <a href="" class="download">
- <img class="svg" alt="Download"
- src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>" />
- <?php p($l->t('Download'))?>
- </a>
- <?php endif; ?>
- </span>
+ <div id="headerName-container">
+ <input type="checkbox" id="select_all" />
+ <label for="select_all"></label>
+ <span class="name"><?php p($l->t( 'Name' )); ?></span>
+ <span class="selectedActions">
+ <?php if($_['allowZipDownload']) : ?>
+ <a href="" class="download">
+ <img class="svg" alt="Download"
+ src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>" />
+ <?php p($l->t('Download'))?>
+ </a>
+ <?php endif; ?>
+ </span>
+ </div>
</th>
<th id="headerSize"><?php p($l->t('Size')); ?></th>
<th id="headerDate">
diff --git a/apps/files/templates/part.list.php b/apps/files/templates/part.list.php
index 3e6f619868d..4076c1bb331 100644
--- a/apps/files/templates/part.list.php
+++ b/apps/files/templates/part.list.php
@@ -1,5 +1,7 @@
<input type="hidden" id="disableSharing" data-status="<?php p($_['disableSharing']); ?>">
<?php foreach($_['files'] as $file):
+ //strlen('files/') => 6
+ $relativePath = substr($file['path'], 6);
// the bigger the file, the darker the shade of grey; megabytes*2
$simple_size_color = intval(160-$file['size']/(1024*1024)*2);
if($simple_size_color<0) $simple_size_color = 0;
@@ -13,16 +15,38 @@
data-file="<?php p($name);?>"
data-type="<?php ($file['type'] == 'dir')?p('dir'):p('file')?>"
data-mime="<?php p($file['mimetype'])?>"
- data-size='<?php p($file['size']);?>'
- data-permissions='<?php p($file['permissions']); ?>'>
+ data-size="<?php p($file['size']);?>"
+ data-permissions="<?php p($file['permissions']); ?>">
+ <?php if($file['isPreviewAvailable']): ?>
+ <td class="filename svg preview-icon"
+ <?php else: ?>
<td class="filename svg"
+ <?php endif; ?>
<?php if($file['type'] == 'dir'): ?>
style="background-image:url(<?php print_unescaped(OCP\mimetype_icon('dir')); ?>)"
<?php else: ?>
- style="background-image:url(<?php print_unescaped(OCP\mimetype_icon($file['mimetype'])); ?>)"
+ <?php if($_['isPublic']): ?>
+ <?php
+ $relativePath = substr($relativePath, strlen($_['sharingroot']));
+ ?>
+ <?php if($file['isPreviewAvailable']): ?>
+ style="background-image:url(<?php print_unescaped(OCP\publicPreview_icon($relativePath, $_['sharingtoken'])); ?>)"
+ <?php else: ?>
+ style="background-image:url(<?php print_unescaped(OCP\mimetype_icon($file['mimetype'])); ?>)"
+ <?php endif; ?>
+ <?php else: ?>
+ <?php if($file['isPreviewAvailable']): ?>
+ style="background-image:url(<?php print_unescaped(OCP\preview_icon($relativePath)); ?>)"
+ <?php else: ?>
+ style="background-image:url(<?php print_unescaped(OCP\mimetype_icon($file['mimetype'])); ?>)"
+ <?php endif; ?>
+ <?php endif; ?>
<?php endif; ?>
>
- <?php if(!isset($_['readonly']) || !$_['readonly']): ?><input type="checkbox" /><?php endif; ?>
+ <?php if(!isset($_['readonly']) || !$_['readonly']): ?>
+ <input id="select-<?php p($file['fileid']); ?>" type="checkbox" />
+ <label for="select-<?php p($file['fileid']); ?>"></label>
+ <?php endif; ?>
<?php if($file['type'] == 'dir'): ?>
<a class="name" href="<?php p(rtrim($_['baseURL'],'/').'/'.trim($directory,'/').'/'.$name); ?>" title="">
<?php else: ?>