From ce1b0c650e3a0e4cb701609ee08a13182909219a Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Thu, 3 Sep 2015 15:53:17 +0200 Subject: [PATCH] show link share --- apps/files_sharing/js/sharetabview.js | 6 ++- core/css/share.css | 4 -- core/js/shareconfigmodel.js | 3 +- core/js/sharedialogexpirationview.js | 10 ++++- core/js/sharedialoglinkshareview.js | 32 ++++++++++----- core/js/shareitemmodel.js | 57 ++++++++++++++++++++++++++- 6 files changed, 92 insertions(+), 20 deletions(-) diff --git a/apps/files_sharing/js/sharetabview.js b/apps/files_sharing/js/sharetabview.js index 11f25c0c47..6836107306 100644 --- a/apps/files_sharing/js/sharetabview.js +++ b/apps/files_sharing/js/sharetabview.js @@ -45,7 +45,6 @@ } if (this.model) { - console.log(this.model); var owner = this.model.get('shareOwner'); if (owner === OC.currentUser) { owner = null; @@ -59,8 +58,11 @@ itemSource: this.model.get('id'), possiblePermissions: this.model.get('sharePermissions') }; - var shareModel = new OC.Share.ShareItemModel(attributes, {configModel: configModel}); var configModel = new OC.Share.ShareConfigModel(); + var shareModel = new OC.Share.ShareItemModel(attributes, { + configModel: configModel, + fileInfoModel: this.model + }); this._dialog = new OC.Share.ShareDialogView({ configModel: configModel, model: shareModel diff --git a/core/css/share.css b/core/css/share.css index 0d687cb76d..bdf34e9a86 100644 --- a/core/css/share.css +++ b/core/css/share.css @@ -126,10 +126,6 @@ a.unshare { margin-right: 0; } -#linkText,#linkPass,#expiration { - display:none; -} - #link #showPassword img { padding-left:5px; width:12px; diff --git a/core/js/shareconfigmodel.js b/core/js/shareconfigmodel.js index e948c57cba..846b2692ec 100644 --- a/core/js/shareconfigmodel.js +++ b/core/js/shareconfigmodel.js @@ -16,7 +16,8 @@ var ShareConfigModel = OC.Backbone.Model.extend({ defaults: { - publicUploadEnabled: false + publicUploadEnabled: false, + enforcePasswordForPublicLink: oc_appconfig.core.enforcePasswordForPublicLink }, /** diff --git a/core/js/sharedialogexpirationview.js b/core/js/sharedialogexpirationview.js index 4c628f5498..9fb404a090 100644 --- a/core/js/sharedialogexpirationview.js +++ b/core/js/sharedialogexpirationview.js @@ -14,11 +14,14 @@ } var TEMPLATE = + // well that could go to linkShareView… + '{{#if isLinkShare}}' + '' + '' + '' + '' + - '{{defaultExpireMessage}}' + '{{defaultExpireMessage}}' + + '{{/if}}' ; /** @@ -44,6 +47,8 @@ /** @type {boolean} **/ showLink: true, + className: 'hidden', + initialize: function(options) { if(!_.isUndefined(options.configModel)) { this.configModel = options.configModel; @@ -68,7 +73,8 @@ setExpirationLabel: t('core', 'Set expiration date'), expirationLabel: t('core', 'Expiration'), expirationDatePlaceholder: t('core', 'Expiration date'), - defaultExpireMessage: defaultExpireMessage + defaultExpireMessage: defaultExpireMessage, + isLinkShare: this.model.get('linkShare').isLinkShare })); return this; diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js index eebf8a3424..373d6d180b 100644 --- a/core/js/sharedialoglinkshareview.js +++ b/core/js/sharedialoglinkshareview.js @@ -16,16 +16,20 @@ var TEMPLATE = '{{#if shareAllowed}}' + '' + - '' + + '' + '
' + '' + - '' + - '' + + '' + + ' {{#if showPasswordCheckBox}}' + + '' + + ' {{/if}}' + + ' {{#if isPasswordSet}}' + '
' + ' ' + - ' ' + + ' ' + ' ' + '
' + + ' {{/if}}' + ' {{#if publicUpload}}' + '