Skip to content

Commit

Permalink
Merge pull request #3452 from Roardom/upload-snatches-stats
Browse files Browse the repository at this point in the history
(Add) Upload snatches to extra stats
  • Loading branch information
HDVinnie committed Feb 1, 2024
2 parents bdeb02e + 44b1063 commit eba9cc7
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/Http/Controllers/StatsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,19 @@ public function seedsize(): \Illuminate\Contracts\View\Factory|\Illuminate\View\
]);
}

/**
* Show Extra-Stats Users.
*/
public function uploadSnatches(): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
{
return view('stats.users.upload-snatches', [
'users' => User::withCount('uploadSnatches')
->orderByDesc('upload_snatches_count')
->take(100)
->get(),
]);
}

/**
* Show Extra-Stats Torrents.
*/
Expand Down
8 changes: 8 additions & 0 deletions resources/views/partials/statsusermenu.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,11 @@ class="{{ Route::is('seedsize') ? 'nav-tab--active__link' : 'nav-tab__link' }}"
{{ __('user.top-seeding-size') }}
</a>
</li>
<li class="{{ Route::is('upload_snatches') ? 'nav-tab--active' : 'nav-tabV2' }}">
<a
class="{{ Route::is('upload_snatches') ? 'nav-tab--active__link' : 'nav-tab__link' }}"
href="{{ route('upload_snatches') }}"
>
Most Upload Snatches
</a>
</li>
50 changes: 50 additions & 0 deletions resources/views/stats/users/upload-snatches.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
@extends('layout.default')

@section('title')
<title>{{ __('stat.stats') }} - {{ config('other.title') }}</title>
@endsection

@section('breadcrumbs')
<li class="breadcrumbV2">
<a href="{{ route('stats') }}" class="breadcrumb__link">
{{ __('stat.stats') }}
</a>
</li>
<li class="breadcrumb--active">
{{ __('common.users') }}
</li>
@endsection

@section('nav-tabs')
@include('partials.statsusermenu')
@endsection

@section('page', 'page__stats--seedtime')

@section('main')
<section class="panelV2">
<h2 class="panel__heading">Most Upload Snatches</h2>
<div class="data-table-wrapper">
<table class="data-table">
<thead>
<tr>
<th>#</th>
<th>{{ __('common.user') }}</th>
<th>Uploads Snatched</th>
</tr>
</thead>
<tbody>
@foreach ($users as $user)
<tr>
<td>{{ $loop->iteration }}</td>
<td>
<x-user_tag :user="$user" :anon="$user->private_profile" />
</td>
<td>{{ $user->upload_snatches_count }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</section>
@endsection
1 change: 1 addition & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
Route::get('/user/bankers', [App\Http\Controllers\StatsController::class, 'bankers'])->name('bankers');
Route::get('/user/seedtime', [App\Http\Controllers\StatsController::class, 'seedtime'])->name('seedtime');
Route::get('/user/seedsize', [App\Http\Controllers\StatsController::class, 'seedsize'])->name('seedsize');
Route::get('/user/upload-snatches', [App\Http\Controllers\StatsController::class, 'uploadSnatches'])->name('upload_snatches');
Route::get('/torrent/seeded', [App\Http\Controllers\StatsController::class, 'seeded'])->name('seeded');
Route::get('/torrent/leeched', [App\Http\Controllers\StatsController::class, 'leeched'])->name('leeched');
Route::get('/torrent/completed', [App\Http\Controllers\StatsController::class, 'completed'])->name('completed');
Expand Down

0 comments on commit eba9cc7

Please sign in to comment.