mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 07:55:36 +00:00
[folder perm, share] select contacts: enable search contact name
This commit is contained in:
@@ -2423,7 +2423,7 @@ def set_group_folder_perm(request, repo_id):
|
||||
content_type = 'application/json; charset=utf-8'
|
||||
|
||||
if not (is_pro_version() and ENABLE_FOLDER_PERM):
|
||||
return HttpResponse(json.dumps({"error": True}),
|
||||
return HttpResponse(json.dumps({"error": _(u"Permission denied")}),
|
||||
status=403, content_type=content_type)
|
||||
|
||||
group_id = request.POST.get('group_id', None)
|
||||
|
@@ -97,7 +97,7 @@ define([
|
||||
for (var i = 0, len = contacts.length; i < len; i++) {
|
||||
contact_list.push({ // 'id' & 'text' are required by the plugin
|
||||
"id": contacts[i].email,
|
||||
"text": contacts[i].email,
|
||||
"text": contacts[i].name + contacts[i].email, // for search. both name & email can be searched.
|
||||
"avatar": contacts[i].avatar,
|
||||
"name": contacts[i].name
|
||||
});
|
||||
@@ -107,13 +107,13 @@ define([
|
||||
tokenSeparators: [',', ' '],
|
||||
formatResult: function(item) { // format items shown in the drop-down menu
|
||||
if (item.avatar) {
|
||||
return item.avatar + '<span class="text">' + item.name + '<br />' + item.text + '</span>';
|
||||
return item.avatar + '<span class="text">' + item.name + '<br />' + item.id + '</span>';
|
||||
} else {
|
||||
return; // if no match, show nothing
|
||||
}
|
||||
},
|
||||
formatSelection: function(item) { // format selected item shown in the input
|
||||
return item.name || item.text; // if no name, show the email, i.e., when directly input, show the email
|
||||
return item.name || item.id; // if no name, show the email, i.e., when directly input, show the email
|
||||
},
|
||||
escapeMarkup: function(m) { return m; }
|
||||
});
|
||||
|
@@ -420,7 +420,7 @@ define([
|
||||
for (var i = 0, len = contacts.length; i < len; i++) {
|
||||
contact_list.push({ // 'id' & 'text' are required by the plugin
|
||||
"id": contacts[i].email,
|
||||
"text": contacts[i].email,
|
||||
"text": contacts[i].name + contacts[i].email, // for search. both name & email can be searched.
|
||||
"avatar": contacts[i].avatar,
|
||||
"name": contacts[i].name
|
||||
});
|
||||
@@ -429,13 +429,13 @@ define([
|
||||
},
|
||||
formatResult: function(item) { // format items shown in the drop-down menu
|
||||
if (item.avatar) {
|
||||
return item.avatar + '<span class="text">' + item.name + '<br />' + item.text + '</span>';
|
||||
return item.avatar + '<span class="text">' + item.name + '<br />' + item.id + '</span>';
|
||||
} else {
|
||||
return; // if no match, show nothing
|
||||
}
|
||||
},
|
||||
formatSelection: function(item) { // format selected item shown in the input
|
||||
return item.name || item.text; // if no name, show the email, i.e., when directly input, show the email
|
||||
return item.name || item.id; // if no name, show the email, i.e., when directly input, show the email
|
||||
},
|
||||
tokenSeparators: [',', ' '],
|
||||
escapeMarkup: function(m) { return m; }
|
||||
@@ -499,7 +499,7 @@ define([
|
||||
for (var i = 0, len = contacts.length; i < len; i++) {
|
||||
contact_list.push({ // 'id' & 'text' are required by the plugin
|
||||
"id": contacts[i].email,
|
||||
"text": contacts[i].email,
|
||||
"text": contacts[i].name + contacts[i].email, // for search. both name & email can be searched.
|
||||
"avatar": contacts[i].avatar,
|
||||
"name": contacts[i].name
|
||||
});
|
||||
@@ -508,13 +508,13 @@ define([
|
||||
},
|
||||
formatResult: function(item) { // format items shown in the drop-down menu
|
||||
if (item.avatar) {
|
||||
return item.avatar + '<span class="text">' + item.name + '<br />' + item.text + '</span>';
|
||||
return item.avatar + '<span class="text">' + item.name + '<br />' + item.id + '</span>';
|
||||
} else {
|
||||
return; // if no match, show nothing
|
||||
}
|
||||
},
|
||||
formatSelection: function(item) { // format selected item shown in the input
|
||||
return item.name || item.text; // if no name, show the email, i.e., when directly input, show the email
|
||||
return item.name || item.id; // if no name, show the email, i.e., when directly input, show the email
|
||||
},
|
||||
tokenSeparators: [',', ' '],
|
||||
escapeMarkup: function(m) { return m; }
|
||||
|
Reference in New Issue
Block a user