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 18:05:25 +0300
committerArthur Schiwon <blizzz@owncloud.com>2015-08-07 02:22:43 +0300
commitff614a7dbde66a9cd795a674d0e0635b6f32e3a5 (patch)
treeeacc5ea87cc99668d07c390228347c79ad523be6 /apps/files/js/mainfileinfodetailview.js
parent12e5f310ddb784c0ed1248020b770d93040918da (diff)
More fixes to the right sidebar
Sidebar now works in all file list views. Moved owner to share tab.
Diffstat (limited to 'apps/files/js/mainfileinfodetailview.js')
-rw-r--r--apps/files/js/mainfileinfodetailview.js20
1 files changed, 15 insertions, 5 deletions
diff --git a/apps/files/js/mainfileinfodetailview.js b/apps/files/js/mainfileinfodetailview.js
index 5eb74145f12..88463bda9e6 100644
--- a/apps/files/js/mainfileinfodetailview.js
+++ b/apps/files/js/mainfileinfodetailview.js
@@ -11,7 +11,14 @@
(function() {
var TEMPLATE =
'<div class="thumbnail"></div><div class="fileName">{{name}}</div>' +
- '<div><span title="{{altSize}}">{{size}}</span>, <span title="{{altDate}}">{{date}}</span></div>';
+ '<div>' +
+ ' <a href="#" ' +
+ ' alt="{{starAltText}}"' +
+ ' class="action action-favorite {{#isFavorite}}permanent{{/isFavorite}}">' +
+ ' <img class="svg" src="{{starIcon}}" />' +
+ ' </a>' +
+ ' <span title="{{altSize}}">{{size}}</span>, <span title="{{altDate}}">{{date}}</span>' +
+ '</div>';
/**
* @class OCA.Files.MainFileInfoDetailView
@@ -48,6 +55,7 @@
}
if (this._fileInfo) {
+ var isFavorite = (this._fileInfo.tags || []).indexOf(OC.TAG_FAVORITE) >= 0
this.$el.append(this._template({
nameLabel: t('files', 'Name'),
name: this._fileInfo.name,
@@ -56,10 +64,13 @@
sizeLabel: t('files', 'Size'),
// TODO: refactor and use size formatter
size: OC.Util.humanFileSize(this._fileInfo.size, true),
- altSize: this._fileInfo.size,
+ altSize: n('files', '%n byte', '%n bytes', this._fileInfo.size),
dateLabel: t('files', 'Modified'),
altDate: OC.Util.formatDate(this._fileInfo.mtime),
- date: OC.Util.relativeModifiedDate(this._fileInfo.mtime)
+ date: OC.Util.relativeModifiedDate(this._fileInfo.mtime),
+ isFavorite: isFavorite,
+ starAltText: isFavorite ? t('files', 'Favorited') : t('files', 'Favorite'),
+ starIcon: OC.imagePath('core', isFavorite ? 'actions/starred' : 'actions/star')
}));
var $iconDiv = this.$el.find('.thumbnail');
@@ -78,8 +89,7 @@
// TODO: special icons / shared / external
$iconDiv.css('background-image', 'url("' + OC.MimeType.getIconUrl('dir') + '")');
}
- } else {
- // TODO: render placeholder text?
+ this.$el.find('[title]').tipsy();
}
}
});