<!--
	The ID "widget-grid" will start to initialize all widgets below 
	You do not need to use widgets if you dont want to. Simply remove 
	the <section></section> and you can use wells or panels instead 
	-->

<!-- widget grid -->
<section id="widget-grid" class="">

    <!-- row -->
    <div class="row">

        <!-- NEW WIDGET START -->
        <article class="col-xs-12 col-sm-12 col-md-12 col-lg-12">

            <!-- Widget ID (each widget will need uniqu e ID)-->
            <div class="jarviswidget" id="wid-id-4">
                <!-- widget options:
                usage: <div class="jarviswidget" id="wid-id-0" data-widget-editbutton="false">

                data-widget-colorbutton="false"
                data-widget-editbutton="false"
                data-widget-togglebutton="false"
                data-widget-deletebutton="false"
                data-widget-fullscreenbutton="false"
                data-widget-custombutton="false"
                data-widget-collapsed="true"
                data-widget-sortable="false"

                -->
                <header>
                    <span class="widget-icon"> <i class="fa fa-table"></i> </span>
                    <h2>咨询快报列表</h2>
                </header>
                <!-- widget div-->
                <div>
                    <!-- widget edit box -->
                    <div class="jarviswidget-editbox">
                        <!-- This area used as dropdown edit box -->
                    </div>
                    <!-- end widget edit box -->
                    <!-- widget content -->
                    <div class="widget-body no-padding">
                        <div class="dt-toolbar">
                            <!--<div class="col-xs-11 col-sm-10">-->
                            <!--<div class="dataTables_filter">-->
                            <!--<label>-->
                            <!--<span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span>-->
                            <!--<input type="search" placeholder="单位名称" data-ng-keyup="getAdviceList()" ng-model="queryParam.keyword" class="form-control" aria-controls="dt_basic"></label>-->
                            <!--</div>-->
                            <!--</div>-->
                            <div class="col-xs-1 col-sm-2">
                                <button class="btn btn-primary" type="button" data-ng-click="open()">
                                    <i class="fa fa-plus"></i>
                                    新增
                                </button>
                            </div>
                        </div>
                        <div class="table-responsive">
                            <table class="table table-striped table-condensed table-hover smart-form has-tickbox">
                                <thead>
                                <tr>
                                    <th width="320">标题</th>
                                    <th width="120">发布时间</th>
                                    <th width="120">发布人</th>
                                    <th width="80">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr ng-repeat="advice in adviceList" ng-if="adviceList.length > 0" ng-mouseenter="show=true" ng-mouseleave="show=false">
                                    <td ng-bind="advice.title"></td>
                                    <td ng-bind="advice.insertDate | date: 'yyyy-MM-dd HH:mm:ss'"></td>
                                    <td ng-bind="advice.insertUser"></td>
                                    <td>
                                        <div ng-show="show">
                                            <a href="javascript:void(0);" data-ng-click="removeAdvice($index)" title="删除：{{advice.adviceName}}">
                                                <span class="glyphicon glyphicon-remove-circle"></span>
                                            </a>
                                            <span> | </span>
                                            <a href="javascript:void(0);" data-ng-click="open($index)" title="编辑：{{advice.adviceName}}">
                                                <span class="fa fa-pencil"></span>
                                            </a>
                                        </div>
                                    </td>
                                </tr>
                                <tr ng-if="adviceList == null || adviceList.length == 0">
                                    <td colspan="4">
                                        <div>暂无消息数据</div>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="dt-toolbar-footer">
                            <div class="col-xs-12 col-sm-12">
                                <ug-pagination page-info="pageInfoSetting"></ug-pagination>
                            </div>
                        </div>
                    </div>
                    <!-- end widget content -->
                </div>
                <!-- end widget div -->
            </div>
            <!-- end widget -->

        </article>
        <!-- WIDGET END -->

    </div>

    <!-- end row -->

</section>
<!-- end widget grid -->

<script type="text/ng-template" id="addAdvice.html">
    <div class="modal-header">
        <h3 class="modal-title">新增快报</h3>
    </div>
    <div class="modal-body">
        <div class="widget-body">
            <form class="form-horizontal" ug-validate="addAdviceForm" name="addAdviceForm" novalidate="">
                <fieldset>
                    <div class="form-group">
                        <label class="col-md-2 control-label">标题<span class="vaild">*</span></label>
                        <div class="col-md-10">
                            <input class="form-control" required="true" data-rule-minlength="1" data-rule-maxlength="20" ng-model="advice.title" name="name" placeholder="标题" type="text">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label">内容<span class="vaild">*</span></label>
                        <div class="col-md-10">
                            <div ueditor="editor" ng-required="true" ng-model="advice.content" id="editor"></div>
                        </div>
                    </div>
                    <div class="form-group" ng-if="errors">
                        <label class="col-md-2 control-label"></label>
                        <div class="col-md-10 error">
                            {{errors.message}}
                        </div>
                    </div>
                </fieldset>
            </form>
        </div>
    </div>
    <div class="modal-footer">
        <button class="btn btn-primary" type="submit" data-ng-click="saveOrUpdateAdvice()">
            <i class="fa fa-save"></i>
            保存
        </button>
        <button class="btn btn-warning" ng-click="cancel()">关闭</button>
    </div>
</script>