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:
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<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>
|
||||||
@@ -27,9 +27,11 @@
|
|||||||
<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)
|
||||||
|
@foreach ($item ?? null as $tag)
|
||||||
<span class="btn btn-xs btn-success pb-2">{{ $tag }}</span>
|
<span class="btn btn-xs btn-success pb-2">{{ $tag }}</span>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -48,7 +50,12 @@
|
|||||||
|
|
||||||
<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', [
|
||||||
|
'model' => 'Shop.Article',
|
||||||
|
'model_id' => $article['id'] ?? false,
|
||||||
|
'comments' => $article['comments'],
|
||||||
|
'with_add' => false,
|
||||||
|
])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -2,14 +2,16 @@
|
|||||||
@push('scripts')
|
@push('scripts')
|
||||||
<script>
|
<script>
|
||||||
function initSaveForm(form, sel) {
|
function initSaveForm(form, sel) {
|
||||||
|
initValidator();
|
||||||
var form = (typeof(form) == 'undefined') ? '#form' : form;
|
var form = (typeof(form) == 'undefined') ? '#form' : form;
|
||||||
var selector = (typeof(sel) == 'undefined') ? '.save' : sel;
|
var selector = (typeof(sel) == 'undefined') ? '.save' : sel;
|
||||||
$(selector).off().click(function(e) {
|
$(selector).off().click(function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var $button = $(this).find('i .fa-save').first();
|
if ($(form).valid()) {
|
||||||
$button.removeClass('fa-save');
|
$(this).prop("disabled", true);
|
||||||
$button.addClass('fa-spinner fa-spin');
|
$(this).html($(this).data('loading-text'));
|
||||||
$(form).submit();
|
$(form).submit();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
@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')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user