Skip to content

Commit

Permalink
refactor: Minimize code a bit at Merc's suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
preimpression committed May 18, 2024
1 parent 853bc72 commit dc49088
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Characters/DesignController.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function getDesignUpdate($id) {

return view('character.design.request', [
'request' => $r,
'canCancel' => config('lorekeeper.extensions.design_return_to_draft'),
'canCancel' => config('lorekeeper.extensions.design_return_to_draft') ?? 0,
]);
}

Expand Down
6 changes: 3 additions & 3 deletions resources/views/character/design/request.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
<p>
This request is in the approval queue.
@if (!Auth::user()->hasPower('manage_characters'))
Please wait for it to be processed{{ isset($canCancel) && $canCancel ? ' or cancel it below.' : '.' }}
@if (isset($canCancel) && $canCancel)
Please wait for it to be processed{{ $canCancel ? ' or cancel it below.' : '.' }}
@if ($canCancel)
<div class="card mb-3">
<div class="card-body">
<a href="#" class="btn btn-outline-secondary cancel-button btn-sm float-right" data-action="cancel">Cancel</a>
Expand Down Expand Up @@ -89,7 +89,7 @@
});
@endif
@if ($request->user_id == Auth::user()->id && $request->status == 'Pending' && isset($canCancel) && $canCancel)
@if ($request->user_id == Auth::user()->id && $request->status == 'Pending' && $canCancel)
$('.cancel-button').on('click', function(e) {
e.preventDefault();
loadModal("{{ url('designs/' . $request->id . '/cancel/') }}", 'Cancel Submission');
Expand Down

0 comments on commit dc49088

Please sign in to comment.