1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-01 23:38:37 +00:00

Add autocomplete when add org user

This commit is contained in:
xiez 2012-08-03 17:04:15 +08:00
parent dc52b5914c
commit 22e90d06d3
2 changed files with 11 additions and 1 deletions

View File

@ -71,7 +71,6 @@
<label>邮箱:</label><br />
<textarea id="added-member-name" name="added-member-name"></textarea>
<p class="tip">可以是非网站注册用户,我们会以邮件通知对方。</p>
<p class="tip">(如未收到,请检查垃圾邮件)</p>
<p class="error hide">输入不能为空。</p>
<input type="submit" value="提交" />
</form>
@ -88,6 +87,12 @@ $('.activate').each(function(){
$('.user-add').click(function() {
$("#user-add-form").modal({appendTo: "#main"});
var contacts_list = [];
{% for contact in contacts %}
contacts_list.push('{{ contact.contact_email }}');
{% endfor %}
addAutocomplete('#added-member-name', '#user-add-form', contacts_list);
return false;
});

View File

@ -22,6 +22,7 @@ from forms import OrgCreateForm
from signals import org_user_added
from notifications.models import UserNotification
from registration.models import RegistrationProfile
from seahub.contacts import Contact
from seahub.forms import RepoCreateForm
import seahub.settings as seahub_settings
from seahub.utils import render_error, render_permission_error, gen_token, \
@ -201,10 +202,14 @@ def org_useradmin(request, url_prefix):
for user in users:
if user.props.id == request.user.id:
user.is_self = True
# My contacts
contacts = Contact.objects.filter(user_email=request.user.username)
return render_to_response(
'organizations/org_useradmin.html', {
'users': users,
'contacts': contacts,
'current_page': current_page,
'prev_page': current_page-1,
'next_page': current_page+1,