add validator, optimizations
This commit is contained in:
@@ -12,7 +12,7 @@ class ArticlesDataTable extends DataTable
|
|||||||
{
|
{
|
||||||
public $model_name = 'articles';
|
public $model_name = 'articles';
|
||||||
|
|
||||||
public $sortedColumn = 2;
|
public $sortedColumn = 3;
|
||||||
|
|
||||||
public function query(Article $model)
|
public function query(Article $model)
|
||||||
{
|
{
|
||||||
@@ -99,15 +99,16 @@ class ArticlesDataTable extends DataTable
|
|||||||
return [
|
return [
|
||||||
Column::make('visible')->title('Visible')->searchable(false)->width(50),
|
Column::make('visible')->title('Visible')->searchable(false)->width(50),
|
||||||
Column::make('homepage')->title('Accueil')->searchable(false)->width(50),
|
Column::make('homepage')->title('Accueil')->searchable(false)->width(50),
|
||||||
|
Column::make('ref')->title('Ref'),
|
||||||
Column::make('article_nature.name')->title('Nature'),
|
Column::make('article_nature.name')->title('Nature'),
|
||||||
Column::make('thumb')->title('')->searchable(false)->orderable(false)->width(40)->class('text-center'),
|
Column::make('thumb')->title('')->searchable(false)->orderable(false)->width(40)->class('text-center'),
|
||||||
Column::make('name')->title('Nom'),
|
Column::make('name')->title('Nom'),
|
||||||
Column::make('tags2')->title('Tags')->searchable(false)->orderable(false),
|
// Column::make('tags2')->title('Tags')->searchable(false)->orderable(false),
|
||||||
Column::make('tags_count')->title('#Tag')->class('text-right')->searchable(false)->width(40),
|
// Column::make('tags_count')->title('#Tag')->class('text-right')->searchable(false)->width(40),
|
||||||
Column::make('categories_count')->title('#Ray')->class('text-right')->searchable(false)->width(40),
|
Column::make('categories_count')->title('#Ray')->class('text-right')->searchable(false)->width(40),
|
||||||
Column::make('offers_count')->title('#Ofr')->class('text-right')->searchable(false)->width(40),
|
Column::make('offers_count')->title('#Ofr')->class('text-right')->searchable(false)->width(40),
|
||||||
Column::make('images_count')->title('#Pho')->class('text-right')->searchable(false)->width(40),
|
// Column::make('images_count')->title('#Pho')->class('text-right')->searchable(false)->width(40),
|
||||||
Column::make('images_count2')->title('#PhoH')->class('text-right')->searchable(false)->orderable(false)->width(40),
|
// Column::make('images_count2')->title('#PhoH')->class('text-right')->searchable(false)->orderable(false)->width(40),
|
||||||
$this->makeColumnButtons(),
|
$this->makeColumnButtons(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Http\Controllers\Admin\Shop;
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
use App\Datatables\Admin\Shop\ArticlesDataTable;
|
use App\Datatables\Admin\Shop\ArticlesDataTable;
|
||||||
|
use App\Http\Requests\Admin\Shop\StoreArticlePost;
|
||||||
use App\Repositories\Shop\ArticleNatures;
|
use App\Repositories\Shop\ArticleNatures;
|
||||||
use App\Repositories\Shop\Articles;
|
use App\Repositories\Shop\Articles;
|
||||||
use App\Repositories\Shop\Categories;
|
use App\Repositories\Shop\Categories;
|
||||||
@@ -20,9 +21,11 @@ class ArticleController extends Controller
|
|||||||
|
|
||||||
public function index(ArticlesDataTable $dataTable)
|
public function index(ArticlesDataTable $dataTable)
|
||||||
{
|
{
|
||||||
$data['article_natures'] = ArticleNatures::getOptions();
|
$data = [
|
||||||
$data['categories'] = Categories::getOptions();
|
'article_natures' => ArticleNatures::getOptions(),
|
||||||
$data['tags'] = Tags::getOptionsFullName();
|
'categories' => Categories::getOptions(),
|
||||||
|
'tags' => Tags::getOptionsFullName(),
|
||||||
|
];
|
||||||
|
|
||||||
return $dataTable->render('Admin.Shop.Articles.list', $data);
|
return $dataTable->render('Admin.Shop.Articles.list', $data);
|
||||||
}
|
}
|
||||||
@@ -34,9 +37,12 @@ class ArticleController extends Controller
|
|||||||
return view('Admin.Shop.Articles.create', $data);
|
return view('Admin.Shop.Articles.create', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store(Request $request)
|
public function store(StoreArticlePost $request)
|
||||||
{
|
{
|
||||||
$data = $request->all();
|
$data = $request->all();
|
||||||
|
$data['visible'] = $data['visible'] ?? false;
|
||||||
|
$data['homepage'] = $data['homepage'] ?? false;
|
||||||
|
|
||||||
Articles::storeFull($data);
|
Articles::storeFull($data);
|
||||||
|
|
||||||
return redirect()->route('Admin.Shop.Articles.index');
|
return redirect()->route('Admin.Shop.Articles.index');
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Admin\Shop;
|
|||||||
|
|
||||||
use App\Datatables\Admin\Shop\OffersDataTable;
|
use App\Datatables\Admin\Shop\OffersDataTable;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Http\Requests\Admin\Shop\StoreOfferPost;
|
||||||
use App\Repositories\Shop\ArticleNatures;
|
use App\Repositories\Shop\ArticleNatures;
|
||||||
use App\Repositories\Shop\Articles;
|
use App\Repositories\Shop\Articles;
|
||||||
use App\Repositories\Shop\Offers;
|
use App\Repositories\Shop\Offers;
|
||||||
@@ -16,32 +17,30 @@ class OfferController extends Controller
|
|||||||
{
|
{
|
||||||
public function index(OffersDataTable $dataTable)
|
public function index(OffersDataTable $dataTable)
|
||||||
{
|
{
|
||||||
$data['article_natures'] = ArticleNatures::getOptions();
|
$data = [
|
||||||
$data['packages'] = Packages::getOptions();
|
'article_natures' => ArticleNatures::getOptions(),
|
||||||
|
'packages' => Packages::getOptions(),
|
||||||
|
];
|
||||||
|
|
||||||
return $dataTable->render('Admin.Shop.Offers.list', $data ?? []);
|
return $dataTable->render('Admin.Shop.Offers.list', $data ?? []);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
$data['articles'] = Articles::getOptionsWithNature();
|
$data = Offers::init();
|
||||||
$data['tariffs'] = Tariffs::getOptions();
|
|
||||||
$data['variations'] = Variations::getOptions();
|
|
||||||
|
|
||||||
return view('Admin.Shop.Offers.create', $data);
|
return view('Admin.Shop.Offers.create', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
$data['offer'] = Offers::get($id)->toArray();
|
$data = Offers::init();
|
||||||
$data['articles'] = Articles::getOptionsWithNature();
|
$data['offer'] = Offers::getArray($id);
|
||||||
$data['tariffs'] = Tariffs::getOptions();
|
|
||||||
$data['variations'] = Variations::getOptions();
|
|
||||||
|
|
||||||
return view('Admin.Shop.Offers.edit', $data);
|
return view('Admin.Shop.Offers.edit', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store(Request $request)
|
public function store(StoreOfferPost $request)
|
||||||
{
|
{
|
||||||
$data = $request->all();
|
$data = $request->all();
|
||||||
$ret = Offers::store($data);
|
$ret = Offers::store($data);
|
||||||
@@ -51,7 +50,7 @@ class OfferController extends Controller
|
|||||||
|
|
||||||
public function show($id)
|
public function show($id)
|
||||||
{
|
{
|
||||||
$data['offer'] = Offers::get($id)->toArray();
|
$data['offer'] = Offers::getArray($id);
|
||||||
|
|
||||||
return view('Admin.Shop.Offers.view', $data);
|
return view('Admin.Shop.Offers.view', $data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,10 +14,11 @@ class StoreArticlePost extends FormRequest
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'ref' => 'required|unique:articles,ref,'.$this->ref,
|
'ref' => 'required|unique:shop_articles,ref,'.$this->id,
|
||||||
'product_type' => 'required',
|
'product_type' => 'required',
|
||||||
'product_id' => 'required',
|
'product_id' => 'required',
|
||||||
'article_nature_id' => 'required',
|
'article_nature_id' => 'required',
|
||||||
|
'name' => 'required',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
23
app/Http/Requests/Admin/Shop/StoreOfferPost.php
Normal file
23
app/Http/Requests/Admin/Shop/StoreOfferPost.php
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\Admin\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class StoreOfferPost extends FormRequest
|
||||||
|
{
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'article_id' => 'required',
|
||||||
|
'variation_id' => 'required',
|
||||||
|
'tariff_id' => 'required',
|
||||||
|
'weight' => 'required',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ namespace App\Repositories\Shop;
|
|||||||
|
|
||||||
use App\Models\Shop\Article;
|
use App\Models\Shop\Article;
|
||||||
use App\Models\Shop\Merchandise;
|
use App\Models\Shop\Merchandise;
|
||||||
|
use App\Traits\Model\Basic;
|
||||||
use App\Repositories\Botanic\Species;
|
use App\Repositories\Botanic\Species;
|
||||||
use App\Repositories\Botanic\Varieties;
|
use App\Repositories\Botanic\Varieties;
|
||||||
use App\Repositories\Core\Comments;
|
use App\Repositories\Core\Comments;
|
||||||
@@ -13,7 +14,7 @@ use Illuminate\Support\Str;
|
|||||||
|
|
||||||
class Articles
|
class Articles
|
||||||
{
|
{
|
||||||
use Imageable;
|
use Basic, Imageable;
|
||||||
|
|
||||||
public static function autocomplete($str)
|
public static function autocomplete($str)
|
||||||
{
|
{
|
||||||
@@ -73,11 +74,6 @@ class Articles
|
|||||||
return Offers::getOffersByArticle($id);
|
return Offers::getOffersByArticle($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getOptions()
|
|
||||||
{
|
|
||||||
return Article::orderBy('name', 'asc')->pluck('name', 'id')->toArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getOptionsWithNature()
|
public static function getOptionsWithNature()
|
||||||
{
|
{
|
||||||
$articles = Article::with(['article_nature'])->get();
|
$articles = Article::with(['article_nature'])->get();
|
||||||
@@ -391,17 +387,17 @@ class Articles
|
|||||||
{
|
{
|
||||||
switch ($product_type) {
|
switch ($product_type) {
|
||||||
case 'App\Models\Botanic\Variety':
|
case 'App\Models\Botanic\Variety':
|
||||||
$data['images'] = Varieties::getImages($product_id);
|
$images = Varieties::getImages($product_id);
|
||||||
break;
|
break;
|
||||||
case 'App\Models\Botanic\Specie':
|
case 'App\Models\Botanic\Specie':
|
||||||
$data['images'] = Species::getImages($product_id);
|
$images = Species::getImages($product_id);
|
||||||
break;
|
break;
|
||||||
case 'App\Models\Shop\Merchandise':
|
case 'App\Models\Shop\Merchandise':
|
||||||
$data['images'] = Merchandises::getImages($product_id);
|
$images = Merchandises::getImages($product_id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $data ?? false;
|
return $images ?? false ? ['images' => $images] : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getMeta(&$data = [])
|
public static function getMeta(&$data = [])
|
||||||
@@ -516,11 +512,6 @@ class Articles
|
|||||||
return Prices::getByArticle($article->id);
|
return Prices::getByArticle($article->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function get($id)
|
|
||||||
{
|
|
||||||
return Article::findOrFail($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getFullImagesByArticleId($id)
|
public static function getFullImagesByArticleId($id)
|
||||||
{
|
{
|
||||||
$article = self::get($id);
|
$article = self::get($id);
|
||||||
@@ -611,32 +602,6 @@ class Articles
|
|||||||
return $article->id;
|
return $article->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function store($data)
|
|
||||||
{
|
|
||||||
$data['visible'] = $data['visible'] ?? false;
|
|
||||||
|
|
||||||
return ($data['id'] ?? false) ? self::update($data) : self::create($data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function create($data)
|
|
||||||
{
|
|
||||||
return Article::create($data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function update($data, $id = false)
|
|
||||||
{
|
|
||||||
$id = $id ? $id : $data['id'];
|
|
||||||
$article = self::get($id);
|
|
||||||
$ret = $article->update($data);
|
|
||||||
|
|
||||||
return $article;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function destroy($id)
|
|
||||||
{
|
|
||||||
return Article::destroy($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function storeCategories($article, $categories)
|
public static function storeCategories($article, $categories)
|
||||||
{
|
{
|
||||||
if (! $categories) {
|
if (! $categories) {
|
||||||
@@ -677,4 +642,9 @@ class Articles
|
|||||||
|
|
||||||
return $name ? hash('crc32c', Str::slug($name)) : false;
|
return $name ? hash('crc32c', Str::slug($name)) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getModel()
|
||||||
|
{
|
||||||
|
return Article::query();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,12 +3,19 @@
|
|||||||
namespace App\Repositories\Shop;
|
namespace App\Repositories\Shop;
|
||||||
|
|
||||||
use App\Models\Shop\Offer;
|
use App\Models\Shop\Offer;
|
||||||
|
use App\Traits\Model\Basic;
|
||||||
|
|
||||||
class Offers
|
class Offers
|
||||||
{
|
{
|
||||||
public static function count()
|
use Basic;
|
||||||
|
|
||||||
|
public static function init()
|
||||||
{
|
{
|
||||||
return Offer::count();
|
return [
|
||||||
|
'articles' => Articles::getOptionsWithNature(),
|
||||||
|
'tariffs' => Tariffs::getOptions(),
|
||||||
|
'variations' => Variations::getOptions(),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getWeight($id, $quantity = 1)
|
public static function getWeight($id, $quantity = 1)
|
||||||
@@ -116,42 +123,13 @@ class Offers
|
|||||||
return Offer::with(['article.tags'])->byTags($tags)->get();
|
return Offer::with(['article.tags'])->byTags($tags)->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getAll()
|
|
||||||
{
|
|
||||||
return Offer::get();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function get($id, $relations = false)
|
|
||||||
{
|
|
||||||
return $relations ? Offer::with($relations)->findOrFail($id) : Offer::findOrFail($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function store($data)
|
|
||||||
{
|
|
||||||
return ($data['id'] ?? false) ? self::update($data) : self::create($data);
|
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function toggle_active($id, $status_id)
|
public static function toggle_active($id, $status_id)
|
||||||
{
|
{
|
||||||
return self::update(['status_id' => $status_id], $id);
|
return self::update(['status_id' => $status_id], $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getModel()
|
||||||
|
{
|
||||||
|
return Offer::query();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => __('shop.articles.title'),
|
'title' => __('shop.articles.title'),
|
||||||
'subtitle' => __('shop.articles.add'),
|
'subtitle' => __('shop.articles.add'),
|
||||||
'breadcrumb' => [__('shop.articles.title'), __('shop.articles.add')]
|
'breadcrumb' => [__('shop.articles.title'), __('shop.articles.add')],
|
||||||
])
|
])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
@include('Admin.Shop.Articles.form')
|
||||||
{{ Form::open(['route' => 'Admin.Shop.Articles.store', 'id' => 'article-form', 'autocomplete' => 'off', 'files' => true]) }}
|
|
||||||
@include('Admin.Shop.Articles.form')
|
|
||||||
</form>
|
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -1,15 +1,9 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => __('shop.articles.title'),
|
'title' => __('shop.articles.title'),
|
||||||
'subtitle' => __('shop.articles.edit'),
|
'subtitle' => __('shop.articles.edit'),
|
||||||
'breadcrumb' => [__('shop.articles.title'), __('shop.articles.edit')]
|
'breadcrumb' => [__('shop.articles.title'), __('shop.articles.edit')],
|
||||||
])
|
])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
@include('Admin.Shop.Articles.form')
|
||||||
{{ Form::open(['route' => 'Admin.Shop.Articles.store', 'id' => 'article-form', 'autocomplete' => 'off', 'files' => true]) }}
|
|
||||||
<input type="hidden" name="id" id="id" value="{{ $article['id'] ?? null }}">
|
|
||||||
|
|
||||||
@include('Admin.Shop.Articles.form')
|
|
||||||
{{ Form::close() }}
|
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
<div class="row mt-3">
|
{{ Form::open(['route' => 'Admin.Shop.Articles.store', 'id' => 'article-form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||||
<div class="col-12">
|
<input type="hidden" name="id" id="id" value="{{ $article['id'] ?? null }}">
|
||||||
@include('Admin.Shop.Articles.partials.characteristics')
|
@include('Admin.Shop.Articles.partials.characteristics')
|
||||||
</div>
|
{{ Form::close() }}
|
||||||
</div>
|
|
||||||
|
|
||||||
@include('components.save')
|
<x-save />
|
||||||
|
|
||||||
@include('load.form.appender')
|
@include('load.form.appender')
|
||||||
@include('load.form.editor')
|
@include('load.form.editor')
|
||||||
@@ -17,20 +16,22 @@
|
|||||||
@include('load.layout.modal')
|
@include('load.layout.modal')
|
||||||
|
|
||||||
@push('js')
|
@push('js')
|
||||||
<script>
|
{!! JsValidator::formRequest('App\Http\Requests\Admin\Shop\StoreArticlePost', '#article-form') !!}
|
||||||
$(function() {
|
|
||||||
|
|
||||||
$('.active-checkbox').bootstrapToggle();
|
<script>
|
||||||
$('.active-checkbox').off('change').on('change', function(e) {
|
$(function() {
|
||||||
var id = $('#id').val();
|
|
||||||
// handleAdmin.toggle(id, $(this).prop('checked'));
|
|
||||||
});
|
|
||||||
|
|
||||||
initChevron();
|
$('.active-checkbox').bootstrapToggle();
|
||||||
initEditor();
|
$('.active-checkbox').off('change').on('change', function(e) {
|
||||||
initSaveForm('#article-form');
|
var id = $('#id').val();
|
||||||
initSelect2();
|
// handleAdmin.toggle(id, $(this).prop('checked'));
|
||||||
|
});
|
||||||
|
|
||||||
});
|
initChevron();
|
||||||
</script>
|
initEditor();
|
||||||
@endpush
|
initSaveForm('#article-form');
|
||||||
|
initSelect2();
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
|||||||
@@ -166,18 +166,17 @@
|
|||||||
var product_type = $(this).val();
|
var product_type = $(this).val();
|
||||||
switch (product_type) {
|
switch (product_type) {
|
||||||
case 'App\\Models\\Botanic\\Specie':
|
case 'App\\Models\\Botanic\\Specie':
|
||||||
var url = '{{ route('Admin.Botanic.Species.getSelect') }}';
|
var url = "{{ route('Admin.Botanic.Species.getSelect') }}";
|
||||||
break;
|
break;
|
||||||
case 'App\\Models\\Botanic\\Variety':
|
case 'App\\Models\\Botanic\\Variety':
|
||||||
var url = '{{ route('Admin.Botanic.Varieties.getSelect') }}';
|
var url = "{{ route('Admin.Botanic.Varieties.getSelect') }}";
|
||||||
break;
|
break;
|
||||||
case 'App\\Models\\Shop\\Merchandise':
|
case 'App\\Models\\Shop\\Merchandise':
|
||||||
var url = '{{ route('Admin.Shop.Merchandises.getSelect') }}';
|
var url = "{{ route('Admin.Shop.Merchandises.getSelect') }}";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
loadProducts(url);
|
loadProducts(url);
|
||||||
var url = '{{ route('Admin.Shop.ArticleNatures.getOptions') }}';
|
loadArticleNatures("{{ route('Admin.Shop.ArticleNatures.getOptions') }}");
|
||||||
loadArticleNatures(url);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function loadArticleNatures(url) {
|
function loadArticleNatures(url) {
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => __('shop.offers.title'),
|
'title' => __('shop.offers.title'),
|
||||||
'subtitle' => __('shop.offers.add'),
|
'subtitle' => __('shop.offers.add'),
|
||||||
'breadcrumb' => [__('shop.offers.title'), __('shop.offers.add')]
|
'breadcrumb' => [__('shop.offers.title'), __('shop.offers.add')],
|
||||||
])
|
])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
@include('Admin.Shop.Offers.form')
|
||||||
{{ Form::open(['route' => 'Admin.Shop.Offers.store', 'id' => 'offer-form', 'autocomplete' => 'off']) }}
|
|
||||||
@include('Admin.Shop.Offers.form')
|
|
||||||
</form>
|
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -1,14 +1,9 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => __('shop.offers.title'),
|
'title' => __('shop.offers.title'),
|
||||||
'subtitle' => __('shop.offers.edit'),
|
'subtitle' => __('shop.offers.edit'),
|
||||||
'breadcrumb' => [__('shop.offers.title'), __('shop.offers.edit')]
|
'breadcrumb' => [__('shop.offers.title'), __('shop.offers.edit')],
|
||||||
])
|
])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
@include('Admin.Shop.Offers.form')
|
||||||
{{ Form::open(['route' => 'Admin.Shop.Offers.store', 'id' => 'offer-form', 'autocomplete' => 'off']) }}
|
|
||||||
<input type="hidden" name="id" value="{{ $offer['id'] }}">
|
|
||||||
@include('Admin.Shop.Offers.form')
|
|
||||||
</form>
|
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
{{ Form::open(['route' => 'Admin.Shop.Offers.store', 'id' => 'offer-form', 'autocomplete' => 'off']) }}
|
||||||
|
<input type="hidden" name="id" value="{{ $offer['id'] }}">
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
@@ -103,13 +106,16 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@include('components.save')
|
{{ form::close() }}
|
||||||
|
<x-save />
|
||||||
|
|
||||||
@include('load.layout.chevron')
|
@include('load.layout.chevron')
|
||||||
@include('load.form.save')
|
@include('load.form.save')
|
||||||
@include('load.form.select2')
|
@include('load.form.select2')
|
||||||
|
|
||||||
@push('js')
|
@push('js')
|
||||||
|
{!! JsValidator::formRequest('App\Http\Requests\Admin\Shop\StoreOfferPost', '#offer-form') !!}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function handleArticle() {
|
function handleArticle() {
|
||||||
$('.select_article').change(function() {
|
$('.select_article').change(function() {
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
|
@foreach ($delivery_types as $delivery_type)
|
||||||
|
|
||||||
|
@endforeach
|
||||||
|
|||||||
@@ -1,90 +1,100 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="{{ App::getLocale() }}" dir="@lang('boilerplate::layout.direction')">
|
<html lang="{{ App::getLocale() }}" dir="@lang('boilerplate::layout.direction')">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta name="robots" content="noindex, nofollow">
|
<meta name="robots" content="noindex, nofollow">
|
||||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||||
<title>{{ $title ?? '' }} | {{ config('app.name') }}</title>
|
<title>{{ $title ?? '' }} | {{ config('app.name') }}</title>
|
||||||
<link rel="shortcut icon" href="{{ config('boilerplate.theme.favicon') ?? mix('favicon.svg', '/assets/vendor/boilerplate') }}">
|
<link rel="shortcut icon"
|
||||||
@stack('plugin-css')
|
href="{{ config('boilerplate.theme.favicon') ?? mix('favicon.svg', '/assets/vendor/boilerplate') }}">
|
||||||
<link rel="stylesheet" href="{{ mix('/plugins/fontawesome/fontawesome.min.css', '/assets/vendor/boilerplate') }}">
|
@stack('plugin-css')
|
||||||
<link rel="stylesheet" href="{{ mix('/adminlte.min.css', '/assets/vendor/boilerplate') }}">
|
<link rel="stylesheet" href="{{ mix('/plugins/fontawesome/fontawesome.min.css', '/assets/vendor/boilerplate') }}">
|
||||||
|
<link rel="stylesheet" href="{{ mix('/adminlte.min.css', '/assets/vendor/boilerplate') }}">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,300;0,400;0,700;1,400&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,300;0,400;0,700;1,400&display=swap"
|
||||||
<link rel="stylesheet" href="/assets/fonts/glyphicons/glyphicons.min.css">
|
rel="stylesheet">
|
||||||
@stack('css')
|
<link rel="stylesheet" href="/assets/fonts/glyphicons/glyphicons.min.css">
|
||||||
<link rel="stylesheet" href="/assets/css/main.min.css?{{ time() }}">
|
@stack('css')
|
||||||
|
<link rel="stylesheet" href="/assets/css/main.min.css?{{ time() }}">
|
||||||
</head>
|
</head>
|
||||||
<body class="layout-fixed layout-navbar-fixed sidebar-mini{{ setting('darkmode', false) && config('boilerplate.theme.darkmode') ? ' dark-mode accent-light' : '' }}{{ setting('sidebar-collapsed', false) ? ' sidebar-collapse' : '' }}">
|
|
||||||
<div class="wrapper">
|
<body
|
||||||
@include('layout.header')
|
class="layout-fixed layout-navbar-fixed sidebar-mini{{ setting('darkmode', false) && config('boilerplate.theme.darkmode') ? ' dark-mode accent-light' : '' }}{{ setting('sidebar-collapsed', false) ? ' sidebar-collapse' : '' }}">
|
||||||
@include('boilerplate::layout.mainsidebar')
|
<div class="wrapper">
|
||||||
<div class="content-wrapper">
|
@include('layout.header')
|
||||||
@include('layout.contentheader')
|
@include('boilerplate::layout.mainsidebar')
|
||||||
<section class="content">
|
<div class="content-wrapper">
|
||||||
<div class="container-fluid">
|
@include('layout.contentheader')
|
||||||
@yield('content')
|
<section class="content">
|
||||||
</div>
|
<div class="container-fluid">
|
||||||
</section>
|
@yield('content')
|
||||||
</div>
|
</div>
|
||||||
|
</section>
|
||||||
@includeWhen(config('boilerplate.theme.footer.visible', true), 'layout.footer')
|
</div>
|
||||||
|
|
||||||
<aside class="control-sidebar control-sidebar-{{ config('boilerplate.theme.sidebar.type') }} elevation-{{ config('boilerplate.theme.sidebar.shadow') }}">
|
@includeWhen(config('boilerplate.theme.footer.visible', true), 'layout.footer')
|
||||||
<button class="btn btn-sm" data-widget="control-sidebar"><span class="fa fa-times"></span></button>
|
|
||||||
<div class="control-sidebar-content">
|
<aside
|
||||||
<div class="p-3">
|
class="control-sidebar control-sidebar-{{ config('boilerplate.theme.sidebar.type') }} elevation-{{ config('boilerplate.theme.sidebar.shadow') }}">
|
||||||
@yield('right-sidebar')
|
<button class="btn btn-sm" data-widget="control-sidebar"><span class="fa fa-times"></span></button>
|
||||||
</div>
|
<div class="control-sidebar-content">
|
||||||
</div>
|
<div class="p-3">
|
||||||
</aside>
|
@yield('right-sidebar')
|
||||||
|
</div>
|
||||||
<div class="control-sidebar-bg"></div>
|
</div>
|
||||||
</div>
|
</aside>
|
||||||
|
|
||||||
|
<div class="control-sidebar-bg"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script src="{{ mix('/bootstrap.min.js', '/assets/vendor/boilerplate') }}"></script>
|
<script src="{{ mix('/bootstrap.min.js', '/assets/vendor/boilerplate') }}"></script>
|
||||||
<script src="{{ mix('/admin-lte.min.js', '/assets/vendor/boilerplate') }}"></script>
|
<script src="{{ mix('/admin-lte.min.js', '/assets/vendor/boilerplate') }}"></script>
|
||||||
<script src="{{ mix('/boilerplate.min.js', '/assets/vendor/boilerplate') }}"></script>
|
<script src="{{ mix('/boilerplate.min.js', '/assets/vendor/boilerplate') }}"></script>
|
||||||
|
<script type="text/javascript" src="{{ asset('vendor/jsvalidation/js/jsvalidation.js') }}"></script>
|
||||||
<script src="/assets/js/main.min.js?{{ time() }}"></script>
|
<script src="/assets/js/main.min.js?{{ time() }}"></script>
|
||||||
|
|
||||||
<script>
|
|
||||||
// initScroll('.sidebar');
|
|
||||||
$('.sidebar').addClass('overflow-y');
|
|
||||||
|
|
||||||
$.ajaxSetup({headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'}});
|
<script>
|
||||||
|
// initScroll('.sidebar');
|
||||||
bootbox.setLocale('{{ App::getLocale() }}');
|
$('.sidebar').addClass('overflow-y');
|
||||||
|
|
||||||
var bpRoutes = {
|
$.ajaxSetup({
|
||||||
|
headers: {
|
||||||
|
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
bootbox.setLocale('{{ App::getLocale() }}');
|
||||||
|
|
||||||
|
var bpRoutes = {
|
||||||
settings: "{{ route('boilerplate.user.settings', null, false) }}",
|
settings: "{{ route('boilerplate.user.settings', null, false) }}",
|
||||||
}
|
}
|
||||||
|
|
||||||
var session = {
|
|
||||||
keepalive: "{{ route('boilerplate.keepalive', null, false) }}",
|
|
||||||
expire: {{ time() + config('session.lifetime') * 60 }},
|
|
||||||
lifetime: {{ config('session.lifetime') * 60 }},
|
|
||||||
id: "{{ session()->getId() }}"
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
var session = {
|
||||||
|
keepalive: "{{ route('boilerplate.keepalive', null, false) }}",
|
||||||
|
expire: {{ time() + config('session.lifetime') * 60 }},
|
||||||
|
lifetime: {{ config('session.lifetime') * 60 }},
|
||||||
|
id: "{{ session()->getId() }}"
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
@if(Session::has('growl'))
|
@if (Session::has('growl'))
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
@if(is_array(Session::get('growl')))
|
@if (is_array(Session::get('growl')))
|
||||||
growl("{!! Session::get('growl')[0] !!}", "{{ Session::get('growl')[1] }}");
|
growl("{!! Session::get('growl')[0] !!}", "{{ Session::get('growl')[1] }}");
|
||||||
@else
|
@else
|
||||||
growl("{{Session::get('growl')}}");
|
growl("{{ Session::get('growl') }}");
|
||||||
@endif
|
@endif
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@stack('scripts')
|
@stack('scripts')
|
||||||
@stack('js')
|
@stack('js')
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user