{template "header.html"}
<div class="note note-danger">
    <p><a href="javascript:dr_update_cache();">{dr_lang('更改数据之后需要更新缓存之后才能生效')}</a></p>
</div>

<form action="" class="form-horizontal" method="post" name="myform" id="myform">
    {dr_form_hidden()}
    <div class="portlet bordered light myfbody">
        <div class="portlet-title tabbable-line">
            <ul class="nav nav-tabs" style="float:left;">
                <li class="{if $page==0}active{/if}">
                    <a href="#tab_0" data-toggle="tab" onclick="$('#dr_page').val('0')"> <i class="{dr_icon($module.icon)}"></i> {$module.name} - {dr_lang('评论设置')} </a>
                </li>
                <li class="{if $page==1}active{/if}">
                    <a href="#tab_1" data-toggle="tab" onclick="$('#dr_page').val('1')"> <i class="fa fa-comments"></i> {dr_lang('评分点评')} </a>
                </li>
                <li class="{if $page==4}active{/if}">
                    <a href="#tab_4" data-toggle="tab" onclick="$('#dr_page').val('4')"> <i class="fa fa-comments"></i> {dr_lang('后台评论显示字段')} </a>
                </li>
            </ul>
        </div>
        <div class="portlet-body">
            <div class="tab-content">


                <div class="tab-pane {if 0 == $page}active{/if}" id="tab_0">
                    <div class="form-body">


                        <div class="form-group">
                            <label class="col-md-2 control-label" style="padding-top:5px;">{dr_lang('评论功能')}</label>
                            <div class="col-md-9">
                                <input type="checkbox" name="data[use]" value="1" {if $data['use']}checked{/if} data-on-text="{dr_lang('开启')}" data-off-text="{dr_lang('关闭')}" data-on-color="success" data-off-color="danger" class="make-switch" data-size="small">

                                <span class="help-block">{dr_lang('选择关闭将不能进行评论')}</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label" style="padding-top:5px;">{dr_lang('命名名称')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[cname]" value="{php echo $data['cname'] ? htmlspecialchars($data['cname']) : dr_lang('评论');}" ></label>
                                <span class="help-block">{dr_lang('系统默认是"评论"，可以定义为"回复"、"论坛"、"帖子"、"点评"等名称')}</span>
                            </div>
                        </div>
                        <div class="form-group pt" >
                            <label class="col-md-2 control-label">{dr_lang('评论次数')}</label>
                            <div class="col-md-9">
                                <div class="mt-radio-inline">
                                    <label class="mt-radio"><input type="radio" name="data[num]" value="1" {if $data['num']}checked{/if} /> {dr_lang('评论一次')} <span></span></label>
                                    <label class="mt-radio"><input type="radio" name="data[num]" value="0" {if !$data['num']}checked{/if} /> {dr_lang('不限制')} <span></span></label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group pt" >
                            <label class="col-md-2 control-label">{dr_lang('评论方式')}</label>
                            <div class="col-md-9">
                                <div class="mt-radio-inline">
                                    <label class="mt-radio"><input type="radio" name="data[my]" value="1" {if $data['my']}checked{/if} /> {dr_lang('不能对自己')} <span></span></label>
                                    <label class="mt-radio"><input type="radio" name="data[my]" value="0" {if !$data['my']}checked{/if} /> {dr_lang('不限制')} <span></span></label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group pt" >
                            <label class="col-md-2 control-label">{dr_lang('评论回复权限')}</label>
                            <div class="col-md-9">
                                <div class="mt-radio-inline">
                                    <label class="mt-radio"><input type="radio" name="data[reply]" value="1" {if $data['reply']==1}checked{/if} /> {dr_lang('都允许')} <span></span></label>
                                    <label class="mt-radio"><input type="radio" name="data[reply]" value="2" {if $data['reply']==2}checked{/if} /> {dr_lang('仅自己')} <span></span></label>
                                    <label class="mt-radio"><input type="radio" name="data[reply]" value="0" {if !$data['reply']}checked{/if} /> {dr_lang('禁止所有')} <span></span></label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group pt" >
                            <label class="col-md-2 control-label">{dr_lang('是否统计回复')}</label>
                            <div class="col-md-9">
                                <div class="mt-radio-inline">
                                    <label class="mt-radio"><input type="radio" name="data[ct_reply]" value="1" {if $data['ct_reply']==1}checked{/if} /> {dr_lang('统计')} <span></span></label>
                                    <label class="mt-radio"><input type="radio" name="data[ct_reply]" value="0" {if !$data['ct_reply']}checked{/if} /> {dr_lang('不统计')} <span></span></label>
                                </div>
                                <span class="help-block">{dr_lang('将评论回复也计算到评论总数之中')}</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('电脑列表分页数量')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[pagesize]" value="{intval($data['pagesize'])}" ></label>
                                <span class="help-block">{dr_lang('用户中心数据列表在电脑网页每页显示数量')}</span>
                            </div>
                        </div>


                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('手机列表分页数量')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[pagesize_mobile]" value="{intval($data['pagesize_mobile'])}" ></label>
                                <span class="help-block">{dr_lang('用户中心数据列表在手机网页每页显示数量')}</span>
                            </div>
                        </div>


                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('API接口列表分页数量')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[pagesize_api]" value="{intval($data['pagesize_api'])}" ></label>
                                <span class="help-block">{dr_lang('用户中心数据列表在API数据请求时每页返回的数量')}</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('前端排列顺序')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control input-xlarge" type="text" name="data[order]" value="{$data['order']}" ></label>
                                <span class="help-block">{dr_lang('前端显示排列的排序方式，默认是时间最新排列最前')}</span>
                            </div>
                        </div>



                    </div>
                </div>

                <div class="tab-pane {if 1 == $page}active{/if}" id="tab_1">
                    <div class="form-body">



                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('开启点评')}</label>
                            <div class="col-md-9">
                                <input type="checkbox" name="data[review][use]" value="1" {if $data['review']['use']}checked{/if} data-on-text="{dr_lang('是')}" data-off-text="{dr_lang('否')}" data-on-color="success" data-off-color="danger" class="make-switch" data-size="small">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('总分形式')}</label>
                            <div class="col-md-9">
                                <div class="mt-radio-inline">
                                    <label class="mt-radio"><input type="radio" name="data[review][score]" value="5" {if $data['review']['score']==5}checked{/if} /> {dr_lang('五分制')}<span></span></label>
                                    <label class="mt-radio"><input type="radio" name="data[review][score]" value="10" {if $data['review']['score']==10}checked{/if} /> {dr_lang('十分制')}<span></span></label>
                                    <label class="mt-radio"><input type="radio" name="data[review][score]" value="100" {if $data['review']['score']==100}checked{/if} /> {dr_lang('百分制')}<span></span></label>
                                </div>
                                <span class="help-block">{dr_lang('显示主题的各个评分项的数值形式')}</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('分数小数点')}</label>
                            <div class="col-md-9">
                                <div class="mt-radio-inline">
                                    <label class="mt-radio"><input type="radio" name="data[review][point]" value="0" {if !$data['review']['point']}checked{/if} /> {dr_lang('不显示')}<span></span></label>
                                    <label class="mt-radio"><input type="radio" name="data[review][point]" value="1" {if $data['review']['point']==1}checked{/if} /> {dr_lang('一位数')}<span></span></label>
                                    <label class="mt-radio"><input type="radio" name="data[review][point]" value="2" {if $data['review']['point']==2}checked{/if} /> {dr_lang('两位数')}<span></span></label>
                                </div>
                                <span class="help-block">{dr_lang('各项得分的显示是否显示小数点')}</span>
                            </div>
                        </div>
                        <div class="form-group dr_one">
                            <label class="col-md-2 control-label">{dr_lang('点评星级')}</label>
                            <div class="col-md-9">
                                {loop $data['review']['value'] $ii $t}
                                <label><input class="form-control" type="text" name="data[review][value][{$ii}][name]" value="{htmlspecialchars($t['name'])}" size="15" /></label>
                                {/loop}
                            </div>
                        </div>
                        <div class="form-group dr_one">
                            <label class="col-md-2 control-label">{dr_lang('点评选项')}</label>
                            <div class="col-md-9">
                                {loop $data['review']['option'] $ii $t}
                                <p>
                                    <label class="mt-checkbox mt-checkbox-outline"><input type="checkbox" name="data[review][option][{$ii}][use]" {if $t.use}checked{/if} value="1"> <span></span></label>
                                    <label><input class="form-control  input-large" type="text" name="data[review][option][{$ii}][name]" value="{htmlspecialchars($t['name'])}" size="15" /></label>
                                </p>
                                {/loop}
                            </div>
                        </div>


                    </div>
                </div>



                <div class="tab-pane {if $page==4}active{/if}" id="tab_4">
                    <div class="form-body">

                        <table class="table table-striped table-bordered table-hover table-checkable dataTable">
                            <thead>
                            <tr class="heading">
                                <th class="myselect">
                                    {dr_lang('显示')}
                                </th>
                                <th width="180"> {dr_lang('字段')} </th>
                                <th width="150"> {dr_lang('名称')} </th>
                                <th width="100"> {dr_lang('宽度')} </th>
                                <th> {dr_lang('回调方法')} </th>
                            </tr>
                            </thead>
                            <tbody class="field-sort-items">
                            {loop $comment_field $n $t}
                            <tr class="odd gradeX">
                                <td class="myselect">
                                    <label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
                                        <input type="checkbox" class="checkboxes" name="data[comment_list_field][{$t.fieldname}][use]" value="1" {if $data['comment_list_field'][$t.fieldname]['use']} checked{/if} />
                                        <span></span>
                                    </label>
                                </td>
                                <td>{dr_lang($t.name)} ({$t.fieldname})</td>
                                <td><input class="form-control" type="text" name="data[comment_list_field][{$t.fieldname}][name]" value="{php echo $data['comment_list_field'][$t.fieldname]['name'] ? htmlspecialchars($data['comment_list_field'][$t.fieldname]['name']) : $t.name}" /></td>
                                <td> <input class="form-control" type="text" name="data[comment_list_field][{$t.fieldname}][width]" value="{htmlspecialchars($data['comment_list_field'][$t.fieldname]['width'])}" /></td>
                                <td> <div class="input-group" style="width:250px">
                                        <span class="input-group-btn">
                                            <a class="btn btn-success" href="javascript:dr_call_alert();">{dr_lang('回调')}</a>
                                        </span>
                                    <input class="form-control" type="text" name="data[comment_list_field][{$t.fieldname}][func]" value="{htmlspecialchars($data['comment_list_field'][$t.fieldname]['func'])}" />
                                </div></td>
                            </tr>
                            {/loop}
                            </tbody>
                        </table>
                    </div>
                </div>


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

    <div class="portlet-body form myfooter">
        <div class="form-actions text-center">
            <button type="button" onclick="dr_ajax_submit('{dr_now_url()}&page='+$('#dr_page').val(), 'myform', '2000')" class="btn green"> <i class="fa fa-save"></i> {dr_lang('保存')}</button>
        </div>
    </div>
</form>




{template "footer.html"}