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

@@ -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)
<span style="font-size: 1.4em; font-weight: bold;">{{ $article['semences']['price'] ?? null }}</span> <br>
{{ $article['semences']['variation'] }}
<div>
Quantité :
<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é : 1
</div>
@include('components.form.button', [
'class' => 'btn-green-dark basket semences mb-3 mt-2 shadow',
'txt' => 'Ajouter au panier',
])
</div>
@include('components.form.button', [
'class' => 'btn-success basket semences',
'txt' => 'Ajouter au panier',
])
@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>
{{ $article['plants']['variation'] }}
<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,22 +2,24 @@
<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">
@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']]) }}">
<img data-lazy="{{ App\Repositories\Shop\Articles::getPreviewSrc($article['image'] ?? false) }}" class="d-block w-100" alt="{{ $name }}"/>
{{ $name }}
</a>
</div>
@endforeach
<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']]) }}">
<img data-lazy="{{ App\Repositories\Shop\Articles::getPreviewSrc($article['image'] ?? false) }}" class="d-block w-100" alt="{{ $name }}"/>
{{ $name }}
</a>
</div>
@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,17 +7,21 @@
</div>
</div>
@foreach ($tags as $group)
<h5>{{ $group['name'] }}</h5>
@foreach ($group['tags'] as $tag)
<div>
@include('components.form.checkbox', [
'name' => 'tag[]',
'val' => $tag['id'],
])
{{ $tag['name'] }} ({{ $tag['count'] }})
</div>
@endforeach
@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', [
'name' => 'tag[]',
'val' => $tag['id'],
])
{{ $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
{!! Form::close() !!}
<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>
<div class="col-6">
{!! $collapse_right ?? '' !!}
</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 ?? '' }}">