fix: multiple bugs

This commit is contained in:
HDVinnie
2023-06-27 07:44:48 -04:00
parent 9f5d83e49a
commit a9de25e9dd
7 changed files with 28 additions and 10 deletions
+1
View File
@@ -13,6 +13,7 @@
namespace App\Http\Controllers;
use App\Models\BlacklistClient;
use App\Models\Group;
use App\Models\Internal;
use App\Models\Page;
@@ -24,8 +24,8 @@ class TorrentHistoryController extends Controller
public function index(int $id): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
{
return view('torrent.history', [
'torrent' => Torrent::withAnyStatus()->findOrFail($id),
'history' => History::with(['user'])->where('torrent_id', '=', $id)->latest()->get(),
'torrent' => Torrent::withAnyStatus()->findOrFail($id),
'histories' => History::with(['user'])->where('torrent_id', '=', $id)->latest()->get(),
]);
}
}
+1 -1
View File
@@ -49,7 +49,7 @@ class TipController extends Controller
->where('name', '=', 'tip')
->latest('date_actioned')
->paginate(25),
'userbon' => $user->getSeedbonus,
'userbon' => $user->getSeedbonus(),
'tips_sent' => BonTransactions::query()
->where('sender', '=', $user->id)
->where('name', '=', 'tip')
+2 -2
View File
@@ -68,13 +68,13 @@ class UserController extends Controller
'warnings' => $user
->userwarning()
->latest()
->paginate(2, ['*'], 'warningsPage'),
->paginate(10, ['*'], 'warningsPage'),
'softDeletedWarnings' => $user
->userwarning()
->with(['torrenttitle', 'warneduser'])
->latest('created_at')
->onlyTrashed()
->paginate(2, ['*'], 'deletedWarningsPage'),
->paginate(10, ['*'], 'deletedWarningsPage'),
'boughtUpload' => BonTransactions::where('sender', '=', $user->id)->where([['name', 'like', '%Upload%']])->sum('cost'),
// 'boughtDownload' => BonTransactions::where('sender', '=', $user->id)->where([['name', 'like', '%Download%']])->sum('cost'),
'invitedBy' => Invite::where('accepted_by', '=', $user->id)->first(),
+1
View File
@@ -156,6 +156,7 @@ return [
'recent-bumped' => 'Recently Bumped',
'recommendations' => 'Recommendations',
'refundable' => 'Refundable',
'refunded' => 'Refunded',
'rejected' => 'Rejected',
'region' => 'Region',
'released' => 'Released',
+16
View File
@@ -434,6 +434,22 @@
<label class="form__label" for="mod_queue_opt_in">Opt in to Moderation Queue?</label>
</p>
@endif
@if (auth()->user()->group->is_modo || auth()->user()->group->is_internal)
<p class="form__group">
<input type="hidden" name="refundable" value="0">
<input
type="checkbox"
class="form__checkbox"
id="refundable"
name="refundable"
value="1"
@checked(old('refundable'))
>
<label class="form__label" for="refundable">{{ __('torrent.refundable') }}?</label>
</p>
@else
<input type="hidden" name="refundable" value="0">
@endif
@if (auth()->user()->group->is_modo || auth()->user()->group->is_internal)
<p class="form__group">
<select name="free" id="free" class="form__select">
+5 -5
View File
@@ -30,10 +30,10 @@
<h2 class="panel__heading">{{ __('torrent.torrent') }} {{ __('torrent.history') }}</h2>
<div class="panel__actions">
<div class="panel__action">
Total Up: {{ App\Helpers\StringHelper::formatBytes($history->sum('actual_uploaded'), 2) }}
Total Up: {{ App\Helpers\StringHelper::formatBytes($histories->sum('actual_uploaded'), 2) }}
</div>
<div class="panel__action">
Total Down: {{ App\Helpers\StringHelper::formatBytes($history->sum('actual_downloaded'), 2) }}
Total Down: {{ App\Helpers\StringHelper::formatBytes($histories->sum('actual_downloaded'), 2) }}
</div>
</div>
</header>
@@ -46,7 +46,7 @@
<th>{{ __('torrent.completed') }}</th>
<th>{{ __('common.upload') }}</th>
<th>{{ __('common.download') }}</th>
<th>{{ __('common.refunded-download') }}</th>
<th>{{ __('torrent.refunded') }}</th>
<th>{{ __('common.added') }}</th>
<th>{{ __('torrent.last-update') }}</th>
<th>{{ __('torrent.completed_at') }}</th>
@@ -54,7 +54,7 @@
</tr>
</thead>
<tbody>
@foreach ($history as $history)
@foreach ($histories as $history)
<tr>
<td>
<x-user_tag :user="$history->user" :anon="
@@ -91,7 +91,7 @@
</span>
</td>
<td>
<span class="text-orange" title="{{ __('torrent.credited') }} {{ strtolower(__('common.download')) }}">
<span class="text-info" title="{{ __('torrent.refunded') }} {{ strtolower(__('common.download')) }}">
({{ App\Helpers\StringHelper::formatBytes($history->refunded_download, 2) }})
</span>
</td>