Fix from mail de Marion Beschu du 20/06/2021 (Service Web)

This commit is contained in:
Jérémy Munsch 2021-06-28 13:00:30 +02:00
parent 334573bf31
commit e1b268decb
8 changed files with 21 additions and 137 deletions

View file

@ -129,7 +129,7 @@ class GameController extends Controller
$instantGagnant = InstantGagnant::where('id', $request->unclaimedWin)
->firstOrFail();
if (!in_array($instantGagnant->id, $user->unclaimedInstantGagnants()->pluck('id')->all())) {
abort(400);
abort(401);
}
return response()->streamDownload(function () use ($user, $instantGagnant) {

15
resources/js/front.js vendored
View file

@ -59,10 +59,13 @@ if (scratchEl) {
}
let wPdf = document.getElementById('unclaimedWin')
let dPdfLink = document.getElementById('winnerPdf')
if (dPdfLink) {
dPdfLink.addEventListener('click', (e) => {
e.preventDefault()
window.open(dPdfLink.href.replace('ID', wPdf.value), '_blank').focus()
})
let dPdfLinks = document.getElementsByClassName('winnerPdf')
if (dPdfLinks.length) {
for (let dPdfLink of dPdfLinks) {
dPdfLink.addEventListener('click', (e) => {
console.log('click')
e.preventDefault()
window.open(dPdfLink.href.replace('ID', wPdf.value), '_blank').focus()
})
}
}

View file

@ -9,6 +9,9 @@ body > footer {
font-weight: 400;
color: $color10;
font-size: 0.8em;
&:first-child {
font-size: 1rem;
}
}
& > ul {

View file

@ -107,7 +107,7 @@
<div class="form-group row justify-content-center mt-3">
<div class="col-md-6">
<input type="text" class="form-control @error('address2') is-invalid @enderror" name="address2" placeholder="{{ __('Addresse complément*') }}" value="{{ old('address2') }}" autocomplete="address2" autofocus>
<input type="text" class="form-control @error('address2') is-invalid @enderror" name="address2" placeholder="{{ __('Addresse complément') }}" value="{{ old('address2') }}" autocomplete="address2" autofocus>
@error('address2')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>

View file

@ -9,7 +9,7 @@
<div class="row justify-content-center text-center">
<div class="col col-md-6">
<div class="card card-gaulois">
<div class="card-header">{{ __('Vérifiez votre email') }}</div>
<div class="card-header">{{ __('Vérifiez votre boite mail') }}</div>
<div class="card-body">
@if (session('resent'))
@ -18,7 +18,7 @@
</div>
@endif
{{ __('Avant de continuer, veuillez vérifier vos emails pour y trouver un lien de vérification de notre part') }}
{{ __('Avant de continuer, veuillez vérifier vos emails pour y trouver un lien de vérification de notre part.') }}
{{ __('Si vous n\'avez pas reçu de mail de vérification') }},
<form class="d-inline" method="POST" action="{{ route('verification.resend') }}">
@csrf

View file

@ -1,122 +0,0 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ str_replace('_', '-', app()->getLocale()) }}"
xml:lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<title>{{ __('Commande Le Gaulois') }}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
html, body {
position: relative;
width: 210mm;
height: 297mm;
margin: 0;
padding: 0;
}
#entete {
position: absolute;
top: 75mm;
left: 20mm;
width: 174mm;
}
#body {
position: absolute;
top: 165mm;
left: 20mm;
width: 174mm;
}
.items {
border-collapse: collapse;
border: 1px solid #000000; /* this draws the table border */
}
.items th,
.items td {
border: 1px solid #000000 !important;
padding: 10px 20px;
}
p {
margin: 0;
padding: 0;
}
.ft10 {
font-size: 18px;
font-family: Helvetica;
color: #000000;
}
.ft11 {
font-size: 18px;
font-family: Helvetica;
color: #000000;
}
</style>
</head>
<body style="background-image: url('{{ asset('assets/email/order.png') }}'); background-image-resize:6; background-repeat: no-repeat;background-size: contain;">
<div id="entete" class="ft10">
<table width="100%">
<tbody>
<tr>
<td colspan="2" style="text-align: right;"><b>{{ __('Date') }}&nbsp;:&nbsp;{{ date('d/m/Y') }}</b></td>
</tr>
<tr>
<td style="padding-top: 10mm;">{{ __('Nom') }}&nbsp;:&nbsp;{{ $lastname }}</td>
<td style="padding-top: 10mm;">{{ __('Prénom') }}&nbsp;:&nbsp;{{ $firstname }}</td>
</tr>
<tr>
<td>{{ __('E-mail') }}&nbsp;:&nbsp;{{ $email }}</td>
<td>{{ __('Téléphone') }}&nbsp;:&nbsp;{{ $phone }}</td>
</tr>
<tr style="vertical-align: top;">
<td colspan="2">{{ __('Adresse') }}&nbsp;:&nbsp;{{ $address }}</td>
</tr>
<tr>
<td>{{ __('Code Postal') }}&nbsp;:&nbsp;{{ $postcode }}</td>
<td>{{ __('Ville') }}&nbsp;:&nbsp;{{ $city }}</td>
</tr>
</tbody>
</table>
</div>
<div id="body">
<table width="100%" class="ft10 items">
<colgroup>
<col span="1" style="width: 20%;">
<col span="1" style="width: 25%;">
<col span="1" style="width: 25%;">
<col span="1" style="width: 20%;">
</colgroup>
<thead>
<tr>
<th></th>
<th>{{ __('Prix unitaire') }}</th>
<th>{{ __('Quantité') }}</th>
<th>{{ __('Total') }}</th>
</tr>
</thead>
<tbody>
@php $totalItems = 0; $total = 0; @endphp
@foreach($items as $item)
<tr>
<td>{!! __('Carte Papier <br> Nouvelle Collection') !!}</td>
<td>{{ $item['price'] }}&nbsp;€</td>
<td>{{ $item['pivot']['quantity'] }}</td>
<td>{{ $item['price'] * $item['pivot']['quantity'] }}&nbsp;€</td>
</tr>
@php $totalItems += $item['pivot']['quantity']; $total += $item['price'] * $item['pivot']['quantity']; @endphp
@endforeach
<tr>
<td>{{ __('Total') }}</td>
<td></td>
<td>{{ $totalItems }}</td>
<td>{{ $total }}&nbsp;€</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>

View file

@ -1,9 +1,9 @@
<footer>
@if(request()->route() and request()->route()->getName() == 'home')
{{-- @if(request()->route() and request()->route()->getName() == 'home') --}}
<div>
*Présent sur le prospectus Scachap valable du 06/07/2021 au 10/07/2021.
</div>
@endif
{{-- @endif --}}
<ul>
<li>
<a href="{{ route('legals') }}">{{ __('Mentions légales') }}</a>

View file

@ -7,7 +7,7 @@
@include('modules/steps', ['step' => 3])
@if(isset($saved))
<div class="container">
<h2 class="formTitle">{{ __('Votre preuve de gain à bien été sauvegardé et va être transmis à nos services.') }}<br>
<h2 class="formTitle">{{ __('Votre preuve de gain a bien été sauvegardée et va être transmise à nos services.') }}<br>
{{ __('Merci d\'avoir participé.') }}</h2>
</div>
@elseif(isset($alreadySaved))
@ -69,7 +69,7 @@
</p>
</div>
<div class="col-12 d-flex d-md-none mt-4 mb-5 justify-content-center">
<a id="winnerPdf" href="{{ route('winnerPdf', 'ID') }}" target="_blank" class="bigButton">{{ __('Télécharger mon formulaire pré-rempli') }}</a>
<a href="{{ route('winnerPdf', 'ID') }}" target="_blank" class="winnerPdf bigButton">{{ __('Télécharger mon formulaire pré-rempli') }}</a>
</div>
</div>
</div>
@ -202,7 +202,7 @@
</div>
<div class="row justify-content-center">
<div class="col-6 d-none d-md-flex justify-content-center">
<a id="winnerPdf" href="{{ route('winnerPdf', 'ID') }}" target="_blank" class="bigButton">{{ __('Télécharger mon formulaire pré-rempli') }}</a>
<a href="{{ route('winnerPdf', 'ID') }}" target="_blank" class="winnerPdf bigButton">{{ __('Télécharger mon formulaire pré-rempli') }}</a>
</div>
<div class="col-6 d-none d-md-flex justify-content-center">
<button type="submit" class="bigButton">