<!-- {#
@Author       : xupingmao
@email        : 578749341@qq.com
@Date         : 2023-10-27 21:17:40
@LastEditors  : xupingmao
@LastEditTime : 2023-12-16 16:59:43
@FilePath     : /xnote/handlers/note/ajax/group_option_dialog.html
@Description  : 描述
 #} -->
{% comment 这是在笔记本详情页里面点击选项弹出的对话框 %}

{% init share_to_list = [] %}
{% init show_delete_btn = False %}

<style>
    select.status, select.orderby-select {
        width: 100px;
    }
</style>

<div class="card">
    <div class="list-item">
        <span>状态</span>
        <div class="float-right">
            <select class="status" value="{{file.level}}"
                data-id="{{file.id}}"
                onchange="xnote.api.note.changeStatus(this)">
                <option value="1">置顶</option>
                <option value="0">活跃</option>
                <option value="-1">归档</option>
            </select>
        </div>
    </div>

    <div class="list-item">
        <span class="btn-line-height">排序</span>
        <div class="float-right">
            <select class="orderby-select" 
                onchange="xnote.note.changeOrderBy(this)"
                data-id="{{file.id}}" value="{{file.orderby}}">
                <option value="ctime_desc">最近创建</option>
                <option value="name_asc">名称</option>
                <option value="hot_desc">访问热度</option>
            </select>
        </div>
    </div>

    <div class="list-item">
        <span>重命名</span>
        <div class="float-right">
            <a class="btn btn-default" 
                data-id="{{file.id}}" 
                data-name="{{file.name}}" 
                onclick="renameNoteByAttr(this);">重命名</a>
        </div>
    </div>

    <div class="list-item">
        <span>分享</span>
        <div class="float-right">
            <a class="btn btn-default" href="{{_server_home}}/note/share/edit?note_id={{file.id}}">分享</a>
        </div>
    </div>

    <div class="list-item">
        <span>批量操作</span>
        <div class="float-right">
            <a class="btn btn-default" href="{{_server_home}}/note/management?parent_id={{file.id}}">进入</a>
        </div>
    </div>

    <div class="list-item">
        <span>移动</span>
        <div class="float-right">
            <a class="btn btn-default" onclick="xnote.note.openDialogToMoveByElement(this);" data-id="{{file.id}}">移动</a>
        </div>
    </div>

    {% if show_delete_btn %}
        <div class="list-item btn-line-height">
            <span>删除</span>
            <div class="float-right">
                <a class="btn btn-danger" href="javascript:remove('{{file.id}}', '{{file.name}}')">删除</a>
            </div>
        </div>
    {% end %}
</div>

<script>
    // 初始化一些默认值
    xnote.refresh();
</script>