Просмотр файла resources/views/admin/offers/index.blade.php

Размер файла: 4.45Kb
  1. @extends('layout')
  2.  
  3. @section('title', __('index.offers'))
  4.  
  5. @section('header')
  6. <div class="float-end">
  7. <a class="btn btn-success" href="/offers/create?type={{ $type }}">{{ __('main.add') }}</a>
  8. <a class="btn btn-light" href="/offers/{{ $type }}?page={{ $offers->currentPage() }}"><i class="fas fa-wrench"></i></a>
  9. </div>
  10.  
  11. <h1>{{ __('index.offers') }}</h1>
  12. @stop
  13.  
  14. @section('breadcrumb')
  15. <nav>
  16. <ol class="breadcrumb">
  17. <li class="breadcrumb-item"><a href="/"><i class="fas fa-home"></i></a></li>
  18. <li class="breadcrumb-item"><a href="/admin">{{ __('index.panel') }}</a></li>
  19. <li class="breadcrumb-item active">{{ __('index.offers') }}</li>
  20. </ol>
  21. </nav>
  22. @stop
  23.  
  24. @section('content')
  25. <div class="mb-3">
  26. @if ($type === 'offer')
  27. <a class="btn btn-primary btn-sm" href="/admin/offers/offer">{{ __('offers.offers') }} <span class="badge bg-light text-dark">{{ $offers->total() }}</span></a>
  28. <a class="btn btn-light btn-sm" href="/admin/offers/issue">{{ __('offers.problems') }} <span class="badge bg-light text-dark">{{ $otherCount }}</span></a>
  29. @else
  30. <a class="btn btn-light btn-sm" href="/admin/offers/offer">{{ __('offers.offers') }} <span class="badge bg-light text-dark">{{ $otherCount }}</span></a>
  31. <a class="btn btn-primary btn-sm" href="/admin/offers/issue">{{ __('offers.problems') }} <span class="badge bg-light text-dark">{{ $offers->total() }}</span></a>
  32. @endif
  33. </div>
  34.  
  35. @if ($offers->isNotEmpty())
  36. {{ __('main.sort') }}:
  37. <?php $active = ($order === 'rating') ? 'success' : 'light text-dark'; ?>
  38. <a href="/admin/offers/{{ $type }}?sort=rating" class="badge bg-{{ $active }}">{{ __('main.votes') }}</a>
  39.  
  40. <?php $active = ($order === 'created_at') ? 'success' : 'light text-dark'; ?>
  41. <a href="/admin/offers/{{ $type }}?sort=time" class="badge bg-{{ $active }}">{{ __('main.date') }}</a>
  42.  
  43. <?php $active = ($order === 'status') ? 'success' : 'light text-dark'; ?>
  44. <a href="/admin/offers/{{ $type }}?sort=status" class="badge bg-{{ $active }}">{{ __('main.status') }}</a>
  45.  
  46. <?php $active = ($order === 'count_comments') ? 'success' : 'light text-dark'; ?>
  47. <a href="/admin/offers/{{ $type }}?sort=comments" class="badge bg-{{ $active }}">{{ __('main.comments') }}</a>
  48. <hr>
  49.  
  50. <form action="/admin/offers/delete?type={{ $type }}&amp;page={{ $offers->currentPage() }}" method="post">
  51. @csrf
  52. @foreach ($offers as $data)
  53. <div class="section mb-3 shadow">
  54. <div class="section-title">
  55. <i class="fa fa-file"></i>
  56. <a href="/admin/offers/{{ $data->id }}">{{ $data->title }}</a> ({{ __('main.votes') }}: {{ $data->rating }})
  57. <div class="float-end">
  58. <a href="/admin/offers/reply/{{ $data->id }}" data-bs-toggle="tooltip" title="{{ __('main.reply') }}"><i class="fas fa-reply text-muted"></i></a>
  59. <a href="/admin/offers/edit/{{ $data->id }}" data-bs-toggle="tooltip" title="{{ __('main.edit') }}"><i class="fas fa-pencil-alt text-muted"></i></a>
  60. <input type="checkbox" class="form-check-input" name="del[]" value="{{ $data->id }}">
  61. </div>
  62. </div>
  63.  
  64. <div class="section-body">
  65. {{ $data->getStatus() }}<br>
  66. {{ bbCode($data->text) }}<br>
  67. {{ __('main.added') }}: {{ $data->user->getProfile() }} ({{ dateFixed($data->created_at) }})<br>
  68. <a href="/offers/comments/{{ $data->id }}">{{ __('main.comments') }}</a> ({{ $data->count_comments }})
  69. <a href="/offers/end/{{ $data->id }}">&raquo;</a>
  70. </div>
  71. </div>
  72. @endforeach
  73.  
  74. <div class="clearfix mb-3">
  75. <button class="btn btn-sm btn-danger float-end">{{ __('main.delete_selected') }}</button>
  76. </div>
  77. </form>
  78.  
  79. {{ $offers->links() }}
  80.  
  81. <div class="mb-3">
  82. {{ __('main.total') }}: <b>{{ $offers->total() }}</b>
  83. </div>
  84. @else
  85. {{ showError(__('main.empty_records')) }}
  86. @endif
  87.  
  88. @if (isAdmin('boss'))
  89. <i class="fa fa-sync"></i> <a href="/admin/offers/restatement?_token={{ csrf_token() }}">{{ __('main.recount') }}</a><br>
  90. @endif
  91. @stop