{% init show_path_list = False %}
{% init error = None %}
{% init group_type = None %}
{% init op = "view" %}
{% init is_iframe = False %}

{% set item = file %}
{% set type_dict = dict(
    md = "Markdown",
    gallery = "相册",
    html = "富文本",
    csv = "表格",
    list = "清单"
) %}

{% if show_path_list %}
    <div class="grid-title btn-line-height">
        <span>文档查看</span>

        <div class="float-right">
            {% if group_type == "gallery" %}
                <a class="btn" href="{{_server_home}}/note/add?type=gallery">创建相册</a>
            {% elif group_type == "list" %}
                <a class="btn" href="{{_server_home}}/note/add?type=list">创建清单</a>
            {% else %}
                {# 其他普通笔记 #}
                {% include note/component/option/note_dropdown.html %}
                {% include common/button/back_button.html %}
            {% end %}
        </div>
    </div>
{% end %}

{% if error != "" and error != None%}
    <div class="col-md-12 error">
        {{error}}
    </div>
{% end %}

<script type="text/javascript">
    $(function () {
        $("body").on("click", ".note-option-btn", function (event) {
            xnote.http.get("/note/ajax/option_dialog", function (resp) {
                xnote.showDialog("选项", resp);
            })
        });
    })
</script>