Edit.html 9.68 KB
<%include '../../common/__ui/header'%>
<%include '../../common/__partail/ListHeader'%>

<div class="contentpanel">
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title"><%pageName%></h4>
                </div><!-- panel-heading -->
                <div id="info-content" class="panel-body" action="<%action%>" type="<%type%>">

                </div><!-- panel-body -->
                <div class="panel-footer">
                    <div class="row">
                        <div class="col-sm-9 col-sm-offset-3">
                            <a id="saveBtn" class="btn btn-primary mr5">添加</a>
                            <a href="/operations/category/index" class="btn btn-primary mr5">取消</a>
                        </div>

                    </div>
                </div><!-- panel-footer -->
            </div><!-- panel -->
        </div>
    </div>
</div>

<script type="text/template" id="content-template">
    <div class="row form-bordered">
        <div class="form-group">
            <label class="col-sm-1 control-label">分类名称</label>
            <div class="col-sm-9">
                <input type="text" value="[[sortName]]" class="form-control observe" data-field="sortName" placeholder="分类名称" required>
                <p style="color:#999">注:分类名称必填</p>
            </div>
        </div><!-- form-group -->
        <div class="form-group">
            <label class="col-sm-1 control-label">英文名称</label>
            <div class="col-sm-9">
                <input type="text" value="[[sortNameEn]]" class="form-control observe" data-field="sortNameEn" placeholder="英文名称" required>
            </div>
        </div><!-- form-group -->
        <div class="form-group">
            <label class="col-sm-1 control-label">色值</label>
            <div class="col-sm-2">
                <input type="text" value="[[sortNameColor]]" data-field="sortNameColor" class="form-control observe" prompt="色值">
            </div>
        </div><!-- form-group -->
        <div class="form-group">
            <label class="col-sm-1 control-label">上级分类</label>
            <div class="col-sm-9" id="categories-content">

            </div>
        </div><!-- form-group -->
        <div class="form-group">
            <label class="col-sm-1 control-label">分类图标</label>
            <div class="col-sm-9">
                <input type="file" name="file" prompt="分类图标" value="[[sortIco]]" class="observe" data-field="sortIco">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-1 control-label">分类大图标</label>
            <div class="col-sm-9">
                <input type="file" name="file" prompt="分类大图标" value="[[sortIcoBig]]" class="observe" data-field="sortIcoBig">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-1 control-label">跳转方式</label>
            <div class="col-sm-9">
                <input type="radio" name="isNewPage" style="width:18px;height:18px;" value="N"> 当前页面打开
                <input type="radio" style="width:18px;height:18px;" name="isNewPage" value="Y" checked> 新页面打开
            </div>
            <input type="hidden" id="isNewPage" for="radio" value="[[isNewPage]]">
        </div>

        <div class="form-group">
            <label class="col-sm-1 control-label">跳转链接</label>
            <div class="col-sm-9">
                <input type="text" id="sortUrl" value='[[sortUrl]]' class="form-control" placeholder="跳转链接" required readonly style="cursor: not-allowed;">
                <a class="btn btn-info" id="addUrl">添加链接</a>
                <p style="color:#999">注:必填,链接中不能有英文单引号</p>
            </div>
        </div><!-- form-group -->
        <div class="form-group">
            <label class="col-sm-1 control-label">分隔符</label>
            <div class="col-sm-9">
                <input type="radio" name="separativeSign" style="width:18px;height:18px;" value="Y"> 
                <input type="radio" style="width:18px;height:18px;" name="separativeSign" value="N" checked> 
            </div>
            <input type="hidden" id="separativeSign" for="radio" value="[[separativeSign]]">
        </div><!-- form-group -->
        <div class="form-group">
            <label class="col-sm-1 control-label">是否新品</label>
            <div class="col-sm-9">
                <input type="radio" name="isNew" style="width:18px;height:18px;" value="Y"> 
                <input type="radio" style="width:18px;height:18px;" name="isNew" value="N" checked> 
            </div>
            <input type="hidden" id="isNew" for="radio" value="[[isNew]]">
        </div><!-- form-group -->
        <div class="form-group">
            <label class="col-sm-1 control-label">是否热门</label>
            <div class="col-sm-9">
                <input type="radio" name="isHot" style="width:18px;height:18px;" value="Y"> 
                <input type="radio" style="width:18px;height:18px;" name="isHot" value="N" checked> 
            </div>
            <input type="hidden" id="isHot" for="radio" value="[[isHot]]">
        </div><!-- form-group -->
        <div class="form-group">
            <label class="col-sm-1 control-label">位置码</label>
            <div class="col-sm-4">
                <input type="text" data-field="contentCode" value="[[contentCode]]" class="form-control observe" placeholder="资源位位置码">
            </div>
        </div><!-- form-group -->
        <div class="form-group">
            <label class="col-sm-1 control-label">显示平台</label>
            <div class="col-sm-8">
                <input type="checkbox" value="iphone" style="width:18px;height:18px;margin-left:5px;" name="platform"> IOS手机
                <input type="checkbox" value="ipad" style="width:18px;height:18px;margin-left:5px;" name="platform"> IOS Pad
                <input type="checkbox" value="android" style="width:18px;height:18px;margin-left:5px;" name="platform"> 安卓手机
                <input type="checkbox" value="androidpad" style="width:18px;height:18px;margin-left:5px;" name="platform"> 安卓Pad
                <input type="checkbox" value="h5" style="width:18px;height:18px;margin-left:5px;" name="platform"> 手机网站
                <input type="checkbox" value="web" style="width:18px;height:18px;margin-left:5px;" name="platform"> 网站
                <input type="checkbox" value="platform" style="width:18px;height:18px;margin-left:5px;" name="platform"> 平台
            </div>
            <input type="hidden" id="platform" for="checkbox" value="[[platform]]">
        </div><!-- form-group -->
        <div class="form-group">
            <label class="col-sm-1 control-label">排序</label>
            <div class="col-sm-9">
                <input type="text" value="[[orderBy]]" data-field="orderBy" class="form-control observe" placeholder="排序" required>
            </div>
        </div><!-- form-group -->
    </div><!-- row -->
</script>

<script type="text/template" id="template2">
    <div id="action-row" class="rows">
        <div class="form-group">
            <label class="col-sm-2 control-label">选择跳转目的地:</label>

            <div class="col-sm-8">
                <select name="goTo" id="goTo" class="form-control" value="[[action]]">
                    [[layout action_template]]
                </select>

            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">跳转地址:</label>

            <div class="col-sm-8">
                <textarea rows="2" id="goToUrl" class="form-control" placeholder="跳转地址">[[url]]</textarea>
            </div>

        </div>
    </div>
</script>

<script type="text/template" id="categories-template">
    <select id="firstSortId" value="[[firstSortId]]" data-field="firstSortId" style="width:150px;" tabindex="-1" title="" class="select2-offscreen observe">
        <option value="">请选择根分类</option>
        [[each categories as item index]]
        <option value="[[item.id]]">[[item.sort_name]]</option>
        [[/each]]
    </select>
    <select id="secondSortId" value="[[secondSortId]]" data-field="secondSortId" style="width:150px;margin-left:10px;" tabindex="-1" class="select2-offscreen observe">
        <option value="">请选择二级分类</option>
        [[if firstSortId]]
            [[each categories as item index]]
                [[if item.id == firstSortId && !!item.sub]]
                    [[each item.sub as item1 index1]]
                    <option value="[[item1.id]]">[[item1.sort_name]]</option>
                    [[/each]]
                [[/if]]
            [[/each]]
        [[/if]]
    </select>
    <select id="threadSortId" value="[[threadSortId]]" data-field="threadSortId" style="width:150px;margin-left:10px;" tabindex="-1" title="" class="select2-offscreen observe">
        <option value="">请选择三级分类</option>
        [[if firstSortId]]
            [[each categories as item index]]
                [[if item.id == firstSortId && !!item.sub]]
                    [[each item.sub as item1 index1]]
                        [[if item1.id == secondSortId && !!item1.sub]]
                            [[each item1.sub as item2 index2]]
                            <option value="[[item2.id]]">[[item2.sort_name]]</option>
                            [[/each]]
                        [[/if]]
                    [[/each]]
                [[/if]]
            [[/each]]
        [[/if]]
    </select>
</script>

<%include '../../resource/__partail/actions'%>