fixes
This commit is contained in:
@@ -24,11 +24,13 @@ class RegisterController extends Controller
|
|||||||
$user = $this->create($request->all());
|
$user = $this->create($request->all());
|
||||||
|
|
||||||
$this->guard()->login($user);
|
$this->guard()->login($user);
|
||||||
|
/*
|
||||||
$response = $this->registered($request, $user);
|
$response = $this->registered($request, $user);
|
||||||
|
|
||||||
if ($response) {
|
if ($response) {
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
return $request->wantsJson()
|
return $request->wantsJson()
|
||||||
? new JsonResponse([], 201)
|
? new JsonResponse([], 201)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class StoreArticlePost extends FormRequest
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'ref' => 'required|unique:shop_articles,ref,'.$this->id,
|
'ref' => 'required|unique:shop_articles',
|
||||||
'product_type' => 'required',
|
'product_type' => 'required',
|
||||||
'product_id' => 'required',
|
'product_id' => 'required',
|
||||||
'article_nature_id' => 'required',
|
'article_nature_id' => 'required',
|
||||||
|
|||||||
@@ -105,10 +105,10 @@ class Articles
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'App\Models\Botanic\Specie':
|
case 'App\Models\Botanic\Specie':
|
||||||
$data['specie'] = $article->product->description;
|
$data['specie'] = $article->product ? $article->product->description : '';
|
||||||
break;
|
break;
|
||||||
case 'App\Models\Shop\Merchandise':
|
case 'App\Models\Shop\Merchandise':
|
||||||
$data['merchandise'] = $article->product->description;
|
$data['merchandise'] = $article->product ? $article->product->description : '';
|
||||||
$data['producer'] = $article->product->producer->description;
|
$data['producer'] = $article->product->producer->description;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -1,60 +1,67 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
{{ Form::label('ref', 'Référence') }}<br>
|
{{ Form::label('ref', 'Référence') }}<br>
|
||||||
{{ $article['ref'] ?? null }}
|
{{ $article['ref'] ?? null }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
{{ Form::label('name', 'Nom') }}<br>
|
{{ Form::label('name', 'Nom') }}<br>
|
||||||
{{ $article['name'] ?? null }}
|
{{ $article['name'] ?? null }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3" class="text-right">
|
<div class="col-3" class="text-right">
|
||||||
<img src="{{ $article['image'] }}" class="img-fluid">
|
<img src="{{ $article['image'] }}" class="img-fluid">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
{{ Form::label('categories', __('shop.shelves.title')) }}<br>
|
{{ Form::label('categories', __('shop.shelves.title')) }}<br>
|
||||||
@foreach (($article['categories'] ?? null) as $category)
|
@foreach ($article['categories'] ?? null as $category)
|
||||||
<span class="btn btn-xs btn-success pb-2">{{ $category }}</span>
|
<span class="btn btn-xs btn-success pb-2">{{ $category }}</span>
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
{{ Form::label('tags', 'Tags') }}<br>
|
{{ Form::label('tags', 'Tags') }}<br>
|
||||||
@foreach (($article['tags'] ?? null) as $tag)
|
@foreach ($article['tags'] ?? [] as $tagGroup => $item)
|
||||||
<span class="btn btn-xs btn-success pb-2">{{ $tag }}</span>
|
@foreach ($item ?? null as $tag)
|
||||||
@endforeach
|
<span class="btn btn-xs btn-success pb-2">{{ $tag }}</span>
|
||||||
</div>
|
@endforeach
|
||||||
</div>
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
@include('Admin.Shop.Articles.partials.product.description')
|
@include('Admin.Shop.Articles.partials.product.description')
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
{{ Form::label('description', 'Description') }}
|
{{ Form::label('description', 'Description') }}
|
||||||
{!! $article['description']['description'] ?? null !!}
|
{!! $article['description']['description'] ?? null !!}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
@include('Admin.Core.Comments.partials.comments', ['model' => 'Shop.Article', 'model_id' => $article['id'] ?? false, 'comments' => $article['comments'], 'with_add' => false])
|
@include('Admin.Core.Comments.partials.comments', [
|
||||||
</div>
|
'model' => 'Shop.Article',
|
||||||
</div>
|
'model_id' => $article['id'] ?? false,
|
||||||
|
'comments' => $article['comments'],
|
||||||
|
'with_add' => false,
|
||||||
|
])
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
initChevron();
|
initChevron();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,18 +1,20 @@
|
|||||||
@once
|
@once
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
<script>
|
<script>
|
||||||
function initSaveForm(form, sel) {
|
function initSaveForm(form, sel) {
|
||||||
var form = (typeof(form) == 'undefined') ? '#form' : form;
|
initValidator();
|
||||||
var selector = (typeof(sel) == 'undefined') ? '.save' : sel;
|
var form = (typeof(form) == 'undefined') ? '#form' : form;
|
||||||
$(selector).off().click(function(e) {
|
var selector = (typeof(sel) == 'undefined') ? '.save' : sel;
|
||||||
e.preventDefault();
|
$(selector).off().click(function(e) {
|
||||||
var $button = $(this).find('i .fa-save').first();
|
e.preventDefault();
|
||||||
$button.removeClass('fa-save');
|
if ($(form).valid()) {
|
||||||
$button.addClass('fa-spinner fa-spin');
|
$(this).prop("disabled", true);
|
||||||
$(form).submit();
|
$(this).html($(this).data('loading-text'));
|
||||||
});
|
$(form).submit();
|
||||||
}
|
}
|
||||||
</script>
|
});
|
||||||
@endpush
|
}
|
||||||
@php(define('LOAD_SAVE', true))
|
</script>
|
||||||
@endonce
|
@endpush
|
||||||
|
@php(define('LOAD_SAVE', true))
|
||||||
|
@endonce
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
@if(!defined('LOAD_CHEVRON'))
|
@if (!defined('LOAD_CHEVRON'))
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
@component('boilerplate::minify')
|
@component('boilerplate::minify')
|
||||||
<script>
|
<script>
|
||||||
function initChevron(sel) {
|
function initChevron(sel) {
|
||||||
var selector = (typeof(sel) == 'undefined') ? '.card-header .btn-link' : sel;
|
var selector = (typeof(sel) == 'undefined') ? '.card-header .btn-link' : sel;
|
||||||
$(selector).click(function() {
|
$(selector).off().click(function() {
|
||||||
$(this).find('i').toggleClass('fa-chevron-right fa-chevron-down')
|
$(this).find('i').toggleClass('fa-chevron-right fa-chevron-down')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@endcomponent
|
@endcomponent
|
||||||
@endpush
|
@endpush
|
||||||
@php(define('LOAD_CHEVRON', true))
|
@php(define('LOAD_CHEVRON', true))
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
Reference in New Issue
Block a user