diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-02-04 11:26:11 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-02-04 11:26:11 +0100 |
commit | 2e46576e83ca4e30801060e0c23b1f587e6e318a (patch) | |
tree | 78f0ff86739fb3f56518183b6295449383d50683 /apps/comments/js | |
parent | b594aa18ee958c955f6f30bed3f446b2cd86cecd (diff) | |
download | nextcloud-server-2e46576e83ca4e30801060e0c23b1f587e6e318a.tar.gz nextcloud-server-2e46576e83ca4e30801060e0c23b1f587e6e318a.zip |
Special label for deleted users in comments list
Diffstat (limited to 'apps/comments/js')
-rw-r--r-- | apps/comments/js/commentstabview.js | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js index 2c5e9414751..8faf98b35ab 100644 --- a/apps/comments/js/commentstabview.js +++ b/apps/comments/js/commentstabview.js @@ -44,7 +44,7 @@ '<li class="comment{{#if isUnread}} unread{{/if}}" data-id="{{id}}">' + ' <div class="authorRow">' + ' {{#if avatarEnabled}}' + - ' <div class="avatar" data-username="{{actorId}}"> </div>' + + ' <div class="avatar" {{#if actorId}}data-username="{{actorId}}"{{/if}}> </div>' + ' {{/if}}' + ' <div class="author">{{actorDisplayName}}</div>' + '{{#if isUserAuthor}}' + @@ -115,11 +115,20 @@ if (!this._commentTemplate) { this._commentTemplate = Handlebars.compile(COMMENT_TEMPLATE); } - return this._commentTemplate(_.extend({ + + params = _.extend({ avatarEnabled: this._avatarsEnabled, editTooltip: t('comments', 'Edit comment'), isUserAuthor: OC.getCurrentUser().uid === params.actorId - }, params)); + }, params); + + if (params.actorType === 'deleted_users') { + // makes the avatar a X + params.actorId = null; + params.actorDisplayName = t('comments', '[Deleted user]'); + } + + return this._commentTemplate(params); }, getLabel: function() { @@ -149,7 +158,9 @@ this.$el.find('.comments').before(this.editCommentTemplate({})); this.$el.find('.has-tooltip').tooltip(); this.$container = this.$el.find('ul.comments'); - this.$el.find('.avatar').avatar(OC.getCurrentUser().uid, 28); + if (this._avatarsEnabled) { + this.$el.find('.avatar').avatar(OC.getCurrentUser().uid, 28); + } this.delegateEvents(); }, |