{layout name="public/layout_main"}
<link rel="stylesheet" href="/static/fileinput/css/fileinput.css">
<link rel="stylesheet" href="/static/bootstrap-select/css/bootstrap-select.min.css">
<style type="text/css">
.progress-bar{
    text-align: center;
}
.dropdown-menu{
    z-index: 100000;
}
</style>

<section class="wrapper">
    <h3 class="">
        <a href="<?php echo url('@admin/Post/index')?>">
            <i class="fa fa-angle-right"></i> <a href="{:url('admin/post/index')}">文章管理</a> <i class="fa fa-angle-right"></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 name="myFrom" class="form-horizontal" enctype="multipart/form-data" method="POST" action="{:url('admin/banner/create')}")?>" id="article-create-form">
                <div class="form-group">
                    <label for="title" class="col-sm-1 control-label text-right" >图片</label>
                    <div class="col-lg-10">
                        <input id="input-b1" name="image" type="file">
                    </div>
                </div>

                <div class="form-group">
                    <label for="title" class="col-sm-1 control-label text-right">文章类型</label>
                    <div class="col-lg-10">
                        <select class="form-control" name="type" id="post_type">
                            <option value="1">小程序页面路径</option>
                            <option value="2">跳转到网页链接地址</option>
                        </select>
                    </div>
                </div>

                <div class="form-group">
                    <label for="title" class="col-sm-1 control-label text-right">请输入链接</label>
                    <div class="col-lg-10">
                        <input type="text" name="href" class="form-control">
                    </div>
                </div>

                <div class="form-group">
                    <label for="title" class="col-sm-1 control-label text-right">是否显示</label>
                    <div class="col-lg-10">
                        <select class="form-control" name="type" id="post_type">
                            <option value="1">显示</option>
                            <option value="2">隐藏</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-1 col-sm-10">
                        <button type="submit" class="btn btn-default" id="btn-save">提交</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</section>
<!-- 文件上传和select插件 -->
<script type="text/javascript" src="/static/fileinput/js/fileinput.min.js"></script>
<script type="text/javascript" src="/static/fileinput/js/locales/zh.js"></script>
<script type="text/javascript" src="/static/bootstrap-select/js/bootstrap-select.min.js"></script>
<script type="text/javascript" src="/static/bootstrap-select/js/i18n/defaults-zh_CN.js"></script>


                        <!-- 配置文件 -->
<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">
// 初始化文件上传
initFileInput($("#input-b1"));
// 单文件上传
function initFileInput(el,initArr,initConfig){
    // var initialPreview = [];
    // initialPreview.push(initArr);
    el.fileinput({
    language: 'zh',
    uploadExtraData:{'name':name},
    // initialPreview: initialPreview,
    uploadExtraData:{'name':'banner-choose'},
    // initialPreviewConfig: initConfig,
    autoReplace : true,
    showUpload:false, //是否显示上    传按钮
    initialPreviewShowDelete:true,
    initialPreviewAsData: true,
    dropZoneEnabled: false,
    showRemove :false,
    showUpload:false, //是否显示上    传按钮
    overwriteInitial:true,
    showUploadedThumbs:false,
    allowedFileExtensions: ['bmp','jpg','png','tif','gif','pcx','tga','exif','fpx','svg','cdr','pcd','dxf','ufo','eps','raw','WMF','webp'],//接收的文件后缀
  })
}
</script>
