mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-05-08 04:00:14 -05:00
refactor: torrent bookmarks system
This commit is contained in:
@@ -33,19 +33,11 @@ class BookmarkController extends Controller
|
||||
*/
|
||||
public function index(Request $request, $username)
|
||||
{
|
||||
$user = User::with('bookmarks')->where('username', '=', $username)->firstOrFail();
|
||||
$user = User::where('username', '=', $username)->firstOrFail();
|
||||
|
||||
\abort_unless(($request->user()->group->is_modo || $request->user()->id == $user->id), 403);
|
||||
\abort_unless(($request->user()->id == $user->id), 403);
|
||||
|
||||
$bookmarks = $user->bookmarks()->latest()->paginate(25);
|
||||
$personal_freeleech = PersonalFreeleech::where('user_id', '=', $user->id)->first();
|
||||
|
||||
return \view('user.bookmarks', [
|
||||
'user' => $user,
|
||||
'personal_freeleech' => $personal_freeleech,
|
||||
'bookmarks' => $bookmarks,
|
||||
'route' => 'bookmarks.index',
|
||||
]);
|
||||
return \view('bookmark.index', ['user' => $user]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,7 +75,7 @@ class BookmarkController extends Controller
|
||||
$torrent = Torrent::withAnyStatus()->findOrFail($id);
|
||||
$request->user()->bookmarks()->detach($torrent->id);
|
||||
|
||||
return \redirect()->route('torrent', ['id' => $torrent->id])
|
||||
return \redirect()->back()
|
||||
->withSuccess('Torrent Has Been Unbookmarked Successfully!');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire;
|
||||
|
||||
use App\Models\User;
|
||||
use Livewire\Component;
|
||||
use Livewire\WithPagination;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\PersonalFreeleech;
|
||||
|
||||
class BookmarkSearch extends Component
|
||||
{
|
||||
use WithPagination;
|
||||
|
||||
public $perPage = 25;
|
||||
public $searchTerm = '';
|
||||
public $sortField = 'created_at';
|
||||
public $sortDirection = 'desc';
|
||||
public $user;
|
||||
|
||||
public function paginationView()
|
||||
{
|
||||
return 'vendor.pagination.livewire-pagination';
|
||||
}
|
||||
|
||||
public function updatingSearchTerm()
|
||||
{
|
||||
$this->resetPage();
|
||||
}
|
||||
|
||||
public function sortBy($field)
|
||||
{
|
||||
if ($this->sortField === $field) {
|
||||
$this->sortDirection = $this->sortDirection === 'asc' ? 'desc' : 'asc';
|
||||
} else {
|
||||
$this->sortDirection = 'asc';
|
||||
}
|
||||
$this->sortField = $field;
|
||||
}
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->user = auth()->user();
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
$user = User::where('username', '=', $this->user->username)->firstOrFail();
|
||||
|
||||
$bookmarks = $user->bookmarks()
|
||||
->when($this->searchTerm, function ($query) {
|
||||
return $query->where('name', 'like', '%'.$this->searchTerm.'%');
|
||||
})
|
||||
->orderBy($this->sortField, $this->sortDirection)
|
||||
->paginate($this->perPage);
|
||||
|
||||
$personal_freeleech = PersonalFreeleech::where('user_id', '=', $this->user->id)->first();
|
||||
|
||||
return view('livewire.bookmark-search', [
|
||||
'user' => $user,
|
||||
'personal_freeleech' => $personal_freeleech,
|
||||
'bookmarks' => $bookmarks,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@section('title')
|
||||
<title>{{ $user->username }} @lang('user.bookmarks') - {{ config('other.title') }}</title>
|
||||
@endsection
|
||||
|
||||
@section('breadcrumb')
|
||||
<li>
|
||||
<a href="{{ route('users.show', ['username' => $user->username]) }}" itemprop="url" class="l-breadcrumb-item-link">
|
||||
<span itemprop="title" class="l-breadcrumb-item-link-title">{{ $user->username }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('bookmarks.index', ['username' => $user->username]) }}" itemprop="url"
|
||||
class="l-breadcrumb-item-link">
|
||||
<span itemprop="title" class="l-breadcrumb-item-link-title">{{ $user->username }} @lang('user.bookmarks')</span>
|
||||
</a>
|
||||
</li>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<style>
|
||||
td {
|
||||
vertical-align: middle !important;
|
||||
}
|
||||
</style>
|
||||
<div class="container">
|
||||
<div class="block">
|
||||
<div class="header gradient silver">
|
||||
<div class="inner_content">
|
||||
<div class="page-title">
|
||||
<h1 style="margin: 0;">{{ $user->username }} @lang('user.bookmarks')</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box container" style="width: 95% !important;">
|
||||
@livewire('bookmark-search')
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,308 @@
|
||||
<div>
|
||||
<div class="mb-10 form-inline pull-right">
|
||||
<div class="form-group">
|
||||
@lang('common.quantity')
|
||||
<select wire:model="perPage" class="form-control">
|
||||
<option>25</option>
|
||||
<option>50</option>
|
||||
<option>100</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<input type="text" wire:model="searchTerm" class="form-control" style="width: 275px;" placeholder="Search By Torrent Name"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<table class="table vertical-align table-hover">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<div sortable wire:click="sortBy('category_id')" :direction="$sortField === 'category_id' ? $sortDirection : null" role="button">
|
||||
@lang('torrent.category')
|
||||
@include('livewire.includes._sort-icon', ['field' => 'category_id'])
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
@lang('torrent.type')/@lang('torrent.resolution')
|
||||
</th>
|
||||
<th>
|
||||
<div sortable wire:click="sortBy('name')" :direction="$sortField === 'name' ? $sortDirection : null" role="button">
|
||||
@lang('common.name')
|
||||
@include('livewire.includes._sort-icon', ['field' => 'name'])
|
||||
</div>
|
||||
</th>
|
||||
<th>
|
||||
<div sortable wire:click="sortBy('size')" :direction="$sortField === 'size' ? $sortDirection : null" role="button">
|
||||
@lang('torrent.size')
|
||||
@include('livewire.includes._sort-icon', ['field' => 'size'])
|
||||
</div>
|
||||
</th>
|
||||
<th class="hidden-sm hidden-xs">
|
||||
<div sortable wire:click="sortBy('seeders')" :direction="$sortField === 'seeders' ? $sortDirection : null"
|
||||
role="button">
|
||||
@lang('torrent.seeders')
|
||||
@include('livewire.includes._sort-icon', ['field' => 'seeders'])
|
||||
</div>
|
||||
</th>
|
||||
<th class="hidden-sm hidden-xs">
|
||||
<div sortable wire:click="sortBy('leechers')" :direction="$sortField === 'leechers' ? $sortDirection : null"
|
||||
role="button">
|
||||
@lang('torrent.leechers')
|
||||
@include('livewire.includes._sort-icon', ['field' => 'leechers'])
|
||||
</div>
|
||||
</th>
|
||||
<th class="hidden-sm hidden-xs">
|
||||
<div sortable wire:click="sortBy('times_completed')" :direction="$sortField === 'times_completed' ? $sortDirection : null"
|
||||
role="button">
|
||||
@lang('torrent.completed-times')
|
||||
@include('livewire.includes._sort-icon', ['field' => 'times_completed'])
|
||||
</div>
|
||||
</th>
|
||||
<th class="hidden-sm hidden-xs">
|
||||
<div sortable wire:click="sortBy('created_at')" :direction="$sortField === 'created_at' ? $sortDirection : null"
|
||||
role="button">
|
||||
@lang('torrent.created_at')
|
||||
@include('livewire.includes._sort-icon', ['field' => 'created_at'])
|
||||
</div>
|
||||
</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
@foreach ($bookmarks as $bookmark)
|
||||
<tr>
|
||||
<td>
|
||||
@if ($bookmark->category->image != null)
|
||||
<a href="{{ route('categories.show', ['id' => $bookmark->category->id]) }}">
|
||||
<div class="text-center">
|
||||
<img src="{{ url('files/img/' . $bookmark->category->image) }}" data-toggle="tooltip"
|
||||
data-original-title="{{ $bookmark->category->name }} {{ strtolower(trans('torrent.torrent')) }}"
|
||||
alt="{{ $bookmark->category->name }}">
|
||||
</div>
|
||||
</a>
|
||||
@else
|
||||
<a href="{{ route('categories.show', ['id' => $bookmark->category->id]) }}">
|
||||
<div class="text-center">
|
||||
<i class="{{ $bookmark->category->icon }} torrent-icon" data-toggle="tooltip"
|
||||
data-original-title="{{ $bookmark->category->name }} {{ strtolower(trans('torrent.torrent')) }}"></i>
|
||||
</div>
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<div class="text-center">
|
||||
<span class="label label-success" data-toggle="tooltip"
|
||||
data-original-title="@lang('torrent.type')">
|
||||
{{ $bookmark->type->name }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="text-center" style="padding-top: 8px;">
|
||||
<span class="label label-success" data-toggle="tooltip"
|
||||
data-original-title="@lang('torrent.resolution')">
|
||||
{{ $bookmark->resolution->name ?? 'No Res' }}
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a class="view-torrent" href="{{ route('torrent', ['id' => $bookmark->id]) }}">
|
||||
{{ $bookmark->name }}
|
||||
</a>
|
||||
<br>
|
||||
@if ($bookmark->anon == 1)
|
||||
<span class="badge-extra text-bold">
|
||||
<i class="{{ config('other.font-awesome') }} fa-upload" data-toggle="tooltip"
|
||||
data-original-title="@lang('torrent.uploader')"></i> @lang('common.anonymous')
|
||||
@if ($user->id == $bookmark->user->id || $user->group->is_modo)
|
||||
<a href="{{ route('users.show', ['username' => $bookmark->user->username]) }}">
|
||||
({{ $bookmark->user->username }})
|
||||
</a>
|
||||
@endif
|
||||
</span>
|
||||
@else
|
||||
<span class="badge-extra text-bold">
|
||||
<i class="{{ config('other.font-awesome') }} fa-upload" data-toggle="tooltip"
|
||||
data-original-title="@lang('torrent.uploader')"></i>
|
||||
<a href="{{ route('users.show', ['username' => $bookmark->user->username]) }}">
|
||||
{{ $bookmark->user->username }}
|
||||
</a>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
<span class="badge-extra text-bold text-pink">
|
||||
<i class="{{ config('other.font-awesome') }} fa-heart" data-toggle="tooltip"
|
||||
data-original-title="@lang('torrent.thanks-given')"></i>
|
||||
{{ $bookmark->thanks()->count() }}
|
||||
</span>
|
||||
|
||||
<a href="{{ route('torrent', ['id' => $bookmark->id, 'hash' => '#comments']) }}">
|
||||
<span class="badge-extra text-bold text-green">
|
||||
<i class="{{ config('other.font-awesome') }} fa-comment" data-toggle="tooltip"
|
||||
data-original-title="@lang('common.comments')"></i>
|
||||
{{ $bookmark->comments()->count() }}
|
||||
</span>
|
||||
</a>
|
||||
|
||||
@if ($bookmark->internal == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-magic' data-toggle='tooltip' title=''
|
||||
data-original-title='@lang('torrent.internal-release')' style="color: #baaf92;"></i>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($bookmark->stream == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-play text-red' data-toggle='tooltip'
|
||||
title='' data-original-title='@lang('torrent.stream-optimized')'></i>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($bookmark->featured == 0)
|
||||
@if ($bookmark->doubleup == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-gem text-green' data-toggle='tooltip'
|
||||
title='' data-original-title='@lang('torrent.double-upload')'></i>
|
||||
</span>
|
||||
@endif
|
||||
@if ($bookmark->free == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-star text-gold' data-toggle='tooltip'
|
||||
title='' data-original-title='@lang('torrent.freeleech')'></i>
|
||||
</span>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@if ($personal_freeleech)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-id-badge text-orange' data-toggle='tooltip'
|
||||
title='' data-original-title='@lang('torrent.personal-freeleech')'></i>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($user->freeleechTokens->where('torrent_id', $bookmark->id)->first())
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-star text-bold' data-toggle='tooltip'
|
||||
title='' data-original-title='@lang('torrent.freeleech-token')'></i>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($bookmark->featured == 1)
|
||||
<span class='badge-extra text-bold' style='background-image:url(/img/sparkels.gif);'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-certificate text-pink' data-toggle='tooltip'
|
||||
title='' data-original-title='@lang('torrent.featured')'></i>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($user->group->is_freeleech == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-trophy text-purple' data-toggle='tooltip'
|
||||
title='' data-original-title='@lang('torrent.special-freeleech')'></i>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if (config('other.freeleech') == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-globe text-blue' data-toggle='tooltip'
|
||||
title='' data-original-title='@lang('torrent.global-freeleech')'></i>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if (config('other.doubleup') == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-globe text-green' data-toggle='tooltip'
|
||||
title='' data-original-title='@lang('torrent.global-double-upload')'></i>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($user->group->is_double_upload == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-trophy text-purple'
|
||||
data-toggle='tooltip' title=''
|
||||
data-original-title='@lang('torrent.special-double_upload')'></i>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($bookmark->leechers >= 5)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-fire text-orange' data-toggle='tooltip'
|
||||
title='' data-original-title='@lang('common.hot')'></i>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($bookmark->sticky == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-thumbtack text-black' data-toggle='tooltip'
|
||||
title='' data-original-title='@lang('torrent.sticky')'></i>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($bookmark->highspeed == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-tachometer text-red' data-toggle='tooltip'
|
||||
title='' data-original-title='@lang('common.high-speeds')'></i>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($bookmark->sd == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-ticket text-orange' data-toggle='tooltip'
|
||||
title='' data-original-title='@lang('torrent.sd-content')'></i>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($bookmark->bumped_at != $bookmark->created_at && $bookmark->bumped_at < Carbon\Carbon::now()->addDay(2))
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-level-up-alt text-gold' data-toggle='tooltip'
|
||||
title='' data-original-title='Recently Bumped!'></i>
|
||||
</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $bookmark->getSize() }}</td>
|
||||
<td class="hidden-sm hidden-xs">{{ $bookmark->seeders }}</td>
|
||||
<td class="hidden-sm hidden-xs">{{ $bookmark->leechers }}</td>
|
||||
<td class="hidden-sm hidden-xs">{{ $bookmark->times_completed }}</td>
|
||||
<td class="hidden-sm hidden-xs">{{ $bookmark->created_at->diffForHumans() }}</td>
|
||||
<td>
|
||||
<div class="dropdown">
|
||||
<a class="dropdown-toggle btn btn-default btn-xs" data-toggle="dropdown" href="#" aria-expanded="true">
|
||||
Actions
|
||||
<i class="fas fa-caret-circle-right"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li role="presentation">
|
||||
<a role="menuitem" tabindex="-1" target="_blank"
|
||||
href="{{ route('torrent', ['id' => $bookmark->id]) }}">View Torrent</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a role="menuitem" tabindex="-1"
|
||||
href="{{ route('download', ['id' => $bookmark->id]) }}">Download Torrent</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<form role="menuitem" tabindex="-1"action="{{ route('bookmarks.destroy', ['id' => $bookmark->id]) }}" method="POST"
|
||||
style="display: inline;">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-xxs btn-danger">
|
||||
@lang('torrent.delete-bookmark')
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@if (! $bookmarks->count())
|
||||
<div class="margin-10">
|
||||
<h1>
|
||||
<i class="{{ config('other.font-awesome') }} fa-frown"></i>
|
||||
@lang('torrent.no-bookmarks')
|
||||
</h1>
|
||||
</div>
|
||||
@endif
|
||||
<br>
|
||||
<div class="text-center">
|
||||
{{ $bookmarks->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,320 +0,0 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@section('title')
|
||||
<title>{{ $user->username }} @lang('user.bookmarks') - {{ config('other.title') }}</title>
|
||||
@endsection
|
||||
|
||||
@section('breadcrumb')
|
||||
<li>
|
||||
<a href="{{ route('users.show', ['username' => $user->username]) }}" itemprop="url" class="l-breadcrumb-item-link">
|
||||
<span itemprop="title" class="l-breadcrumb-item-link-title">{{ $user->username }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('bookmarks.index', ['username' => $user->username]) }}" itemprop="url"
|
||||
class="l-breadcrumb-item-link">
|
||||
<span itemprop="title" class="l-breadcrumb-item-link-title">{{ $user->username }} @lang('user.bookmarks')</span>
|
||||
</a>
|
||||
</li>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
<div class="block">
|
||||
@include('user.buttons.other')
|
||||
<div class="header gradient red">
|
||||
<div class="inner_content">
|
||||
<h1>{{ $user->username }} @lang('user.bookmarks')</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="some-padding">
|
||||
<div class="table-responsive">
|
||||
<div class="pull-right"></div>
|
||||
<table class="table table-condensed table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-1">@lang('torrent.category') / @lang('torrent.type')</th>
|
||||
<th>@lang('common.name')</th>
|
||||
<th><i class="{{ config('other.font-awesome') }} fa-clock"></i></th>
|
||||
<th><i class="{{ config('other.font-awesome') }} fa-file"></i></th>
|
||||
<th><i class="{{ config('other.font-awesome') }} fa-arrow-circle-up"></i></th>
|
||||
<th><i class="{{ config('other.font-awesome') }} fa-arrow-circle-down"></i></th>
|
||||
<th><i class="{{ config('other.font-awesome') }} fa-check-square"></i></th>
|
||||
<th><i class="{{ config('other.font-awesome') }} fa-cogs"></i></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($bookmarks as $bookmark)
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{ route('categories.show', ['id' => $bookmark->category->id]) }}">
|
||||
<div class="text-center">
|
||||
<i class="{{ $bookmark->category->icon }} torrent-icon" data-toggle="tooltip"
|
||||
data-original-title="{{ $bookmark->category->name }} {{ strtolower(trans('torrent.torrent')) }}"
|
||||
style="padding-bottom: 6px;"></i>
|
||||
</div>
|
||||
</a>
|
||||
<div class="text-center">
|
||||
<span class="label label-success" data-toggle="tooltip" data-original-title="Type">
|
||||
{{ $bookmark->type->name }}
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a class="view-torrent" href="{{ route('torrent', ['id' => $bookmark->id]) }}">
|
||||
{{ $bookmark->name }}
|
||||
</a>
|
||||
@if (config('torrent.download_check_page') == 1)
|
||||
<a href="{{ route('download_check', ['id' => $bookmark->id]) }}">
|
||||
<button class="btn btn-primary btn-circle" type="button" data-toggle="tooltip"
|
||||
data-original-title="Download Torrent">
|
||||
<i class="{{ config('other.font-awesome') }} fa-download"></i>
|
||||
</button>
|
||||
</a>
|
||||
@else
|
||||
<a href="{{ route('download', ['id' => $bookmark->id]) }}">
|
||||
<button class="btn btn-primary btn-circle" type="button" data-toggle="tooltip"
|
||||
data-original-title="Download Torrent">
|
||||
<i class="{{ config('other.font-awesome') }} fa-download"></i>
|
||||
</button>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@php $history = \App\Models\History::where('user_id', '=',
|
||||
$user->id)->where('info_hash', '=', $bookmark->info_hash)->first(); @endphp
|
||||
@if ($history)
|
||||
@if ($history->seeder == 1 && $history->active == 1)
|
||||
<button class="btn btn-success btn-circle" type="button" data-toggle="tooltip"
|
||||
data-original-title="Currently Seeding!">
|
||||
<i class="{{ config('other.font-awesome') }} fa-arrow-up"></i>
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@if ($history->seeder == 0 && $history->active == 1)
|
||||
<button class="btn btn-warning btn-circle" type="button" data-toggle="tooltip"
|
||||
data-original-title="Currently Leeching!">
|
||||
<i class="{{ config('other.font-awesome') }} fa-arrow-down"></i>
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@if ($history->seeder == 0 && $history->active == 0 && $history->completed_at == null)
|
||||
<button class="btn btn-info btn-circle" type="button" data-toggle="tooltip"
|
||||
data-original-title="Started Downloading But Never Completed!">
|
||||
<i class="{{ config('other.font-awesome') }} fa-spinner"></i>
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@if ($history->seeder == 0 && $history->active == 0 && $history->completed_at != null)
|
||||
<button class="btn btn-danger btn-circle" type="button" data-toggle="tooltip"
|
||||
data-original-title="You Completed This Download But Are No Longer Seeding It!">
|
||||
<i class="{{ config('other.font-awesome') }} fa-thumbs-down"></i>
|
||||
</button>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
<br>
|
||||
|
||||
@if ($bookmark->anon == 1)
|
||||
<span class="badge-extra text-bold">
|
||||
<i class="{{ config('other.font-awesome') }} fa-upload" data-toggle="tooltip"
|
||||
data-original-title="Uploaded By"></i> By ANONYMOUS USER
|
||||
@if ($user->id == $bookmark->user->id || $user->group->is_modo)
|
||||
<a href="{{ route('users.show', ['username' => $bookmark->user->username]) }}">
|
||||
({{ $bookmark->user->username }})
|
||||
</a>
|
||||
@endif
|
||||
</span>
|
||||
@else
|
||||
<span class="badge-extra text-bold">
|
||||
<i class="{{ config('other.font-awesome') }} fa-upload" data-toggle="tooltip"
|
||||
data-original-title="Uploaded By"></i> By
|
||||
<a href="{{ route('users.show', ['username' => $bookmark->user->username]) }}">
|
||||
{{ $bookmark->user->username }}
|
||||
</a>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
<span class="badge-extra text-bold text-pink">
|
||||
<i class="{{ config('other.font-awesome') }} fa-heart" data-toggle="tooltip"
|
||||
data-original-title="Thanks Given"></i>
|
||||
{{ $bookmark->thanks()->count() }}
|
||||
</span>
|
||||
|
||||
<span class="badge-extra text-bold text-green">
|
||||
<i class="{{ config('other.font-awesome') }} fa-comment" data-toggle="tooltip"
|
||||
data-original-title="Comments Left"></i>
|
||||
{{ $bookmark->comments()->count() }}
|
||||
</span>
|
||||
|
||||
@if ($bookmark->internal == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-magic' data-toggle='tooltip'
|
||||
data-original-title='Internal Release' style="color: #baaf92;"></i> Internal
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($bookmark->stream == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-play text-red' data-toggle='tooltip'
|
||||
data-original-title='Stream Optimized'></i> Stream Optimized
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($bookmark->featured == 0)
|
||||
@if ($bookmark->doubleup == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-gem text-green'
|
||||
data-toggle='tooltip' data-original-title='Double upload'></i> Double Upload
|
||||
</span>
|
||||
@endif
|
||||
@if ($bookmark->free == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-star text-gold'
|
||||
data-toggle='tooltip' data-original-title='100% Free'></i> 100% Free
|
||||
</span>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@if ($personal_freeleech)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-id-badge text-orange'
|
||||
data-toggle='tooltip' data-original-title='Personal FL'></i> Personal FL
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@php $freeleech_token = \App\Models\FreeleechToken::where('user_id', '=',
|
||||
$user->id)->where('torrent_id', '=', $bookmark->id)->first(); @endphp
|
||||
@if ($freeleech_token)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-star text-bold'
|
||||
data-toggle='tooltip' data-original-title='Freeleech Token'></i> Freeleech Token
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($bookmark->featured == 1)
|
||||
<span class='badge-extra text-bold' style='background-image:url(/img/sparkels.gif);'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-certificate text-pink'
|
||||
data-toggle='tooltip' data-original-title='Featured Torrent'></i> Featured
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($user->group->is_freeleech == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-trophy text-purple'
|
||||
data-toggle='tooltip' data-original-title='Special FL'></i> Special FL
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if (config('other.freeleech') == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-globe text-blue'
|
||||
data-toggle='tooltip' data-original-title='Global FreeLeech'></i> Global
|
||||
FreeLeech
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if (config('other.doubleup') == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-globe text-green'
|
||||
data-toggle='tooltip' data-original-title='Double Upload'></i> Global Double
|
||||
Upload
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($bookmark->leechers >= 5)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-fire text-orange'
|
||||
data-toggle='tooltip' data-original-title='Hot!'></i> Hot
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($bookmark->sticky == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-thumbtack text-black'
|
||||
data-toggle='tooltip' data-original-title='Sticky!'></i> Sticky
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($user->updated_at->getTimestamp() < $bookmark->created_at->getTimestamp())
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-magic text-black'
|
||||
data-toggle='tooltip' data-original-title='NEW!'></i> NEW
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($bookmark->highspeed == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-tachometer text-red'
|
||||
data-toggle='tooltip' data-original-title='High Speeds!'></i> High Speeds
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($bookmark->sd == 1)
|
||||
<span class='badge-extra text-bold'>
|
||||
<i class='{{ config('other.font-awesome') }} fa-ticket text-orange'
|
||||
data-toggle='tooltip' data-original-title='SD Content!'></i> SD Content
|
||||
</span>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<time>
|
||||
{{ $bookmark->created_at->diffForHumans() }}
|
||||
</time>
|
||||
</td>
|
||||
<td>
|
||||
<span class='badge-extra text-blue text-bold'>
|
||||
{{ $bookmark->getSize() }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ route('peers', ['id' => $bookmark->id]) }}">
|
||||
<span class='badge-extra text-green text-bold'>
|
||||
{{ $bookmark->seeders }}
|
||||
</span>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ route('peers', ['id' => $bookmark->id]) }}">
|
||||
<span class='badge-extra text-red text-bold'>
|
||||
{{ $bookmark->leechers }}
|
||||
</span>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ route('history', ['id' => $bookmark->id]) }}">
|
||||
<span class='badge-extra text-orange text-bold'>
|
||||
{{ $bookmark->times_completed }} @lang('common.times')
|
||||
</span>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<form action="{{ route('bookmarks.destroy', ['id' => $bookmark->id]) }}" method="POST"
|
||||
style="display: inline;">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-xxs btn-danger">
|
||||
<i class="{{ config('other.font-awesome') }} fa-trash"></i>
|
||||
@lang('torrent.delete-bookmark')
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
{{ $bookmarks->links() }}
|
||||
</div>
|
||||
@if (count($bookmarks) <= 0) <div class="row">
|
||||
<div class="col-md-12 text-center">
|
||||
<h1 class="text-blue"><i class="{{ config('other.font-awesome') }} fa-frown text-blue"></i>
|
||||
@lang('torrent.no-bookmarks')</h1>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user