diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-09-04 13:55:49 +0200 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-09-04 14:11:40 +0200 |
commit | 4af5a8c483278eae2e8e38f5ea0a238072848b87 (patch) | |
tree | beca3f5250e1a50eca58fa63eea056b69ab82e44 /apps/files/templates | |
parent | 7c9d9992432839f2265b8f6b0f43ed15bfca9ff1 (diff) | |
parent | 09187f3b3b30e6f810c6afff7332615ed472154e (diff) | |
download | nextcloud-server-4af5a8c483278eae2e8e38f5ea0a238072848b87.tar.gz nextcloud-server-4af5a8c483278eae2e8e38f5ea0a238072848b87.zip |
Merge branch 'master' into fix_3728_with_file_exists_dialog
Conflicts:
apps/files/ajax/upload.php
apps/files/js/file-upload.js
apps/files/js/filelist.js
apps/files/js/files.js
apps/files/templates/part.list.php
Diffstat (limited to 'apps/files/templates')
-rw-r--r-- | apps/files/templates/index.php | 34 | ||||
-rw-r--r-- | apps/files/templates/part.list.php | 81 |
2 files changed, 50 insertions, 65 deletions
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 79c283dc336..29cb457cd5a 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> @@ -56,24 +56,27 @@ </div> <?php if (isset($_['files']) and $_['isCreatable'] and count($_['files'])==0):?> - <div id="emptyfolder"><?php p($l->t('Nothing in here. Upload something!'))?></div> + <div id="emptycontent"><?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"> @@ -101,7 +104,7 @@ <?php print_unescaped($_['fileList']); ?> </tbody> </table> -<div id="editor"></div> +<div id="editor"></div><!-- FIXME Do not use this div in your app! It is deprecated and will be removed in the future! --> <div id="uploadsize-message" title="<?php p($l->t('Upload too large'))?>"> <p> <?php p($l->t('The files you are trying to upload exceed the maximum size for file uploads on this server.'));?> @@ -119,3 +122,4 @@ <!-- config hints for javascript --> <input type="hidden" name="allowZipDownload" id="allowZipDownload" value="<?php p($_['allowZipDownload']); ?>" /> <input type="hidden" name="usedSpacePercent" id="usedSpacePercent" value="<?php p($_['usedSpacePercent']); ?>" /> +<input type="hidden" name="encryptedFiles" id="encryptedFiles" value="<?php $_['encryptedFiles'] ? p('1') : p('0'); ?>" /> diff --git a/apps/files/templates/part.list.php b/apps/files/templates/part.list.php index 39f5ac471e5..4076c1bb331 100644 --- a/apps/files/templates/part.list.php +++ b/apps/files/templates/part.list.php @@ -1,15 +1,7 @@ <input type="hidden" id="disableSharing" data-status="<?php p($_['disableSharing']); ?>"> -<?php $totalfiles = 0; -$totaldirs = 0; -$totalsize = 0; -$pc = 0; ?> <?php foreach($_['files'] as $file): - $totalsize += $file['size']; - if ($file['type'] === 'dir') { - $totaldirs++; - } else { - $totalfiles++; - } + //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; @@ -18,23 +10,43 @@ $pc = 0; ?> $relative_date_color = round((time()-$file['mtime'])/60/60/24*14); if($relative_date_color>160) $relative_date_color = 160; $name = \OCP\Util::encodePath($file['name']); - $directory = \OCP\Util::encodePath($file['directory']); - ?> - <!--<tr style="position:absolute; width:100%"><td colspan="3" style="display:block;"><div style="width: <?php echo $pc++; ?>%; height: 31px;background-color: green;"/></td></tr>--> + $directory = \OCP\Util::encodePath($file['directory']); ?> <tr data-id="<?php p($file['fileid']); ?>" 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: ?> @@ -55,47 +67,16 @@ $pc = 0; ?> </td> <td class="filesize" style="color:rgb(<?php p($simple_size_color.','.$simple_size_color.','.$simple_size_color) ?>)"> - <span style="position:relative;"> <?php print_unescaped(OCP\human_file_size($file['size'])); ?> - </span> </td> <td class="date"> <span class="modified" title="<?php p($file['date']); ?>" - style="position:relative; color:rgb(<?php p($relative_date_color.',' + style="color:rgb(<?php p($relative_date_color.',' .$relative_date_color.',' .$relative_date_color) ?>)"> <?php p($relative_modified_date); ?> </span> </td> </tr> -<?php endforeach; ?> - <?php if ($totaldirs !== 0 || $totalfiles !== 0): ?> - <tr class="summary"> - <td><span class="info"> - <?php if ($totaldirs !== 0) { - p($totaldirs.' '); - if ($totaldirs === 1) { - p($l->t('directory')); - } else { - p($l->t('directories')); - } - } - if ($totaldirs !== 0 && $totalfiles !== 0) { - p(' & '); - } - if ($totalfiles !== 0) { - p($totalfiles.' '); - if ($totalfiles === 1) { - p($l->t('file')); - } else { - p($l->t('files')); - } - } ?> - </span></td> - <td class="filesize"> - <?php print_unescaped(OCP\human_file_size($totalsize)); ?> - </td> - <td></td> - </tr> - <?php endif; +<?php endforeach; |