{{include_file name='home/public/header' title='系统设置'}}

</head>

<body>

<div id="wrapper">

    <!-- Navigation -->
    {{include_file name='home/public/nav' sidebar='admin/public/sidebar' active='config'}}
    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <div class="page-header">
                    <h1>系统设置 </h1>
                </div>
            </div>
            <!-- /.col-lg-12 -->
        </div>
        <!-- /.row -->
        <div class="row">

            <div class="col-lg-12">

                <div class="panel panel-default">

                    {{include_file name='admin/setting/tab' tab='app'}}

                    <div class="panel-body">
                        <form role="form" action="{{url('')}}" method="post">
                            <input type="hidden" name="csrf-phprap" value="{{csrf_token()}}" />

                            <div class="form-group">
                                <label>网站名称</label>
                                <input class="form-control" name="Config[name]" value="{{$config->name}}" placeholder="必填，至少2位" datatype="*2-250" nullmsg="请输入网站名称！">
                            </div>

                            <div class="form-group">
                                <label>网站关键字</label>
                                <input class="form-control" name="Config[keywords]" value="{{$config->keywords}}" placeholder="" ignore="ignore" datatype="*">
                            </div>

                            <div class="form-group">
                                <label>网站描述</label>
                                <textarea class="form-control" name="Config[description]" rows="2" ignore="ignore" datatype="*" nullmsg="请输入版权信息！">{{$config->description}}</textarea>
                            </div>

                            <div class="form-group">
                                <label>版权信息</label>
                                <input class="form-control" name="Config[copyright]" value="{{$config->copyright}}" placeholder="" ignore="ignore" datatype="*">
                            </div>

                            <div class="form-group">
                                <label>系统邮箱</label>
                                <input class="form-control" name="Config[email]" value="{{$config->email}}" placeholder="必填" datatype="e" nullmsg="请输入系统邮箱！" errormsg="请输入合法邮箱">
                            </div>

                            <div class="form-group">
                                <label class="control-label">推送消息 <a data-toggle="tooltip" data-placement="right" class="btn-show-tips" data-title="开启后会在指定时间间隔内推送申请消息，关闭后只有在刷新页面时才会推送消息">
                                    <i class="fa fa-info-circle"></i>
                                </a></label>
                                <div class="form-group">
                                    <label class="radio-inline">
                                        <input type="radio" name="Config[is_push]" {{if $config->is_push == 1}}checked{{/if}} value=1 > 开启
                                    </label>
                                    <label class="radio-inline">
                                        <input type="radio" name="Config[is_push]" {{if $config->is_push == 0}}checked{{/if}} value=0> 关闭
                                    </label>

                                </div>
                            </div>

                            <div class="form-group js_pushTime hidden">
                                <label>推送间隔(单位秒)</label>
                                <input class="form-control" name="Config[push_time]" value="{{$config->push_time}}" placeholder="单位秒，推送时间间隔不能小于10秒" value="10" datatype="numrange" min="10" nullmsg="请输入推送间隔" errormsg="推送时间间隔不能小于10秒">
                            </div>

                            <button type="reset" class="btn btn-default mr-1">重置</button>
                            <button type="button" class="btn btn-primary" id="js_submit">确认</button>

                        </form>

                    </div>
                    <!-- /.panel-body -->
                </div>
                <!-- /.panel -->
            </div>
            <!-- /.col-lg-12 -->
        </div>

    </div>
    <!-- /#page-wrapper -->

</div>
<!-- /#wrapper -->

<script>

//展示推送间隔信息
var pushTimeShow = function(){
    var isPush = $("input[name='Config[is_push]']:checked").val();

    if(isPush == 1){

        $(".js_pushTime").removeClass("hidden");
        $(".js_pushTime input").attr("ignore",'');

    }else{

        $(".js_pushTime").addClass("hidden");
        $(".js_pushTime input").attr("ignore",'ignore');

    }
}

pushTimeShow();

// 选择不时时推送时
$("input[name='Config[is_push]']").click(function(){
    pushTimeShow();
});

$(function () {
    $("form").validateForm();
});

</script>

{{include_file name='admin/public/footer'}}