Sync 2 Html loading ok

This commit is contained in:
Jérémy Munsch 2023-11-21 12:28:09 +01:00
parent e6a16ff965
commit d3f2942c68
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
19 changed files with 50 additions and 44 deletions

View file

@ -21,7 +21,7 @@ class EndPageController extends Controller
$settings->activated_close_page === 1 &&
$settings->close_page_active_date > now()
) {
return view('front.basic.end', compact('settings'));
return view('theme::fo.end', compact('settings'));
}
return redirect()->route('home');
}

View file

@ -44,9 +44,9 @@ class EnterCodeController extends Controller
$nbParticipations = Participation::where('user_id', Auth::user()->id)->count();
$settings = app(Settings::class)->select('use_ean_codes', 'nb_participation_player')->first();
if ($nbParticipations >= $settings->nb_participation_player) {
return view('front.basic.participation-exhausted', compact('settings'));
return view('theme::fo.participation-exhausted', compact('settings'));
}
return view('front.basic.enter-code', compact('settings'));
return view('theme::fo.enter-code', compact('settings'));
}
/**
@ -64,13 +64,13 @@ class EnterCodeController extends Controller
// * Cas IP bannie.
$ipBanned = BannedIp::where('ip', app('clientIp'))->first() === null ? 0 : 1;
if ($ipBanned) {
return view('front.basic.participation-exhausted', compact('settings'));
return view('theme::fo.participation-exhausted', compact('settings'));
}
// * Cas nombre de participation maximale atteint.
$nbParticipations = Participation::where('user_id', auth()->user()->id)->count();
if ($nbParticipations >= $settings->nb_participation_player) {
return view('front.basic.participation-exhausted', compact('settings'));
return view('theme::fo.participation-exhausted', compact('settings'));
}
// * Tous les cas "bloquants" sont passé, l'utilisateur participe à partir d'ici.
@ -178,7 +178,7 @@ class EnterCodeController extends Controller
Mail::to($mail->email)->send(new NotifWinAdmin($settings, $participation));
}
$participation->save();
return view("front.basic." . $instantWin->prize->gainView->file_name, compact('settings'))
return view("theme::fo." . $instantWin->prize->gainView->file_name, compact('settings'))
->with('prize', $instantWin->prize);
}
@ -201,9 +201,9 @@ class EnterCodeController extends Controller
return back()->withErrors("Une erreur est survenue, merci de réessayez ultérieurement.");
}
Mail::to(Auth::user()->email)->send(new ReductionWon(Auth::user(), $coupon, $settings, $crmCoupon));
return view('front.basic.reduction', compact('crmCoupon', 'coupon'));
return view('theme::fo.reduction', compact('crmCoupon', 'coupon'));
} else {
return view('front.basic.loose');
return view('theme::fo.loose');
}
}
@ -284,7 +284,7 @@ class EnterCodeController extends Controller
['barcode', null]
])->has('instantWin')->first();
if ($participation) {
return view('front.basic.winning-proof', compact('participation'));
return view('theme::fo.winning-proof', compact('participation'));
}
return redirect()->route('home');
}

View file

@ -19,6 +19,6 @@ class FAQController extends Controller
if (count($questions) === 0 && count($themes) === 0) {
return redirect()->route('home');
}
return view('front.basic.faq', compact('questions', 'themes'));
return view('theme::fo.faq', compact('questions', 'themes'));
}
}

View file

@ -11,8 +11,8 @@ class GainsController extends Controller
*/
public function index()
{
if (view()->exists('front.basic.gains')) {
return view('front.basic.gains');
if (view()->exists('theme::fo.gains')) {
return view('theme::fo.gains');
}
return redirect()->route('home');
}

View file

@ -11,6 +11,6 @@ class HomeController extends Controller
*/
public function home()
{
return view('front.basic.home');
return view('theme::fo.home');
}
}

View file

@ -11,8 +11,8 @@ class HowToPlayController extends Controller
*/
public function index()
{
if (view()->exists('front.basic.how-to-play')) {
return view('front.basic.how-to-play');
if (view()->exists('theme::fo.basic.how-to-play')) {
return view('theme::fo.basic.how-to-play');
}
return redirect()->route('home');
}

View file

@ -35,7 +35,7 @@ class LoginController extends Controller
*/
public function index()
{
return view('front.basic.login');
return view('theme::fo.login');
}
/**
@ -162,7 +162,7 @@ class LoginController extends Controller
$result = false;
$user = Customer::where('email_verify_token', $verifyToken)->first();
if (!$user) {
return view('front.basic.confirm-email', compact('result'));
return view('theme::fo.confirm-email', compact('result'));
}
$activation = $this->apiCrm->activateCustomer($user->crm_id);
@ -182,7 +182,7 @@ class LoginController extends Controller
}
}
return view('front.basic.confirm-email', compact('result'));
return view('theme::fo.confirm-email', compact('result'));
}
/**
@ -196,9 +196,9 @@ class LoginController extends Controller
if ($request->tokenValid && $request->token) {
$tokenValid = $request->tokenValid;
$token = $request->token;
return view('front.basic.forgot-password', compact('tokenValid', 'token'));
return view('theme::fo.forgot-password', compact('tokenValid', 'token'));
}
return view('front.basic.forgot-password');
return view('theme::fo.forgot-password');
}
/**

View file

@ -14,8 +14,8 @@ class ProduitsController extends Controller
public function index()
{
$ranges = Range::with('products')->orderBy('id')->get();
if (view()->exists('front.basic.produits-porteurs')) {
return view('front.basic.produits-porteurs', compact('ranges'));
if (view()->exists('theme::fo.produits-porteurs')) {
return view('theme::fo.produits-porteurs', compact('ranges'));
}
return redirect()->route('home');
}

View file

@ -26,7 +26,7 @@ class Re7Controller extends Controller
{
$settings = app(Settings::class)
->select('start_date', 'end_date', 'activated_teaser', 'teaser_end_activity')->first();
return view('front.basic.teaser', compact('settings'));
return view('theme::fo.teaser', compact('settings'));
}
/**
@ -36,7 +36,7 @@ class Re7Controller extends Controller
*/
public function prizeMail()
{
return view('front.basic.prize-mail');
return view('theme::fo.prize-mail');
}
/**
@ -46,7 +46,7 @@ class Re7Controller extends Controller
*/
public function reductionMail()
{
return view('front.basic.reduction-mail');
return view('theme::fo.reduction-mail');
}
/**
@ -59,7 +59,7 @@ class Re7Controller extends Controller
$settings = app(Settings::class);
$coupon = $this->getRandomCoupon($settings);
$crmCoupon = new Reduction();
return view('front.basic.reduction', compact('coupon', 'crmCoupon'));
return view('theme::fo.reduction', compact('coupon', 'crmCoupon'));
}
/**
@ -69,7 +69,7 @@ class Re7Controller extends Controller
*/
public function gain1()
{
return view('front.basic.gain1');
return view('theme::fo.gain1');
}
/**
@ -79,7 +79,7 @@ class Re7Controller extends Controller
*/
public function gain2()
{
return view('front.basic.gain2');
return view('theme::fo.gain2');
}
/**
* getRandomCoupon

View file

@ -36,7 +36,7 @@ class RegisterController extends Controller
*/
public function index()
{
return view('front.basic.register-crm');
return view('theme::fo.register-crm');
}
/**

View file

@ -16,7 +16,7 @@ class TeaserController extends Controller
$settings = app(Settings::class)
->select('start_date', 'end_date', 'activated_teaser', 'teaser_end_activity')->first();
if ($settings->activated_teaser === 1 && $settings->teaser_end_activity > now()) {
return view('front.basic.teaser', compact('settings'));
return view('theme::fo.teaser', compact('settings'));
}
return redirect()->route('home');
}

View file

@ -14,7 +14,7 @@ class ViewContentController extends Controller
public function reglement()
{
$content = Content::find(3);
return view('front.basic.reglement', compact('content'));
return view('theme::fo.reglement', compact('content'));
}
/**
@ -25,7 +25,7 @@ class ViewContentController extends Controller
public function charte()
{
$content = Content::find(2);
return view('front.basic.charte', compact('content'));
return view('theme::fo.charte', compact('content'));
}
/**
@ -36,6 +36,6 @@ class ViewContentController extends Controller
public function legals()
{
$content = Content::find(1);
return view('front.basic.legals', compact('content'));
return view('theme::fo.legals', compact('content'));
}
}

View file

@ -139,6 +139,6 @@ class WinningProofController extends Controller
));
}
return view('front.basic.replay');
return view('theme::fo.replay');
}
}

View file

@ -10,7 +10,7 @@ use Illuminate\Database\Eloquent\Model;
* @property-read \Illuminate\Support\Carbon $appear_date Appear date
* @property boolean $won Is the prize won ?
*
* @property-read \App\Models\Prizes $prize Associated prize.
* @property-read \App\Models\Prize $prize Associated prize.
* @property-read \App\Models\Participation $participation Associated participation.
*/
class InstantWin extends Model

View file

@ -23,7 +23,7 @@ class ViewServiceProvider extends ServiceProvider
// * View shares
// ! Add view file pathes (also needed for console xml job).
View::addNamespace('back', resource_path('views'));
View::addNamespace('theme', resource_path('theme/views'));
View::addNamespace('theme', resource_path('theme/mounted/views'));
if (!app()->runningInConsole()) {
$appInfos = Cache::remember('composer', 3600, function () {

View file

@ -193,6 +193,8 @@ return [
|
*/
'aliases' => Facade::defaultAliases()->merge([])->toArray(),
'aliases' => Facade::defaultAliases()->merge([
'Carbon' => \Illuminate\Support\Carbon::class,
])->toArray(),
];

View file

@ -15,6 +15,8 @@ return [
'paths' => [
resource_path('views'),
// ! for theme vendor publish (mail notifications par ex)
resource_path('theme/mounted/views/vendor'),
// ! for vendor publish (mail notifications par ex)
resource_path('views/vendor'),
],

View file

@ -1,6 +1,6 @@
// ASSETS
/// <reference types="vite/client" />
import.meta.glob(["./../assets/images/**"]);
import.meta.glob(["./../../assets/images/**"]);
// UTILITIES
import "./utilities/bootstrap";

View file

@ -123,6 +123,8 @@ export default defineConfig({
},
},
resolve: {
// * This is important for theme
preserveSymlinks: true,
extensions: ["*", ".js", ".ts", ".vue"],
alias: [
{