list.blade.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. @extends('layouts.admin.app')
  2. @section('content')
  3. <!-- Main content -->
  4. <section class="content">
  5. @include('layouts.errors-and-messages')
  6. <!-- Default box -->
  7. <div class="box">
  8. <div class="box-body">
  9. <h2>Attributes</h2>
  10. @if($attributes->total() > 0)
  11. <table class="table">
  12. <thead>
  13. <tr>
  14. <td>Attribute name</td>
  15. <td></td>
  16. </tr>
  17. </thead>
  18. <tbody>
  19. @foreach ($attributes as $attribute)
  20. <tr>
  21. <td>
  22. <a href="{{ route('admin.attributes.show', $attribute->id) }}">{{ $attribute->name }} <strong>({{ $attribute->values->count() }})</strong></a>
  23. </td>
  24. <td>
  25. <form action="{{ route('admin.attributes.destroy', $attribute->id) }}" method="post" class="form-horizontal">
  26. {{ csrf_field() }}
  27. <input type="hidden" name="_method" value="delete">
  28. <div class="btn-group">
  29. <a href="{{ route('admin.attributes.values.create', $attribute->id) }}" class="btn btn-default btn-sm"><i class="fa fa-plus"></i> Add values</a>
  30. <a href="{{ route('admin.attributes.edit', $attribute->id) }}" class="btn btn-primary btn-sm"><i class="fa fa-edit"></i> Edit</a>
  31. <button onclick="return confirm('Are you sure?')" type="submit" class="btn btn-danger btn-sm"><i class="fa fa-times"></i> Delete</button>
  32. </div>
  33. </form>
  34. </td>
  35. </tr>
  36. @endforeach
  37. </tbody>
  38. </table>
  39. <div class="row">
  40. <div class="col-md-12">
  41. <div class="pull-left">{{ $attributes->links() }}</div>
  42. </div>
  43. </div>
  44. <div class="box-footer">
  45. <div class="btn-group">
  46. <a class="btn btn-sm btn-primary" href="{{ route('admin.attributes.create') }}"><i class="fa fa-plus"></i> Create attribute</a>
  47. </div>
  48. </div>
  49. @else
  50. <p class="alert alert-warning">No attribute yet. <a href="{{ route('admin.attributes.create') }}">Create one</a></p>
  51. @endif
  52. </div>
  53. <!-- /.box-body -->
  54. </div>
  55. <!-- /.box -->
  56. </section>
  57. <!-- /.content -->
  58. @endsection