This commit is contained in:
ludo
2024-03-03 14:44:35 +01:00
parent cc411cba68
commit 139aeb8074
6 changed files with 85 additions and 74 deletions

View File

@@ -24,11 +24,13 @@ class RegisterController extends Controller
$user = $this->create($request->all());
$this->guard()->login($user);
/*
$response = $this->registered($request, $user);
if ($response) {
return $response;
}
*/
return $request->wantsJson()
? new JsonResponse([], 201)

View File

@@ -14,7 +14,7 @@ class StoreArticlePost extends FormRequest
public function rules()
{
return [
'ref' => 'required|unique:shop_articles,ref,'.$this->id,
'ref' => 'required|unique:shop_articles',
'product_type' => 'required',
'product_id' => 'required',
'article_nature_id' => 'required',

View File

@@ -105,10 +105,10 @@ class Articles
}
break;
case 'App\Models\Botanic\Specie':
$data['specie'] = $article->product->description;
$data['specie'] = $article->product ? $article->product->description : '';
break;
case 'App\Models\Shop\Merchandise':
$data['merchandise'] = $article->product->description;
$data['merchandise'] = $article->product ? $article->product->description : '';
$data['producer'] = $article->product->producer->description;
break;
default:

View File

@@ -18,7 +18,7 @@
<div class="row mb-3">
<div class="col-12">
{{ 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>
@endforeach
</div>
@@ -27,9 +27,11 @@
<div class="row mb-3">
<div class="col-12">
{{ 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>
@endforeach
@endforeach
</div>
</div>
@@ -48,7 +50,12 @@
<div class="row mb-3">
<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>

View File

@@ -2,14 +2,16 @@
@push('scripts')
<script>
function initSaveForm(form, sel) {
initValidator();
var form = (typeof(form) == 'undefined') ? '#form' : form;
var selector = (typeof(sel) == 'undefined') ? '.save' : sel;
$(selector).off().click(function(e) {
e.preventDefault();
var $button = $(this).find('i .fa-save').first();
$button.removeClass('fa-save');
$button.addClass('fa-spinner fa-spin');
if ($(form).valid()) {
$(this).prop("disabled", true);
$(this).html($(this).data('loading-text'));
$(form).submit();
}
});
}
</script>

View File

@@ -1,10 +1,10 @@
@if(!defined('LOAD_CHEVRON'))
@if (!defined('LOAD_CHEVRON'))
@push('scripts')
@component('boilerplate::minify')
<script>
function initChevron(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')
});
}