comment.blade.php 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. @extends('layouts.base')
  2. @section('content')
  3. @section('title', trans('文章评论'))
  4. <div class="w1200 ">
  5. <div class=" rightlist ">
  6. <div class="right-titpos">
  7. <ul class="add-snav">
  8. <li class="active"><a href="#">文章评论</a></li>
  9. </ul>
  10. </div>
  11. <form action="" method="post" class="form-horizontal" id="form1">
  12. <div class="right-addbox">
  13. <div class="panel panel-info">
  14. <div class="panel-body">
  15. <div class="form-group col-xs-12 col-sm-8">
  16. <div class="col-sm-2">
  17. <label class='radio-inline'>
  18. <input type='checkbox' value='1' name='search[is_time]'
  19. @if($search['is_time'] == '1') checked @endif>是否搜索时间
  20. </label>
  21. </div>
  22. {!! app\common\helpers\DateRange::tplFormFieldDateRange('search[time]', [
  23. 'starttime'=>$search['time']['start'],
  24. 'endtime'=>$search['time']['end'],
  25. 'start'=>$search['time']['start'],
  26. 'end'=>$search['time']['end']
  27. ], true) !!}
  28. <!--</div>-->
  29. </div>
  30. <div class="form-group col-xs-12 col-sm-7 col-lg-4">
  31. <div class="">
  32. <button type="button" id="search" class="btn btn-success "><i class="fa fa-search"></i>搜索</button>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. <a href="{{yzWebUrl('plugin.article.manager.comment.pass', ['pass_all' => 1, 'article_id'=> $article_id])}}" class="btn btn-info" onClick="return confirm('点击确认审核全部评论');">一键全部审核</a>
  38. <a id="pass_update" class="btn btn-info" onclick="return batchDel()">批量审核</a>
  39. </div>
  40. </form>
  41. <div class="clearfix">
  42. <div class='panel panel-default'>
  43. <div class='panel-body table-responsive'>
  44. <table class="table table-hover" style="overflow:visible;">
  45. <thead>
  46. <tr>
  47. <th style='width:6%;text-align: center;'><input id='select_all' onclick="selectAll()" type="checkbox"> 全选</th>
  48. <th style='width:6%;text-align: center;'>评论时间</th>
  49. <th style='width:6%;text-align: center;'>评论会员</th>
  50. <th style='width:8%;text-align: center;'>评论内容</th>
  51. @if($pass)
  52. <th style='width:8%;text-align: center;'>审核状态(点击可更改)</th>
  53. @endif
  54. <th style='width:8%;text-align: center;'>操作</th>
  55. </tr>
  56. </thead>
  57. <tbody>
  58. @if (!empty($list['data']))
  59. <form action="{{yzWebUrl('plugin.article.manager.comment.pass', ['article_id'=> $article_id, 'is_pass' => 1])}}" method="post" id="form_pass">
  60. @foreach($list['data'] as $row)
  61. <tr>
  62. @if($row['is_pass'])
  63. <td style='text-align: center;'><input class="ids_check" type="checkbox" checked="checkbox" disabled="disabled"></td>
  64. @else
  65. <td style='text-align: center;'><input class="ids_check" type="checkbox" name="ids[]" value="{{$row['id']}}"></td>
  66. @endif
  67. <td style='text-align: center;'>{{$row['created_at']}}</td>
  68. <td style='text-align: center;'>
  69. <a href="{!! yzWebUrl('member.member.detail', ['id'=>$row['member']['uid']]) !!}"><img src="{{tomedia($row['member']['avatar'])}}"
  70. style="width: 30px; height: 30px;border:1px solid #ccc;padding:1px;">
  71. </br>
  72. {{$row['member']['nickname']}}
  73. </td>
  74. <td style='text-align: center;'>
  75. {{$row['content']}}
  76. </td>
  77. @if($pass)
  78. <td style='text-align: center;'>
  79. @if($row['is_pass'])
  80. <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>
  81. @else
  82. <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>
  83. @endif
  84. </td>
  85. @endif
  86. <td style='text-align: center;'>
  87. <a class='btn btn-default' href="{{yzWebUrl("plugin.article.manager.comment.reply", ['id'=>$row['id']])}}"
  88. >回复</a>
  89. <a class='btn btn-default' href="{{yzWebUrl("plugin.article.manager.comment.del", ['id'=>$row['id']])}}"
  90. onclick="return confirm('确认删除此评论吗?');return false;">删除</a>
  91. </td>
  92. </tr>
  93. @endforeach
  94. </form>
  95. @else
  96. <td colspan="4" style="color: red">没有更多数据了!</td>
  97. @endif
  98. </tbody>
  99. </table>
  100. {!! $pager !!}
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. <script language="javascript">
  107. $(function () {
  108. $('#search').click(function () {
  109. $('#form1').attr('action', '{!! yzWebUrl('plugin.article.manager.comment.index', ['id'=>$search['article_id']]) !!}');
  110. $('#form1').submit();
  111. });
  112. });
  113. $(function () {
  114. $('#pass_update').click(function () {
  115. $('#form_pass').submit();
  116. })
  117. });
  118. function selectAll(){
  119. var input_ids = document.getElementsByClassName("ids_check");
  120. var select_all = document.getElementById('select_all');
  121. if(select_all.checked){
  122. for (i=0;i<input_ids.length;i++) {
  123. console.log(input_ids[i]);
  124. input_ids[i].checked = 'checkbox';
  125. }
  126. }else{
  127. for (i=0;i<input_ids.length;i++) {
  128. input_ids[i].checked = '';
  129. }
  130. }
  131. }
  132. function batchDel(){
  133. var ids = document.getElementsByClassName('ids_check');
  134. for(let element of ids){
  135. if (element.checked){
  136. return true;
  137. }
  138. }
  139. }
  140. </script>
  141. @endsection