{layout name="layout"}
<style>
    .autocomplete-searchtitle {
        padding: 0px 8px;
        display: none;
    }

    .autocomplete-suggestions {
        display: none;
    }

    .autocomplete-searchtitle .media {
        border-bottom: 1px solid #eee;
        margin-top: 10px;
        padding-bottom: 10px;
    }

    .autocomplete-searchtitle .media:last-child {
        border-bottom: 0;
    }

    .autocomplete-searchtitle .media h4.media-heading {
        font-size: 14px;
    }

    .autocomplete-searchtitle .media .text-muted {
        font-size: 12px;
    }

    .autocomplete-searchtitle .media:hover {
        background: #fefefe;
    }

    @media (min-width: 992px) {
        .form-archives>.row>.col-md-3 {
            padding-left: 0;
        }

        .form-archives>.row>.col-md-3 .form-group .control-label {}
    }

    .panel-intro {
        box-shadow: none;
    }
</style>

<link href="__JS__/libs/jquery-tags-input/jquery.tagsinput.min.css?v={$Think.config.site.version}" rel="stylesheet">
<!-- <script src="/static/libs/froala/js/languages/zh_cn.js"></script> -->
<script type="text/html" id="headertpl">
    <div class="px-2">
        <div class="row">
            <div class="col-12">
                <div class="alert" style="border-radius: 0;color: #0084ff; background: rgba(0, 132, 255, 0.1);margin-bottom:0;">
                    共找到以下几篇相关文章:
                </div>
            </div>
        </div>
    </div>
</script>

<script type="text/html" id="itemtpl">
    <div class="media">
        <a class="" href="<%=item.url%>" target="_blank">
            <div class="media-left">
                <img src="<%=item.image%>" style="width: 50px; height: 50px;">
            </div>

            <div class="media-body">
                <h4 class="media-heading"><%=#replace(item.title)%></h4>
                <div class="text-muted"><%=#formatter.status.call(context, item.status, item)%></div>
            </div>
        </a>
    </div>
</script>

<div class="card">
    <div class="card-body">
        <form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

            <input name="id" type="hidden" value="{$row.id}">
            <input name="category_id" type="hidden" value="12">
            <input name="type" type="hidden" value="{$row.type}">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">标题:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-title" data-rule="required;length(2~100)" class="form-control" name="title"
                        type="text" value="{$row.title|htmlentities}" data-suggestion-url="{:url('archives/suggestion')}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">标识:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-name" data-rule="required;length(2~100)" class="form-control" name="name"
                        type="text" value="{$row.name|htmlentities}" data-suggestion-url="{:url('archives/suggestion')}">
                </div>
            </div>
            <!--@formatter:off-->
            <div class="form-group" data-field="content">
                <label for="c-content" class="control-label col-xs-12 col-sm-2">正文:</label>
                <div class="col-xs-12 col-sm-8">
                    <textarea id="c-content" data-rule="required;length(100~20000)" class="form-control editor" name="content" data-role="editor"
                        rows="15">{$row.content}</textarea>
                    <div style="margin-top:5px;">
                        <a href="javascript:" class="btn btn-xs btn-info btn-getimage" data-toggle="tooltip"
                            data-title="将提取内容第一张图作为缩略图"><i class="fa fa-camera"></i> {:__('提取缩略图')}</a>
                        <a href="javascript:" class="btn btn-xs btn-info btn-getimages" data-toggle="tooltip"
                            data-title="将提取内容前4张图作为组图"><i class="fa fa-camera"></i> {:__('提取组图')}</a>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2"></label>
                <div class="col-xs-12 col-sm-8 col-md-6 layer-footer">
                    <button type="submit" class="btn btn-primary m-r-5">提交</button>
                    <button type="reset" class="btn btn-warning m-r-5">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>
{include file="common/file_preview" id="preview"/}