MrDoc/template/app_doc/manage/manage_project_transfer.html

79 lines
2.9 KiB
HTML
Raw Normal View History

2020-11-16 21:32:08 +08:00
{% extends 'app_doc/user/user_base.html' %}
2020-10-18 08:05:41 +08:00
{% load static %}
2020-12-02 21:25:59 +08:00
{% load i18n %}
{% block title %}{% trans "文集设置" %}{% endblock %}
2020-10-18 08:05:41 +08:00
{% block content %}
2020-11-16 21:32:08 +08:00
<div class="layui-card">
<div class="layui-card-body">
<div class="layui-row" style="padding-left:15px;">
<span class="layui-breadcrumb" lay-separator=">">
<a href="{% url 'manage_project' %}">{% trans "文集管理" %}</a>
<a href="{% url 'modify_project' %}?pro_id={{pro.id}}">{% trans "文集设置" %}</a>
<a><cite>{% trans "转让文集" %}</cite></a>
2020-10-18 08:05:41 +08:00
</span>
</div>
2020-11-16 21:32:08 +08:00
</div>
</div>
<div class="layui-card">
<div class="layui-card-body">
<div class="layui-card-header" style="margin-bottom: 10px;">
<div class="layui-row">
<span style="font-size:18px;">{% trans "转让文集:" %}{{pro.name}}
2020-11-16 21:32:08 +08:00
</span>
</div>
</div>
2020-10-18 08:05:41 +08:00
<div class="layui-row">
<div class="layui-form">
<select name="user-select" id="user-select" lay-verify="" lay-search>
<option value="">{% trans "选择用户,可搜索" %}</option>
2020-10-18 08:05:41 +08:00
{% for user in user_list %}
<option value="{{user.username}}">{{user.first_name}}({{user.username}})</option>
{% endfor %}
2020-11-16 21:32:08 +08:00
</select>
2020-10-18 08:05:41 +08:00
</div>
</div>
<div class="layui-row" style="margin-top: 5px;">
<button class="layui-btn layui-btn-normal" id="transfer-project"><i class="layui-icon layui-icon-transfer"></i> {% trans "转让文集的管理权限及文档" %}</button>
2020-10-18 08:05:41 +08:00
</div>
</div>
2020-11-16 21:32:08 +08:00
</div>
2020-10-18 08:05:41 +08:00
{% endblock %}
{% block custom_script %}
<script>
2020-11-16 21:32:08 +08:00
layui.use(['table','jquery','form','layer','element'], function() {
let table = layui.table;
let form = layui.form;
let $ = layui.jquery;
let layer = layui.layer;
let element = layui.element;
$.ajaxSetup({
2020-10-18 08:05:41 +08:00
data: {csrfmiddlewaretoken: '{{ csrf_token }}' },
});
2020-11-16 21:32:08 +08:00
// 转让文集
transferProject = function(){
layer.load(1);
data = {
'username':$("#user-select").val(),
2020-10-18 08:05:41 +08:00
}
2020-11-16 21:32:08 +08:00
$.post("{% url 'manage_pro_transfer' pro.id %}",data,function(r){
layer.closeAll('loading'); //关闭loading
if(r.status){
//转让成功
layer.msg('{% trans "转让成功,即将返回文集列表……" %}',function(){
2020-11-16 21:32:08 +08:00
window.location.href = "{% url 'manage_project' %}"
})
//layer.close(index)
}else{
//转让失败,提示
console.log(r)
layer.msg(r.data)
}
})
}
$("#transfer-project").click(function(){
transferProject();
2020-10-18 08:05:41 +08:00
})
2020-11-16 21:32:08 +08:00
});
2020-10-18 08:05:41 +08:00
</script>
{% endblock %}