2015-04-20 02:12:11 +00:00
|
|
|
{% 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>编辑用户信息</h5>
|
|
|
|
<div class="ibox-tools">
|
|
|
|
<a class="collapse-link">
|
|
|
|
<i class="fa fa-chevron-up"></i>
|
|
|
|
</a>
|
2015-09-06 13:37:22 +00:00
|
|
|
|
2015-04-20 02:12:11 +00:00
|
|
|
<a class="close-link">
|
|
|
|
<i class="fa fa-times"></i>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="ibox-content">
|
|
|
|
<form method="post" id="userForm" 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">
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<input id="user_id" name="user_id" type="text" value="{{ user.id }}" style="display: none">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<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="Name" type="text" class="form-control" value="{{ user.name }}">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="hr-line-dashed"></div>
|
|
|
|
<div class="form-group">
|
2015-11-17 12:06:25 +00:00
|
|
|
<label for="password" class="col-sm-2 control-label">密码</label>
|
2015-04-20 02:12:11 +00:00
|
|
|
<div class="col-sm-8">
|
2015-11-02 08:00:34 +00:00
|
|
|
<input id="password" name="password" placeholder="Password" type="password" class="form-control">
|
2015-04-20 02:12:11 +00:00
|
|
|
<span class="help-block m-b-none">
|
|
|
|
登陆web的密码
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="hr-line-dashed"></div>
|
|
|
|
<div class="form-group">
|
2015-09-06 13:37:22 +00:00
|
|
|
<label for="ssh_key_pwd" class="col-sm-2 control-label">SSH密钥</label>
|
2015-04-20 02:12:11 +00:00
|
|
|
<div class="col-sm-8">
|
2015-09-06 13:37:22 +00:00
|
|
|
<a value="/juser/regen_ssh_key/?uuid={{ user.uuid }}" id="regen_ssh_key" class="form-control"> 重新生成</a>
|
2015-04-20 02:12:11 +00:00
|
|
|
<span class="help-block m-b-none">
|
2015-09-06 13:37:22 +00:00
|
|
|
重新生成密钥,需要重新下载并导入
|
2015-04-20 02:12:11 +00:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="hr-line-dashed"></div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="email" class="col-sm-2 control-label">Email<span class="red-fonts">*</span></label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<input id="email" name="email" type="email" placeholder="Email" class="form-control" value="{{ user.email }}" >
|
|
|
|
</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="submit">取消</button>
|
|
|
|
<button id="submit_button" class="btn btn-primary" type="submit">确认修改</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-09-06 13:37:22 +00:00
|
|
|
{% endblock %}
|
2015-04-20 02:12:11 +00:00
|
|
|
|
2015-09-06 13:37:22 +00:00
|
|
|
{% block self_footer_js %}
|
2015-04-20 02:12:11 +00:00
|
|
|
<script>
|
|
|
|
$('#userForm').validator({
|
|
|
|
timely: 2,
|
|
|
|
theme: "yellow_right_effect",
|
|
|
|
|
|
|
|
fields: {
|
|
|
|
"password": {
|
2015-11-17 12:06:25 +00:00
|
|
|
rule: "length[6~50]",
|
2015-04-20 02:12:11 +00:00
|
|
|
tip: "输入密码",
|
|
|
|
ok: "",
|
|
|
|
msg: {required: "必须填写!"}
|
|
|
|
},
|
|
|
|
"name": {
|
|
|
|
rule: "required",
|
|
|
|
tip: "姓名",
|
|
|
|
ok: "",
|
|
|
|
msg: {required: "必须填写"}
|
|
|
|
},
|
|
|
|
"email": {
|
|
|
|
rule: "required",
|
|
|
|
tip: "Email",
|
|
|
|
ok: "",
|
|
|
|
msg: {required: "必须填写"}
|
2015-09-06 13:37:22 +00:00
|
|
|
}
|
2015-04-20 02:12:11 +00:00
|
|
|
},
|
|
|
|
valid: function(form) {
|
|
|
|
form.submit();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-09-06 13:37:22 +00:00
|
|
|
$("document").ready(function() {
|
|
|
|
$("#regen_ssh_key").click(function () {
|
|
|
|
alert('申请已提交,请等待,请勿重复提交');
|
|
|
|
$.get(
|
|
|
|
$(this).attr('value'),
|
|
|
|
{},
|
|
|
|
function(data){
|
|
|
|
alert(data)
|
|
|
|
}
|
|
|
|
)
|
|
|
|
})
|
|
|
|
})
|
2015-04-20 02:12:11 +00:00
|
|
|
|
2015-09-06 13:37:22 +00:00
|
|
|
</script>
|
2015-04-20 02:12:11 +00:00
|
|
|
{% endblock %}
|