Display user avatar in share dialog
This commit is contained in:
parent
c751ba0409
commit
639a634cfd
2 changed files with 22 additions and 2 deletions
|
@ -68,6 +68,12 @@
|
|||
overflow: hidden;
|
||||
vertical-align: middle;
|
||||
}
|
||||
#shareWithList .avatar {
|
||||
margin-right: 2px;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
vertical-align: middle;
|
||||
}
|
||||
#shareWithList li label{
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
|
|
@ -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()){
|
||||
|
|
Loading…
Reference in a new issue