diff options
author | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2017-08-13 15:39:48 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-10-31 11:35:19 +0100 |
commit | 9998700e7c9e8bccc901e21214a863f1aea86344 (patch) | |
tree | a44956d750b2ed23850dca171c2a230d3b7e0d2e | |
parent | 8ce5adcf70445ff9f319d301ebaf11e97431906c (diff) | |
download | nextcloud-server-9998700e7c9e8bccc901e21214a863f1aea86344.tar.gz nextcloud-server-9998700e7c9e8bccc901e21214a863f1aea86344.zip |
Show avatar instead of username for shared files
Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
-rw-r--r-- | apps/files/css/files.scss | 4 | ||||
-rw-r--r-- | core/js/share.js | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/apps/files/css/files.scss b/apps/files/css/files.scss index c03b1ce6fad..1fc38f03672 100644 --- a/apps/files/css/files.scss +++ b/apps/files/css/files.scss @@ -555,6 +555,10 @@ a.action > img { #fileList a.action.action-share { padding: 17px 14px; } +#fileList a.action.action-share .avatar { + display: inline-block; + vertical-align: middle; +} #fileList a.action.action-menu { padding-top: 17px; diff --git a/core/js/share.js b/core/js/share.js index 659d719788d..c8eaa08878e 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -207,7 +207,7 @@ OC.Share = _.extend(OC.Share || {}, { var parts = this._REMOTE_OWNER_REGEXP.exec(remoteAddress); if (!parts) { // display as is, most likely to be a simple owner name - return escapeHTML(remoteAddress); + return '<div class="avatar" data-userName="' + escapeHTML(remoteAddress) + '" title="' + t('core', 'Shared by') + ' ' + escapeHTML(remoteAddress) + '"></div>'; } var userName = parts[1]; @@ -303,7 +303,12 @@ OC.Share = _.extend(OC.Share || {}, { message = t('core', 'Shared with {recipients}', {recipients: this._formatShareList(recipients.split(", ")).join(", ")}, 0, {escape: false}); } action.html('<span> ' + message + '</span>').prepend(icon); + if (owner || recipients) { + var avatarElement = action.find('.avatar'); + avatarElement.avatar(avatarElement.data('username'), 32); + avatarElement.tooltip({placement: 'top'}); + action.find('.remoteAddress').tooltip({placement: 'top'}); } } |