comments
This commit is contained in:
35
app/Datatables/Admin/Core/CommentsDataTable.php
Normal file
35
app/Datatables/Admin/Core/CommentsDataTable.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Datatables\Admin\Core;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
|
||||
use App\Models\Admin\Core\Comment;
|
||||
use App\Repositories\Core\Comments;
|
||||
|
||||
class CommentsDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'comments';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->url = route('Admin.Core.Comments.index');
|
||||
}
|
||||
|
||||
public function query(Comment $model)
|
||||
{
|
||||
$model = $model::with(['user'])->select('*');
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('updated_at')->title(__('date'))->width('80')->class('text-center')->searchable(false),
|
||||
Column::make('user.name')->title(__('name'))->searchable(false),
|
||||
Column::make('comment')->title(__('comments'))->searchable(false),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -10,12 +10,14 @@ use Yajra\DataTables\Services\DataTable;
|
||||
|
||||
class ParentDataTable extends DataTable
|
||||
{
|
||||
public $rowReorder = true;
|
||||
public $rowReorderSelector; // ['selector' => 'tr']
|
||||
public $autoWidth = false;
|
||||
public $colReorder = false;
|
||||
public $fixedColumns = false;
|
||||
public $fixedHeader = false;
|
||||
public $rowReorder = false;
|
||||
public $rowReorderSelector; // ['selector' => 'tr']
|
||||
public $scrollCollapse = false;
|
||||
public $scrollX = false;
|
||||
public $scrollCollapse = true;
|
||||
public $sortedColumn = 0;
|
||||
public $sortedOrder = 'asc';
|
||||
public $stateSave = false;
|
||||
@@ -50,15 +52,27 @@ class ParentDataTable extends DataTable
|
||||
public function getHtmlButtons()
|
||||
{
|
||||
$buttons = '';
|
||||
|
||||
// $buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-secondary btn-show mr-2"><i class="fa fa-fw fa-eye"></i></button>';
|
||||
// $buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-primary btn-edit mr-2"><i class="fa fa-fw fa-leaf-alt"></i></button>';
|
||||
$buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-primary btn-edit mr-2"><i class="fa fa-fw fa-pencil-alt"></i></button>';
|
||||
$buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-danger btn-del"><i class="fa fa-fw fa-trash"></i></button>';
|
||||
$buttons .= self::getButtonEdit();
|
||||
$buttons .= self::getButtonDel();
|
||||
return $buttons;
|
||||
// return view('components.datatables.buttons.row_action');
|
||||
}
|
||||
|
||||
public function getButtonEdit()
|
||||
{
|
||||
return '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-primary btn-edit mr-2"><i class="fa fa-fw fa-pencil-alt"></i></button>';
|
||||
}
|
||||
|
||||
public function getButtonShow()
|
||||
{
|
||||
return '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-secondary btn-show mr-2"><i class="fa fa-fw fa-eye"></i></button>';
|
||||
}
|
||||
|
||||
public function getButtonDel()
|
||||
{
|
||||
return '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-danger btn-del"><i class="fa fa-fw fa-trash"></i></button>';
|
||||
}
|
||||
|
||||
public function makeColumnButtons()
|
||||
{
|
||||
return Column::computed('action')
|
||||
@@ -66,7 +80,7 @@ class ParentDataTable extends DataTable
|
||||
->exportable(false)
|
||||
->printable(false)
|
||||
->searchable(false)
|
||||
->width("74")
|
||||
->width(74)
|
||||
->addClass('text-center text-nowrap');
|
||||
}
|
||||
|
||||
@@ -109,12 +123,10 @@ class ParentDataTable extends DataTable
|
||||
->setTableId($table_id)
|
||||
->parameters($this->getParameters())
|
||||
->columns($this->getColumns())
|
||||
->ajax(
|
||||
[
|
||||
->ajax([
|
||||
'data' => 'function(d) { d.filters = $("' . $selector . '").serializeJSON(); }',
|
||||
'url' => isset($this->url) ? $this->url : ''
|
||||
]
|
||||
)
|
||||
])
|
||||
->dom($this->getDom())
|
||||
->orderBy($this->sortedColumn, $this->sortedOrder)
|
||||
->buttons($this->getButtons());
|
||||
@@ -123,7 +135,7 @@ class ParentDataTable extends DataTable
|
||||
public function getButtons()
|
||||
{
|
||||
return [
|
||||
Button::make('export'),
|
||||
// Button::make('export'),
|
||||
Button::make('print'),
|
||||
Button::make('colvis'),
|
||||
Button::make('columnsToggle')
|
||||
@@ -133,13 +145,14 @@ class ParentDataTable extends DataTable
|
||||
public function getParameters()
|
||||
{
|
||||
$data = [
|
||||
'pageLength' => 5,
|
||||
'scrollX' => $this->scrollX,
|
||||
'scrollCollapse' => $this->scrollCollapse,
|
||||
'searchDelay' => 500,
|
||||
'autoWidth' => $this->autoWidth,
|
||||
'colReorder' => $this->colReorder,
|
||||
'fixedColumns' => $this->fixedColumns,
|
||||
// 'autoWidth' => false,
|
||||
'fixedHeader' => $this->fixedHeader,
|
||||
'pageLength' => 5,
|
||||
'searchDelay' => 500,
|
||||
'scrollX' => $this->scrollX,
|
||||
'scrollCollapse' => $this->scrollCollapse,
|
||||
'stateSave' => $this->stateSave
|
||||
];
|
||||
if ($this->rowReorder) {
|
||||
|
||||
46
app/Http/Controllers/Admin/Core/CommentController.php
Normal file
46
app/Http/Controllers/Admin/Core/CommentController.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Core;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Repositories\Core\Comments;
|
||||
use App\Datatables\Admin\Core\CommentsDataTable;
|
||||
|
||||
class CommentController extends Controller
|
||||
{
|
||||
public function index(CommentsDataTable $dataTable, $model, $model_id)
|
||||
{
|
||||
$data['model'] = $model;
|
||||
$data['model_id'] = $model_id;
|
||||
return $dataTable->render('Admin.Core.Comment.index', $data);
|
||||
}
|
||||
|
||||
public function create($model, $model_id)
|
||||
{
|
||||
$data['comment']['commentable_type'] = $model;
|
||||
$data['comment']['commentable_id'] = $model_id;
|
||||
return view('Admin.Core.Comments.partials.modal', $data);
|
||||
}
|
||||
|
||||
public function edit(Request $request, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $request->input('id');
|
||||
$data = Comments::get($id);
|
||||
return view('Admin.Core.Comments.partials.modal', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
Comments::store($data);
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
|
||||
public function destroy(Request $request, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $request->input('id');
|
||||
Comments::destroy($id);
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,7 @@ class ArticleController extends Controller
|
||||
public function create()
|
||||
{
|
||||
$data = Articles::getMeta();
|
||||
// $data['comment']['']
|
||||
return view('Admin.Shop.Articles.create', $data);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ class OfferController extends Controller
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
dump($request->all());
|
||||
exit;
|
||||
$ret = Offers::store($request->all());
|
||||
return redirect()->route('Admin.Shop.Offers.index');
|
||||
}
|
||||
|
||||
@@ -2,15 +2,22 @@
|
||||
|
||||
namespace App\Models\Core;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
use Venturecraft\Revisionable\RevisionableTrait;
|
||||
use Wildside\Userstamps\Userstamps;
|
||||
use App\Repositories\Core\DateTime;
|
||||
|
||||
use BeyondCode\Comments\Comment as parentComment;
|
||||
|
||||
class Comment extends parentComment
|
||||
class Comment extends Model
|
||||
{
|
||||
use SoftDeletes, Userstamps;
|
||||
protected $guarded = [];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(\App\Models\Core\Auth\User::class);
|
||||
}
|
||||
|
||||
public function getUpdatedAtAttribute($value)
|
||||
{
|
||||
return DateTime::DateToLocale($value);
|
||||
}
|
||||
}
|
||||
@@ -2,31 +2,83 @@
|
||||
|
||||
namespace App\Repositories\Core;
|
||||
|
||||
use BeyondCode\Comments\Comment;
|
||||
use App\Models\Core\Comment as rawComment;
|
||||
use App\Repositories\Core\Auth\Users;
|
||||
|
||||
use App\Datatables\Admin\Core\CommentsDataTable;
|
||||
|
||||
class Comments
|
||||
{
|
||||
|
||||
public static function get($id)
|
||||
{
|
||||
return rawComment::find($id);
|
||||
}
|
||||
|
||||
public static function getDatatable()
|
||||
{
|
||||
$model = new CommentsDataTable();
|
||||
return $model->html();
|
||||
}
|
||||
|
||||
public static function getCommentsByClass($class, $id)
|
||||
{
|
||||
return self::getByModel(self::getModel($class, $id));
|
||||
}
|
||||
|
||||
public static function getModel($class, $id)
|
||||
{
|
||||
return $$class::find($id);
|
||||
}
|
||||
|
||||
public static function getClass($class)
|
||||
{
|
||||
return 'App\Models\\' . str_replace('.','\\', $class);
|
||||
}
|
||||
|
||||
public static function getByModel($model)
|
||||
{
|
||||
if (!$model) {
|
||||
return false;
|
||||
}
|
||||
return $model->comments;
|
||||
return $model ? $model->comments : false;
|
||||
}
|
||||
|
||||
public static function storeComments($model, $comments)
|
||||
{
|
||||
if ($comments) {
|
||||
foreach ($comments as $comment) {
|
||||
foreach (($comments ?? []) as $comment) {
|
||||
self::storeComment($model, $comment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function storeComment($model, $comment)
|
||||
{
|
||||
return $model->comment($comment);
|
||||
}
|
||||
|
||||
public static function store($data)
|
||||
{
|
||||
$id = $data['id'] ?? false;
|
||||
unset($data['_token']);
|
||||
$data['commentable_type'] = Comments::getClass($data['commentable_type']);
|
||||
$data['commentable_id'] = (int) $data['commentable_id'];
|
||||
return $id ? self::update($data, $id) : self::create($data);
|
||||
}
|
||||
|
||||
public static function create($data)
|
||||
{
|
||||
unset($data['id']);
|
||||
$data['is_approved'] = true;
|
||||
$data['user_id'] = Users::getId();
|
||||
return rawComment::create($data);
|
||||
}
|
||||
|
||||
public static function update($data, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $data['id'];
|
||||
$model = self::get($id);
|
||||
$model->update($data);
|
||||
return $model;
|
||||
}
|
||||
|
||||
public static function deleteComments($model)
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -6,6 +6,7 @@ use Illuminate\Support\Str;
|
||||
|
||||
use App\Repositories\Core\Tag;
|
||||
use App\Repositories\Core\Media;
|
||||
use App\Repositories\Core\Comments;
|
||||
use App\Repositories\Botanic\Species;
|
||||
use App\Repositories\Botanic\Varieties;
|
||||
use App\Models\Shop\Article;
|
||||
@@ -37,6 +38,10 @@ class Articles
|
||||
$data['article']['categories'] = self::getCategoriesByArticle($article);
|
||||
$data['article']['tags'] = self::getTagsByArticle($article);
|
||||
// $data['article']['prices'] = self::getPricesByArticle($article);
|
||||
|
||||
// $data['datatables']['comments'] = Comments::getDatatable();
|
||||
$data['article']['comments'] = $article->comments;
|
||||
|
||||
self::getMeta($data);
|
||||
return $data;
|
||||
}
|
||||
|
||||
53
app/Repositories/Shop/Offers.php
Normal file
53
app/Repositories/Shop/Offers.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\Offer;
|
||||
|
||||
class Offers
|
||||
{
|
||||
public static function getOptions()
|
||||
{
|
||||
return Offer::orderBy('value', 'asc')->get()->pluck('value', 'id')->toArray();
|
||||
}
|
||||
|
||||
public static function getOptionsByPackage($package_id)
|
||||
{
|
||||
return Offer::byPackage($package_id)->orderBy('value', 'asc')->get()->pluck('value', 'id')->toArray();
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
return Offer::orderBy('value', 'asc')->get();
|
||||
}
|
||||
|
||||
public static function get($id)
|
||||
{
|
||||
return Offer::findOrFail($id);
|
||||
}
|
||||
|
||||
public static function store($data)
|
||||
{
|
||||
$id = isset($data['id']) ? $data['id'] : false;
|
||||
$item = $id ? self::update($data, $id) : self::create($data);
|
||||
return $item->id;
|
||||
}
|
||||
|
||||
public static function create($data)
|
||||
{
|
||||
return Offer::create($data);
|
||||
}
|
||||
|
||||
public static function update($data, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $data['id'];
|
||||
$item = self::get($id);
|
||||
$item->update($data);
|
||||
return $item;
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
{
|
||||
return Offer::destroy($id);
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ class Tariffs
|
||||
{
|
||||
public static function autocomplete($str)
|
||||
{
|
||||
$data = Tariff::where('name', 'LIKE', "%${str}%")->orderBy('name')->limit(30)->get()->pluck('name', 'id');
|
||||
$data = Tariff::where('name', 'LIKE', "%${str}%")->orWhere('ref', 'LIKE', "${str}%")->orWhere('code', 'LIKE', "${str}%")->orderBy('name')->limit(30)->get()->pluck('name', 'id');
|
||||
$export = [];
|
||||
foreach ($data as $key => $name) {
|
||||
$export[] = ['value' => $key, 'text' => $name];
|
||||
|
||||
58
resources/lang/fr.json
Normal file
58
resources/lang/fr.json
Normal file
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"Date": "Date",
|
||||
"The list of logs is empty!": "La liste des logs est vide !",
|
||||
"All": "Tous",
|
||||
"Emergency": "Urgence",
|
||||
"Alert": "Alerte",
|
||||
"Critical": "Critique",
|
||||
"Error": "Erreur",
|
||||
"Warning": "Avertissement",
|
||||
"Notice": "Notice",
|
||||
"Info": "Info",
|
||||
"Debug": "Debogage",
|
||||
"name": "Nom",
|
||||
"gender": "Civilité",
|
||||
"mr": "M.",
|
||||
"mrs": "Mme",
|
||||
"firstname": "Prénom",
|
||||
"lastname": "Nom",
|
||||
"position": "Poste",
|
||||
"department": "Service",
|
||||
"office": "Bureau",
|
||||
"fax": "Fax",
|
||||
"email": "Email",
|
||||
"phone": "Téléphone",
|
||||
"phone_central": "Téléphone Accueil",
|
||||
"mobile": "Mobile",
|
||||
"zipcode": "Code postal",
|
||||
"country": "Pays",
|
||||
"company": "Entreprise",
|
||||
"address": "Adresse",
|
||||
"street": "Rue",
|
||||
"state": "Région",
|
||||
"postal_address": "Adresse postale",
|
||||
"city": "Ville",
|
||||
"copyright": "© JardinEnvie 2021",
|
||||
"records": "enregistrements",
|
||||
"delay": "Délai",
|
||||
"rows_on": "lignes sur",
|
||||
"selection": "Sélection",
|
||||
"others": "Autres",
|
||||
"list": "Liste",
|
||||
"active": "Actif",
|
||||
"yes": "Oui",
|
||||
"no": "Non",
|
||||
"choose_a_file": "Choisissez un fichier",
|
||||
"select_a_value": "Selectionnez une valeur",
|
||||
"members_area": "Espace réservé",
|
||||
"login_to_your_account": "Se connecter à votre compte",
|
||||
"sign_in": "connexion",
|
||||
"password_reset": "Réinitialisation du mot de passe",
|
||||
"login": "Identifiant",
|
||||
"password": "Mot de passe",
|
||||
"updated_at": "Mis à jour",
|
||||
"cancel": "Annuler",
|
||||
"save": "Sauver",
|
||||
"comments": "Notes internes",
|
||||
"comment_add": "Ajout de Note interne"
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@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() {
|
||||
|
||||
10
routes/Admin/Core/Comments.php
Normal file
10
routes/Admin/Core/Comments.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
Route::prefix('Comments')->name('Comments.')->group(function () {
|
||||
Route::get('{model?}/{model_id?}', 'CommentController@index')->name('index');
|
||||
Route::get('create/{model?}/{model_id?}', 'CommentController@create')->name('create');
|
||||
Route::delete('destroy/{id?}', 'CommentController@destroy')->name('destroy');
|
||||
Route::post('store', 'CommentController@store')->name('store');
|
||||
Route::get('edit/{id}', 'CommentController@edit')->name('edit');
|
||||
});
|
||||
|
||||
5
routes/Admin/Core/route.php
Normal file
5
routes/Admin/Core/route.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
Route::prefix('Core')->namespace('Core')->name('Core.')->group(function () {
|
||||
include( __DIR__ . '/Comments.php');
|
||||
});
|
||||
@@ -3,5 +3,6 @@
|
||||
Route::middleware('auth')->prefix('Admin')->namespace('Admin')->name('Admin.')->group(function () {
|
||||
Route::get('', 'HomeController@index')->name('home');
|
||||
include( __DIR__ . '/Botanic/route.php');
|
||||
include( __DIR__ . '/Core/route.php');
|
||||
include( __DIR__ . '/Shop/route.php');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user