#@layout()
#define content()
<div class="content-wrapper">

    <section class="content-header">
        <h1>
            附件设置
            <small>Attachment Setting</small>
        </h1>
    </section>

    <section class="content">

        <div class="row">
            <div class="col-xs-12">
                <div class="box box-primary">
                    <div class="box-header ">
                        <h3 class="box-title"></h3>
                    </div>
                    <!-- /.box-header -->
                    <!-- form start -->
                    <form class="form-horizontal form-setting" autocomplete="off" id="optionForm">
                        <div class="box-body ">


                            <h4 class="page-first-header">附件大小限制</h4>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">图片限制</label>
                                <div class="col-sm-6">
                                    <input type="input" class="form-control" placeholder="图片最大值"
                                           name="attachment_img_maxsize" value="#option('attachment_img_maxsize')">
                                    <p class="help-block"> 单位兆（M），默认为2M，填写0允许任何大小。</p>

                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">其他文件</label>
                                <div class="col-sm-6">
                                    <input type="input" class="form-control" placeholder="视频、文档等最大值"
                                           name="attachment_other_maxsize" value="#option('attachment_other_maxsize')">
                                    <p class="help-block"> 单位兆（M），默认为10M，填写0允许任何大小。</p>
                                </div>
                            </div>


                            <h4 class="page-header">阿里云OSS同步</h4>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">是否启用附件同步</label>
                                <div class="col-sm-6">
                                    <input type="checkbox" class="switchery" data-for="attachment_aliyunoss_enable"
                                           #checkedIf(option("attachment_aliyunoss_enable"))>
                                    <input type="hidden" id="attachment_aliyunoss_enable"
                                           name="attachment_aliyunoss_enable">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">OSS删除同步</label>
                                <div class="col-sm-6">
                                    <input type="checkbox" class="switchery" data-for="attachment_aliyunoss_del"
                                           #checkedIf(option("attachment_aliyunoss_del"))>
                                    <input type="hidden" id="attachment_aliyunoss_del"
                                           name="attachment_aliyunoss_del">
                                    <p class="help-block"> 开启后会在删除附件时同时也删除OSS中的文件</p>
                                </div>
                            </div>


                            <div class="form-group">
                                <label class="col-sm-2 control-label">API访问域名</label>
                                <div class="col-sm-6">
                                    <input type="input" class="form-control" placeholder="阿里云oss的 endPoint"
                                           name="attachment_aliyunoss_endpoint" value="#option('attachment_aliyunoss_endpoint')">
                                    <p class="help-block"> 阿里云API域名详情：<a target="_blank" href="https://help.aliyun.com/document_detail/31837.html">https://help.aliyun.com/document_detail/31837.html</a>。 </p>

                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">AccessKeyId</label>
                                <div class="col-sm-6">
                                    <input type="input" class="form-control" placeholder="通过阿里云安全令牌生成..."
                                           name="attachment_aliyunoss_accesskeyid" value="#option('attachment_aliyunoss_accesskeyid')">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">AccessKeySecret</label>
                                <div class="col-sm-6">
                                    <input type="input" class="form-control" placeholder="通过阿里云安全令牌生成..."
                                           name="attachment_aliyunoss_accesskeysecret" value="#option('attachment_aliyunoss_accesskeysecret')">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">存储空间</label>
                                <div class="col-sm-6">
                                    <input type="input" class="form-control" placeholder="阿里云oss的 bucketName"
                                           name="attachment_aliyunoss_bucketname" value="#option('attachment_aliyunoss_bucketname')">
                                </div>
                            </div>

                            <h4 class="page-header">图片水印</h4>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">是否启用水印</label>
                                <div class="col-sm-6">
                                    <input type="checkbox" class="switchery" data-for="attachment_watermark_enable"
                                           #checkedIf(option("attachment_watermark_enable"))>
                                    <input type="hidden" id="attachment_watermark_enable"
                                           name="attachment_watermark_enable">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">水印位置</label>
                                <div class="col-sm-6">
                                    <select class="form-control" name="attachment_watermark_position">
                                        <option value="1" #selectedIf(option(
                                        'attachment_watermark_position') == '1')>左上角</option>
                                        <option value="2" #selectedIf(option(
                                        'attachment_watermark_position') == '2')>右上角</option>
                                        <option value="3" #selectedIf(option(
                                        'attachment_watermark_position') == '3')>正中间</option>
                                        <option value="4" #selectedIf(option(
                                        'attachment_watermark_position') == '4')>左下角</option>
                                        <option value="5" #selectedIf(option(
                                        'attachment_watermark_position') == '5')>右下角</option>
                                    </select>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">透明度</label>
                                <div class="col-sm-6">
                                    <input type="input" class="form-control" placeholder="..."
                                           name="attachment_watermark_transparency"
                                           value="#option('attachment_watermark_transparency')">
                                    <p class="help-block"> 请填写0~1的数字，默认为1不透明 </p>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">水印图片</label>
                                <div class="col-sm-6">
                                    <button type="button"
                                            for-src="wimg"
                                            for-input="imginput"
                                            class="btn-image-browser btn btn-flat btn-default btn-xs">
                                        <i class="fa fa-fw fa-image"></i> 选择图片
                                    </button>
                                    <br/>
                                    <img src="#(CPATH)#option('attachment_watermark_img','/static/commons/img/nothumbnail.jpg')"
                                         id="img">
                                    <input type="hidden" id="imginput" name="attachment_watermark_img"
                                           value="#option('attachment_watermark_img')">
                                </div>
                            </div>


                        </div>
                        <!-- /.box-body -->
                        <div class="box-footer">
                            <div class="col-sm-offset-2 col-sm-10 submit-block">
                                <div class="box-submit">
                                    <button type="submit" class="btn btn-primary">提交</button>
                                </div>
                            </div>
                        </div>
                        <!-- /.box-footer -->
                    </form>
                </div>
            </div>
        </div>

    </section>

</div>
#end
