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
6d545565
Commit
6d545565
authored
Jan 24, 2015
by
guanghongwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
╡И
©
╢пч╦д
parent
dc8f6d4d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
116 additions
and
144 deletions
+116
-144
views.py
juser/views.py
+13
-2
group_list.html
templates/juser/group_list.html
+103
-61
user_list2.html
templates/juser/user_list2.html
+0
-81
No files found.
juser/views.py
View file @
6d545565
...
@@ -147,8 +147,19 @@ def group_add(request):
...
@@ -147,8 +147,19 @@ def group_add(request):
def
group_list
(
request
):
def
group_list
(
request
):
header_title
,
path1
,
path2
=
'查看属组 | Add Group'
,
'juser'
,
'group_list'
header_title
,
path1
,
path2
=
'查看属组 | Show Group'
,
'juser'
,
'group_list'
groups
=
UserGroup
.
objects
.
all
()
groups
=
contact_list
=
UserGroup
.
objects
.
all
()
.
order_by
(
'id'
)
p
=
paginator
=
Paginator
(
contact_list
,
10
)
try
:
page
=
int
(
request
.
GET
.
get
(
'page'
,
'1'
))
except
ValueError
:
page
=
1
try
:
contacts
=
paginator
.
page
(
page
)
except
(
EmptyPage
,
InvalidPage
):
contacts
=
paginator
.
page
(
paginator
.
num_pages
)
return
render_to_response
(
'juser/group_list.html'
,
locals
())
return
render_to_response
(
'juser/group_list.html'
,
locals
())
...
...
templates/juser/group_list.html
View file @
6d545565
{% extends 'base.html' %}
{% extends 'base.html' %}
{% load mytags %}
{% block content %}
{% block content %}
{% include 'nav_cat_bar.html' %}
{% include 'nav_cat_bar.html' %}
<div
class=
"wrapper wrapper-content animated fadeInRight"
>
<div
class=
"row"
>
<div
class=
"wrapper wrapper-content animated fadeInRight"
>
<div
class=
"col-lg-10"
>
<div
class=
"row"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"col-lg-10"
>
<div
class=
"ibox-title"
>
<div
class=
"ibox float-e-margins"
>
<h5>
属组信息
<small>
show group info.
</small></h5>
<div
class=
"ibox-title"
>
<div
class=
"ibox-tools"
>
<h5>
查看分组
<small>
show group info.
</small>
</h5>
<a
class=
"collapse-link"
>
<div
class=
"ibox-tools"
>
<i
class=
"fa fa-chevron-up"
></i>
<a
class=
"collapse-link"
>
</a>
<i
class=
"fa fa-chevron-up"
></i>
<a
class=
"dropdown-toggle"
data-toggle=
"dropdown"
href=
"#"
>
</a>
<i
class=
"fa fa-wrench"
></i>
<a
class=
"dropdown-toggle"
data-toggle=
"dropdown"
href=
"#"
>
</a>
<i
class=
"fa fa-wrench"
></i>
<ul
class=
"dropdown-menu dropdown-user"
>
</a>
<li><a
href=
"#"
>
未启用 1
</a>
<ul
class=
"dropdown-menu dropdown-user"
>
</li>
<li><a
href=
"#"
>
未启用 1
</a>
<li><a
href=
"#"
>
未启用 2
</a>
</li>
</li>
<li><a
href=
"#"
>
未启用 2
</a>
</ul>
</li>
<a
class=
"close-link"
>
</ul>
<i
class=
"fa fa-times"
></i>
<a
class=
"close-link"
>
</a>
<i
class=
"fa fa-times"
></i>
</div>
</a>
</div>
</div>
<div
class=
"ibox-content"
>
<div
class=
""
>
<a
target=
"_blank"
href=
"/juser/user_add/"
class=
"btn btn-sm btn-primary "
>
添加
</a>
</div>
</div>
<div
class=
"ibox-content"
style=
"display: block;"
>
<form
method=
"post"
action=
""
>
<table
class=
"table table-striped table-bordered table-hover "
id=
"editable"
>
<table
class=
"table table-hover"
>
<thead>
<thead>
<tr>
<tr>
<th
class=
"text-center"
><input
type=
"checkbox"
class=
"i-checks"
name=
""
></th>
<th>
<th
class=
"text-center"
>
ID
</th>
<div
class=
"checkbox i-checks"
>
<th
class=
"text-center"
>
组名
</th>
<input
onclick=
"selectAll()"
type=
"checkbox"
name=
"select_all"
style=
"select_all"
id=
"select_all"
>
<th
class=
"text-center"
>
备注
</th>
</div>
<th
class=
"text-center"
>
操作
</th>
</th>
</tr>
<th>
ID
</th>
</thead>
<th>
组名
</th>
<tbody>
<th>
备注
</th>
{% for group in contacts.object_list %}
</tr>
<tr
class=
"gradeX"
>
</thead>
<td
class=
"text-center"
><input
type=
"checkbox"
class=
"i-checks"
name=
""
></td>
<tbody>
<td
class=
"text-center"
>
{{ group.id }}
</td>
{% for group in groups %}
<td
class=
"text-center"
>
{{ group.name }}
</td>
<tr>
<td
class=
"text-center"
>
{{ user.comment }}
</td>
<td>
<td
class=
"text-center"
>
<div
class=
"checkbox i-checks"
>
<a
href=
"../group_detail/?id={{ group.id }}"
class=
"iframe btn btn-xs btn-primary"
>
详情
</a>
<input
type=
"checkbox"
value=
"{{ group.id }}"
name=
"selected"
>
<a
href=
"../group_edit/?id={{ group.id }}"
class=
"btn btn-xs btn-info"
>
编辑
</a>
</div>
<a
href=
"../group_del/?id={{ group.id }}"
class=
"btn btn-xs btn-danger"
>
删除
</a>
</td>
</td>
<td>
{{ group.id }}
</td>
</tr>
<td>
{{ group.name }}
</td>
{% endfor %}
<td>
{{ group.comment }}
</td>
</tbody>
</tr>
</table>
{% endfor %}
<div
class=
"row"
>
</tbody>
<div
class=
"col-sm-6"
>
</table>
<div
class=
"dataTables_info"
id=
"editable_info"
role=
"status"
aria-live=
"polite"
>
<div
class=
"form-group"
>
Showing {{ contacts.start_index }} to {{ contacts.end_index }} of {{ p.count }} entries
<div
class=
"col-sm-4 col-sm-offset-2"
>
</div>
<button
class=
"btn btn-white"
type=
"submit"
>
取消
</button>
</div>
<button
id=
"submit_button"
class=
"btn btn-primary"
type=
"submit"
>
确认删除
</button>
<div
class=
"col-sm-6"
>
</div>
<div
class=
"dataTables_paginate paging_simple_numbers"
id=
"editable_paginate"
>
<ul
class=
"pagination"
style=
"margin-top: 0; float: right"
>
{% if contacts.has_previous %}
<li
class=
"paginate_button previous"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_previous"
>
<a
href=
"?page={{ contacts.previous_page_number }}"
>
Previous
</a>
</li>
{% else %}
<li
class=
"paginate_button previous disabled"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_previous"
>
<a
href=
"#"
>
Previous
</a>
</li>
{% endif %}
{% for page in p.page_range %}
{% ifequal offset1 page %}
<li
class=
"paginate_button active"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?page={{ page }}"
title=
"第{{ page }}页"
>
{{ page }}
</a></li>
{% else %}
<li
class=
"paginate_button"
aria-controls=
"editable"
tabindex=
"0"
><a
href=
"?page={{ page }}"
title=
"第{{ page }}页"
>
{{ page }}
</a></li>
{% endifequal %}
{% endfor %}
{% if contacts.has_next %}
<li
class=
"paginate_button next"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_next"
>
<a
href=
"?page={{ contacts.next_page_number }}"
>
Next
</a>
</li>
{% else %}
<li
class=
"paginate_button next disabled"
aria-controls=
"editable"
tabindex=
"0"
id=
"editable_next"
>
<a
href=
"#"
>
Next
</a>
</li>
{% endif %}
</ul>
</div>
</div>
</
form
>
</
div
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$
(
document
).
ready
(
function
(){
$
(
".iframe"
).
colorbox
({
iframe
:
true
,
width
:
"70%"
,
height
:
"70%"
});
});
</script>
{% endblock %}
{% endblock %}
\ No newline at end of file
templates/juser/user_list2.html
deleted
100644 → 0
View file @
dc8f6d4d
{% extends 'base.html' %}
{% load mytags %}
{% block content %}
{% include 'nav_cat_bar.html' %}
<div
class=
"wrapper wrapper-content animated fadeInRight"
>
<div
class=
"row"
>
<div
class=
"col-lg-10"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<h5>
用户信息
<small>
show user info.
</small></h5>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
</a>
<a
class=
"dropdown-toggle"
data-toggle=
"dropdown"
href=
"#"
>
<i
class=
"fa fa-wrench"
></i>
</a>
<ul
class=
"dropdown-menu dropdown-user"
>
<li><a
href=
"#"
>
未启用 1
</a>
</li>
<li><a
href=
"#"
>
未启用 2
</a>
</li>
</ul>
<a
class=
"close-link"
>
<i
class=
"fa fa-times"
></i>
</a>
</div>
</div>
<div
class=
"ibox-content"
style=
"display: block;"
>
<form
method=
"post"
action=
""
>
<table
class=
"table table-hover"
>
<thead>
<tr>
<th>
<div
class=
"checkbox i-checks"
>
<input
onclick=
"selectAll()"
type=
"checkbox"
name=
"select_all"
style=
"select_all"
id=
"select_all"
>
</div>
</th>
<th>
ID
</th>
<th>
用户名
</th>
<th>
姓名
</th>
<th>
属组
</th>
<th>
角色
</th>
<th>
Email
</th>
<th>
激活
</th>
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td>
<div
class=
"checkbox i-checks"
>
<input
type=
"checkbox"
value=
"{{ user.id }}"
name=
"selected"
>
</div>
</td>
<td>
{{ user.id }}
</td>
<td>
{{ user.username }}
</td>
<td>
{{ user.name }}
</td>
<td>
{{ user.username|groups_str }}
</td>
<td>
{{ user.id|get_role }}
</td>
<td>
{{ user.email }}
</td>
<td>
{{ user.is_active }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div
class=
"form-group"
>
<div
class=
"col-sm-4 col-sm-offset-2"
>
<button
class=
"btn btn-white"
type=
"submit"
>
取消
</button>
<button
id=
"submit_button"
class=
"btn btn-primary"
type=
"submit"
>
确认删除
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
\ No newline at end of file
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