<section class="content">
    <div class="row">
        <!-- left column -->
        <div class="col-md-12">
            <!-- general form elements -->
            <div class="box box-primary"  style="padding:0 10%">
                <div class="box-header with-border">
                    <h3 class="box-title">{{$title}}</h3>
                </div>
                <!-- /.box-header -->

                <!-- form start -->
                <form role="form" class="data_forum">
                    <div class="box-body">
                        <div class="form-group">
                            <label>显示名称</label>
                            <input type="text" name="title" placeholder="请输入显示名称"  class="form-control" value="{{$menu.title}}" />
                        </div>

                        <div class="form-group">
                            <label>url</label>
                            <input type="text" name="url" placeholder="请输入url"  class="form-control" value="{{$menu.url}}" />
                        </div>

                        <!-- radio -->
                        <div class="form-group">
                            <label for="">是否显示到菜单</label>
                            <br />
                            <input type="radio" name="isshow"  value="1" {{if $menu['isshow'] }}checked="true" {{/if}} />
                            是
                            <input type="radio" name="isshow"  value="0" {{if !$menu['isshow'] }}checked="true" {{/if}} />
                            否
                        </div>

                        <div class="form-group">
                            <label>排序</label>
                            <input type="text" name="sort" value="{{$menu.sort}}" class="form-control"   />
                        </div>

                        <input type="hidden" name="id" value="{{$menu.id}}" />
                    </div>
                    <!-- /.box-body -->
                </form>
            </div>
            <!-- /.box -->
        </div>
        <!-- /.row -->
    </div>
</section>

<script>
    require(['validate', 'cml'], function() {
        $(".data_forum").validate({
            rules:{
                title:{
                    required: true
                },
                url :{
                    required: true
                }
            },
            errorClass: "help-block",
            errorElement: "span",
            highlight:function(element, errorClass, validClass) {
                $(element).parents('.form-group').addClass('has-error');
            },
            unhighlight: function(element, errorClass, validClass) {
                $(element).parents('.form-group').removeClass('has-error');
                $(element).parents('.form_group').addClass('has-success');
            }
        });
    });
</script>
