diff --git a/organizations/templates/organizations/org_useradmin.html b/organizations/templates/organizations/org_useradmin.html index bc4b5ad17f..2f1e6f5a24 100644 --- a/organizations/templates/organizations/org_useradmin.html +++ b/organizations/templates/organizations/org_useradmin.html @@ -71,7 +71,6 @@

可以是非网站注册用户,我们会以邮件通知对方。

-

(如未收到,请检查垃圾邮件)

输入不能为空。

@@ -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; }); diff --git a/organizations/views.py b/organizations/views.py index d47615fa6c..f4f90d78b5 100644 --- a/organizations/views.py +++ b/organizations/views.py @@ -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,