diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-07-13 17:29:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-13 17:29:57 +0200 |
commit | 82021b2b1bd6e6ae9c85564ba614797a1110e29c (patch) | |
tree | dcae47bf607411ae0e2e4e54ed5715aa98354c35 /core/js/sharedialogshareelistview.js | |
parent | 14314584ba88ed8d8a7c8486b61c6677a14271f2 (diff) | |
parent | 4f5814c27bc43a8f10bd35f60bc3254697c50659 (diff) | |
download | nextcloud-server-82021b2b1bd6e6ae9c85564ba614797a1110e29c.tar.gz nextcloud-server-82021b2b1bd6e6ae9c85564ba614797a1110e29c.zip |
Merge pull request #5280 from nextcloud/shared-with-display-name
sharedWithDisplayName & sharedWithAvatar
Diffstat (limited to 'core/js/sharedialogshareelistview.js')
-rw-r--r-- | core/js/sharedialogshareelistview.js | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js index 0ff4c36b712..53a65fcdf7a 100644 --- a/core/js/sharedialogshareelistview.js +++ b/core/js/sharedialogshareelistview.js @@ -25,7 +25,7 @@ '<ul id="shareWithList" class="shareWithList">' + '{{#each sharees}}' + '<li data-share-id="{{shareId}}" data-share-type="{{shareType}}" data-share-with="{{shareWith}}">' + - '<div class="avatar {{#if modSeed}}imageplaceholderseed{{/if}}" data-username="{{shareWith}}" data-displayname="{{shareWithDisplayName}}" {{#if modSeed}}data-seed="{{shareWith}} {{shareType}}"{{/if}}></div>' + + '<div class="avatar {{#if modSeed}}imageplaceholderseed{{/if}}" data-username="{{shareWith}}" data-avatar="{{shareWithAvatar}}" data-displayname="{{shareWithDisplayName}}" {{#if modSeed}}data-seed="{{shareWith}} {{shareType}}"{{/if}}></div>' + '<span class="username" title="{{shareWithTitle}}">{{shareWithDisplayName}}</span>' + '<span class="sharingOptionsGroup">' + '{{#if editPermissionPossible}}' + @@ -188,6 +188,7 @@ getShareeObject: function(shareIndex) { var shareWith = this.model.getShareWith(shareIndex); var shareWithDisplayName = this.model.getShareWithDisplayName(shareIndex); + var shareWithAvatar = this.model.getShareWithAvatar(shareIndex); var shareWithTitle = ''; var shareType = this.model.getShareType(shareIndex); var sharedBy = this.model.getSharedBy(shareIndex); @@ -216,6 +217,10 @@ shareWithTitle = shareWith + " (" + t('core', 'email') + ')'; } else if (shareType === OC.Share.SHARE_TYPE_CIRCLE) { shareWithTitle = shareWith; + // Force "shareWith" in the template to a safe value, as the + // original "shareWith" returned by the model may contain + // problematic characters like "'". + shareWith = 'circle-' + shareIndex; } if (sharedBy !== oc_current_user) { @@ -243,10 +248,11 @@ hasDeletePermission: this.model.hasDeletePermission(shareIndex), shareWith: shareWith, shareWithDisplayName: shareWithDisplayName, + shareWithAvatar: shareWithAvatar, shareWithTitle: shareWithTitle, shareType: shareType, shareId: this.model.get('shares')[shareIndex].id, - modSeed: shareType !== OC.Share.SHARE_TYPE_USER && shareType !== OC.Share.SHARE_TYPE_CIRCLE, + modSeed: shareType !== OC.Share.SHARE_TYPE_USER && (shareType !== OC.Share.SHARE_TYPE_CIRCLE || shareWithAvatar), isRemoteShare: shareType === OC.Share.SHARE_TYPE_REMOTE, isRemoteGroupShare: shareType === OC.Share.SHARE_TYPE_REMOTE_GROUP, isMailShare: shareType === OC.Share.SHARE_TYPE_EMAIL, @@ -357,9 +363,16 @@ this.$('.avatar').each(function () { var $this = $(this); + if ($this.hasClass('imageplaceholderseed')) { $this.css({width: 32, height: 32}); - $this.imageplaceholder($this.data('seed')); + if ($this.data('avatar')) { + $this.css('border-radius', '0%'); + $this.css('background', 'url(' + $this.data('avatar') + ') no-repeat'); + $this.css('background-size', '31px'); + } else { + $this.imageplaceholder($this.data('seed')); + } } else { // user, size, ie8fix, hidedefault, callback, displayname $this.avatar($this.data('username'), 32, undefined, undefined, undefined, $this.data('displayname')); |