mirror of https://github.com/jumpserver/jumpserver
parent
7adbf52aeb
commit
0336bfa906
@ -0,0 +1,4 @@
|
||||
{% for user in users %}
|
||||
<option value="{{ user.id }}">{{ user.name }}</option>
|
||||
{% endfor %}
|
||||
|
@ -0,0 +1,133 @@
|
||||
{% 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> Fill group 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">
|
||||
<form id="groupForm" 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 %}
|
||||
<div class="form-group">
|
||||
<label for="group_name" class="col-sm-2 control-label">缁勫悕<span class="red-fonts">*</span></label>
|
||||
<div class="col-sm-8">
|
||||
<input id="group_name" name="group_name" placeholder="Group name" type="text" class="form-control" value="{{ group_name }}">
|
||||
<input id="group_id" name="group_id" type="text" class="form-control" value="{{ group.id }}" style="display: none">
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<label for="group_type" class="col-sm-2 control-label">绫诲瀷<span class="red-fonts">*</span></label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" value="{{ group_type|group_type_to_str }}" readonly>
|
||||
<input name="group_type" class="form-control" id="group_type" value="{{ group_type }}" style="display: none">
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<label for="users" class="col-lg-2 control-label">鐢ㄦ埛</label>
|
||||
<div class="col-sm-3">
|
||||
<select id="users" name="users" size="12" class="form-control m-b" multiple>
|
||||
{% for user in users %}
|
||||
<option value="{{ user.id }}">{{ user.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-1">
|
||||
<div class="btn-group" style="margin-top: 50px;">
|
||||
<button type="button" class="btn btn-white" onclick="move('users', 'users_selected')"><i class="fa fa-chevron-right"></i></button>
|
||||
<button type="button" class="btn btn-white" onclick="move('users_selected', 'users')"><i class="fa fa-chevron-left"></i> </button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<div>
|
||||
<select id="users_selected" name="users_selected" class="form-control m-b" size="12" multiple>
|
||||
{% for user in users_selected %}
|
||||
<option value="{{ user.id }}">{{ user.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<label for="comment" class="col-sm-2 control-label">澶囨敞</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="comment" name="comment" placeholder="Comment" type="text" class="form-control" value="{{ comment }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="hr-line-dashed"></div>
|
||||
<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>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$('#groupForm').validator({
|
||||
timely: 2,
|
||||
theme: "yellow_right_effect",
|
||||
fields: {
|
||||
"group_name": {
|
||||
rule: "required",
|
||||
tip: "杈撳叆缁勫悕",
|
||||
ok: "",
|
||||
msg: {required: "蹇呴』濉啓!"}
|
||||
},
|
||||
"group_type": {
|
||||
rule: "checked",
|
||||
tip: "閫夋嫨缁勭被鍨",
|
||||
ok: "",
|
||||
msg: {required: "鑷冲皯閫夋嫨涓涓粍!"}
|
||||
}
|
||||
},
|
||||
valid: function(form) {
|
||||
form.submit();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#submit_button").click(function(){
|
||||
$('#users_selected option').each(function(){
|
||||
$(this).prop('selected', true)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
@ -0,0 +1,74 @@
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf8'>
|
||||
<script src="http://cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script>
|
||||
<style type="text/css">
|
||||
|
||||
.blue
|
||||
{
|
||||
color: blue;
|
||||
}
|
||||
</style>
|
||||
{#<script>#}
|
||||
{#$('html').ajaxSend(function(event, xhr, settings) {#}
|
||||
{# function getCookie(name) {#}
|
||||
{# var cookieValue = null;#}
|
||||
{# if (document.cookie && document.cookie != '') {#}
|
||||
{# var cookies = document.cookie.split(';');#}
|
||||
{# for (var i = 0; i < cookies.length; i++) {#}
|
||||
{# var cookie = jQuery.trim(cookies[i]);#}
|
||||
{# // Does this cookie string begin with the name we want?#}
|
||||
{# if (cookie.substring(0, name.length + 1) == (name + '=')) {#}
|
||||
{# cookieValue = decodeURIComponent(cookie.substring(name.length + 1));#}
|
||||
{# break;#}
|
||||
{# }#}
|
||||
{# }#}
|
||||
{# }#}
|
||||
{# return cookieValue;#}
|
||||
{# }#}
|
||||
{# if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) {#}
|
||||
{# // Only send the token to relative URLs i.e. locally.#}
|
||||
{# xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));#}
|
||||
{# }#}
|
||||
{#});#}
|
||||
{#</script>#}
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#btn1").click(function(){
|
||||
$("#test").text(function(i,origText){
|
||||
return "Old text: " + origText + "New text: Hllo" + i
|
||||
})
|
||||
});
|
||||
|
||||
$("#btn2").click(function(){
|
||||
$.post('/test_ajax/',
|
||||
{'name': 'join', 'age': 10},
|
||||
function(data, status){
|
||||
$('#btn1').text(data)
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
$("#btn3").click(function(){
|
||||
$("p").toggleClass('blue')
|
||||
// $("p").addClass('blue')
|
||||
// $("p").before("Some thine")
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p id="test" class="blue">
|
||||
杩欐槸娈佃惤涓殑<b>绮椾綋</b>鏂囨湰銆
|
||||
<p><span>hello</span></p>
|
||||
|
||||
</p>
|
||||
<!-- <input type="text" id="test2" name="nameaaaaaaaaaa" value="绫宠侀紶"> -->
|
||||
<button id="btn1">鏄剧ず鏂囨湰</button>
|
||||
<button id="btn2">鏄剧ず HTML</button>
|
||||
<button id="btn3">鏄剧ず value</button>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading鈥
Reference in new issue