Win proof form fix

This commit is contained in:
Jérémy Munsch 2023-12-06 16:07:41 +01:00
parent 42c4cc0817
commit fee25d4cb4
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
3 changed files with 12 additions and 6 deletions

View file

@ -6,14 +6,15 @@ document.addEventListener("DOMContentLoaded", function () {
const wheelWrapper = document.getElementById("wheel-wrapper"),
spinWheelInner = wheelWrapper?.querySelector(".wheel-inner") as HTMLElement | null | undefined,
spinWheelBtnList = wheelWrapper?.querySelectorAll(".wheel-spin") as NodeListOf<HTMLElement> | undefined,
animationSection = document.getElementById("spin-animation"),
prizeSection = document.getElementById("prize-section"),
discountSection = document.getElementById("discount-section"),
winningProofSection = document.getElementById("winning-proof-section");
/** Hide animation and show win sections */
const toggleAnimationPhase = () => {
if (wheelWrapper) {
wheelWrapper.classList.add("d-none");
if (animationSection) {
animationSection.classList.add("d-none");
}
if (prizeSection) {
prizeSection.classList.remove("d-none");
@ -27,6 +28,10 @@ document.addEventListener("DOMContentLoaded", function () {
}
};
if (!animationSection) {
throw Error("section#spin-animation missing");
}
if (wheelWrapper && spinWheelInner && spinWheelBtnList && spinWheelBtnList.length) {
let clicks: number = 0;
// * Set default degree (360*5) soit 5 tours

View file

@ -16,7 +16,7 @@
</div>
<div class="row justify-content-center mb-5">
<div class="col g-0">
<div class="container my-2 border py-3" method="POST" action="{{ route('fo.send-winning-proof') }}"
<form class="container my-2 border py-3" method="POST" action="{{ route('fo.send-winning-proof') }}"
enctype="multipart/form-data">
@method('PUT')
@csrf
@ -26,7 +26,8 @@
<div class="row mb-3">
<div class="col text-center">
<button class="btn btn-lg btn-tertiary py-md-3 px-md-4">{{ __('Envoyer mes preuves d\'achat') }}</button>
<button class="btn btn-lg btn-tertiary py-md-3 px-md-4"
type="submit">{{ __('Envoyer mes preuves d\'achat') }}</button>
</div>
</div>
<div class="row">
@ -34,7 +35,7 @@
<span>{{ __('*Champs obligatoires') }}</span>
</div>
</div>
</div>
</form>
</div>
</div>

View file

@ -18,7 +18,7 @@
@include('theme::pages.participation.parts.prize', [
'sectionId' => 'prize-section',
'prizeModel' => $prizeModel,
'winProofAnchor' => 'winproof',
'winProofAnchor' => 'winning-proof-section',
])
@elseif (!empty($discount))
{{-- COUPON --}}