Просмотр файла resources/views/loads/down.blade.php

Размер файла: 5.09Kb
  1. @extends('layout')
  2.  
  3. @section('title', $down->title)
  4.  
  5. @section('description', truncateDescription(bbCode($down->text, false)))
  6.  
  7. @section('header')
  8. @if (isAdmin('admin'))
  9. <div class="float-end">
  10. <a class="btn btn-light" href="/admin/downs/edit/{{ $down->id }}"><i class="fas fa-wrench"></i></a>
  11. </div>
  12. @endif
  13.  
  14. <h1>{{ $down->title }}</h1>
  15. @stop
  16.  
  17. @section('breadcrumb')
  18. <nav>
  19. <ol class="breadcrumb">
  20. <li class="breadcrumb-item"><a href="/"><i class="fas fa-home"></i></a></li>
  21. <li class="breadcrumb-item"><a href="/loads">{{ __('index.loads') }}</a></li>
  22.  
  23. @if ($down->category->parent->id)
  24. <li class="breadcrumb-item"><a href="/loads/{{ $down->category->parent->id }}">{{ $down->category->parent->name }}</a></li>
  25. @endif
  26.  
  27. <li class="breadcrumb-item"><a href="/loads/{{ $down->category_id }}">{{ $down->category->name }}</a></li>
  28. <li class="breadcrumb-item active">{{ $down->title }}</li>
  29. </ol>
  30. </nav>
  31. @stop
  32.  
  33. @section('content')
  34. @if (! $down->active)
  35. <div class="alert alert-warning">
  36. <i class="fas fa-exclamation-triangle"></i> {{ __('loads.pending_down1') }}<br>
  37. @if (getUser() && getUser('id') === $down->user_id)
  38. <i class="fa fa-pencil-alt"></i> <a href="/downs/edit/{{ $down->id }}">{{ __('main.edit') }}</a>
  39. @endif
  40. </div>
  41. @endif
  42.  
  43. <i class="fas fa-rss"></i> <a class="me-3" href="/downs/rss/{{ $down->id }}">{{ __('main.rss') }}</a>
  44. <hr>
  45.  
  46. <div class="mb-3">
  47. @if ($down->getImages()->isNotEmpty())
  48. @foreach ($down->getImages() as $image)
  49. <div class="media-file mb-3">
  50. <a href="{{ $image->hash }}" class="gallery" data-group="{{ $down->id }}">{{ resizeImage($image->hash, ['alt' => $down->title]) }}</a>
  51. </div>
  52. @endforeach
  53. @endif
  54.  
  55. <div class="section-message mb-3">
  56. {{ bbCode($down->text) }}
  57. </div>
  58.  
  59. @if ($down->getFiles()->isNotEmpty())
  60. @foreach ($down->getFiles() as $file)
  61. <div class="media-file mb-3">
  62. @if ($file->hash && file_exists(public_path($file->hash)))
  63.  
  64. @if ($file->extension === 'mp3')
  65. <div>
  66. <audio src="{{ $file->hash }}" style="max-width:100%;" preload="metadata" controls controlsList="{{ $allowDownload ? null : 'nodownload' }}"></audio>
  67. </div>
  68. @endif
  69.  
  70. @if ($file->extension === 'mp4')
  71. <div>
  72. <video src="{{ $file->hash }}" style="max-width:100%;" preload="metadata" controls playsinline controlsList="{{ $allowDownload ? null : 'nodownload' }}"></video>
  73. </div>
  74. @endif
  75.  
  76. <b>{{ $file->name }}</b> ({{ formatSize($file->size) }})<br>
  77. @if ($file->extension === 'zip')
  78. <a href="/downs/zip/{{ $file->id }}">{{ __('loads.view_archive') }}</a><br>
  79. @endif
  80.  
  81. @if ($allowDownload)
  82. <a class="btn btn-success" href="/downs/download/{{ $file->id }}"><i class="fa fa-download"></i> {{ __('main.download') }}</a><br>
  83. @endif
  84. @else
  85. <i class="fa fa-download"></i> {{ __('main.file_not_found') }}
  86. @endif
  87. </div>
  88. @endforeach
  89.  
  90. @if (! $allowDownload)
  91. {{ showError(__('loads.download_authorized')) }}
  92. @endif
  93. @else
  94. {{ showError(__('main.not_uploaded')) }}
  95. @endif
  96.  
  97. <div class="mb-3">
  98. <i class="fa fa-comment"></i> <a href="/downs/comments/{{ $down->id }}">{{ __('main.comments') }}</a> ({{ $down->count_comments }})
  99. <a href="/downs/end/{{ $down->id }}">&raquo;</a><br>
  100.  
  101. <div class="my-2 js-rating">{{ __('main.rating') }}:
  102. @if (getUser() && getUser('id') !== $down->user_id)
  103. <a class="post-rating-down<?= $down->vote === '-' ? ' active' : '' ?>" href="#" onclick="return changeRating(this);" data-id="{{ $down->id }}" data-type="{{ $down->getMorphClass() }}" data-vote="-" data-token="{{ csrf_token() }}"><i class="fa fa-arrow-down"></i></a>
  104. @endif
  105. <b>{{ formatNum($down->rating) }}</b>
  106. @if (getUser() && getUser('id') !== $down->user_id)
  107. <a class="post-rating-up<?= $down->vote === '+' ? ' active' : '' ?>" href="#" onclick="return changeRating(this);" data-id="{{ $down->id }}" data-type="{{ $down->getMorphClass() }}" data-vote="+" data-token="{{ csrf_token() }}"><i class="fa fa-arrow-up"></i></a>
  108. @endif
  109. </div>
  110.  
  111. {{ __('main.downloads') }}: <b>{{ $down->loads }}</b><br>
  112. {{ __('main.author') }}: {{ $down->user->getProfile() }} ({{ dateFixed($down->created_at) }})
  113. </div>
  114. </div>
  115. @stop