index.blade.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. @extends('admin.layout')
  2. @section('content')
  3. <div class="wrapper wrapper-content animated fadeInRight">
  4. <div class="row">
  5. <div class="col-sm-12">
  6. <div class="ibox float-e-margins">
  7. <div class="ibox-title">
  8. <h5>新闻列表</h5>
  9. <div class="ibox-tools">
  10. <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
  11. </a>
  12. </div>
  13. </div>
  14. <div class="ibox-content">
  15. <div class="row">
  16. <form method="GET" action="" accept-charset="UTF-8">
  17. <div class="col-sm-4">
  18. <div class="input-group">
  19. <input type="text" value="{{Request::get('keyword')}}" placeholder="请输入ID/标题/内容"
  20. name="keyword" class="input-sm form-control">
  21. <span class="input-group-btn">
  22. <button type="submit" class="btn btn-sm btn-primary">搜索</button>
  23. </span>
  24. </div>
  25. </div>
  26. </form>
  27. @if(role('Album/News/create'))
  28. <div class="col-sm-3 pull-right">
  29. <a href="{{ U('Album/News/create')}}"
  30. class="btn btn-sm btn-primary pull-right">添加</a>
  31. </div>
  32. @endif
  33. </div>
  34. <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
  35. <thead>
  36. <tr>
  37. <th class="sorting" data-sort="id">ID</th>
  38. <th class="sorting" data-sort="title"> 标题</th>
  39. <th class="sorting" data-sort="sort"> 排序</th>
  40. <th class="sorting" data-sort="created_at">创建时间</th>
  41. <th class="sorting" data-sort="updated_at">更新时间</th>
  42. <th width="22%">相关操作</th>
  43. </tr>
  44. </thead>
  45. <tbody>
  46. @if(isset($list))
  47. @foreach($list as $key => $item)
  48. <tr>
  49. <td>{{ $item->id }}</td>
  50. <td>{{ $item->title }}</td>
  51. <td>{{ $item->sort }}</td>
  52. <td>{{ $item->created_at }}</td>
  53. <td>{{ $item->updated_at }}</td>
  54. <td>
  55. <div class="pull-left">
  56. @if(role('Album/News/update'))
  57. <a href="{{ U('Album/News/update',['id'=>$item->id])}}" class="btn btn-sm btn-warning pull-right">修改</a>
  58. @endif
  59. @if(role('Album/News/destroy'))
  60. <a href="{{ U('Album/News/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-sm btn-danger pull-right">删除</a>
  61. @endif
  62. @if(role('Album/News/view'))
  63. <a onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Album/News/view',['id'=>$item->id])}}'});"
  64. class="btn btn-sm btn-primary pull-right">查看
  65. </a>
  66. @endif
  67. </div>
  68. </td>
  69. </tr>
  70. @endforeach
  71. @endif
  72. </tbody>
  73. </table>
  74. <div class="row">
  75. <div class="col-sm-6">
  76. <div class="dataTables_info" id="DataTables_Table_0_info"
  77. role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}
  78. 条,共{{ $list->lastPage() }}页,总{{ $list->total() }}条。
  79. </div>
  80. </div>
  81. <div class="col-sm-6">
  82. <div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
  83. {!! $list->setPath('')->appends(Request::all())->render() !!}
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. @endsection