View file resources/views/admin/loads/load.blade.php

File size: 4.07Kb
  1. @extends('layout')
  2.  
  3. @section('title', $category->name . ' (' . __('main.page_num', ['page' => $downs->currentPage()]) . ')')
  4.  
  5. @section('header')
  6. <div class="float-right">
  7. @if (! $category->closed)
  8. <a class="btn btn-success" href="/downs/create?cid={{ $category->id }}">{{ __('main.add') }}</a>
  9. @endif
  10. <a class="btn btn-light" href="/loads/{{ $category->id }}?page={{ $downs->currentPage() }}"><i class="fas fa-wrench"></i></a>
  11. </div>
  12.  
  13. <h1>{{ $category->name }}</h1>
  14. @stop
  15.  
  16. @section('breadcrumb')
  17. <nav>
  18. <ol class="breadcrumb">
  19. <li class="breadcrumb-item"><a href="/"><i class="fas fa-home"></i></a></li>
  20. <li class="breadcrumb-item"><a href="/admin">{{ __('index.panel') }}</a></li>
  21. <li class="breadcrumb-item"><a href="/admin/loads">{{ __('index.loads') }}</a></li>
  22.  
  23. @if ($category->parent->id)
  24. <li class="breadcrumb-item"><a href="/admin/loads/{{ $category->parent->id }}">{{ $category->parent->name }}</a></li>
  25. @endif
  26.  
  27. <li class="breadcrumb-item active">{{ $category->name }}</li>
  28. </ol>
  29. </nav>
  30. @stop
  31.  
  32. @section('content')
  33. Сортировать:
  34.  
  35. <?php $active = ($order === 'created_at') ? 'success' : 'light'; ?>
  36. <a href="/admin/loads/{{ $category->id }}?sort=time" class="badge badge-{{ $active }}">{{ __('main.date') }}</a>
  37.  
  38. <?php $active = ($order === 'loads') ? 'success' : 'light'; ?>
  39. <a href="/admin/loads/{{ $category->id }}?sort=loads" class="badge badge-{{ $active }}">{{ __('main.downloads') }}</a>
  40.  
  41. <?php $active = ($order === 'rated') ? 'success' : 'light'; ?>
  42. <a href="/admin/loads/{{ $category->id }}?sort=rated" class="badge badge-{{ $active }}">{{ __('main.rating') }}</a>
  43.  
  44. <?php $active = ($order === 'count_comments') ? 'success' : 'light'; ?>
  45. <a href="/admin/loads/{{ $category->id }}?sort=comments" class="badge badge-{{ $active }}">{{ __('main.comments') }}</a>
  46. <hr>
  47.  
  48. @if ($downs->onFirstPage() && $category->children->isNotEmpty())
  49. @foreach ($category->children as $child)
  50. <div class="section mb-3 shadow border-left border-info">
  51. <div class="section-title">
  52. <i class="fa fa-folder-open"></i>
  53. <a href="/admin/loads/{{ $child->id }}">{{ $child->name }}</a> ({{ $child->count_downs }})
  54. </div>
  55. </div>
  56. @endforeach
  57. <hr>
  58. @endif
  59.  
  60. @if ($downs->isNotEmpty())
  61. @foreach ($downs as $data)
  62. <div class="section mb-3 shadow">
  63. <div class="section-header d-flex align-items-center">
  64. <div class="flex-grow-1">
  65. <div class="section-title">
  66. <i class="fa fa-file"></i>
  67. <a href="/downs/{{ $data->id }}">{{ $data->title }}</a> ({{ $data->count_comments }})
  68. </div>
  69. </div>
  70.  
  71. <div class="text-right">
  72. <a href="/admin/downs/edit/{{ $data->id }}" title="{{ __('main.edit') }}"><i class="fa fa-pencil-alt"></i></a>
  73.  
  74. @if (isAdmin('boss'))
  75. <a href="/admin/downs/delete/{{ $data->id }}?token={{ $_SESSION['token'] }}" onclick="return confirm('{{ __('loads.confirm_delete_down') }}')"><i class="fa fa-times"></i></a>
  76. @endif
  77. </div>
  78. </div>
  79.  
  80. <div class="section-content">
  81. {{ __('main.rating') }}: {{ $data->getCalculatedRating() }}<br>
  82. {{ __('main.downloads') }}: {{ $data->loads }}<br>
  83. <a href="/downs/comments/{{ $data->id }}">{{ __('main.comments') }}</a> ({{ $data->count_comments }})
  84. <a href="/downs/end/{{ $data->id }}">&raquo;</a>
  85. </div>
  86. </div>
  87. @endforeach
  88. @elseif (! $category->closed)
  89. {{ showError(__('loads.empty_downs')) }}
  90. @endif
  91.  
  92. @if ($category->closed)
  93. {{ showError(__('loads.closed_load')) }}
  94. @endif
  95.  
  96. {{ $downs->links() }}
  97. @stop