admin/plugins/article/views/manager/comment.blade.php

154 lines
7.9 KiB
PHP

@extends('layouts.base')
@section('content')
@section('title', trans('文章评论'))
<div class="w1200 ">
<div class=" rightlist ">
<div class="right-titpos">
<ul class="add-snav">
<li class="active"><a href="#">文章评论</a></li>
</ul>
</div>
<form action="" method="post" class="form-horizontal" id="form1">
<div class="right-addbox">
<div class="panel panel-info">
<div class="panel-body">
<div class="form-group col-xs-12 col-sm-8">
<div class="col-sm-2">
<label class='radio-inline'>
<input type='checkbox' value='1' name='search[is_time]'
@if($search['is_time'] == '1') checked @endif>是否搜索时间
</label>
</div>
{!! app\common\helpers\DateRange::tplFormFieldDateRange('search[time]', [
'starttime'=>$search['time']['start'],
'endtime'=>$search['time']['end'],
'start'=>$search['time']['start'],
'end'=>$search['time']['end']
], true) !!}
<!--</div>-->
</div>
<div class="form-group col-xs-12 col-sm-7 col-lg-4">
<div class="">
<button type="button" id="search" class="btn btn-success "><i class="fa fa-search"></i>搜索</button>
</div>
</div>
</div>
</div>
<a href="{{yzWebUrl('plugin.article.manager.comment.pass', ['pass_all' => 1, 'article_id'=> $article_id])}}" class="btn btn-info" onClick="return confirm('点击确认审核全部评论');">一键全部审核</a>
<a id="pass_update" class="btn btn-info" onclick="return batchDel()">批量审核</a>
</div>
</form>
<div class="clearfix">
<div class='panel panel-default'>
<div class='panel-body table-responsive'>
<table class="table table-hover" style="overflow:visible;">
<thead>
<tr>
<th style='width:6%;text-align: center;'><input id='select_all' onclick="selectAll()" type="checkbox"> 全选</th>
<th style='width:6%;text-align: center;'>评论时间</th>
<th style='width:6%;text-align: center;'>评论会员</th>
<th style='width:8%;text-align: center;'>评论内容</th>
@if($pass)
<th style='width:8%;text-align: center;'>审核状态(点击可更改)</th>
@endif
<th style='width:8%;text-align: center;'>操作</th>
</tr>
</thead>
<tbody>
@if (!empty($list['data']))
<form action="{{yzWebUrl('plugin.article.manager.comment.pass', ['article_id'=> $article_id, 'is_pass' => 1])}}" method="post" id="form_pass">
@foreach($list['data'] as $row)
<tr>
@if($row['is_pass'])
<td style='text-align: center;'><input class="ids_check" type="checkbox" checked="checkbox" disabled="disabled"></td>
@else
<td style='text-align: center;'><input class="ids_check" type="checkbox" name="ids[]" value="{{$row['id']}}"></td>
@endif
<td style='text-align: center;'>{{$row['created_at']}}</td>
<td style='text-align: center;'>
<a href="{!! yzWebUrl('member.member.detail', ['id'=>$row['member']['uid']]) !!}"><img src="{{tomedia($row['member']['avatar'])}}"
style="width: 30px; height: 30px;border:1px solid #ccc;padding:1px;">
</br>
{{$row['member']['nickname']}}
</td>
<td style='text-align: center;'>
{{$row['content']}}
</td>
@if($pass)
<td style='text-align: center;'>
@if($row['is_pass'])
<a href="{{yzWebUrl('plugin.article.manager.comment.pass', ['ids' => [$row['id']], 'is_pass' => 0, 'article_id'=> $article_id])}}" type="button" class="btn btn-success"> 已审核 </a>
@else
<a href="{{yzWebUrl('plugin.article.manager.comment.pass', ['ids' => [$row['id']], 'is_pass' => 1, 'article_id'=> $article_id])}}" type="button" class="btn btn-danger"> 待审核 </a>
@endif
</td>
@endif
<td style='text-align: center;'>
<a class='btn btn-default' href="{{yzWebUrl("plugin.article.manager.comment.reply", ['id'=>$row['id']])}}"
>回复</a>
<a class='btn btn-default' href="{{yzWebUrl("plugin.article.manager.comment.del", ['id'=>$row['id']])}}"
onclick="return confirm('确认删除此评论吗?');return false;">删除</a>
</td>
</tr>
@endforeach
</form>
@else
<td colspan="4" style="color: red">没有更多数据了!</td>
@endif
</tbody>
</table>
{!! $pager !!}
</div>
</div>
</div>
</div>
</div>
<script language="javascript">
$(function () {
$('#search').click(function () {
$('#form1').attr('action', '{!! yzWebUrl('plugin.article.manager.comment.index', ['id'=>$search['article_id']]) !!}');
$('#form1').submit();
});
});
$(function () {
$('#pass_update').click(function () {
$('#form_pass').submit();
})
});
function selectAll(){
var input_ids = document.getElementsByClassName("ids_check");
var select_all = document.getElementById('select_all');
if(select_all.checked){
for (i=0;i<input_ids.length;i++) {
console.log(input_ids[i]);
input_ids[i].checked = 'checkbox';
}
}else{
for (i=0;i<input_ids.length;i++) {
input_ids[i].checked = '';
}
}
}
function batchDel(){
var ids = document.getElementsByClassName('ids_check');
for(let element of ids){
if (element.checked){
return true;
}
}
}
</script>
@endsection