{{include_file name='home/public/header' title='申请管理'}}

</head>

<body>

<div id="wrapper">

    <!-- Navigation -->
    {{include_file name='home/public/nav' sidebar='home/account/sidebar' active='apply'}}
    <div id="page-wrapper">

        <div class="row">
            <div class="col-lg-12">
                <h1 class="page-header">申请管理
                    <small>({{$apply->count}})</small>
                </h1>
                <div class="search">
                    <div class="row">
                        <form action="" method="get" autocomplete="off">

                            <div class="col-sm-4">
                                <div class="form-group">
                                    <input name="user[name]" type="text" class="form-control" placeholder="创建人昵称或邮箱，支持模糊查询" value="{{$apply->params->user->name}}">
                                </div>
                            </div>

                            <div class="col-sm-4">
                                <div class="form-group">
                                    <input name="title" type="text" class="form-control" placeholder="项目名称，支持模糊查询" value="{{$apply->params->title}}">
                                </div>
                            </div>

                            <div class="col-sm-4">
                                <div class="form-group">
                                    <input name="user[ip]" type="text" class="form-control" placeholder="IP，支持模糊查询" value="{{$apply->params->ip}}">
                                </div>
                            </div>

                            <div class="col-sm-12">
                                <div class="form-group">
                                    <button type="reset" class="btn btn-warning mr-1">重置</button>

                                    <button type="submit" class="btn btn-primary">搜索</button>
                                </div>
                            </div>


                        </form>

                    </div>
                </div>
            </div>
            <!-- /.col-lg-12 -->
        </div>
        <!-- /.row -->
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">

                    {{include_file name='home/apply/tab' tab='index'}}

                    <!-- /.panel-heading -->
                    <div class="panel-body">
                        <div class="table-responsive">
                            <table class="table">
                                <thead>
                                <tr>
                                    <th>申请人昵称/账号</th>
                                    <th>申请加入的项目</th>
                                    <th>项目类型</th>
                                    <th class="datetime">申请时间</th>
                                    <th >申请IP</th>
                                    <th >申请地点</th>
                                    {{if $apply->count}}
                                    <th width="95px"></th>
                                    {{/if}}
                                </tr>
                                </thead>
                                <tbody>
                                {{foreach $apply->models as $model}}
                                <tr>
                                    <td >
                                        {{$model->applier->fullName}}
                                    </td>

                                    <td >{{$model->project->title}}</td>
                                    <td >{{$model->project->typeLabel}}</td>
                                    <td >{{$model->created_at}}</td>
                                    <td >{{$model->ip}}</td>
                                    <td >{{$model->location}}</td>
                                    {{if $apply->count}}
                                    <td >
                                        {{if $model->status == $model::CHECK_STATUS}}
                                        <a class="btn btn-success btn-xs mr-1" data-modal="#js_popModal" data-height="190" data-title="通过申请" data-src="{{url('home/apply/pass', ['id' => $model->id])}}">通过</a>
                                        <a class="btn btn-danger btn-xs" data-modal="#js_popModal" data-height="190" data-title="驳回申请" data-src="{{url('home/apply/refuse', ['id' => $model->id])}}">驳回</a>
                                        {{/if}}
                                    </td>
                                    {{/if}}
                                </tr>
                                {{/foreach}}

                                </tbody>
                            </table>
                        </div>
                        {{$apply->pages}}
                        <!-- /.table-responsive -->
                    </div>
                    <!-- /.panel-body -->
                </div>
                <!-- /.panel -->
            </div>

            <!-- /.col-lg-6 -->
        </div>
        <!-- /#page-wrapper -->

    </div>
    <!-- /#wrapper -->
    {{include_file name='home/public/copyright'}}

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