Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
cc72d599
Commit
cc72d599
authored
Jan 22, 2015
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
9dc7e953
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
mytags.py
jumpserver/templatetags/mytags.py
+9
-0
views.py
juser/views.py
+3
-3
user_list.html
templates/juser/user_list.html
+2
-1
No files found.
jumpserver/templatetags/mytags.py
View file @
cc72d599
...
@@ -38,3 +38,11 @@ def groups_str(username):
...
@@ -38,3 +38,11 @@ def groups_str(username):
@register.filter
(
name
=
'get_item'
)
@register.filter
(
name
=
'get_item'
)
def
get_item
(
dictionary
,
key
):
def
get_item
(
dictionary
,
key
):
return
dictionary
.
get
(
key
)
return
dictionary
.
get
(
key
)
@register.filter
(
name
=
'bool2str'
)
def
bool2str
(
value
):
if
value
:
return
u'是'
else
:
return
u'否'
\ No newline at end of file
juser/views.py
View file @
cc72d599
...
@@ -153,9 +153,9 @@ def group_list(request):
...
@@ -153,9 +153,9 @@ def group_list(request):
def
user_list
(
request
):
def
user_list
(
request
):
user_role
=
{
'SU'
:
u'超级管理员'
,
'GA'
:
u'组管理员'
,
'CU'
:
u'普通用户'
}
user_role
=
{
'SU'
:
u'超级管理员'
,
'GA'
:
u'组管理员'
,
'CU'
:
u'普通用户'
}
header_title
,
path1
,
path2
=
'查看用户 |
Add
User'
,
'juser'
,
'user_list'
header_title
,
path1
,
path2
=
'查看用户 |
Show
User'
,
'juser'
,
'user_list'
users
=
contact_list
=
User
.
objects
.
all
()
users
=
contact_list
=
User
.
objects
.
all
()
.
order_by
(
'id'
)
p
=
paginator
=
Paginator
(
contact_list
,
5
)
p
=
paginator
=
Paginator
(
contact_list
,
10
)
try
:
try
:
page
=
int
(
request
.
GET
.
get
(
'page'
,
'1'
))
page
=
int
(
request
.
GET
.
get
(
'page'
,
'1'
))
...
...
templates/juser/user_list.html
View file @
cc72d599
...
@@ -44,6 +44,7 @@
...
@@ -44,6 +44,7 @@
<th
class=
"text-center"
>
角色
</th>
<th
class=
"text-center"
>
角色
</th>
<th
class=
"text-center"
>
Email
</th>
<th
class=
"text-center"
>
Email
</th>
<th
class=
"text-center"
>
激活
</th>
<th
class=
"text-center"
>
激活
</th>
<th
class=
"text-center"
>
操作
</th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
...
@@ -56,7 +57,7 @@
...
@@ -56,7 +57,7 @@
<td
class=
"text-center"
>
{{ user.username|groups_str }}
</td>
<td
class=
"text-center"
>
{{ user.username|groups_str }}
</td>
<td
class=
"text-center"
>
{{ user.id|get_role }}
</td>
<td
class=
"text-center"
>
{{ user.id|get_role }}
</td>
<td
class=
"text-center"
>
{{ user.email }}
</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"
>
<td
class=
"text-center"
>
<a
href=
"/juser/{{ user.username }}/"
class=
"iframe btn btn-xs btn-primary"
>
详情
</a>
<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>
<a
href=
"/juser/user_edit/{{ user.username }}"
class=
"btn btn-xs btn-info"
>
编辑
</a>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment