2019-12-15 15:45:05 +08:00
|
|
|
|
<!-- 继承自模板:app_doc/docs_base.html -->
|
|
|
|
|
{% extends 'app_doc/docs_base.html' %}
|
|
|
|
|
<!-- 引入静态文件 -->
|
2019-12-08 18:59:49 +08:00
|
|
|
|
{% load staticfiles %}
|
|
|
|
|
|
2020-02-17 23:02:53 +08:00
|
|
|
|
{% block keyword %}{{ doc.name }},{{ project.name }},{% endblock %}
|
|
|
|
|
{% block description %}{{doc.pre_content | slice:"0:100"}}{% endblock %}
|
2019-12-15 15:45:05 +08:00
|
|
|
|
{% block title %}{{ doc.name }} - {{ project.name }}{% endblock %}
|
2019-12-08 18:59:49 +08:00
|
|
|
|
|
2019-12-15 15:45:05 +08:00
|
|
|
|
{% block head_toolbar %}
|
|
|
|
|
{% if request.user == doc.create_user %}
|
2020-04-03 21:05:27 +08:00
|
|
|
|
<span class="btn pull-left">|</span>
|
2019-12-15 15:45:05 +08:00
|
|
|
|
<a class="btn pull-left" aria-label="" href="{% url 'modify_doc' doc_id=doc.id %}">
|
2020-04-03 21:05:27 +08:00
|
|
|
|
<i class="fa fa-edit"></i> <span class="layui-hide-xs">修改</span>
|
2019-12-15 15:45:05 +08:00
|
|
|
|
</a>
|
2020-02-27 20:58:37 +08:00
|
|
|
|
<a class="btn pull-left" aria-label="" href="{% url 'create_doc' %}?pid={{project.id}}" target="_blank">
|
2020-04-03 21:05:27 +08:00
|
|
|
|
<i class="fa fa-file"></i> <span class="layui-hide-xs">添加</span>
|
|
|
|
|
</a>
|
|
|
|
|
<a class="btn pull-left" aria-label="" href="{% url 'manage_doc' %}" target="_blank">
|
|
|
|
|
<i class="fa fa-file"></i> <span class="layui-hide-xs">管理</span>
|
|
|
|
|
</a>
|
|
|
|
|
{% elif colla_user > 0 %}
|
|
|
|
|
<span class="btn pull-left">|</span>
|
|
|
|
|
{% if colla_user_role == 1 %}
|
|
|
|
|
<a class="btn pull-left" aria-label="" href="{% url 'modify_doc' doc_id=doc.id %}">
|
|
|
|
|
<i class="fa fa-edit"></i> <span class="layui-hide-xs">修改</span>
|
|
|
|
|
</a>
|
|
|
|
|
{% endif %}
|
|
|
|
|
<a class="btn pull-left" aria-label="" href="{% url 'create_doc' %}?pid={{project.id}}" target="_blank">
|
|
|
|
|
<i class="fa fa-file"></i> <span class="layui-hide-xs">添加</span>
|
2019-12-15 15:45:05 +08:00
|
|
|
|
</a>
|
2020-03-21 16:52:11 +08:00
|
|
|
|
{% endif %}
|
2020-03-21 16:11:21 +08:00
|
|
|
|
<!-- 文档目录 -->
|
|
|
|
|
<div id="toc-container" style="display:none;padding:10px;overflow:auto;"></div>
|
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>{{ doc.name }}</h1><hr>
|
2020-03-21 16:11:21 +08:00
|
|
|
|
|
2019-12-15 15:45:05 +08:00
|
|
|
|
<p style="color: #666;font-size:12px;">
|
|
|
|
|
<!--<i class="fa fa-th-large"></i> 发表:{{ doc.create_time }}-->
|
2020-03-21 16:11:21 +08:00
|
|
|
|
<i class="fa fa-user"></i> 作者:{{ doc.create_user.username }}
|
2019-12-15 15:45:05 +08:00
|
|
|
|
<i class="fa fa-edit"></i> 最后修改于:{{ doc.modify_time }}
|
|
|
|
|
</p>
|
2020-03-21 16:11:21 +08:00
|
|
|
|
|
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 page_content %}
|
|
|
|
|
{# {{ doc.content | safe }} #}
|
2020-03-21 16:11:21 +08:00
|
|
|
|
<textarea style="display: none;">{{ doc.pre_content }}</textarea>
|
|
|
|
|
|
2020-01-15 21:03:44 +08:00
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
{% block doc_previous_next %}
|
|
|
|
|
{% load doc_filter %}
|
2020-02-17 23:02:53 +08:00
|
|
|
|
<div class="layui-row" style="margin-top: 10px;padding:10px;display:flex;justify-content:space-around;border-top: 1px #e6e6e6 solid;">
|
|
|
|
|
<hr>
|
2020-01-15 21:03:44 +08:00
|
|
|
|
<div>
|
|
|
|
|
{% if doc.id|get_doc_previous == None %}
|
|
|
|
|
<button class="layui-btn layui-btn-disabled layui-btn-sm"><i class="layui-icon layui-icon-prev "></i>上一篇</button>
|
|
|
|
|
{% else %}
|
|
|
|
|
<a href="{% url 'doc' doc.top_doc doc.id|get_doc_previous %}" class="layui-btn layui-btn-normal layui-btn-sm"><i class="layui-icon layui-icon-prev "></i>上一篇</a>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
{% if doc.id|get_doc_next == None %}
|
|
|
|
|
<button class="layui-btn layui-btn-disabled layui-btn-sm">下一篇<i class="layui-icon layui-icon-next"></i></button>
|
|
|
|
|
{% else %}
|
|
|
|
|
<a href="{% url 'doc' doc.top_doc doc.id|get_doc_next %}" class="layui-btn layui-btn-normal layui-btn-sm">下一篇<i class="layui-icon layui-icon-next"></i></a>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-03-21 16:11:21 +08:00
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
{% block custom_script %}
|
|
|
|
|
<script>
|
|
|
|
|
var layer = layui.layer;
|
2020-04-03 21:05:27 +08:00
|
|
|
|
//初始化悬浮目录
|
2020-03-21 16:11:21 +08:00
|
|
|
|
var toc = $("#toc-container").find('li');
|
|
|
|
|
if(toc.length > 0){
|
|
|
|
|
layer.open({
|
|
|
|
|
title: '目录',
|
|
|
|
|
type:1,
|
|
|
|
|
offset:'r',//坐标
|
|
|
|
|
maxmin:true, //最大最小化
|
|
|
|
|
area: ['200px','200px'],
|
|
|
|
|
shade: 0,
|
|
|
|
|
content: $("#toc-container"),
|
|
|
|
|
});
|
2020-04-03 21:05:27 +08:00
|
|
|
|
};
|
|
|
|
|
//修改a标签链接新窗口打开
|
|
|
|
|
$('#content').on('click','a',function(e){
|
|
|
|
|
e.target.target = '_blank';
|
|
|
|
|
});
|
2020-03-21 16:11:21 +08:00
|
|
|
|
</script>
|
2019-12-15 15:45:05 +08:00
|
|
|
|
{% endblock %}
|