{layout name="public/layout_main"}

<style type="text/css">
.progress-bar{
    text-align: center;
}
</style>
<section class="wrapper">
    <h3 class="top-back">
        <a href="<?php echo url('@admin/Post/index')?>">
            <i class="fa fa-angle-left"></i> 编辑文章
        </a>
    </h3>
    <hr>

     <?php if(isset($msg) && $msg !== ''):?>
    <div class="row margin-bottom">
        <div class="col-md-12">
            <div class="alert alert-danger alert-dismissible fade in" role="alert">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
                <?php echo $msg;?>
            </div>
        </div>
    </div>
    <?php endif;?>

    <div class="row margin-bottom">
        <div class="col-md-12">
            <form class="form-horizontal" enctype="multipart/form-data" method="POST" id="robot-create-form">
                <div class="form-group">
                    <label for="title" class="col-sm-2 control-label text-right">文章标题</label>
                    <div class="col-lg-8">
                        <input type="text" class="form-control validate[required]" name="title" id="title" value="<?php echo $article->title;?>">
                    </div>
                </div>
                <div class="form-group">
                    <label for="content" class="col-sm-2 control-label text-right">文章内容</label>
                    <div class="col-lg-8">
                        <!-- 加载编辑器的容器 -->
                        <script id="post_container" name="content" type="text/plain"><?php echo htmlspecialchars_decode($article->content); ?></script>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-default">提交</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</section>

<!-- 配置文件 -->
<script type="text/javascript" src="/static/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="/static/ueditor/ueditor.all.js"></script>

<script type="text/javascript">
    var ue = UE.getEditor('post_container',{
        // 图片上传配置路径
        'serverUrl': "{:url('@admin/Ueditor/index')}",
        
        'elementPathEnabled':false,
        // autoHeight: true,
        'autoHeightEnabled':false,
        //编辑区域大小
        'initialFrameHeight' : '300',
        //定制菜单
        'toolbars' : [
            [
                'fullscreen', 'source', 'undo', 'redo', '|',
                'fontsize',
                'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'removeformat',
                'formatmatch', 'blockquote', 'pasteplain', '|',
                'forecolor', 'backcolor', '|',
                'lineheight', '|',
                'indent', '|', 'insertimage', '|',
                'justifyleft', //居左对齐
                'justifyright', //居右对齐
                'justifycenter', //居中对齐
                'justifyjustify', //两端对齐
            ],
        ]
    });
/*
 * 初始化分类
*/
$(function () {
   
});
</script>