Allow for tabulators marking a failed prelim

Addresses #45
This commit is contained in:
Matt Young 2024-10-31 19:26:49 -05:00
parent 0875be4e68
commit bf0e5cc8bb
2 changed files with 19 additions and 7 deletions

View File

@ -83,7 +83,12 @@ class EntryFlagController extends Controller
$entry->addFlag('no_show');
ScoreSheet::where('entry_id', $entry->id)->delete();
CalculatedScore::where('entry_id', $entry->id)->delete();
$msg = 'No Show has been entered for '.$entry->audition->name.' #'.$entry->draw_number.' (ID: '.$entry->id.').';
if (request()->input('noshow-type') == 'failprelim') {
$msg = 'Failed prelim has been entered for '.$entry->audition->name.' #'.$entry->draw_number.' (ID: '.$entry->id.').';
$entry->addFlag('failed_prelim');
} else {
$msg = 'No Show has been entered for '.$entry->audition->name.' #'.$entry->draw_number.' (ID: '.$entry->id.').';
}
return to_route('entry-flags.noShowSelect')->with('success', $msg);
}

View File

@ -20,7 +20,9 @@
@endforeach
</div>
<div class="pb-5 pl-5 flex gap-1">
<x-form.checkbox name="confirm" x-model="showButton" /> I understand that marking this entry as a no-show will delete existing scores. The scores cannot be recovered.
<x-form.checkbox name="confirm" x-model="showButton"/>
I understand that marking this entry as a no-show will delete existing scores. The scores cannot be
recovered.
</div>
</x-card.card>
@endif
@ -35,10 +37,15 @@
{{ $entry->audition->name }} #{{ $entry->draw_number ?? ' no draw number' }}
</x-card.list.row>
</x-card.list.body>
<x-form.footer class="mb-4">
<x-form.form method="{{ $method }}" action="{{route($submitRouteName, $entry)}}" id="{{ $formId }}">
<x-form.button type="submit" >{{ $buttonName }}</x-form.button>
</x-form.form>
</x-form.footer>
<x-form.form method="{{ $method }}" action="{{route($submitRouteName, $entry)}}" id="{{ $formId }}">
<x-form.footer class="mb-4">
@if($buttonName == "Confirm No Show")
<x-form.option name="noshow-type" value="noshow" id="noshowoption" option_text="No-Show" checked/>
<x-form.option name="noshow-type" value="failprelim" id="failprelimoption" option_text="Fail Prelim"/>
@endif
<x-form.button type="submit">{{ $buttonName }}</x-form.button>
</x-form.footer>
</x-form.form>
</x-card.card>
</x-layout.app>