diff options
author | Michael Jobst <mjobst+github@tecratech.de> | 2016-11-02 15:17:16 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-11-14 15:22:27 +0100 |
commit | 96debafd08fb56a0e7930596ce54f401feb442b3 (patch) | |
tree | 72564063ee0f3f3dca6cf07cb2dce4c15115df9e /apps/files_versions/js | |
parent | cebb68992509215163f6776b76e48411a31a287e (diff) | |
download | nextcloud-server-96debafd08fb56a0e7930596ce54f401feb442b3.tar.gz nextcloud-server-96debafd08fb56a0e7930596ce54f401feb442b3.zip |
Display changes in file versions tab view and detailsView (#26511)
* Display changes in file versions tab view and detailsView
* versions tab enhancements
enhanced js test file
removed css superscript attribute for version size
* Replaced spaces with tabs
Diffstat (limited to 'apps/files_versions/js')
-rw-r--r-- | apps/files_versions/js/versionstabview.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/apps/files_versions/js/versionstabview.js b/apps/files_versions/js/versionstabview.js index 2e334edacb5..35abde6d34a 100644 --- a/apps/files_versions/js/versionstabview.js +++ b/apps/files_versions/js/versionstabview.js @@ -13,13 +13,26 @@ (function() { var TEMPLATE_ITEM = '<li data-revision="{{timestamp}}">' + + '<div>' + + '<div class="preview-container">' + '<img class="preview" src="{{previewUrl}}"/>' + + '</div>' + + '<div class="version-container">' + + '<div>' + '<a href="{{downloadUrl}}" class="downloadVersion"><img src="{{downloadIconUrl}}" />' + '<span class="versiondate has-tooltip live-relative-timestamp" data-timestamp="{{millisecondsTimestamp}}" title="{{formattedTimestamp}}">{{relativeTimestamp}}</span>' + '</a>' + + '</div>' + + '{{#hasDetails}}' + + '<div class="version-details">' + + '<span class="size has-tooltip" title="{{altSize}}">{{humanReadableSize}}</span>' + + '</div>' + + '{{/hasDetails}}' + + '</div>' + '{{#canRevert}}' + '<a href="#" class="revertVersion" title="{{revertLabel}}"><img src="{{revertIconUrl}}" /></a>' + '{{/canRevert}}' + + '</div>' + '</li>'; var TEMPLATE = @@ -182,10 +195,14 @@ _formatItem: function(version) { var timestamp = version.get('timestamp') * 1000; + var size = version.has('size') ? version.get('size') : 0; return _.extend({ millisecondsTimestamp: timestamp, formattedTimestamp: OC.Util.formatDate(timestamp), relativeTimestamp: OC.Util.relativeModifiedDate(timestamp), + humanReadableSize: OC.Util.humanFileSize(size, true), + altSize: n('files', '%n byte', '%n bytes', size), + hasDetails: version.has('size'), downloadUrl: version.getDownloadUrl(), downloadIconUrl: OC.imagePath('core', 'actions/download'), revertIconUrl: OC.imagePath('core', 'actions/history'), |