Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-07-15 17:09:00 +0300
committerArthur Schiwon <blizzz@owncloud.com>2015-08-07 02:22:42 +0300
commit12e5f310ddb784c0ed1248020b770d93040918da (patch)
tree6bfc053ff77ba25f238fef59fe3eb0c358269dc8 /apps/files/js/mainfileinfodetailview.js
parent9854e71d2c83bd5f74a4798be1547e75112d5a41 (diff)
Improved right sidebar
Added owner info. Added animation, but causes scrollbal. Default file action now when clicking on name directly. Fixed icon. Added empty share tab.
Diffstat (limited to 'apps/files/js/mainfileinfodetailview.js')
-rw-r--r--apps/files/js/mainfileinfodetailview.js48
1 files changed, 31 insertions, 17 deletions
diff --git a/apps/files/js/mainfileinfodetailview.js b/apps/files/js/mainfileinfodetailview.js
index 3f3705c2586..5eb74145f12 100644
--- a/apps/files/js/mainfileinfodetailview.js
+++ b/apps/files/js/mainfileinfodetailview.js
@@ -10,11 +10,8 @@
(function() {
var TEMPLATE =
- '<div class="thumbnail"></div>' +
- '<ul class="detailList">' +
- ' <li>Name: {{name}}</li>' +
- ' <li>Path: {{path}}</li>' +
- '</ul>';
+ '<div class="thumbnail"></div><div class="fileName">{{name}}</div>' +
+ '<div><span title="{{altSize}}">{{size}}</span>, <span title="{{altDate}}">{{date}}</span></div>';
/**
* @class OCA.Files.MainFileInfoDetailView
@@ -42,8 +39,6 @@
/**
* Renders this details view
- *
- * @abstract
*/
render: function() {
this.$el.empty();
@@ -53,17 +48,36 @@
}
if (this._fileInfo) {
- this.$el.append(this._template(this._fileInfo));
+ this.$el.append(this._template({
+ nameLabel: t('files', 'Name'),
+ name: this._fileInfo.name,
+ pathLabel: t('files', 'Path'),
+ path: this._fileInfo.path,
+ sizeLabel: t('files', 'Size'),
+ // TODO: refactor and use size formatter
+ size: OC.Util.humanFileSize(this._fileInfo.size, true),
+ altSize: this._fileInfo.size,
+ dateLabel: t('files', 'Modified'),
+ altDate: OC.Util.formatDate(this._fileInfo.mtime),
+ date: OC.Util.relativeModifiedDate(this._fileInfo.mtime)
+ }));
+
var $iconDiv = this.$el.find('.thumbnail');
- // FIXME: use proper way, this is only for demo purposes
- FileList.lazyLoadPreview({
- path: this._fileInfo.path + '/' + this._fileInfo.name,
- mime: this._fileInfo.mimetype,
- etag: this._fileInfo.etag,
- callback: function(url) {
- $iconDiv.css('background-image', 'url("' + url + '")');
- }
- });
+ // TODO: we really need OC.Previews
+ if (this._fileInfo.mimetype !== 'httpd/unix-directory') {
+ // FIXME: use proper way, this is only for demo purposes
+ var previewUrl = FileList.generatePreviewUrl({
+ file: this._fileInfo.path + '/' + this._fileInfo.name,
+ c: this._fileInfo.etag,
+ x: 50,
+ y: 50
+ });
+ previewUrl = previewUrl.replace('(', '%28').replace(')', '%29');
+ $iconDiv.css('background-image', 'url("' + previewUrl + '")');
+ } else {
+ // TODO: special icons / shared / external
+ $iconDiv.css('background-image', 'url("' + OC.MimeType.getIconUrl('dir') + '")');
+ }
} else {
// TODO: render placeholder text?
}