Filters collapsed, customer auth and register, fix on basket recalculation

This commit is contained in:
Ludovic CANDELLIER
2022-04-20 00:16:16 +02:00
parent 483aa59750
commit 6837954fc9
31 changed files with 218 additions and 251 deletions

View File

@@ -20,7 +20,7 @@ class LoginController extends Controller
public function showLoginForm()
{
return view('Shop.auth.login', $data);
return view('Shop.auth.login', $data ?? []);
}
public function authenticated(Request $request, $user)

View File

@@ -7,64 +7,39 @@ use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;
use App\Repositories\Layout;
use App\Repositories\Languages;
use App\Repositories\Shop\Customers;
class LoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/
use AuthenticatesUsers;
/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = '/';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
// $this->middleware('guest')->except('logout');
}
protected function guard()
{
return Auth::guard('customer');
}
public function showLoginForm()
{
$data['url'] = route('Shop.login.post');
return view('Shop.auth.login', $data);
}
protected function guard()
{
return Auth::guard('guest');
}
public function login(Request $request)
{
$this->validate($request, [
'username' => 'required|email',
'password' => 'required|min:8'
'email' => 'required|email',
'password' => 'required|min:8',
]);
if (Auth::guard('guest')->attempt(['username' => $request->username, 'password' => $request->password], $request->get('remember'))) {
if (Auth::guard('customer')->attempt(['email' => $request->email, 'password' => $request->password], $request->get('remember'))) {
return redirect()->intended(route('home'));
}
return back()->withInput($request->only('username', 'remember'));
return back()->withInput($request->only('email', 'remember'));
}
public function logout(Request $request)

View File

@@ -16,114 +16,52 @@ use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Validator;
use Sebastienheyd\Boilerplate\Rules\Password;
use App\Models\Shop\Customer;
class RegisterController extends Controller
{
use RegistersUsers;
/**
* Where to redirect users after registration.
*
* @var string
*/
protected $redirectTo;
/**
* Is registering the first user ?
*
* @var bool
*/
protected $firstUser;
/**
* Create a new controller instance.
*/
public function __construct()
protected function guard()
{
$userModel = config('auth.providers.users.model');
$this->firstUser = $userModel::whereRoleIs('admin')->count() === 0;
return Auth::guard('customer');
}
/**
* Return route where to redirect after login success.
*
* @return string
*/
protected function redirectTo()
{
return route(config('boilerplate.app.redirectTo', 'boilerplate.dashboard'));
}
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'last_name' => 'required|max:255',
'first_name' => 'required|max:255',
'email' => 'required|email|max:255|unique:users,email,NULL,id,deleted_at,NULL',
'email' => 'required|email|max:255|unique:shop_customers,email,NULL,id,deleted_at,NULL',
'password' => ['required', 'confirmed', new Password()],
]);
}
/**
* Show the application registration form.
*
* @return Application|Factory|View
*/
public function showRegistrationForm()
{
if (! $this->firstUser && ! config('boilerplate.auth.register')) {
abort('404');
return view('Shop.auth.register');
}
return view('boilerplate::auth.register', ['firstUser' => $this->firstUser]);
}
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return mixed
*/
protected function create(array $data)
{
if (! $this->firstUser && ! config('boilerplate.auth.register')) {
abort('404');
}
$userModel = config('auth.providers.users.model');
$roleModel = config('laratrust.models.role');
$user = $userModel::withTrashed()->updateOrCreate(['email' => $data['email']], [
$user = Customer::withTrashed()->updateOrCreate(['email' => $data['email']], [
'active' => true,
'first_name' => $data['first_name'],
'last_name' => $data['last_name'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
'last_login' => Carbon::now()->toDateTimeString(),
]);
if ($this->firstUser) {
$admin = $roleModel::whereName('admin')->first();
$user->attachRole($admin);
} else {
$user->restore();
$role = $roleModel::whereName(config('boilerplate.auth.register_role'))->first();
$user->roles()->sync([$role->id]);
}
return $user;
}
/**
* Show message to verify e-mail.
*
* @return Application|Factory|View
*/
public function emailVerify()
{
if (Auth::user()->hasVerifiedEmail()) {
@@ -133,25 +71,12 @@ class RegisterController extends Controller
return view('boilerplate::auth.verify-email');
}
/**
* If e-mail has been verified, redirect to the given route.
*
* @param EmailVerificationRequest $request
* @return Application|RedirectResponse|Redirector
*/
public function emailVerifyRequest(EmailVerificationRequest $request)
{
$request->fulfill();
return redirect(route(config('boilerplate.app.redirectTo', 'boilerplate.dashboard')));
}
/**
* Send verification e-mail.
*
* @param Request $request
* @return RedirectResponse
*/
public function emailSendVerification(Request $request)
{
$request->user()->sendEmailVerificationNotification();

View File

@@ -8,31 +8,10 @@ use Illuminate\Foundation\Auth\ResetsPasswords;
class ResetPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset requests
| and uses a simple trait to include this behavior. You're free to
| explore this trait and override any methods you wish to tweak.
|
*/
use ResetsPasswords;
/**
* Where to redirect users after resetting their password.
*
* @var string
*/
protected $redirectTo = '/';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');

View File

@@ -18,12 +18,14 @@ class CategoryController extends Controller
return $dataTable->render('Shop.Categories.list');
}
public function show(Request $request, $category_id)
public function show($category_id, $by_rows = false)
{
$data = self::init();
$data['display_by_rows'] = $request->input('by_rows') ?? false;
$data['display_by_rows'] = $by_rows;
$data['category'] = Categories::getFull($category_id);
$data['articles'] = Articles::getArticlesToSell(['category_id' => $category_id]);
// dump($data['articles']);
// exit;
$data['tags'] = TagGroups::getWithTagsAndCountOffers();
return view('Shop.shelve', $data);
}

View File

@@ -6,29 +6,16 @@ use Carbon\Carbon;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\SoftDeletes;
use Yadahan\AuthenticationLog\AuthenticationLogable;
use HighIdeas\UsersOnline\Traits\UsersOnlineTrait;
// use HighIdeas\UsersOnline\Traits\UsersOnlineTrait;
use Sebastienheyd\Boilerplate\Models\User as parentUser;
class User extends parentUser
{
// use UserHasTeams;
use AuthenticationLogable, SoftDeletes, UsersOnlineTrait;
// use UserHasTeams, UsersOnlineTrait;
use AuthenticationLogable, SoftDeletes;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['active', 'last_name', 'first_name', 'username', 'email', 'password', 'remember_token', 'last_login'];
protected $hidden = ['password', 'remember_token'];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'email_verified_at' => 'datetime',
];

View File

@@ -94,6 +94,21 @@ class Article extends Model implements HasMedia
return $query->where($this->table . '.article_nature_id', $id);
}
public function scopeByCategories($query, $categories_id)
{
return $categories_id ? $query->whereHas('categories', function ($query) use ($categories_id) {
$query->whereIn('id', $categories_id);
}) : $query;
}
public function scopeByCategoryParent($query, $category_id)
{
$category = Category::find($category_id);
return $category_id ? $query->whereHas('categories', function ($query) use ($category) {
$query->where('_lft', '>=', $category->_lft)->where('_rgt', '<=', $category->_rgt);
}) : $query;
}
public function scopeByCategory($query, $category_id)
{
return $category_id ? $query->whereHas('categories', function ($query) use ($category_id) {

View File

@@ -3,11 +3,19 @@
namespace App\Models\Shop;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Yadahan\AuthenticationLog\AuthenticationLogable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class Customer extends Model
class Customer extends Authenticatable
{
use AuthenticationLogable, SoftDeletes;
protected $guarded = ['id'];
protected $table = 'shop_customers';
protected $fillable = ['active', 'last_name', 'first_name', 'username', 'email', 'password', 'remember_token', 'settings', 'last_login'];
protected $hidden = ['password', 'remember_token'];
protected $casts = ['email_verified_at' => 'datetime',];
public function addresses()
{

View File

@@ -12,10 +12,13 @@ class ShopCart
{
if (self::has($item['id'])) {
if ($update) {
self::remove($id);
self::remove($item['id']);
$ret = self::get()->add($item);
// $ret = self::get()->update($item['id'], ['quantity' => $item['quantity']]);
} else {
$ret = self::get()->update($item['id'], ['quantity' => $item['quantity']]);
// self::remove($item['id']);
// $ret = self::get()->add($item);
}
} else {
$ret = self::get()->add($item);
@@ -45,7 +48,7 @@ class ShopCart
public static function clear()
{
Cart::clear();
return Cart::session(Auth::id())->clear();
return self::get()->clear();
}
public static function has($id)
@@ -70,7 +73,17 @@ class ShopCart
public static function getTotal()
{
return self::get()->getTotal();
return number_format(round(self::get()->getTotal(),2),2);
}
public static function getItemQuantity($id)
{
return self::getItem($id) ? (int) self::getItem($id)->quantity : 0;
}
public static function getItem($id)
{
return Cart::get($id);
}
public static function getContent()
@@ -80,6 +93,6 @@ class ShopCart
public static function get()
{
return Cart::session(Users::getId());
return Cart::session('_token');
}
}

View File

@@ -195,7 +195,7 @@ class Articles
$model = ($options['homepage'] ?? false) ? Article::homepage()->visible() : Article::visible();
// exit;
$data = $model->byCategory($category_id)->byTags($tags)->withAvailableOffers($sale_channel_id)->with([
$data = $model->byCategoryParent($category_id)->byTags($tags)->withAvailableOffers($sale_channel_id)->with([
'image',
'product',
'article_nature',

View File

@@ -31,7 +31,8 @@ class Offers
'tariff.price_lists.price_list_values',
'variation',
])->find($id);
$offer->article->image = Articles::getFullImageByArticle($offer->article);
$images = Articles::getFullImagesByArticle($offer->article);
$offer->article->image = Articles::getPreviewSrc($images[0] ?? false);
return $offer;
}

View File

@@ -14,7 +14,7 @@ class TagGroups
return TagGroup::get()->SortBy('name')->pluck('name', 'id')->toArray();
}
public static function getWithTagsAndCountOffers()
public static function getWithTagsAndCountOffers($category_id = false)
{
$tags = Tag::withCount(['articles'])->get()->toArray();
$tag_groups = TagGroup::pluck('name', 'id')->toArray();

View File

@@ -30,6 +30,19 @@ a.green-dark:hover {
text-shadow: 4px black;
}
.btn-green-dark {
color: #fff;
background-color: #335012;
border-color: #28a745;
}
.btn-green-dark a:hover {
color: #fff;
font-weight: 900;
text-decoration: none;
text-shadow: 4px black;
}
.green-light {
color: #F1F7EE;
}
@@ -60,6 +73,10 @@ a.green-dark:hover {
width: 100%
}
.slick-prev:before, .slick-next:before {
color: #335012!important;
}
@font-face {
font-family: 'noto_sanscondensed';
src: url('/fonts/notosans-condensed/notosans-condensed-webfont.eot');

View File

@@ -35,7 +35,6 @@
"geo6/geocoder-php-addok-provider": "^1.1",
"gzero/eloquent-tree": "^3.1",
"hassankhan/config": "^2.1",
"highideas/laravel-users-online": "^3.0",
"intervention/image": "^2.5",
"intervention/imagecache": "^2.4",
"jasonlewis/expressive-date": "^1.0",

View File

@@ -46,6 +46,11 @@ return [
'provider' => 'guests',
],
'customer' => [
'driver' => 'session',
'provider' => 'customers',
],
'api' => [
'driver' => 'token',
'provider' => 'users',
@@ -81,6 +86,11 @@ return [
'model' => App\Models\Shop\Customer::class,
],
'customers' => [
'driver' => 'eloquent',
'model' => App\Models\Shop\Customer::class,
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
@@ -115,6 +125,12 @@ return [
'expire' => 60,
'throttle' => 60,
],
'customers' => [
'provider' => 'customers',
'table' => 'shop_customer_password_resets',
'expire' => 60,
'throttle' => 60,
],
],
/*

View File

@@ -3,18 +3,18 @@
<img src="{{ App\Repositories\Shop\Articles::getPreviewSrc($article['image'] ?? false) }}" class="card-img-top" alt="{{ $product_name }}">
<div class="card-body">
<div class="row card-title">
<div class="col-10">
<div class="mb-0" style="font-size: 1.3em;">{{ $article['parent_name'] }}</div>
{{ $article['product_name'] }}
</div>
<div class="col-2 p-0 text-right" style="font-size: 2em; color: red;">
<i class="fa fa-heart"></i>
<div class="col-12">
<!--
<i class="fa fa-heart red"></i>
-->
<div class="text-truncate mb-0" style="font-size: 1.3em;">{{ $article['parent_name'] }}</div>
<div class="text-truncate">{{ $article['product_name'] }}</div>
</div>
</div>
<div class="row">
<div class="col-6">
<strong>Semence</strong>
<strong>Semence</strong><br/>
@if ($article['semences'] ?? false)
<span style="font-size: 1.4em">{{ $article['semences']['price'] ?? null }}</span> <br>
@else
@@ -22,7 +22,7 @@
@endif
</div>
<div class="col-6">
<strong>Plant</strong>
<strong>Plant</strong><br/>
@if ($article['plants'] ?? false)
<span style="font-size: 1.4em">{{ $article['plants']['price'] }}</span> <br>
@else

View File

@@ -1,47 +1,60 @@
<div class="row pb-3" style="background-color: #CCC;">
<div class="row pb-3 bg-light">
<div class="col-8">
<div class="row pt-2">
<div class="col-10">
<a href="{{ route('Shop.Articles.show', ['id' => $article['semences']['article_id'] ?? false ]) }}" class="text-decoration-none">
<div style="font-weight: bold; color: green; font-size: 1.5em;">{{ $product_name }}</div>
<a href="{{ route('Shop.Articles.show', ['id' => $article['id'] ?? false ]) }}" class="green-dark">
<div style="font-size: 1.5em;">{{ $product_name }}</div>
</a>
</div>
<div class="col-2 text-right">
<!--
<span style="font-size: 2em; color: red;">
<i class="fa fa-heart"></i>
</span>
-->
</div>
</div>
<a href="{{ route('Shop.Articles.show', ['id' => $article['semences']['article_id'] ?? false ]) }}" class="text-decoration-none">
<a href="{{ route('Shop.Articles.show', ['id' => $article['id'] ?? false ]) }}" class="green-dark">
<div class="row">
<div class="col-2">
<img src="{{ App\Repositories\Shop\Articles::getPreviewSrc($article['image'] ?? false) }}" class="card-img-top" alt="...">
</div>
<div class="col-10">
<div class="col-10 text-justify">
{!! $article['description'] !!}
</div>
</div>
</a>
</div>
<div class="col-4">
<div class="row h-100" style="color: green; display: flex;">
<div class="col-6 text-center" style="background-color: rgba(0,128,0,0.3); margin: auto;">
<div class="row h-100">
<div class="col-6">
@if ($article['semences'] ?? false)
<div class="w-100 mt-3 p-1 bg-green-light green-dark rounded-lg border border-success text-center">
<span style="font-size: 1.4em; font-weight: bold;">{{ $article['semences']['price'] ?? null }}</span> <br>
{{ $article['semences']['variation'] }}
<div>
Quantité :
Quantité : 1
</div>
@include('components.form.button', [
'class' => 'btn-success basket semences',
'class' => 'btn-green-dark basket semences mb-3 mt-2 shadow',
'txt' => 'Ajouter au panier',
])
</div>
@endif
</div>
<div class="col-6 text-center">
<div class="col-6">
@if ($article['plants'] ?? false)
<span style="font-size: 1.4em; font-weight: bold;">{{ $article['plants']['price'] }}</span> <br>
<div class="w-100 mt-3 p-1 bg-yellow-light yellow-dark border border-warning text-center">
<span style="font-size: 1.4em; font-weight: bold;">{{ $article['plants']['price'] ?? null }}</span> <br>
{{ $article['plants']['variation'] }}
<div>
Quantité : 1
</div>
@include('components.form.button', [
'class' => 'btn-success basket semences mb-3 mt-2 shadow',
'txt' => 'Ajouter au panier',
])
</div>
@endif
</div>
</div>

View File

@@ -17,7 +17,7 @@
</div>
</div>
@foreach ($basket as $nature => $items)
<div class="row mb-3 p-2 bg-green-light border">
<div class="row ml-1 mb-3 p-2 bg-green-light border">
<div class="col-12">
<h2 style="font-size: 1.6em;">{{ ucfirst($nature) }}</h2>
@foreach ($items as $item)
@@ -75,10 +75,11 @@
$('.basket-quantity').change(function() {
var offer_id = $(this).data('id');
var quantity = $(this).val();
var $row = $(this).parents('.row');
console.log("add basket");
console.log(quantity);
updateBasket(offer_id, quantity, function() {
calculatePrice($(this).parents('.basket-row'));
calculatePrice($row);
calculateTotal();
});
});
@@ -98,6 +99,8 @@
}
function calculatePrice($that) {
console.log('calculatePrice');
console.log($that);
var quantity = $that.find('.basket-quantity').val();
var price = $that.find('.basket-price').text();
var total_price = fixNumber(quantity * price);

View File

@@ -1,4 +1,4 @@
<div class="row mb-3 basket-row" id="basket_offer-{{ $item['id'] }}" data-id={{ $item['id'] }}>
<div class="row basket-row" id="basket_offer-{{ $item['id'] }}" data-id={{ $item['id'] }}>
<div class="col-2 text-center">
<img src="{{ $item['image'] }}" class="img-fluid">
</div>

View File

@@ -2,7 +2,7 @@
<div class="col-5">
<div class="row">
<div class="col-6">
<img src="{{ App\Repositories\Shop\Articles::getPreviewSrc($offer['article']['image'] ?? false) }}" class="card-img-top" alt="...">
<img src="{{ $offer['article']['image'] }}" class="card-img-top" alt="...">
</div>
<div class="col-6">
<div class="text-uppercase">

View File

@@ -2,14 +2,15 @@
<div class="mb-3 bg-green-light">
<div class="row">
<div class="col-6">
<h1 class="green" style="font-size: 2em;">{{ $shelve['name'] }}</h1>
<h1 class="green p-2" style="font-size: 2em;">{{ $shelve['name'] }}</h1>
</div>
<div class="col-6 text-right">
<a class="green-dark btn" href="{{ route('Shop.Categories.show', ['id' => $shelve['id']]) }}">Découvrir la sélection</a>
<a class="green-dark btn" href="{{ route('Shop.Categories.show', ['id' => $shelve['id']]) }}">Tout voir</a>
<a class="mt-2 btn btn-green-dark" href="{{ route('Shop.Categories.show', ['id' => $shelve['id']]) }}">Découvrir la sélection</a>
<a class="mt-2 green-dark btn" href="{{ route('Shop.Categories.show', ['id' => $shelve['id']]) }}">Tout voir</a>
</div>
</div>
<div class="row shelve_slider_{{ $shelve['id'] }} slider">
<div class="row">
<div class="col-11 mx-auto shelve_slider_{{ $shelve['id'] }} slider">
@foreach ($shelve['articles'] as $name => $article)
<div class="text-center pr-2 pl-2">
<a class="green-dark" href="{{ route('Shop.Articles.show', ['id' => $article['id']]) }}">
@@ -20,4 +21,5 @@
@endforeach
</div>
</div>
</div>
@endif

View File

@@ -1,5 +1,5 @@
<aside class="main-sidebar float-left d-none" id="sidebar" style="width: 300px;">
<section class="sidebar" style="height: auto;">
<section class="sidebar shadow" style="height: auto;">
<div class="row">
<div class="col-12">
@@ -7,8 +7,11 @@
</div>
</div>
@foreach ($tags as $group)
<h5>{{ $group['name'] }}</h5>
@foreach ($tags as $tag_group_id => $group)
@component('components.layout.box-collapse', [
'title' => $group['name'],
'id' => 'tag_group_' . $tag_group_id,
])
@foreach ($group['tags'] as $tag)
<div>
@include('components.form.checkbox', [
@@ -18,6 +21,7 @@
{{ $tag['name'] }} ({{ $tag['count'] }})
</div>
@endforeach
@endcomponent
@endforeach
</section>

View File

@@ -4,7 +4,7 @@
])
@section('content')
{!! Form::open(['route' => 'boilerplate.login', 'method' => 'post', 'autocomplete'=> 'off']) !!}
{!! Form::open(['route' => 'Shop.login.post', 'method' => 'post', 'autocomplete'=> 'off']) !!}
<div class="row" style="width: 380px;">
<div class="col-12 text-center">
<img src="/img/logo.png" height="128">
@@ -14,33 +14,38 @@
<div class="form-group has-feedback">
<div class="form-group {{ $errors->has('email') ? 'has-error' : '' }}">
{{ Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.email'), 'required', 'autofocus']) }}
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
<span class="fa fa-email form-control-feedback"></span>
{!! $errors->first('email','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
<div class="form-group has-feedback">
<div class="form-group {{ $errors->has('password') ? 'has-error' : '' }}">
{{ Form::password('password', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password')]) }}
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
<span class="fa fa-lock form-control-feedback"></span>
{!! $errors->first('password','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
<div class="row">
<div class="col-12 col-lg-8">
<div class="col-12 col-lg-6 mbs">
<button type="submit" class="btn btn-primary btn-block btn-flat">{{ __('Se connecter') }}</button>
</div>
<div class="col-12 col-lg-6">
<a href="{{ route('Shop.password.reset') }}">{{ __('Mot de passe oublié ?') }}</a><br>
<!--
<div class="checkbox icheck">
<label style="padding-left: 0">
<input type="checkbox" name="remember" class="icheck" {{ old('remember') ? 'checked' : '' }}>
{{ __('boilerplate::auth.login.rememberme') }}
</label>
</div>
</div>
<div class="col-12 col-lg-4 mbs">
<button type="submit" class="btn btn-primary btn-block btn-flat">{{ __('boilerplate::auth.login.signin') }}</button>
-->
</div>
</div>
{!! Form::close() !!}
<a href="{{ route('boilerplate.password.request') }}">{{ __('boilerplate::auth.login.forgotpassword') }}</a><br>
@if(config('boilerplate.auth.register'))
<a href="{{ route('boilerplate.register') }}" class="text-center">{{ __('boilerplate::auth.login.register') }}</a>
@endif
<p class="mt-3">
Vous n'avez pas encore de compte ?
<a href="{{ route('Shop.register') }}" class="text-center">{{ __('Inscrivez-vous') }}</a>
</p>
@endsection

View File

@@ -3,7 +3,7 @@
@section('content')
@component('boilerplate::auth.loginbox')
<p class="login-box-msg">{{ __('boilerplate::auth.register.intro') }}</p>
{!! Form::open(['route' => 'boilerplate.register', 'method' => 'post', 'autocomplete'=> 'off']) !!}
{!! Form::open(['route' => 'Shop.register.post', 'method' => 'post', 'autocomplete'=> 'off']) !!}
<div class="form-group {{ $errors->has('first_name') ? 'has-error' : '' }}">
{{ Form::text('first_name', old('first_name'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.first_name'), 'required', 'autofocus']) }}
{!! $errors->first('first_name','<p class="text-danger"><strong>:message</strong></p>') !!}
@@ -32,8 +32,5 @@
</div>
</div>
{!! Form::close() !!}
@if(!$firstUser)
<a href="{{ route('boilerplate.login') }}">{{ __('boilerplate::auth.register.login_link') }}</a><br>
@endif
@endcomponent
@endsection

View File

@@ -31,7 +31,7 @@
slidesToScroll: 1,
dots: true,
autoplay: true,
autoplaySpeed: 2000
autoplaySpeed: 5000
});
});
</script>

View File

@@ -28,7 +28,7 @@
@include("Shop.layout.partials.header")
<div class="content-wrapper">
<section class="content">
<div class="container-fluid">
<div class="container-fluid p-0">
@yield('content')
</div>
</section>

View File

@@ -1,19 +1,19 @@
<div class="row">
<div class="col-6">
<button type="button" class="btn btn-success">
<button type="button" class="btn btn-success shadow">
<i class="fa fa-3x fa-seedling float-left"></i>
Ajouter au panier la liste des <strong>semences</strong>
Ajouter au panier<br>la liste des <strong>semences</strong>
</button>
</div>
<div class="col-6">
<button type="button" class="btn btn-warning">
<button type="button" class="btn btn-warning shadow">
<i class="fab fa-3x fa-pagelines float-left"></i>
Ajouter au panier la liste des <strong>plants</strong>
Ajouter au panier<br>la liste des <strong>plants</strong>
</button>
</div>
</div>
<div class="row">
<div class="row pt-3">
<div class="col-12">
Il y a {{ $articles ? count($articles) : 0 }} article(s) dans la liste
</div>
@@ -25,21 +25,23 @@
@include('components.form.button', ['id' => 'by_rows', 'icon' => 'fa-list', 'class' => 'btn-success'])
</div>
<div class="col-6">
<form name="product_sorting">
<!--
<form name="product_sorting" class="mt-0">
<label>Trier par</label>
@include('components.form.select', ['name' => 'sorting', 'list' => ['Pertinence']])
</form>
-->
</div>
</div>
@push('js')
<script>
$('#by_rows').click(function() {
var url = "{{ url()->current() }}" + '?by_rows=1';
var url = "{{ route('Shop.Categories.show', ['id' => $category['id'], 'by_rows' => true]) }}";
window.location = url;
})
$('#by_cards').click(function() {
var url = "{{ url()->current() }}";
var url = "{{ route('Shop.Categories.show', ['id' => $category['id']]) }}";
window.location = url;
})
</script>

View File

@@ -7,7 +7,7 @@
<ul class="dropdown-menu" aria-labelledby="dLabel">
<li>
<a href="fr/mon-compte" title="Identifiez-vous" rel="nofollow">
<a href="{{ route('Shop.login') }}" title="Identifiez-vous" rel="nofollow">
<span>Connexion</span>
</a>
</li>

View File

@@ -1,7 +1,7 @@
<div class="card {{ $class ?? '' }}">
<div class="card-header p-0">
<div class="row">
<div class="col-6">
<div class="{{ ($collapse_right ?? false) ? 'col-6' : 'col-12' }}">
<button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#{{ $id }}" aria-expanded="false" aria-controls="{{ $id }}">
<i class="fa {{ ($collapsed ?? true) ? 'fa-chevron-right' : 'fa-chevron-down' }}"></i>
</button>
@@ -14,9 +14,11 @@
<span class="check ml-5 error"></span>
</div>
@if ($collapse_right ?? false)
<div class="col-6">
{!! $collapse_right ?? '' !!}
</div>
@endif
</div>
</div>
<div id="{{ $id }}" class="card-body collapse {{ ($collapsed ?? true) ? '' : 'show' }} {{ $class_body ?? '' }}">

View File

@@ -2,7 +2,7 @@
Route::prefix('Categories')->name('Categories.')->group(function () {
Route::get('', 'CategoryController@index')->name('index');
Route::get('show/{id}', 'CategoryController@show')->name('show');
Route::get('show/{id}/{by_rows?}', 'CategoryController@show')->name('show');
Route::get('getTree', 'CategoryController@getTree')->name('getTree');
});

View File

@@ -7,6 +7,8 @@ Route::prefix('Shop')->namespace('Shop')->name('Shop.')->group(function () {
Route::get('invite/{token?}/{event_id?}', 'Auth\LoginController@invite')->name('invite');
Route::get('password/reset/{token?}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.update');
Route::get('register', 'Auth\RegisterController@showRegistrationForm')->name('register');
Route::post('register', 'Auth\RegisterController@register')->name('register.post');
});
Route::prefix('Shop')->namespace('Shop')->name('Shop.')->group(function () {