Skip to content

Commit

Permalink
Development (#1053)
Browse files Browse the repository at this point in the history
  • Loading branch information
1day2die authored Nov 25, 2024
2 parents c3fc601 + 66faa4d commit 6635edb
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/TicketsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function show($ticket_id, PterodactylSettings $ptero_settings)
$this->checkPermission(self::READ_PERMISSION);
try {
$ticket = Ticket::where('ticket_id', $ticket_id)->firstOrFail();
if($ticket->user_id != Auth::user()->id){ return redirect()->back()->with('warning', __('This ticket is not made by you or dosent exist')); }
if($ticket->user_id != Auth::user()->id){ return redirect()->back()->with('error', __('This ticket is not made by you or dosent exist')); }
} catch (Exception $e) {
return redirect()->back()->with('warning', __('Ticket not found on the server. It potentially got deleted earlier'));
}
Expand All @@ -118,7 +118,7 @@ public function reply(Request $request)
$this->validate($request, ['ticketcomment' => 'required']);
try {
$ticket = Ticket::where('id', $request->input('ticket_id'))->firstOrFail();
if($ticket->user_id != Auth::user()->id){ return redirect()->back()->with('warning', __('This ticket is not made by you or dosent exist')); }
if($ticket->user_id != Auth::user()->id){ return redirect()->back()->with('error', __('This ticket is not made by you or dosent exist')); }
} catch (Exception $e) {
return redirect()->back()->with('warning', __('Ticket not found on the server. It potentially got deleted earlier'));
}
Expand Down
26 changes: 26 additions & 0 deletions themes/BlueInfinity/views/layouts/main.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,16 @@ class="nav-link @if (Request::routeIs('admin.partners.*')) active @endif">
</li>
@endcanany

@canany(["admin.coupons.read", "admin.coupons.write"])
<li class="nav-item">
<a href="{{ route('admin.coupons.index') }}"
class="nav-link @if (Request::routeIs('admin.coupons.*')) active @endif">
<i class="nav-icon fas fa-ticket-alt"></i>
<p>{{ __('Coupons') }}</p>
</a>
</li>
@endcanany

@canany(["admin.useful_links.read","admin.legal.read"])
<li class="nav-header">{{ __('Other') }}</li>
@endcanany
Expand Down Expand Up @@ -633,6 +643,22 @@ class="nav-link @if (Request::routeIs('admin.activitylogs.*')) active @endif">
}
})
@endif
@if (Session::has('warning'))
Swal.fire({
icon: 'warning',
title: '{{ Session::get('warning') }}',
position: 'top-end',
showConfirmButton: false,
background: '#343a40',
toast: true,
timer: 3000,
timerProgressBar: true,
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
})
@endif
</script>
</body>

Expand Down
16 changes: 16 additions & 0 deletions themes/default/views/layouts/main.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,22 @@ class="nav-link @if (Request::routeIs('admin.activitylogs.*')) active @endif">
}
})
@endif
@if (Session::has('warning'))
Swal.fire({
icon: 'warning',
title: '{{ Session::get('warning') }}',
position: 'top-end',
showConfirmButton: false,
background: '#343a40',
toast: true,
timer: 3000,
timerProgressBar: true,
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
})
@endif
</script>
</body>

Expand Down

0 comments on commit 6635edb

Please sign in to comment.