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:
@@ -2,11 +2,11 @@
|
|||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
{% if is_pro %}
|
{% 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 "Status" %}</th>
|
||||||
<th width="12%">{% trans "Role" %}</th>
|
<th width="12%">{% trans "Role" %}</th>
|
||||||
{% else %}
|
{% else %}
|
||||||
<th width="36%">{% trans "Email" %}</th>
|
<th width="36%">{% trans "Email" %} / {% trans "Name" %} / {% trans "Contact Email" %}</th>
|
||||||
<th width="12%">{% trans "Status" %}</th>
|
<th width="12%">{% trans "Status" %}</th>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<th width="16%">{% trans "Space Used" %}</th>
|
<th width="16%">{% trans "Space Used" %}</th>
|
||||||
@@ -16,15 +16,18 @@
|
|||||||
|
|
||||||
{% for user in users %}
|
{% for user in users %}
|
||||||
<tr data-userid="{{user.email}}">
|
<tr data-userid="{{user.email}}">
|
||||||
<td><a href="{% url 'user_info' user.email %}">{{ user.email }}</a>
|
<td>
|
||||||
{% if not is_admin_page %}
|
<a href="{% url 'user_info' user.email %}">{{ user.email }}</a>
|
||||||
{% if user.org %}
|
{% if user.name %}<br />{{ user.name }}{% endif %}
|
||||||
<p style="font-size:11px;"><a href="{% url 'sys_org_info_user' user.org.org_id %}">({{user.org.org_name}})</a></p>
|
{% if user.contact_email %}<br />{{ user.contact_email }}{% endif %}
|
||||||
{% endif %}
|
{% if not is_admin_page %}
|
||||||
{% if user.trial_info %}
|
{% if user.org %}
|
||||||
<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>
|
<p style="font-size:11px;"><a href="{% url 'sys_org_info_user' user.org.org_id %}">({{user.org.org_name}})</a></p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% 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>
|
||||||
<td>
|
<td>
|
||||||
<div class="user-status">
|
<div class="user-status">
|
||||||
|
@@ -190,6 +190,14 @@ def sys_user_admin(request):
|
|||||||
else:
|
else:
|
||||||
trial_users = []
|
trial_users = []
|
||||||
for user in 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:
|
if user.email == request.user.email:
|
||||||
user.is_self = True
|
user.is_self = True
|
||||||
|
|
||||||
@@ -1452,6 +1460,14 @@ def user_search(request):
|
|||||||
for user in users:
|
for user in users:
|
||||||
_populate_user_quota_usage(user)
|
_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
|
# check user's role
|
||||||
if user.role == GUEST_USER:
|
if user.role == GUEST_USER:
|
||||||
user.is_guest = True
|
user.is_guest = True
|
||||||
|
Reference in New Issue
Block a user