2019-12-15 15:45:05 +08:00
|
|
|
|
<!-- 继承自模板:app_doc/docs_base.html -->
|
|
|
|
|
{% extends 'app_doc/docs_base.html' %}
|
|
|
|
|
<!-- 引入静态文件 -->
|
2019-07-21 22:08:04 +08:00
|
|
|
|
{% load staticfiles %}
|
|
|
|
|
|
2019-12-15 15:45:05 +08:00
|
|
|
|
{% block title %}{{ project.name }}{% endblock %}
|
2019-12-08 18:59:49 +08:00
|
|
|
|
|
2019-12-15 15:45:05 +08:00
|
|
|
|
{% block head_toolbar %}
|
2020-04-03 21:05:27 +08:00
|
|
|
|
{% if request.user == project.create_user or colla_user > 0 %}
|
|
|
|
|
<span class="btn pull-left">|</span>
|
|
|
|
|
<a class="btn pull-left" href="{% url 'create_doc' %}?pid={{project.id}}" target="_blank">
|
2020-04-20 07:51:25 +08:00
|
|
|
|
<i class="fa fa-plus-square"></i> <span class="layui-hide-xs">添加</span>
|
2019-12-15 15:45:05 +08:00
|
|
|
|
</a>
|
|
|
|
|
{% endif %}
|
2020-04-11 22:14:27 +08:00
|
|
|
|
{% if request.user == project.create_user %}
|
|
|
|
|
<a class="btn pull-left" href="{% url 'manage_project' %}" target="_blank">
|
2020-04-20 07:51:25 +08:00
|
|
|
|
<i class="fa fa-cubes"></i> <span class="layui-hide-xs">管理</span>
|
2020-04-11 22:14:27 +08:00
|
|
|
|
</a>
|
|
|
|
|
{% endif %}
|
2019-12-15 15:45:05 +08:00
|
|
|
|
{% endblock %}
|
2019-12-08 18:59:49 +08:00
|
|
|
|
|
2019-12-15 15:45:05 +08:00
|
|
|
|
{% block content_head %}
|
|
|
|
|
<h1>{{ project.name }}</h1><hr>
|
2020-04-20 07:51:25 +08:00
|
|
|
|
<p style="color: #c2c2c2;font-size:12px;">
|
|
|
|
|
<!--<i class="fa fa-th-large"></i> 发表:{{ doc.create_time }}-->
|
|
|
|
|
<i class="fa fa-user"></i> 创建人:{{ project.create_user.username }}
|
|
|
|
|
<i class="fa fa-timer"></i> 创建于:{{ project.create_time }}
|
|
|
|
|
</p>
|
2019-12-15 15:45:05 +08:00
|
|
|
|
{% endblock %}
|
2019-07-24 14:38:06 +08:00
|
|
|
|
|
2019-12-15 15:45:05 +08:00
|
|
|
|
{% block page_content %}
|
|
|
|
|
<!-- 引入文档过滤器 -->
|
|
|
|
|
{% load doc_filter %}
|
|
|
|
|
<div class="layui-row">
|
|
|
|
|
<h3>文集简介:</h3>
|
|
|
|
|
<p>{{project.intro}}</p>
|
2019-07-21 22:08:04 +08:00
|
|
|
|
</div>
|
2019-12-15 15:45:05 +08:00
|
|
|
|
<div class="layui-row">
|
|
|
|
|
<h3>文集大纲:</h3>
|
|
|
|
|
<ul class="summary">
|
|
|
|
|
<!-- 一级目录 -->
|
|
|
|
|
{% for docs in project_docs %}
|
|
|
|
|
<li>
|
|
|
|
|
{% if docs.id|get_next_doc %}
|
|
|
|
|
<a href="{% url 'doc' pro_id=docs.top_doc doc_id=docs.id %}">{{ docs.name }}</a>
|
|
|
|
|
<ul class="sub-menu">
|
|
|
|
|
<!-- 二级目录 -->
|
|
|
|
|
{% for node in docs.id|get_next_doc %}
|
|
|
|
|
<li>
|
|
|
|
|
{% if node.id|get_next_doc %}
|
|
|
|
|
<a href="{% url 'doc' pro_id=node.top_doc doc_id=node.id %}">{{ node.name }}</a>
|
|
|
|
|
<ul class="sub-menu">
|
|
|
|
|
<!-- 三级目录 -->
|
|
|
|
|
{% for doc in node.id|get_next_doc %}
|
|
|
|
|
<li><a href="{% url 'doc' pro_id=doc.top_doc doc_id=doc.id %}">{{ doc.name }}</a></li>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</ul>
|
|
|
|
|
{% else %}
|
|
|
|
|
<a href="{% url 'doc' pro_id=node.top_doc doc_id=node.id %}">{{ node.name }}</a>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</li>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</ul>
|
|
|
|
|
{% else %}
|
|
|
|
|
<a href="{% url 'doc' pro_id=docs.top_doc doc_id=docs.id %}">{{ docs.name }}</a>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</li>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2020-03-07 09:30:11 +08:00
|
|
|
|
|
|
|
|
|
{% if enable_project_report %}
|
|
|
|
|
<div class="layui-row">
|
|
|
|
|
<h3>文集下载:</h3>
|
|
|
|
|
<p>
|
|
|
|
|
<span class="layui-breadcrumb" lay-separator="|">
|
|
|
|
|
{% if allow_epub_download == 1 %}
|
|
|
|
|
<a href="javascript:void(0);" onclick="reportFile('{{project.id}}','epub')"><i class="fa fa-download"></i> <u>EPUB电子书</u></a>
|
|
|
|
|
{% else %}
|
|
|
|
|
<a>文集作者未开放此文集的任何格式下载!</a>
|
|
|
|
|
{% endif %}
|
|
|
|
|
<!--<a href=""><i class="fa fa-download"></i> <u>DOCX文档</u></a>-->
|
|
|
|
|
</span>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<script>
|
|
|
|
|
reportFile = function(pro_id,types){
|
|
|
|
|
var data = {'pro_id':pro_id,'types':types};
|
|
|
|
|
$.post("{% url 'report_file' %}",data,function(r){
|
|
|
|
|
if(r.status){
|
|
|
|
|
//文件下载提示
|
|
|
|
|
downloadFile(r.data)
|
|
|
|
|
}else{
|
|
|
|
|
layer.msg("导出文件出错")
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
//下载文件弹出框
|
|
|
|
|
downloadFile = function(download_link){
|
|
|
|
|
layer.open({
|
|
|
|
|
type:1,
|
|
|
|
|
title:"下载导出文档",
|
|
|
|
|
area:"300px",
|
|
|
|
|
id:"downloadMd",
|
|
|
|
|
content:'<p style="text-align:center;color:red;">请尽快下载,避免失效!</p><br><a class="layui-btn layui-btn-fluid download-md-link" href="'+ download_link + '" download="" >点击下载文件</a>',
|
|
|
|
|
//btn:['确定','取消'], //添加按钮
|
|
|
|
|
//btnAlign:'c', //按钮居中
|
|
|
|
|
success: function (layero, index) {
|
|
|
|
|
$(layero).find('.download-md-link').click(function () {
|
|
|
|
|
layer.close(index);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
{% endif %}
|
2019-12-15 15:45:05 +08:00
|
|
|
|
{% endblock %}
|