2015-01-28 16:53:15 +00:00
|
|
|
{% extends 'base.html' %}
|
|
|
|
{% load mytags %}
|
|
|
|
{% block content %}
|
2015-02-11 10:38:56 +00:00
|
|
|
{% include 'nav_cat_bar.html' %}
|
2015-01-28 16:53:15 +00:00
|
|
|
|
2015-02-11 10:38:56 +00:00
|
|
|
<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">
|
2015-03-05 16:24:17 +00:00
|
|
|
<h5> 涓绘満鎺堟潈淇敼</h5>
|
2015-02-11 10:38:56 +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-28 16:53:15 +00:00
|
|
|
</div>
|
2015-02-11 10:38:56 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="ibox-content">
|
|
|
|
<form id="sudoPerm" method="post" class="form-horizontal" action="">
|
|
|
|
{% if error %}
|
|
|
|
<div class="alert alert-warning text-center">{{ error }}</div>
|
|
|
|
{% endif %}
|
|
|
|
{% if msg %}
|
|
|
|
<div class="alert alert-success text-center">{{ msg }}</div>
|
|
|
|
{% endif %}
|
2015-01-28 16:53:15 +00:00
|
|
|
<div class="row">
|
2015-02-11 10:38:56 +00:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="name" class="col-sm-2 control-label">鎺堟潈鍚<span class="red-fonts">*</span></label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<input id="name" name="name" placeholder="鎺堟潈鍚嶇О" type="text" class="form-control" value="{{ name }}">
|
|
|
|
<input id="perm_id" name="perm_id" placeholder="鎺堟潈鍚嶇О" type="text" class="form-control" style="display: none" value="{{ perm_id }}">
|
|
|
|
<span class="help-block m-b-none">鍙栦釜鍚嶅瓧鏂逛究杈ㄨ瘑</span>
|
2015-01-28 16:53:15 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2015-02-11 10:38:56 +00:00
|
|
|
<div class="hr-line-dashed"></div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="" class="col-sm-2 control-label">鐢ㄦ埛缁<span class="red-fonts">*</span></label>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<div>
|
|
|
|
<select id="user_groups" name="user_groups" class="form-control" size="5" multiple>
|
|
|
|
{% for user_group in user_groups %}
|
|
|
|
<option value="{{ user_group.id }}">{{ user_group.name }} --- {{ user_group.type|group_type_to_str }}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
2015-01-28 16:53:15 +00:00
|
|
|
</div>
|
2015-02-11 10:38:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
<div class="col-sm-1">
|
|
|
|
<div class="btn-group" style="margin-top: 12px;">
|
|
|
|
<button type="button" class="btn btn-white" onclick="move('user_groups', 'user_groups_select')"><i class="fa fa-chevron-right"></i></button>
|
|
|
|
<button type="button" class="btn btn-white" onclick="move('user_groups_select', 'user_groups')"><i class="fa fa-chevron-left"></i> </button>
|
|
|
|
</div>
|
2015-01-28 16:53:15 +00:00
|
|
|
</div>
|
|
|
|
|
2015-02-11 10:38:56 +00:00
|
|
|
<div class="col-sm-3">
|
2015-01-28 16:53:15 +00:00
|
|
|
<div>
|
2015-02-11 10:38:56 +00:00
|
|
|
<select id="user_groups_select" name="user_groups_select" class="form-control m-b" size="5" multiple>
|
|
|
|
{% for user_group in user_groups_select %}
|
|
|
|
<option value="{{ user_group.id }}">{{ user_group.name }} --- {{ user_group.type|group_type_to_str }}</option>
|
2015-01-28 16:53:15 +00:00
|
|
|
{% endfor %}
|
|
|
|
</select>
|
2015-02-11 10:38:56 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="hr-line-dashed"></div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="" class="col-sm-2 control-label">涓绘満缁<span class="red-fonts">*</span></label>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<div>
|
|
|
|
<select id="asset_groups" name="asset_groups" class="form-control m-b" size="5" multiple>
|
|
|
|
{% for asset_group in asset_groups %}
|
2015-01-28 16:53:15 +00:00
|
|
|
<option value="{{ asset_group.id }}">{{ asset_group.name }}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-sm-1">
|
2015-02-11 10:38:56 +00:00
|
|
|
<div class="btn-group" style="margin-top: 12px;">
|
|
|
|
<button type="button" class="btn btn-white" onclick="move('asset_groups', 'asset_groups_select')"><i class="fa fa-chevron-right"></i></button>
|
|
|
|
<button type="button" class="btn btn-white" onclick="move('asset_groups_select', 'asset_groups')"><i class="fa fa-chevron-left"></i> </button>
|
2015-01-28 16:53:15 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2015-02-11 10:38:56 +00:00
|
|
|
<div class="col-sm-3">
|
2015-01-28 16:53:15 +00:00
|
|
|
<div>
|
2015-02-11 10:38:56 +00:00
|
|
|
<select id="asset_groups_select" name="asset_groups_select" class="form-control m-b" size="5" multiple>
|
|
|
|
{% for asset_group in asset_groups_select %}
|
|
|
|
<option value="{{ asset_group.id }}">{{ asset_group.name }}</option>
|
|
|
|
{% endfor %}
|
2015-01-28 16:53:15 +00:00
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-02-11 10:38:56 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="hr-line-dashed"></div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="group_name" class="col-sm-2 control-label">澶囨敞</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<input id="comment" name="comment" placeholder="澶囨敞璇存槑" type="text" class="form-control" value="{{ comment }}">
|
2015-01-28 16:53:15 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2015-02-11 10:38:56 +00:00
|
|
|
<div class="hr-line-dashed"></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-sm-4 col-sm-offset-2">
|
|
|
|
<button class="btn btn-white" type="reset">鍙栨秷</button>
|
|
|
|
<button id="submit_button" class="btn btn-primary" type="submit">纭淇濆瓨</button>
|
|
|
|
</div>
|
2015-01-28 16:53:15 +00:00
|
|
|
</div>
|
2015-02-11 10:38:56 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
2015-01-28 16:53:15 +00:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-02-11 10:38:56 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
$('#sudoPerm').validator({
|
|
|
|
timely: 2,
|
|
|
|
theme: "yellow_right_effect",
|
|
|
|
fields: {
|
|
|
|
"name": {
|
|
|
|
rule: "required",
|
|
|
|
tip: "杈撳叆鎺堟潈鍚",
|
|
|
|
ok: "",
|
|
|
|
msg: {required: "蹇呴』濉啓!"}
|
|
|
|
},
|
|
|
|
"user_groups_select": {
|
|
|
|
rule: "required",
|
|
|
|
tip: "閫夋嫨鐢ㄦ埛缁",
|
|
|
|
ok: "",
|
|
|
|
msg: {checked: "鑷冲皯閫夋嫨涓涓敤鎴风粍"}
|
|
|
|
},
|
|
|
|
"asset_groups_select": {
|
|
|
|
rule: "required",
|
|
|
|
tip: "閫夋嫨涓绘満缁",
|
|
|
|
ok: "",
|
|
|
|
msg: {checked: "鑷冲皯閫夋嫨涓涓富鏈虹粍"}
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
valid: function(form) {
|
|
|
|
form.submit();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$(document).ready(function(){
|
|
|
|
$("#submit_button").click(function(){
|
|
|
|
$('#users_selected option').each(function(){
|
|
|
|
$(this).prop('selected', true)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
</script>
|
2015-01-28 16:53:15 +00:00
|
|
|
|
|
|
|
{% endblock %}
|