add.html 14.5 KB
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('广告类型')}:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
                {foreach name="typeList" item="vo"}
                <label class="type" for="row[type]-{$key}"><input class="type" id="row[type]-{$key}" name="row[type]" type="radio" value="{$key}" {in name="key" value="3"}checked{/in} /> {$vo}</label>
                {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Goods_name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-goods_name" data-rule="required" class="form-control" name="row[goods_name]" type="text">
        </div>
    </div>
    <div class="form-group video" style="display: none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('Video')}:</label>
        <div class="col-xs-12 col-sm-8">
            <!--<input id="c-video" class="form-control" name="row[video]" type="text">-->
            <div class="input-group">
                <input id="c-video" class="form-control" size="50" name="row[video]" type="text">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-video" class="btn btn-danger plupload" data-input-id="c-video" data-mimetype="mp4,avi,flv,wmv" data-multiple="true" data-preview-id="p-video"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-video" class="btn btn-primary fachoose" data-input-id="c-video" data-mimetype="mp4,avi,flv,wmv" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-video"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-video"></ul>
            <!--<div class="input-group">
                <input id="c-video" class="form-control" size="50" name="row[video]" type="text">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-video" class="btn btn-danger plupload" data-input-id="c-video" data-mimetype="mp4,avi,flv,wmv" data-multiple="false" data-preview-id="p-video"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-video" class="btn btn-primary fachoose" data-input-id="c-video" data-mimetype="mp4,avi,flv,wmv" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-video"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-video"></ul>-->
        </div>
    </div>
    <div class="form-group voice" style="display: none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('Voice')}:</label>
        <div class="col-xs-12 col-sm-8">
            <!--<input id="c-voice" class="form-control" name="row[voice]" type="text">-->
            <div class="input-group">
                <input id="c-voice" class="form-control" size="50" name="row[voice]" type="text">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-voice" class="btn btn-danger plupload" data-input-id="c-voice" data-mimetype="mp3" data-multiple="true" data-preview-id="p-voice"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-voice" class="btn btn-primary fachoose" data-input-id="c-voice" data-mimetype="mp3" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-voice"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-voice"></ul>
        </div>
    </div>
    <div class="form-group content2">
        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
        </div>
    </div>
    <div class="form-group view_time">
        <label class="control-label col-xs-12 col-sm-2">{:__('最短观看时间')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-view_time" class="form-control" name="row[view_time]" type="number" value="0">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('重新答题时间')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-anew_time" class="form-control" name="row[anew_time]" type="number" value="0">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('限制性别')}:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
                {foreach name="sexList" item="vo"}
                <label for="row[sex]-{$key}"><input id="row[sex]-{$key}" name="row[sex]" type="radio" value="{$key}" {in name="key" value="0"}checked{/in} /> {$vo}</label>
                {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Min_age')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-min_age" class="form-control" name="row[min_age]" type="number">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Max_age')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-max_age" class="form-control" name="row[max_age]" type="number">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('地址')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-area" data-toggle="addresspicker" data-input-id="c-area" data-lat-id="c-latitude" data-lng-id="c-longitude" class="form-control" name="row[area]" type="text" readonly="true">
        </div>
    </div>
    <!--<div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Province')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-province" data-rule="required" class="form-control" name="row[province]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('City')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-city" data-rule="required" class="form-control" name="row[city]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('County')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-county" data-rule="required" class="form-control" name="row[county]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-address" data-rule="required" class="form-control" name="row[address]" type="text">
        </div>
    </div>-->
    <div class="form-group hidden" readonly="true">
        <label class="control-label col-xs-12 col-sm-2">{:__('Longitude')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-longitude" class="form-control" name="row[longitude]" type="text">
        </div>
    </div>
    <div class="form-group hidden" readonly="true">
        <label class="control-label col-xs-12 col-sm-2">{:__('Latitude')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-latitude" class="form-control" name="row[latitude]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Distance')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-distance" class="form-control" name="row[distance]" type="number" value="0">
            <p class="text-warning">0为不限</p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-start_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[start_time]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-end_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[end_time]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Url')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-url" class="form-control" name="row[url]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Exp')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-exp" class="form-control" name="row[exp]" type="number">
        </div>
    </div>
    <!--<div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('View')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-view" class="form-control" name="row[view]" type="number" value="0">
        </div>
    </div>-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-images" class="form-control" size="50" name="row[images]" type="text">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-images" class="btn btn-danger plupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-images"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-images"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('上架状态')}:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
                {foreach name="userIsUpList" item="vo"}
                <label for="row[user_is_up]-{$key}"><input id="row[user_is_up]-{$key}" name="row[user_is_up]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label>
                {/foreach}
            </div>

        </div>
    </div>
    <!--<a href="" title="添加"  class="dialogit">添加</a>-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('题')}:</label>
        <div class="col-xs-12 col-sm-8">
            <!--<a href="" title="添加" class="dialogit btn btn-success btn-embossed">添加</a>-->
            <!--<div id="toolbar" class="toolbar">
                <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('question/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
             </div>
            <table id="table" class="table table-striped table-bordered table-hover table-nowrap">

            </table>-->
            <dl class="fieldlist" data-template="questiontpl" data-name="row[question]">
                <dd>
                    <ins>{:__('问题类型')}</ins>
                    <ins>{:__('问题')}</ins>
                    <ins>{:__('正确答案')}</ins>
                    <ins>{:__('选项')}<span class="text-warning">多个选项使用英文格式逗号隔开</span></ins>
                </dd>
                <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
                <!--请注意 dd和textarea间不能存在其它任何元素,实际开发中textarea应该添加个hidden进行隐藏-->
                <textarea name="row[question]" class="form-control hidden" cols="30" rows="5">[{"question_type":"","question_name":"","question_answer":"","option":""}]</textarea>
            </dl>
            <script id="questiontpl" type="text/html">
                <dd class="form-inline">
                    <ins>
                        <select class="form-control" name="<%=name%>[<%=index%>][question_type]" style="width: 100%">
                            <option value="">请选择</option>
                            <option value="2">选择题</option>
                            <option value="1">填空题</option>
                        </select>
                    </ins>
                    <ins><input type="text" name="<%=name%>[<%=index%>][question_name]" class="form-control" value="" placeholder="问题"/></ins>
                    <ins><input type="text" name="<%=name%>[<%=index%>][question_answer]" class="form-control" value="" placeholder="正确答案"/></ins>
                    <ins><input type="text" name="<%=name%>[<%=index%>][option]" class="form-control" value="" placeholder="选项"/></ins>
                    <!--下面的两个按钮务必保留-->
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                    <!--<span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>-->
                </dd>
            </script>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>