1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-20 02:48:51 +00:00

[sysadmin] update user admin page

This commit is contained in:
lian
2016-08-08 14:03:07 +08:00
parent 0ba90fb72a
commit 06022c3109
2 changed files with 30 additions and 11 deletions

View File

@@ -2,11 +2,11 @@
<table>
<tr>
{% if is_pro %}
<th width="24%">{% trans "Email" %}</th>
<th width="24%">{% trans "Email" %} / {% trans "Name" %} / {% trans "Contact Email" %}</th>
<th width="12%">{% trans "Status" %}</th>
<th width="12%">{% trans "Role" %}</th>
{% else %}
<th width="36%">{% trans "Email" %}</th>
<th width="36%">{% trans "Email" %} / {% trans "Name" %} / {% trans "Contact Email" %}</th>
<th width="12%">{% trans "Status" %}</th>
{% endif %}
<th width="16%">{% trans "Space Used" %}</th>
@@ -16,7 +16,10 @@
{% for user in users %}
<tr data-userid="{{user.email}}">
<td><a href="{% url 'user_info' user.email %}">{{ user.email }}</a>
<td>
<a href="{% url 'user_info' user.email %}">{{ user.email }}</a>
{% if user.name %}<br />{{ user.name }}{% endif %}
{% if user.contact_email %}<br />{{ user.contact_email }}{% endif %}
{% if not is_admin_page %}
{% if user.org %}
<p style="font-size:11px;"><a href="{% url 'sys_org_info_user' user.org.org_id %}">({{user.org.org_name}})</a></p>

View File

@@ -190,6 +190,14 @@ def sys_user_admin(request):
else:
trial_users = []
for user in users:
user_profile = Profile.objects.get_profile_by_user(user.email)
if user_profile:
user.contact_email = user_profile.contact_email
user.name = user_profile.nickname
else:
user.contact_email = ''
user.name = ''
if user.email == request.user.email:
user.is_self = True
@@ -1452,6 +1460,14 @@ def user_search(request):
for user in users:
_populate_user_quota_usage(user)
user_profile = Profile.objects.get_profile_by_user(user.email)
if user_profile:
user.contact_email = user_profile.contact_email
user.name = user_profile.nickname
else:
user.contact_email = ''
user.name = ''
# check user's role
if user.role == GUEST_USER:
user.is_guest = True