mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-20 10:58:33 +00:00
[sysadmin] update user admin page
This commit is contained in:
@@ -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,15 +16,18 @@
|
||||
|
||||
{% for user in users %}
|
||||
<tr data-userid="{{user.email}}">
|
||||
<td><a href="{% url 'user_info' user.email %}">{{ user.email }}</a>
|
||||
{% 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>
|
||||
{% endif %}
|
||||
{% if user.trial_info %}
|
||||
<p style="font-size:11px;">(Trial <a href="#" class="unset-trial" data-target="{{ user.email }}" data-url="{% url 'remove_trial' user.email %}">X</a>)</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<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>
|
||||
{% endif %}
|
||||
{% if user.trial_info %}
|
||||
<p style="font-size:11px;">(Trial <a href="#" class="unset-trial" data-target="{{ user.email }}" data-url="{% url 'remove_trial' user.email %}">X</a>)</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<div class="user-status">
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user