summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/templates
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-10-28 20:22:06 +0100
committerVincent Petry <pvince81@owncloud.com>2014-04-02 15:33:47 +0200
commit0be9de5df558232e12e2f582af5d08e1f488ba90 (patch)
treede37dea2e23dd28f631948295979980ec774027f /apps/files_trashbin/templates
parent268206cec55921d2d0309469ebd5d9533e4f79ee (diff)
downloadnextcloud-server-0be9de5df558232e12e2f582af5d08e1f488ba90.tar.gz
nextcloud-server-0be9de5df558232e12e2f582af5d08e1f488ba90.zip
Files, trashbin, public apps use ajax/JSON for the file list
Files app: - removed file list template, now rendering list from JSON response - FileList.addFile/addDir is now FileList.add() and takes a JS map with all required arguments instead of having a long number of function arguments - added unit tests for many FileList operations - fixed newfile.php, newfolder.php and rename.php to return the file's full JSON on success - removed obsolete/unused undo code - removed download_url / loading options, now using Files.getDownloadUrl() for that - server side now uses Helper::getFileInfo() to prepare file JSON response - previews are now client-side only Breadcrumbs are now JS only: - Added BreadCrumb class to handle breadcrumb rendering and events - Added unit test for BreadCrumb class - Moved all relevant JS functions to the BreadCrumb class Public page now uses ajax to load the file list: - Added Helper class in sharing app to make it easier to authenticate and retrieve the file's real path - Added ajax/list.php to retrieve the file list - Fixed FileActions and FileList to work with the ajax list Core: - Fixed file picker dialog to use the same list format as files app
Diffstat (limited to 'apps/files_trashbin/templates')
-rw-r--r--apps/files_trashbin/templates/index.php9
-rw-r--r--apps/files_trashbin/templates/part.breadcrumb.php19
-rw-r--r--apps/files_trashbin/templates/part.list.php79
3 files changed, 3 insertions, 104 deletions
diff --git a/apps/files_trashbin/templates/index.php b/apps/files_trashbin/templates/index.php
index f9264d4352c..615cf8bdd00 100644
--- a/apps/files_trashbin/templates/index.php
+++ b/apps/files_trashbin/templates/index.php
@@ -1,13 +1,11 @@
<div id="controls">
- <?php print_unescaped($_['breadcrumb']); ?>
- <div id="file_action_panel"></div>
+ <div id="file_action_panel"></div>
</div>
<div id='notification'></div>
-<div id="emptycontent" <?php if (!(isset($_['files']) && count($_['files']) === 0 && $_['dirlisting'] === false && !$_['ajaxLoad'])):?>class="hidden"<?php endif; ?>><?php p($l->t('Nothing in here. Your trash bin is empty!'))?></div>
+<div id="emptycontent" class="hidden"><?php p($l->t('Nothing in here. Your trash bin is empty!'))?></div>
-<input type="hidden" name="ajaxLoad" id="ajaxLoad" value="<?php p($_['ajaxLoad']); ?>" />
-<input type="hidden" id="disableSharing" data-status="<?php p($_['disableSharing']); ?>"></input>
+<input type="hidden" id="permissions" value="0"></input>
<input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir">
<table id="filestable">
@@ -40,6 +38,5 @@
</tr>
</thead>
<tbody id="fileList">
- <?php print_unescaped($_['fileList']); ?>
</tbody>
</table>
diff --git a/apps/files_trashbin/templates/part.breadcrumb.php b/apps/files_trashbin/templates/part.breadcrumb.php
deleted file mode 100644
index fdf78c190d0..00000000000
--- a/apps/files_trashbin/templates/part.breadcrumb.php
+++ /dev/null
@@ -1,19 +0,0 @@
-<div class="crumb home">
- <a href="<?php print_unescaped($_['home']); ?>">
- <img src="<?php print_unescaped(OCP\image_path('core', 'places/home.svg'));?>" class="svg" />
- </a>
-</div>
-<div class="crumb svg"
- data-dir='/'>
- <a href="<?php p($_['baseURL']); ?>"><?php p($l->t("Deleted Files")); ?></a>
-</div>
-<?php if(count($_["breadcrumb"])):?>
-<?php endif;?>
-<?php for($i=0; $i<count($_["breadcrumb"]); $i++):
- $crumb = $_["breadcrumb"][$i];
- $dir = \OCP\Util::encodePath($crumb["dir"]); ?>
- <div class="crumb <?php if($i === count($_["breadcrumb"])-1) p('last');?> svg"
- data-dir='<?php p($dir);?>'>
- <a href="<?php p($_['baseURL'].$dir); ?>"><?php p($crumb["name"]); ?></a>
- </div>
-<?php endfor;
diff --git a/apps/files_trashbin/templates/part.list.php b/apps/files_trashbin/templates/part.list.php
deleted file mode 100644
index c32d9fd54da..00000000000
--- a/apps/files_trashbin/templates/part.list.php
+++ /dev/null
@@ -1,79 +0,0 @@
-<?php foreach($_['files'] as $file):
- $relative_deleted_date = OCP\relative_modified_date($file['timestamp']);
- // the older the file, the brighter the shade of grey; days*14
- $relative_date_color = round((time()-$file['date'])/60/60/24*14);
- if($relative_date_color>200) $relative_date_color = 200;
- $name = \OCP\Util::encodePath($file['name']);
- $directory = \OCP\Util::encodePath($file['directory']); ?>
- <tr data-filename="<?php p($file['name']);?>"
- data-type="<?php ($file['type'] === 'dir')?p('dir'):p('file')?>"
- data-mime="<?php p($file['mimetype'])?>"
- data-permissions='<?php p($file['permissions']); ?>'
- <?php if ( $_['dirlisting'] ): ?>
- id="<?php p($file['directory'].'/'.$file['name']);?>"
- data-file="<?php p($name);?>"
- data-timestamp=''
- data-dirlisting=1
- <?php else: ?>
- id="<?php p($file['name'].'.d'.$file['timestamp']);?>"
- data-file="<?php p($file['name'].'.d'.$file['timestamp']);?>"
- data-timestamp='<?php p($file['timestamp']);?>'
- data-dirlisting=0
- <?php endif; ?>>
- <?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: ?>
- <?php if($file['isPreviewAvailable']): ?>
- style="background-image:url(<?php print_unescaped(OCA\Files_Trashbin\Trashbin::preview_icon(!$_['dirlisting'] ? ($file['name'].'.d'.$file['timestamp']) : ($file['directory'].'/'.$file['name']))); ?>)"
- <?php else: ?>
- style="background-image:url(<?php print_unescaped(OCP\mimetype_icon($file['mimetype'])); ?>)"
- <?php endif; ?>
- <?php endif; ?>
- >
- <?php if(!isset($_['readonly']) || !$_['readonly']): ?>
- <input id="select-<?php p($file['id']); ?>" type="checkbox" />
- <label for="select-<?php p($file['id']); ?>"></label>
- <?php endif; ?>
- <?php if($file['type'] === 'dir'): ?>
- <?php if( $_['dirlisting'] ): ?>
- <a class="name dir" href="<?php p($_['baseURL'].'/'.$name); ?>" title="">
- <?php else: ?>
- <a class="name dir" href="<?php p($_['baseURL'].'/'.$name.'.d'.$file['timestamp']); ?>" title="">
- <?php endif; ?>
- <?php else: ?>
- <?php if( $_['dirlisting'] ): ?>
- <a class="name file" href="<?php p($_['downloadURL'].'/'.$name); ?>" title="">
- <?php else: ?>
- <a class="name file" href="<?php p($_['downloadURL'].'/'.$name.'.d'.$file['timestamp']);?>" title="">
- <?php endif; ?>
- <?php endif; ?>
- <span class="nametext">
- <?php if($file['type'] === 'dir'):?>
- <?php print_unescaped(htmlspecialchars($file['name']));?>
- <?php else:?>
- <?php print_unescaped(htmlspecialchars($file['basename']));?><span
- class='extension'><?php p($file['extension']);?></span>
- <?php endif;?>
- </span>
- <?php if($file['type'] === 'dir'):?>
- <span class="uploadtext" currentUploads="0">
- </span>
- <?php endif;?>
- </a>
- </td>
- <td class="date">
- <span class="modified"
- title="<?php p($file['date']); ?>"
- style="color:rgb(<?php p($relative_date_color.','
- .$relative_date_color.','
- .$relative_date_color) ?>)">
- <?php p($relative_deleted_date); ?>
- </span>
- </td>
- </tr>
-<?php endforeach;