comments
This commit is contained in:
@@ -1,11 +1,35 @@
|
||||
@component('components.layout.box-collapse', ['id' => 'comments', 'title' => __('comments')])
|
||||
@if (!empty($comments))
|
||||
@foreach ($comments as $comment)
|
||||
{!! $comment !!}
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<strong>{{ App\Repositories\Core\Auth\Users::getName($comment->user_id) }}</strong>
|
||||
</div>
|
||||
<div class="col-6 text-right"><i>{{ App\Repositories\Core\DateTime::DateToLocale($comment->updated_at) }}</i></div>
|
||||
<div class="col-12">
|
||||
{!! $comment->comment !!}
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
<button type="button" class="btn btn-primary">
|
||||
Ajout note interne
|
||||
|
||||
<button type="button" class="btn btn-xs btn-primary" id="add-comment">
|
||||
{{ __('comment_add') }}
|
||||
<i class="fa fa-plus"></i>
|
||||
</button>
|
||||
@endcomponent
|
||||
@endcomponent
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
function handleAddComment() {
|
||||
$('#add-comment').click(function() {
|
||||
openModal('{{ __('comment_add') }}', '#comment-form', '{{ route('Admin.Core.Comments.create', ['model' => $model, 'model_id' => $model_id]) }}', '{{ route('Admin.Core.Comments.store') }}' );
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
handleAddComment();
|
||||
});
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,7 @@
|
||||
@if ($model['id'] ?? true)
|
||||
@include('components.datatable', ['route' => route('Admin.Core.Comments.index'), 'model' => 'comments', 'with_filters' => false, 'with_print' => false, 'dataTable' => $datatables['comments'], 'create_callback' => 'CommentCreate();', 'edit_callback' => 'CommentEdit(id);', 'delete_callback' => 'CommentRefresh();'])
|
||||
|
||||
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-comments-filters'])
|
||||
@include('Admin.Core.Comments.partials.filters')
|
||||
@endcomponent
|
||||
@endif
|
||||
@@ -0,0 +1,2 @@
|
||||
<form id="comments-filters">
|
||||
</form>
|
||||
34
resources/views/Admin/Core/Comments/partials/modal.blade.php
Normal file
34
resources/views/Admin/Core/Comments/partials/modal.blade.php
Normal file
@@ -0,0 +1,34 @@
|
||||
{{ Form::open(['route' => 'Admin.Core.Comments.store', 'id' => 'comment-form', 'autocomplete' => 'off']) }}
|
||||
|
||||
<input type="hidden" name="id" value="{{ $comment['id'] ?? null }}">
|
||||
<input type="hidden" name="commentable_type" value="{{ $comment['commentable_type'] ?? null }}">
|
||||
<input type="hidden" name="commentable_id" value="{{ $comment['commentable_id'] ?? null }}">
|
||||
|
||||
@if ($comment['id'] ?? null)
|
||||
<div class="row mb-3">
|
||||
<div class="col-8">
|
||||
{{ $comment['user_id'] }}
|
||||
</div>
|
||||
<div class="col-4">
|
||||
{{ $comment['created_at'] }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
{{ Form::label('name', __('commentaire')) }}<br/>
|
||||
@include('components.form.editor', ['name' => 'comment', 'value' => $comment['comment'] ?? null])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
@include('load.form.editor')
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
initEditor();
|
||||
});
|
||||
</script>
|
||||
@@ -9,6 +9,7 @@
|
||||
Caractéristiques
|
||||
</a>
|
||||
</li>
|
||||
<!--
|
||||
<li class="nav-item">
|
||||
<a href="#offers" class="nav-link" data-toggle="tab" aria-expanded="true">
|
||||
{{ __('Shop.offers.title') }}
|
||||
@@ -32,6 +33,7 @@
|
||||
Référencement
|
||||
</a>
|
||||
</li>
|
||||
-->
|
||||
</ul>
|
||||
|
||||
<div class="card-tools">
|
||||
@@ -80,6 +82,7 @@
|
||||
@include('load.form.toggle')
|
||||
@include('load.form.upload.fileinput')
|
||||
@include('load.layout.chevron')
|
||||
@include('load.layout.modal')
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<div class="col-md-4">
|
||||
@include('Admin.Shop.Articles.partials.product.images')
|
||||
@include('components.uploader.widget', ['load_url' => route('Admin.Shop.Articles.getImages', ['id' => $article['id'] ?? false]), 'delete_url' => route('Admin.Shop.Articles.deleteImage'), 'title' => 'Photos', 'name' => 'images' ])
|
||||
@include('Admin.Core.Comments.partials.comments')
|
||||
@include('Admin.Core.Comments.partials.comments', ['model' => 'Shop.Article', 'model_id' => $article['id'] ?? false, 'comments' => $article['comments']])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('offers.title'),
|
||||
'subtitle' => __('offers.create.title'),
|
||||
'breadcrumb' => [__('offers.title'), __('offers.create.title')]
|
||||
'title' => __('Shop.offers.title'),
|
||||
'subtitle' => __('Shop.offers.add'),
|
||||
'breadcrumb' => [__('Shop.offers.title'), __('Shop.offers.add')]
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
@extends('layout.index', [
|
||||
'title' => 'Offre',
|
||||
'subtitle' => 'Edition d\'une offre',
|
||||
'breadcrumb' => ['Offres']
|
||||
'title' => __('Shop.offers.title'),
|
||||
'subtitle' => __('Shop.offers.edit'),
|
||||
'breadcrumb' => [__('Shop.offers.title'), __('Shop.offers.edit')]
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Admin.Shop.Offers.update', 'id' => 'offer-form', 'autocomplete' => 'off']) }}
|
||||
{{ Form::open(['route' => 'Admin.Shop.Offers.store', 'id' => 'offer-form', 'autocomplete' => 'off']) }}
|
||||
<input type="hidden" name="id" value="{{ $id }}">
|
||||
@include('Admin.Shop.Offers.form')
|
||||
</form>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="row">
|
||||
<div class="row mb-3">
|
||||
<div class="col-8">
|
||||
<div class="row mb-3">
|
||||
<div class="col-8">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
|
||||
@if(!defined('LOAD_EDITOR'))
|
||||
@include('load.form.editor.editor')
|
||||
@include('load.form.editor')
|
||||
@push('js')
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
Reference in New Issue
Block a user