summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2015-02-03 17:22:24 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2015-02-12 16:50:14 +0100
commit639a634cfdd2613ef0045a61a4382fd1bd517803 (patch)
tree6f861c52970157225ef87c725be475f43837a4a0 /core/js
parentc751ba04091195d499c0221fa7df38a85257eeca (diff)
downloadnextcloud-server-639a634cfdd2613ef0045a61a4382fd1bd517803.tar.gz
nextcloud-server-639a634cfdd2613ef0045a61a4382fd1bd517803.zip
Display user avatar in share dialog
Diffstat (limited to 'core/js')
-rw-r--r--core/js/share.js18
1 files changed, 16 insertions, 2 deletions
diff --git a/core/js/share.js b/core/js/share.js
index b3533af4824..1e86cddb89d 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -358,9 +358,9 @@ OC.Share={
var html = '<div id="dropdown" class="drop shareDropDown" data-item-type="'+itemType+'" data-item-source="'+itemSource+'">';
if (data !== false && data.reshare !== false && data.reshare.uid_owner !== undefined) {
if (data.reshare.share_type == OC.Share.SHARE_TYPE_GROUP) {
- html += '<span class="reshare">'+t('core', 'Shared with you and the group {group} by {owner}', {group: data.reshare.share_with, owner: data.reshare.displayname_owner})+'</span>';
+ html += '<span class="reshare">'+t('core', 'Shared with you and the group {group} by {owner}', {group: data.reshare.share_with, owner: data.reshare.displayname_owner})+' <div id="avatar-share-owner" style="display: inline-block"></div></span>';
} else {
- html += '<span class="reshare">'+t('core', 'Shared with you by {owner}', {owner: data.reshare.displayname_owner})+'</span>';
+ html += '<span class="reshare">'+t('core', 'Shared with you by {owner}', {owner: data.reshare.displayname_owner})+' <div id="avatar-share-owner" style="display: inline-block"></div></span>';
}
html += '<br />';
// reduce possible permissions to what the original share allowed
@@ -437,6 +437,12 @@ OC.Share={
html += '</div>';
dropDownEl = $(html);
dropDownEl = dropDownEl.appendTo(appendTo);
+
+ //Get owner avatars
+ if (data !== false && data.reshare !== false && data.reshare.uid_owner !== undefined) {
+ $('#avatar-share-owner').avatar(data.reshare.uid_owner, 32);
+ }
+
// Reset item shares
OC.Share.itemShares = [];
OC.Share.currentShares = {};
@@ -650,6 +656,11 @@ OC.Share={
var html = '<li style="clear: both;" data-share-type="'+escapeHTML(shareType)+'" data-share-with="'+escapeHTML(shareWith)+'" title="' + escapeHTML(shareWith) + '">';
var showCrudsButton;
html += '<a href="#" class="unshare"><img class="svg" alt="'+t('core', 'Unshare')+'" title="'+t('core', 'Unshare')+'" src="'+OC.imagePath('core', 'actions/delete')+'"/></a>';
+ if (shareType == OC.Share.SHARE_TYPE_USER) {
+ html += '<div id="avatar-' + escapeHTML(shareWith) + '" class="avatar"></div>';
+ } else {
+ html += '<div class="avatar" style="padding-right: 32px"></div>';
+ }
html += '<span class="username">' + escapeHTML(shareWithDisplayName) + '</span>';
var mailNotificationEnabled = $('input:hidden[name=mailNotificationEnabled]').val();
if (mailNotificationEnabled === 'yes' && shareType !== OC.Share.SHARE_TYPE_REMOTE) {
@@ -681,6 +692,9 @@ OC.Share={
html += '</div>';
html += '</li>';
html = $(html).appendTo('#shareWithList');
+ if (shareType == OC.Share.SHARE_TYPE_USER) {
+ $('#avatar-' + escapeHTML(shareWith)).avatar(escapeHTML(shareWith), 32);
+ }
// insert cruds button into last label element
var lastLabel = html.find('>label:last');
if (lastLabel.exists()){