jumpserver/templates/juser/user_list.html

138 lines
6.6 KiB
HTML
Raw Normal View History

2015-01-14 15:30:20 +00:00
{% extends 'base.html' %}
2015-01-14 15:51:30 +00:00
{% load mytags %}
2015-01-14 15:30:20 +00:00
{% block content %}
2015-01-22 14:12:41 +00:00
{% include 'nav_cat_bar.html' %}
<div class="wrapper wrapper-content animated fadeInRight">
<div class="row">
2015-03-07 10:06:50 +00:00
<div class="col-lg-12">
2015-01-22 14:12:41 +00:00
<div class="ibox float-e-margins">
<div class="ibox-title">
2015-03-05 16:24:17 +00:00
<h5> 查看用户 </h5>
2015-01-22 14:12:41 +00:00
<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>
2015-01-14 15:30:20 +00:00
</div>
2015-01-22 14:12:41 +00:00
</div>
<div class="ibox-content">
<div class="">
2015-03-04 16:20:24 +00:00
<a target="_blank" href="/juser/user_add/" class="btn btn-sm btn-primary "> 添加用户 </a>
<a id="del_btn" class="btn btn-sm btn-danger "> 删除所选 </a>
2015-03-14 15:57:53 +00:00
<form id="search_form" method="get" action="" class="pull-right mail-search">
2015-03-03 10:42:06 +00:00
<div class="input-group">
2015-03-12 16:09:18 +00:00
<input type="text" class="form-control input-sm" id="search_input" name="keyword" placeholder="Search">
2015-03-03 10:42:06 +00:00
<div class="input-group-btn">
<button id='search_btn' type="submit" class="btn btn-sm btn-primary">
Search
</button>
</div>
</div>
</form>
2015-01-21 14:38:55 +00:00
</div>
2015-01-22 14:12:41 +00:00
<table class="table table-striped table-bordered table-hover " id="editable" >
<thead>
<tr>
2015-01-26 16:14:50 +00:00
<th class="text-center">
<input type="checkbox" id="select_all" onclick="selectAll()" name="select_all">
</th>
2015-01-22 14:12:41 +00:00
<th class="text-center">用户名</th>
<th class="text-center">姓名</th>
2015-02-01 15:03:28 +00:00
<th class="text-center">部门</th>
2015-03-03 10:42:06 +00:00
<th class="text-center">小组</th>
2015-01-22 14:12:41 +00:00
<th class="text-center">角色</th>
<th class="text-center">激活</th>
2015-01-22 14:26:13 +00:00
<th class="text-center">操作</th>
2015-01-22 14:12:41 +00:00
</tr>
</thead>
<tbody>
2015-01-22 15:15:50 +00:00
{% for user in contacts.object_list %}
2015-01-22 14:12:41 +00:00
<tr class="gradeX">
2015-01-26 16:14:50 +00:00
<td class="text-center">
<input type="checkbox" name="selected" value="{{ user.id }}">
</td>
2015-01-22 14:12:41 +00:00
<td class="text-center"> {{ user.username }} </td>
<td class="text-center"> {{ user.name }} </td>
2015-03-03 10:42:06 +00:00
<td class="text-center"> {{ user.dept.name }} </td>
2015-03-12 16:09:18 +00:00
<td class="text-center" title="{% for user_group in user.group.all %} {{ user_group.name }} {% endfor %}"> {{ user.group.all | group_str2 }} </td>
2015-03-03 10:42:06 +00:00
<td class="text-center"> {{ user.id | get_role }}</td>
2015-01-22 14:26:13 +00:00
<td class="text-center">{{ user.is_active|bool2str }}</td>
2015-01-22 14:12:41 +00:00
<td class="text-center">
2015-04-01 14:54:10 +00:00
<a title="[ {{ user.name }} ] 详情" value="../user_detail/?id={{ user.id }}" class="iframe btn btn-xs btn-primary">详情</a>
2015-03-19 15:57:08 +00:00
{% ifequal session_role_id 2 %}
2015-01-24 05:34:36 +00:00
<a href="../user_edit/?id={{ user.id }}" class="btn btn-xs btn-info">编辑</a>
<a href="../user_del/?id={{ user.id }}" class="btn btn-xs btn-danger">删除</a>
2015-03-19 15:57:08 +00:00
{% else %}
<a href="../user_edit/?id={{ user.id }}" class="btn btn-xs btn-info {% if user.id|user_readonly %} disabled {% endif %}">编辑</a>
<a href="../user_del/?id={{ user.id }}" class="btn btn-xs btn-danger {% if user.id|user_readonly %} disabled {% endif %}">删除</a>
{% endifequal %}
2015-01-22 14:12:41 +00:00
</td>
</tr>
{% endfor %}
</tbody>
</table>
2015-03-07 10:25:31 +00:00
<div class="row">
<div class="col-sm-6">
<div class="dataTables_info" id="editable_info" role="status" aria-live="polite">
Showing {{ contacts.start_index }} to {{ contacts.end_index }} of {{ p.count }} entries
</div>
</div>
{% include 'paginator.html' %}
</div>
2015-01-21 14:38:55 +00:00
</div>
2015-01-14 15:30:20 +00:00
</div>
</div>
</div>
2015-01-22 14:12:41 +00:00
</div>
2015-03-04 16:20:24 +00:00
<script>
$(document).ready(function(){
2015-04-01 14:54:10 +00:00
$(".iframe").on('click', function() {
var url = $(this).attr("value");
$.layer({
type: 2,
title: '用户详情',
maxmin: true,
shift: 'top',
border: [2, 0.3, '#1AB394'],
shade: [0.5, '#000000'],
shadeClose: true,
area: ['800px', '600px'],
iframe: {src: url}
})
});
var check_array = [];
2015-03-04 16:20:24 +00:00
$('#del_btn').click(function(){
2015-03-14 09:54:17 +00:00
if (confirm("确定删除")) {
$(".gradeX input:checked").each(function() {check_array.push($(this).attr("value")) })
$(".gradeX input:checked").closest("tr").remove()
$.post("/juser/user_del_ajax/",
{ids: check_array.join(",")},
function(data){
window.open("/juser/user_list/", "_self");
}
)
}
2015-03-04 16:20:24 +00:00
})
});
</script>
2015-01-22 14:12:41 +00:00
2015-01-26 16:14:50 +00:00
{% endblock %}