From 30cf631e27838f5823210a844443c0921fb4487a Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 19 Apr 2024 10:45:19 +0200 Subject: [PATCH] wip #6872 @1 --- .../Controllers/Admin/ClientCrudController.php | 1 - .../Fluidbook.php => FluidbookController.php} | 15 ++------------- ...ebflowController.php => LandingController.php} | 8 +++++--- app/Models/Client.php | 4 +--- ...te-de-protection-des-donnees-personnelles.html | 2 +- resources/webflow/index.html | 4 ++-- resources/webflow/js/custom.js | 11 ++++++++++- resources/webflow/mentions-legales.html | 2 +- routes/web.php | 11 ++++++++++- 9 files changed, 32 insertions(+), 26 deletions(-) rename app/Http/Controllers/{Operations/Client/Fluidbook.php => FluidbookController.php} (63%) rename app/Http/Controllers/{WebflowController.php => LandingController.php} (52%) diff --git a/app/Http/Controllers/Admin/ClientCrudController.php b/app/Http/Controllers/Admin/ClientCrudController.php index 1376ba9..481d3f0 100644 --- a/app/Http/Controllers/Admin/ClientCrudController.php +++ b/app/Http/Controllers/Admin/ClientCrudController.php @@ -13,7 +13,6 @@ class ClientCrudController extends \Cubist\Backpack\Magic\Controllers\CubistMagi use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation; use \Backpack\CRUD\app\Http\Controllers\Operations\BulkDeleteOperation; use \Cubist\Backpack\Http\Controllers\Operations\ReviseOperation; - use \App\Http\Controllers\Operations\Client\Fluidbook; diff --git a/app/Http/Controllers/Operations/Client/Fluidbook.php b/app/Http/Controllers/FluidbookController.php similarity index 63% rename from app/Http/Controllers/Operations/Client/Fluidbook.php rename to app/Http/Controllers/FluidbookController.php index 756b48e..6055e34 100644 --- a/app/Http/Controllers/Operations/Client/Fluidbook.php +++ b/app/Http/Controllers/FluidbookController.php @@ -1,24 +1,13 @@ withoutMiddleware([CheckIfAdmin::class, VerifyCsrfToken::class]); - Route::match(['post'], $segment . '/login', $controller . '@login')->withoutMiddleware([CheckIfAdmin::class, VerifyCsrfToken::class]); - Route::match(['post'], $segment . '/forgotpassword', $controller . '@login')->withoutMiddleware([CheckIfAdmin::class, VerifyCsrfToken::class]); - } - protected function signin() { $validator = Validator::make(request()->all(), [ diff --git a/app/Http/Controllers/WebflowController.php b/app/Http/Controllers/LandingController.php similarity index 52% rename from app/Http/Controllers/WebflowController.php rename to app/Http/Controllers/LandingController.php index d143667..7b0c15f 100644 --- a/app/Http/Controllers/WebflowController.php +++ b/app/Http/Controllers/LandingController.php @@ -4,7 +4,7 @@ namespace App\Http\Controllers; use Cubist\Backpack\Http\Controllers\Base\XSendFileController; -class WebflowController extends Controller +class LandingController extends Controller { public function catchall($path = '') { @@ -13,8 +13,10 @@ class WebflowController extends Controller } $relayPath = resource_path('webflow') . '/' . $path; - if($path!=='index.html'){ - // dd($relayPath); + if (str_ends_with( $path,'.html')) { + $html = file_get_contents($relayPath); + $html = str_replace('', '', $html); + return response($html)->header('Content-Type', 'text/html'); } return XSendFileController::sendfile($relayPath); diff --git a/app/Models/Client.php b/app/Models/Client.php index 12d466f..b4b4cb0 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -3,6 +3,7 @@ namespace App\Models; use App\Http\Controllers\Operations\Client\Fluidbook; +use App\Http\Controllers\Operations\Client\Landing; use Cubist\Backpack\Magic\Fields\Text; use Cubist\Backpack\Magic\Models\CubistMagicAuthenticatable; @@ -13,8 +14,6 @@ class Client extends CubistMagicAuthenticatable 'singular' => 'client', 'plural' => 'clients']; - protected $_operations = [Fluidbook::class]; - public function setFields() { parent::setFields(); @@ -26,6 +25,5 @@ class Client extends CubistMagicAuthenticatable $this->addField('name', Text::class, 'Nom', ['tab' => 'Login']); $this->addField('function', Text::class, 'Fonction', ['tab' => 'Login']); $this->addField('phone', Text::class, 'Numéro de téléphone', ['tab' => 'Login']); - } } diff --git a/resources/webflow/charte-de-protection-des-donnees-personnelles.html b/resources/webflow/charte-de-protection-des-donnees-personnelles.html index 3eaa239..3195b39 100644 --- a/resources/webflow/charte-de-protection-des-donnees-personnelles.html +++ b/resources/webflow/charte-de-protection-des-donnees-personnelles.html @@ -1,5 +1,5 @@ - + diff --git a/resources/webflow/index.html b/resources/webflow/index.html index ca83034..de43b54 100644 --- a/resources/webflow/index.html +++ b/resources/webflow/index.html @@ -1,5 +1,5 @@ - + @@ -39,7 +39,7 @@

Pour afficher les tarifs, ajouter des produits à votre sélection, et nous envoyer une demande de devis, veuillez vous identifier :

-
+
Thank you! Your submission has been received!
diff --git a/resources/webflow/js/custom.js b/resources/webflow/js/custom.js index 6b762bd..3bee40e 100644 --- a/resources/webflow/js/custom.js +++ b/resources/webflow/js/custom.js @@ -1,6 +1,15 @@ $(function () { $('#wf-form-login').on('submit', function (e) { - alert('non !! va pas sur ' + $(this).attr('action')); + $.ajax( + { + url: $(this).attr('action'), + method: "POST", + data: $(this).serialize(), + dataType: 'json', + success: function (data) { + + } + }); return false; }); }); diff --git a/resources/webflow/mentions-legales.html b/resources/webflow/mentions-legales.html index ba8d60f..a1b6d36 100644 --- a/resources/webflow/mentions-legales.html +++ b/resources/webflow/mentions-legales.html @@ -1,5 +1,5 @@ - + diff --git a/routes/web.php b/routes/web.php index ea13b82..dcd368e 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,8 +1,17 @@ where('path', '.*'); Route::get('/catalogue_invite/{path?}', \App\Http\Controllers\CatalogController::class . '@guest')->where('path', '.*'); -Route::get('/{path?}', \App\Http\Controllers\WebflowController::class . '@catchall')->where('path', '.*'); +Route::get('/{path?}', \App\Http\Controllers\LandingController::class . '@catchall')->where('path', '.*'); +Route::match(['post'], '/fluidbook/signin', \App\Http\Controllers\FluidbookController::class . '@signin')->withoutMiddleware([CheckIfAdmin::class, VerifyCsrfToken::class]); +Route::match(['post'], '/fluidbook/login', \App\Http\Controllers\FluidbookController::class . '@login')->withoutMiddleware([CheckIfAdmin::class, VerifyCsrfToken::class]); +Route::match(['post'], '/fluidbook/forgotpassword', \App\Http\Controllers\FluidbookController::class . '@forgotPAssword')->withoutMiddleware([CheckIfAdmin::class, VerifyCsrfToken::class]); + +Route::match(['post'], '/landing/signin', \App\Http\Controllers\LandingController::class . '@signin')->withoutMiddleware([CheckIfAdmin::class]); +Route::match(['post'], '/landing/login', \App\Http\Controllers\LandingController::class . '@login')->withoutMiddleware([CheckIfAdmin::class]); +Route::match(['post'], '/landing/forgotpassword', \App\Http\Controllers\LandingController::class . '@forgotPassword')->withoutMiddleware([CheckIfAdmin::class]); -- 2.39.5