diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-06-28 12:09:58 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-06-28 13:00:58 +0200 |
commit | f22af90c09926192ff17c77755c0359c7e0c072f (patch) | |
tree | 2fe2c8f1e6e2a2487c5e2aee9ad631c58d75a216 /apps/files_versions/js | |
parent | 894b7d93f6de7229802a5d42c5e56d0f0c6ab587 (diff) | |
download | nextcloud-server-f22af90c09926192ff17c77755c0359c7e0c072f.tar.gz nextcloud-server-f22af90c09926192ff17c77755c0359c7e0c072f.zip |
Hide revert button when no permission to revert
Diffstat (limited to 'apps/files_versions/js')
-rw-r--r-- | apps/files_versions/js/versionstabview.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/files_versions/js/versionstabview.js b/apps/files_versions/js/versionstabview.js index 0e17fff466a..b9ccf03c3e2 100644 --- a/apps/files_versions/js/versionstabview.js +++ b/apps/files_versions/js/versionstabview.js @@ -15,7 +15,9 @@ '<a href="{{downloadUrl}}" class="downloadVersion"><img src="{{downloadIconUrl}}" />' + '<span class="versiondate has-tooltip" title="{{formattedTimestamp}}">{{relativeTimestamp}}</span>' + '</a>' + + '{{#canRevert}}' + '<a href="#" class="revertVersion" title="{{revertLabel}}"><img src="{{revertIconUrl}}" /></a>' + + '{{/canRevert}}' + '</li>'; var TEMPLATE = @@ -109,6 +111,9 @@ }, error: function() { + fileInfoModel.trigger('busy', fileInfoModel, false); + self.$el.find('.versions').removeClass('hidden'); + self._toggleLoading(false); OC.Notification.showTemporary( t('files_version', 'Failed to revert {file} to revision {timestamp}.', { file: versionModel.getFullPath(), @@ -183,6 +188,7 @@ revertIconUrl: OC.imagePath('core', 'actions/history'), previewUrl: version.getPreviewUrl(), revertLabel: t('files_versions', 'Restore'), + canRevert: (this.collection.getFileInfo().get('permissions') & OC.PERMISSION_UPDATE) !== 0 }, version.attributes); }, |