mirror of https://github.com/jumpserver/jumpserver
修改bug
parent
9dc7e953c9
commit
cc72d59965
|
@ -38,3 +38,11 @@ def groups_str(username):
|
|||
@register.filter(name='get_item')
|
||||
def get_item(dictionary, key):
|
||||
return dictionary.get(key)
|
||||
|
||||
|
||||
@register.filter(name='bool2str')
|
||||
def bool2str(value):
|
||||
if value:
|
||||
return u'是'
|
||||
else:
|
||||
return u'否'
|
|
@ -153,9 +153,9 @@ def group_list(request):
|
|||
|
||||
def user_list(request):
|
||||
user_role = {'SU': u'超级管理员', 'GA': u'组管理员', 'CU': u'普通用户'}
|
||||
header_title, path1, path2 = '查看用户 | Add User', 'juser', 'user_list'
|
||||
users = contact_list = User.objects.all()
|
||||
p = paginator = Paginator(contact_list, 5)
|
||||
header_title, path1, path2 = '查看用户 | Show User', 'juser', 'user_list'
|
||||
users = contact_list = User.objects.all().order_by('id')
|
||||
p = paginator = Paginator(contact_list, 10)
|
||||
|
||||
try:
|
||||
page = int(request.GET.get('page', '1'))
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
<th class="text-center">角色</th>
|
||||
<th class="text-center">Email</th>
|
||||
<th class="text-center">激活</th>
|
||||
<th class="text-center">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -56,7 +57,7 @@
|
|||
<td class="text-center"> {{ user.username|groups_str }}</td>
|
||||
<td class="text-center">{{ user.id|get_role }}</td>
|
||||
<td class="text-center">{{ user.email }}</td>
|
||||
<td class="text-center">{{ user.is_active }}</td>
|
||||
<td class="text-center">{{ user.is_active|bool2str }}</td>
|
||||
<td class="text-center">
|
||||
<a href="/juser/{{ user.username }}/" class="iframe btn btn-xs btn-primary">详情</a>
|
||||
<a href="/juser/user_edit/{{ user.username }}" class="btn btn-xs btn-info">编辑</a>
|
||||
|
|
Loading…
Reference in New Issue