index.blade.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. @extends('layouts.backend')
  2. @section('title', '友情链接')
  3. @section('header')
  4. <h1>
  5. 友情链接
  6. </h1>
  7. @endsection
  8. @section('content')
  9. <div class="row">
  10. <div class="col-xs-12">
  11. @include('backend.alert.success')
  12. <div class="box box-solid">
  13. <!-- /.box-header -->
  14. <div class="box-header">
  15. <div class="pull-right">
  16. <div class="btn-group">
  17. <a href="{{ route('backend.link.create') }}" class="btn btn-white tooltips"
  18. data-toggle="tooltip" data-original-title="新增"><i
  19. class="glyphicon glyphicon-plus"></i></a>
  20. </div>
  21. </div><!-- pull-right -->
  22. </div>
  23. <div class="box-body table-responsive no-padding ">
  24. <table class="table table-hover">
  25. <tr>
  26. <th>名字</th>
  27. <th>排序</th>
  28. <th>URL</th>
  29. <th>操作</th>
  30. </tr>
  31. @if ($links)
  32. @foreach($links as $link)
  33. <tr>
  34. <td>{{ $link->name }}</td>
  35. <td>{{ $link->sequence }}</td>
  36. <td>{{ $link->url }}</td>
  37. <td>
  38. <a href='{{ route("backend.link.edit", ["id" => $link->id]) }}' class='btn btn-info btn-xs'>
  39. <i class="fa fa-pencil"></i> 修改</a>
  40. <a data-href='{{ route("backend.link.destroy", ["id" => $link->id]) }}'
  41. class='btn btn-danger btn-xs link-delete'><i class="fa fa-trash-o"></i> 删除</a>
  42. </td>
  43. </tr>
  44. @endforeach
  45. @endif
  46. </table>
  47. </div>
  48. </div>
  49. <!-- /.box -->
  50. </div>
  51. </div>
  52. @endsection
  53. @section('javascript')
  54. <script>
  55. $(function() {
  56. $(".link-delete").click(function(){
  57. var url = $(this).attr('data-href');
  58. Moell.ajax.delete(url);
  59. });
  60. });
  61. </script>
  62. @endsection