MrDoc/template/app_doc/project.html
2019-12-15 15:45:05 +08:00

60 lines
2.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- 继承自模板app_doc/docs_base.html -->
{% extends 'app_doc/docs_base.html' %}
<!-- 引入静态文件 -->
{% load staticfiles %}
{% block title %}{{ project.name }}{% endblock %}
{% block head_toolbar %}
{% if request.user == project.create_user %}
<a class="btn pull-left" aria-label="" href="{% url 'create_doc' %}" target="_blank">
<i class="fa fa-edit"></i> 添加文档
</a>
{% endif %}
{% endblock %}
{% block content_head %}
<h1>{{ project.name }}</h1><hr>
{% endblock %}
{% block page_content %}
<!-- 引入文档过滤器 -->
{% load doc_filter %}
<div class="layui-row">
<h3>文集简介:</h3>
<p>{{project.intro}}</p>
</div>
<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>
{% endblock %}