aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-08-10 13:14:15 +0200
committerVincent Petry <pvince81@owncloud.com>2015-08-10 13:14:15 +0200
commit15e16d335db5771778477e944d4e63ac807382b9 (patch)
tree597e7ea2f7adf12f257ccc78c04f90c06958aba3 /apps/files_sharing/js
parent214729a5524e2c406415985717c174bedc810954 (diff)
parent038d29b8def77ad906a722f72a1501b369f9c1ee (diff)
downloadnextcloud-server-15e16d335db5771778477e944d4e63ac807382b9.tar.gz
nextcloud-server-15e16d335db5771778477e944d4e63ac807382b9.zip
Merge pull request #17656 from owncloud/files-rightsidebar
Basic work for right sidebar
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r--apps/files_sharing/js/public.js3
-rw-r--r--apps/files_sharing/js/share.js4
-rw-r--r--apps/files_sharing/js/sharetabview.js67
3 files changed, 73 insertions, 1 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 5923e426f05..1993efe7d73 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -57,7 +57,8 @@ OCA.Sharing.PublicApp = {
scrollContainer: $(window),
dragOptions: dragOptions,
folderDropOptions: folderDropOptions,
- fileActions: fileActions
+ fileActions: fileActions,
+ detailsViewEnabled: false
}
);
this.files = OCA.Files.Files;
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index e7823454c53..12bec0e8c9a 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -140,6 +140,10 @@
}
});
}, t('files_sharing', 'Share'));
+
+ OC.addScript('files_sharing', 'sharetabview').done(function() {
+ fileList.registerTabView(new OCA.Sharing.ShareTabView('shareTabView'));
+ });
},
/**
diff --git a/apps/files_sharing/js/sharetabview.js b/apps/files_sharing/js/sharetabview.js
new file mode 100644
index 00000000000..e02de923751
--- /dev/null
+++ b/apps/files_sharing/js/sharetabview.js
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2015
+ *
+ * This file is licensed under the Affero General Public License version 3
+ * or later.
+ *
+ * See the COPYING-README file.
+ *
+ */
+
+(function() {
+ var TEMPLATE =
+ '<div>Owner: {{owner}}';
+
+ /**
+ * @class OCA.Sharing.ShareTabView
+ * @classdesc
+ *
+ * Displays sharing information
+ *
+ */
+ var ShareTabView = function(id) {
+ this.initialize(id);
+ };
+ /**
+ * @memberof OCA.Sharing
+ */
+ ShareTabView.prototype = _.extend({}, OCA.Files.DetailTabView.prototype,
+ /** @lends OCA.Sharing.ShareTabView.prototype */ {
+ _template: null,
+
+ /**
+ * Initialize the details view
+ */
+ initialize: function() {
+ OCA.Files.DetailTabView.prototype.initialize.apply(this, arguments);
+ this.$el.addClass('shareTabView');
+ },
+
+ getLabel: function() {
+ return t('files_sharing', 'Sharing');
+ },
+
+ /**
+ * Renders this details view
+ */
+ render: function() {
+ this.$el.empty();
+
+ if (!this._template) {
+ this._template = Handlebars.compile(TEMPLATE);
+ }
+
+ if (this._fileInfo) {
+ this.$el.append(this._template({
+ owner: this._fileInfo.shareOwner || OC.currentUser
+ }));
+
+ } else {
+ // TODO: render placeholder text?
+ }
+ }
+ });
+
+ OCA.Sharing.ShareTabView = ShareTabView;
+})();
+