jumpserver/templates/jperm/perm_edit.html

130 lines
5.6 KiB
HTML
Raw Normal View History

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">
2015-03-12 10:43:17 +00:00
<label for="" class="col-sm-2 control-label">灏忕粍<span class="red-fonts">*</span></label>
2015-02-11 10:38:56 +00:00
<div class="col-sm-4">
2015-03-12 10:43:17 +00:00
<input id="user_group_id" name="user_group_id"type="text" value="{{ user_group.id }}" style="display: none">
<input id="user_group_name" name="user_group_name" type="text" class="form-control" value="{{ user_group.name }}" readonly>
2015-02-11 10:38:56 +00:00
</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>
2015-03-12 10:43:17 +00:00
<select id="asset_groups" name="asset_groups" class="form-control m-b" size="12" multiple>
2015-02-11 10:38:56 +00:00
{% 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-03-12 10:43:17 +00:00
<div class="btn-group" style="margin-top: 42px;">
2015-02-11 10:38:56 +00:00
<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-03-12 10:43:17 +00:00
<select id="asset_groups_select" name="asset_groups_select" class="form-control m-b" size="12" multiple>
2015-02-11 10:38:56 +00:00
{% 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>
2015-01-28 16:53:15 +00:00
</div>
2015-02-11 10:38:56 +00:00
<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: "蹇呴』濉啓!"}
}
},
valid: function(form) {
form.submit();
}
});
$(document).ready(function(){
$("#submit_button").click(function(){
2015-03-06 16:12:38 +00:00
$('#user_groups_select option').each(function(){
$(this).prop('selected', true)
})
$('#asset_groups_select option').each(function(){
2015-02-11 10:38:56 +00:00
$(this).prop('selected', true)
})
})
})
</script>
2015-01-28 16:53:15 +00:00
{% endblock %}