{% extends base.html %}

{% block head %}
<style type="text/css">
    .doc-detail {
        background: #ccccff;
        border: solid 1px;
        padding: 2px;
    }
    .doc-type {
        color: red;
        background-color: #eee;
    }
</style>
{% end %}

{% block body %}

<div class="col-md-12 card">
    {% include common/title/base_title.html %}
</div>

<div class="card">

{% if doc_info is not None %}
    <h2>模块: {{doc_info.name}}</h2>

    <p>位于 <a href="{{_server_home}}/code/edit?path={{doc_info.file}}">{{doc_info.file}}</a></p>

    {% if doc_info.doc != None %}
    <pre class="doc-detail">{{doc_info.doc}}</pre>
    {% end %}

    {% if len(doc_info.functions) > 0 %}
        <h2>方法目录</h2>
        <ul>
            {% for func in doc_info.functions %}
                {% if func.type == "method" %}
                    <ul><li><a href="#{{func.uuid}}">{{func.name}}</a></li></ul>
                {% else %}
                    <li><a href="#{{func.uuid}}">{{func.name}}</a></li>
                {% end %}
            {% end %}
        </ul>
        
        <h2>方法详情</h2>

        {% for func in doc_info.functions %}
            <div id="{{func.uuid}}">
                <span class="tag">{{func.type}}</span>
                <span>{{func.name}}</span>
                <pre class="doc-detail">{{func.doc}}</pre>
            </div>
        {% end %}
    {% end %}


{% end %}
</div>

{% end %}


{% block body_right %}
    {% include system/component/admin_nav.html %}
{% end %}
