<script type="text/javascript">
    function pic_upload_success(file, data) {
        var json = $.parseJSON(data)
        $(this).bjuiajax('ajaxDone', json)
        if (json[BJUI.keys.statusCode] == BJUI.statusCode.ok) {
            $('#j_site_logo').val(json.filename).trigger('validate')
            $('#j_site_logo_span_pic').html('<img src="'+ json.filename +'" WIDTH="200" HEIGHT="120"/>')
        }
    }
</script>
<div class="bjui-pageContent">
    <form method="post" action="${ctxPath}/system/cms/site/save" id="j_client_form" data-toggle="validate" data-autorefresh="true" data-alertmsg="false">
        <input TYPE="hidden" name="siteId" value="${site.siteId!}">
        <table class="table table-condensed table-hover" width="100%">
            <tbody>
            <tr>
                <td>
                    <label for="siteName" class="control-label x85">站点名称：</label>
                    <input type="text" name="siteName" id="siteName" value="${site.siteName!,xss}" placeholder="站点名称" data-rule="required;" >
                </td>
            </tr>
            <tr>
                <td>
                    <label for="domain" class="control-label x85">站点域名：</label>
                    @if(isEmpty(site.domain)){
                    <input type="text" name="domain" id="domain" value="${site.domain!,xss}" data-rule="required;remote(${ctxPath}/system/cms/site/checkDomain)"   placeholder="站点域名">
                    @}else{
                    <input type="text" name="domain" id="domain" value="${site.domain!,xss}" data-rule="required;"   placeholder="站点域名">
                    @}
                </td>
            </tr>
            <tr>
                <td>
                    <label class="control-label x85">logo：</label>
                    <div style="display: inline-block; vertical-align: middle;">
                        <div id="j_site_logo_up" data-toggle="upload" data-uploader="${ctxPath}/uploads"
                             data-file-size-limit="1024000000"
                             data-file-type-exts="*.jpg;*.png;*.gif;*.mpg"
                             data-multi="false"
                             data-on-upload-success="pic_upload_success"
                             data-icon="cloud-upload"></div>
                        <input type="hidden" name="logo" value="${site.logo!}" id="j_site_logo">
                        <span id="j_site_logo_span_pic">
                    @if(isNotEmpty(site.logo)){
                    <IMG WIDTH="200" HEIGHT="120" src="${site.logo!}">
                    @}
                        </span>
                    </div>
                    <br>

                </td>
            </tr>
            <tr>
                <td>
                    <label class="control-label x85">管理员：</label>
                    <input type="text" data-toggle="lookup" data-rule="required;"  data-url="${ctxPath}/system/cms/site/userCheck" name="userIds"   data-maxable="false" data-resizable="false"  data-width="750" data-height="430"  value="${site.userIds!}">
                </td>
            </tr>
            <tr>
                <td>
                    <label for="j_status" class="control-label x85"  data-toggle="selectpicker">站点状态：</label>
                    <select name="status" id="j_status"  data-rule="required">
                        @if(isNotEmpty(site.status)&&!site.status){
                        <option value="1">正常</option>
                        <option value="0" selected>禁用</option>
                        @}else{
                        <option value="1" selected>正常</option>
                        <option value="0">禁用</option>
                        @}
                    </select>
                </td>
            </tr>
            <tr>
                <td>
                    <label for="j_mstatus" class="control-label x85"  data-toggle="selectpicker">开启移动：</label>
                    <select name="isMobile" id="j_mstatus"  data-rule="required">
                        @if(isNotEmpty(site.isMobile)&&!site.isMobile){
                        <option value="1">启用</option>
                        <option value="0" selected>禁用</option>
                        @}else{
                        <option value="1" selected>启用</option>
                        <option value="0">禁用</option>
                        @}
                    </select>
                </td>
            </tr>
            <tr>
                <td>
                    <label for="j_linkman" class="control-label x85">首页标题：</label>
                    <input type="text" name="title" id="j_linkman" value="${site.title!,xss}" placeholder="站点标题" data-rule="required" >
                </td>
            </tr>
            <tr>
                <td>
                    <label for="j_email" class="control-label x85">关键字：</label>
                    <input type="text" name="keyword" id="j_email" value="${site.keyword!,xss}" placeholder="关键字"  data-rule="required;">
                </td>
            </tr>

            <tr>
                <td>
                    <label for="j_mobile" class="control-label x85">描述：</label>
                    <input type="text" name="description" id="j_mobile" value="${site.description!,xss}"  placeholder="描述"  data-rule="required">
                </td>
            </tr>

            <tr>
                <td>
                    <label for="j_tpl" class="control-label x85">模板：</label>
                    <input type="text" name="template" id="j_tpl" value="${site.template!,xss}"  placeholder="模板"  data-rule="required">
                </td>
            </tr>
            <tr>
                <td>
                    <label for="j_tpl" class="control-label x85">手机模板：</label>
                    <input type="text" name="mobileTpl" id="j_mtpl" value="${site.mobileTpl!,xss}"  placeholder="模板"  data-rule="required">
                </td>
            </tr>
            </tbody>
        </table>
    </form>
    </div>
<div class="bjui-pageFooter">
    <ul>
        <li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
        <li><button type="submit" class="btn-default"  data-icon="save">保存</button></li>
    </ul>
</div>