diff --git a/app/DataTables/Shop/ArticlePricesDataTable.php b/app/DataTables/Shop/ArticlePricesDataTable.php new file mode 100644 index 00000000..ae47f178 --- /dev/null +++ b/app/DataTables/Shop/ArticlePricesDataTable.php @@ -0,0 +1,31 @@ +exportable(false) + ->printable(false) + ->width(120) + ->addClass('text-center'), + ]; + } + +} diff --git a/app/Http/Controllers/Shop/Admin/ArticleController.php b/app/Http/Controllers/Shop/Admin/ArticleController.php index 28b451e7..a5cafe02 100644 --- a/app/Http/Controllers/Shop/Admin/ArticleController.php +++ b/app/Http/Controllers/Shop/Admin/ArticleController.php @@ -6,6 +6,7 @@ use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Repositories\Shop\Articles; +use App\Repositories\Shop\ArticleAttributeFamilies; use App\Repositories\Shop\ArticleFamilies; use App\Repositories\Shop\Categories; use App\DataTables\Shop\ArticlesDataTable; @@ -27,6 +28,7 @@ class ArticleController extends Controller $data = []; $data['categories'] = Categories::getOptions(); $data['families'] = ArticleFamilies::getOptions(); + $data['attribute_families'] = ArticleAttributeFamilies::getOptions(); $data['models'] = ['App\Models\Botanic\Specie' => 'Espèces', 'App\Models\Botanic\Variety' => 'Variétés']; return view('Shop.Admin.Articles.create', $data); } diff --git a/app/Menu/Botanic.php b/app/Menu/Botanic.php index 883ad20f..a2227468 100644 --- a/app/Menu/Botanic.php +++ b/app/Menu/Botanic.php @@ -12,7 +12,7 @@ class Botanic $menu->add('Botanique', [ 'permission' => 'backend_access', 'icon' => 'leaf' ]) ->id('botanic') ->activeIfRoute('botanic') - ->order(2); + ->order(4); $menu->addTo('botanic', 'Familles', [ 'route' => 'Botanic.Admin.Families.index', 'permission' => 'backend_access' ]) ->activeIfRoute(['Botanic.Admin.Families.*'])->order(1); diff --git a/app/Menu/Customers.php b/app/Menu/Customers.php new file mode 100644 index 00000000..b107321d --- /dev/null +++ b/app/Menu/Customers.php @@ -0,0 +1,21 @@ +add('Clients', [ 'permission' => 'backend_access', 'icon' => 'address-card' ]) + ->id('customers') + ->activeIfRoute('customers') + ->order(3); + + $menu->addTo('customers', 'Clients', [ 'route' => 'Shop.Admin.Customers.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Shop.Admin.Customers.*'])->order(1); + + + } +} diff --git a/app/Menu/Orders.php b/app/Menu/Orders.php new file mode 100644 index 00000000..e29615dc --- /dev/null +++ b/app/Menu/Orders.php @@ -0,0 +1,26 @@ +add('Commandes', [ 'permission' => 'backend_access', 'icon' => 'shopping-basket' ]) + ->id('orders') + ->activeIfRoute('orders') + ->order(1); + + $menu->addTo('orders', 'Commandes', [ 'route' => 'Shop.Admin.Orders.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Shop.Admin.Orders.*'])->order(1); + $menu->addTo('orders', 'Factures', [ 'route' => 'Shop.Admin.Invoices.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Shop.Admin.Invoices.*'])->order(2); + $menu->addTo('orders', 'Avoirs', [ 'route' => 'Shop.Admin.Invoices.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Shop.Admin.Invoices.*'])->order(3); + $menu->addTo('orders', 'Bons de livraison', [ 'route' => 'Shop.Admin.Invoices.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Shop.Admin.Invoices.*'])->order(4); + + } +} diff --git a/app/Menu/Shop.php b/app/Menu/Shop.php index 7c9cf817..a9cd7562 100644 --- a/app/Menu/Shop.php +++ b/app/Menu/Shop.php @@ -3,33 +3,31 @@ namespace App\Menu; use Sebastienheyd\Boilerplate\Menu\Builder; -use App\Repositories\Users; class Shop { public function make(Builder $menu) { - $menu->add('Commerce', [ 'permission' => 'backend_access', 'icon' => 'shopping-basket' ]) + $menu->add('Catalogue', [ 'permission' => 'backend_access', 'icon' => 'store' ]) ->id('shop') ->activeIfRoute('shop') - ->order(1); + ->order(2); - $menu->addTo('shop', 'Categories', [ 'route' => 'Shop.Admin.Categories.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.Categories.*'])->order(1); - $menu->addTo('shop', 'Articles', [ 'route' => 'Shop.Admin.Articles.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.Articles.*'])->order(2); + ->activeIfRoute(['Shop.Admin.Articles.*'])->order(1); + $menu->addTo('shop', 'Categories', [ 'route' => 'Shop.Admin.Categories.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Shop.Admin.Categories.*'])->order(2); $menu->addTo('shop', 'Familles d\'articles', [ 'route' => 'Shop.Admin.ArticleFamilies.index', 'permission' => 'backend_access' ]) ->activeIfRoute(['Shop.Admin.ArticleFamilies.*'])->order(3); $menu->addTo('shop', 'Familles d\'attributs', [ 'route' => 'Shop.Admin.ArticleAttributeFamilies.index', 'permission' => 'backend_access' ]) ->activeIfRoute(['Shop.Admin.ArticleAttributeFamilies.*'])->order(4); $menu->addTo('shop', 'Attributs', [ 'route' => 'Shop.Admin.ArticleAttributeValues.index', 'permission' => 'backend_access' ]) ->activeIfRoute(['Shop.Admin.ArticleAttributeValues.*'])->order(5); + $menu->addTo('shop', 'Réductions', [ 'route' => 'Shop.Admin.ArticleAttributeValues.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Shop.Admin.ArticleAttributeValues.*'])->order(6); + $menu->addTo('shop', 'Stock', [ 'route' => 'Shop.Admin.ArticleAttributeValues.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Shop.Admin.ArticleAttributeValues.*'])->order(7); - $menu->addTo('shop', 'Commandes', [ 'route' => 'Shop.Admin.Orders.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.Orders.*'])->order(6); - $menu->addTo('shop', 'Factures', [ 'route' => 'Shop.Admin.Invoices.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.Invoices.*'])->order(7); } } diff --git a/app/Models/Shop/Article.php b/app/Models/Shop/Article.php index ef6cd45a..58c214b3 100644 --- a/app/Models/Shop/Article.php +++ b/app/Models/Shop/Article.php @@ -30,9 +30,9 @@ class Article extends Model return $this->hasMany('App\Models\Shop\ArticlePrice'); } - public function ArticleAttributes() + public function Attributes() { - return $this->hasMany('App\Models\Shop\ArticleAttribute'); + return $this->hasManyThrough('App\Models\Shop\ArticleAttribute','App\Models\Shop\ArticlePrice'); } public function Categories() diff --git a/app/Models/Shop/ArticleAttribute.php b/app/Models/Shop/ArticleAttribute.php index 3f1a09d3..5387a0c3 100644 --- a/app/Models/Shop/ArticleAttribute.php +++ b/app/Models/Shop/ArticleAttribute.php @@ -2,17 +2,27 @@ namespace App\Models\Shop; -use Illuminate\Database\Eloquent\Relations\Pivot; +use Illuminate\Database\Eloquent\Model; -class ArticleAttribute extends Pivot +class ArticleAttribute extends Model { - public function article() + public function Price() { - return $this->belongsTo('App\Models\Shop\Article'); + return $this->belongsTo('App\Models\Shop\ArticlePrice'); } - public function value() + public function Value() { return $this->belongsTo('App\Models\Shop\ArticleAttribute'); } + + public function scopeByPrice($query, $article_price_id) + { + return $query->where('article_price_id', $article_price_id); + } + + public function scopeByAttribueValue($query, $article_value_id) + { + return $query->where('article_value_id', $article_value_id); + } } \ No newline at end of file diff --git a/app/Models/Shop/ArticleAttributeValue.php b/app/Models/Shop/ArticleAttributeValue.php index 8450e1f4..ec10f767 100644 --- a/app/Models/Shop/ArticleAttributeValue.php +++ b/app/Models/Shop/ArticleAttributeValue.php @@ -9,8 +9,14 @@ class ArticleAttributeValue extends Model protected $guarded = ['id']; protected $table = 'shop_article_attribute_values'; - public function attribute_family() + public function AttributeFamily() { return $this->belongsTo('App\Models\Shop\ArticleAttributeFamily'); } + + public function scopeByFamily($query, $attribute_family_id) + { + return $query->where('attribute_family_id', $attribute_family_id); + } + } \ No newline at end of file diff --git a/app/Models/Shop/ArticleComponent.php b/app/Models/Shop/ArticleComponent.php new file mode 100644 index 00000000..7f457ff6 --- /dev/null +++ b/app/Models/Shop/ArticleComponent.php @@ -0,0 +1,17 @@ +belongsTo('App\Models\Shop\Article'); + } + +} \ No newline at end of file diff --git a/app/Models/Shop/ArticlePrice.php b/app/Models/Shop/ArticlePrice.php index aeb21df0..f19ba53e 100644 --- a/app/Models/Shop/ArticlePrice.php +++ b/app/Models/Shop/ArticlePrice.php @@ -13,9 +13,9 @@ class ArticlePrice extends Model return $this->belongsTo('App\Models\Shop\Article'); } - public function ArticleAttribute() + public function ArticleAttributes() { - return $this->belongsTo('App\Models\Shop\ArticleAttribute'); + return $this->hasMany('App\Models\Shop\ArticleAttribute'); } public function scopeByArticle($query, $id) diff --git a/app/Repositories/Shop/ArticleAttributeFamilies.php b/app/Repositories/Shop/ArticleAttributeFamilies.php index 5585f9e8..5b8dd89b 100644 --- a/app/Repositories/Shop/ArticleAttributeFamilies.php +++ b/app/Repositories/Shop/ArticleAttributeFamilies.php @@ -25,6 +25,11 @@ class ArticleAttributeFamilies return ArticleAttributeFamily::find($id); } + public static function getOptions() + { + return ArticleAttributeFamily::get()->pluck('name','id')->toArray(); + } + public static function store($data) { $id = isset($data['id']) ? $data['id'] : false; diff --git a/app/Repositories/Shop/ArticleAttributeValues.php b/app/Repositories/Shop/ArticleAttributeValues.php index d7906ad1..e7d073c8 100644 --- a/app/Repositories/Shop/ArticleAttributeValues.php +++ b/app/Repositories/Shop/ArticleAttributeValues.php @@ -25,6 +25,16 @@ class ArticleAttributeValues return ArticleAttributeValue::find($id); } + public static function getOptions() + { + return ArticleAttributeValue::get()->pluck('name','id')->toArray(); + } + + public static function getOptionsByFamily($attribute_family_id) + { + return ArticleAttributeValue::byFamily($attribute_family_id)->get()->pluck('name','id')->toArray(); + } + public static function store($data) { $id = isset($data['id']) ? $data['id'] : false; diff --git a/composer.json b/composer.json index b2409b8f..2d6e5762 100644 --- a/composer.json +++ b/composer.json @@ -62,7 +62,9 @@ "rtconner/laravel-tagging": "^3.2", "rutorika/sortable": "^6.0", "santigarcor/laratrust": "^5.2", - "sebastienheyd/boilerplate": "^7.0", + "sebastienheyd/boilerplate": "^7.1", + "sebastienheyd/boilerplate-email-editor": "^8.0", + "sebastienheyd/boilerplate-media-manager": "^7.0", "sensiolabs/security-checker": "^6.0", "sheub/ban-france-provider": "^1.0@dev", "smajohusic/laravel-mail-logger": "^1.0", diff --git a/config/boilerplate/email-editor.php b/config/boilerplate/email-editor.php new file mode 100644 index 00000000..529e416d --- /dev/null +++ b/config/boilerplate/email-editor.php @@ -0,0 +1,5 @@ + env('EMAIL_LAYOUTS_PATH', resource_path('views/email-layouts')), +]; diff --git a/config/boilerplate/mediamanager.php b/config/boilerplate/mediamanager.php new file mode 100644 index 00000000..bc78cf3b --- /dev/null +++ b/config/boilerplate/mediamanager.php @@ -0,0 +1,68 @@ + '/storage', + 'tinymce_upload_dir' => 'edition', + 'thumbs_dir' => 'thumbs', + 'hide_thumbs_dir' => true, + 'authorized' => [ + 'size' => '2048', + 'mimes' => [// @see https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types) + 'jpg', + 'jpeg', + 'png', + 'gif', + 'svg', + 'pdf', + 'doc', + 'docx', + 'odt', + 'xls', + 'xlsx', + 'ods', + 'ppt', + 'pptx', + 'zip', + 'rar', + 'txt', + 'mp3', + 'wav', + 'ogg', + 'mkv', + 'mp4', + 'avi', + 'wmv', + ], + ], + 'filetypes' => [// Recognized filetypes + 'image' => 'png|jpg|jpeg|gif|svg', + 'word' => 'doc|docx|odt', + 'excel' => 'xls|xlsx|ods', + 'ppt' => 'ppt|pptx', + 'pdf' => 'pdf', + 'code' => 'php|js|java|python|ruby|go|c|cpp|sql|m|h|json|html|aspx', + 'archive' => 'zip|tar\.gz|rar|rpm', + 'txt' => 'txt|pac|log|md', + 'audio' => 'mp3|wav|flac|3pg|aa|aac|ape|au|m4a|mpc|ogg', + 'video' => 'mkv|rmvb|flv|mp4|avi|wmv|rm|asf|mpeg', + ], + 'icons' => [// Icons linked to filetypes + 'file' => 'file', // default + 'image' => 'file-image', + 'word' => 'file-word', + 'excel' => 'file-excel', + 'ppt' => 'file-powerpoint', + 'pdf' => 'file-pdf', + 'code' => 'file-code', + 'archive' => 'file-zip', + 'txt' => 'file-text', + 'audio' => 'file-audio', + 'video' => 'file-video', + ], + 'filter' => [ + '.gitignore', + '.git', + '.htaccess', + 'thumb_.*', + ], +]; diff --git a/config/dompdf.php b/config/dompdf.php new file mode 100644 index 00000000..9a993058 --- /dev/null +++ b/config/dompdf.php @@ -0,0 +1,244 @@ + false, // Throw an Exception on warnings from dompdf + 'orientation' => 'portrait', + 'defines' => array( + /** + * The location of the DOMPDF font directory + * + * The location of the directory where DOMPDF will store fonts and font metrics + * Note: This directory must exist and be writable by the webserver process. + * *Please note the trailing slash.* + * + * Notes regarding fonts: + * Additional .afm font metrics can be added by executing load_font.php from command line. + * + * Only the original "Base 14 fonts" are present on all pdf viewers. Additional fonts must + * be embedded in the pdf file or the PDF may not display correctly. This can significantly + * increase file size unless font subsetting is enabled. Before embedding a font please + * review your rights under the font license. + * + * Any font specification in the source HTML is translated to the closest font available + * in the font directory. + * + * The pdf standard "Base 14 fonts" are: + * Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique, + * Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique, + * Times-Roman, Times-Bold, Times-BoldItalic, Times-Italic, + * Symbol, ZapfDingbats. + */ + "font_dir" => storage_path('fonts/'), // advised by dompdf (https://github.com/dompdf/dompdf/pull/782) + + /** + * The location of the DOMPDF font cache directory + * + * This directory contains the cached font metrics for the fonts used by DOMPDF. + * This directory can be the same as DOMPDF_FONT_DIR + * + * Note: This directory must exist and be writable by the webserver process. + */ + "font_cache" => storage_path('fonts/'), + + /** + * The location of a temporary directory. + * + * The directory specified must be writeable by the webserver process. + * The temporary directory is required to download remote images and when + * using the PFDLib back end. + */ + "temp_dir" => sys_get_temp_dir(), + + /** + * ==== IMPORTANT ==== + * + * dompdf's "chroot": Prevents dompdf from accessing system files or other + * files on the webserver. All local files opened by dompdf must be in a + * subdirectory of this directory. DO NOT set it to '/' since this could + * allow an attacker to use dompdf to read any files on the server. This + * should be an absolute path. + * This is only checked on command line call by dompdf.php, but not by + * direct class use like: + * $dompdf = new DOMPDF(); $dompdf->load_html($htmldata); $dompdf->render(); $pdfdata = $dompdf->output(); + */ + "chroot" => realpath(base_path()), + + /** + * Whether to enable font subsetting or not. + */ + "enable_font_subsetting" => false, + + /** + * The PDF rendering backend to use + * + * Valid settings are 'PDFLib', 'CPDF' (the bundled R&OS PDF class), 'GD' and + * 'auto'. 'auto' will look for PDFLib and use it if found, or if not it will + * fall back on CPDF. 'GD' renders PDFs to graphic files. {@link + * Canvas_Factory} ultimately determines which rendering class to instantiate + * based on this setting. + * + * Both PDFLib & CPDF rendering backends provide sufficient rendering + * capabilities for dompdf, however additional features (e.g. object, + * image and font support, etc.) differ between backends. Please see + * {@link PDFLib_Adapter} for more information on the PDFLib backend + * and {@link CPDF_Adapter} and lib/class.pdf.php for more information + * on CPDF. Also see the documentation for each backend at the links + * below. + * + * The GD rendering backend is a little different than PDFLib and + * CPDF. Several features of CPDF and PDFLib are not supported or do + * not make any sense when creating image files. For example, + * multiple pages are not supported, nor are PDF 'objects'. Have a + * look at {@link GD_Adapter} for more information. GD support is + * experimental, so use it at your own risk. + * + * @link http://www.pdflib.com + * @link http://www.ros.co.nz/pdf + * @link http://www.php.net/image + */ + "pdf_backend" => "CPDF", + + /** + * PDFlib license key + * + * If you are using a licensed, commercial version of PDFlib, specify + * your license key here. If you are using PDFlib-Lite or are evaluating + * the commercial version of PDFlib, comment out this setting. + * + * @link http://www.pdflib.com + * + * If pdflib present in web server and auto or selected explicitely above, + * a real license code must exist! + */ + //"DOMPDF_PDFLIB_LICENSE" => "your license key here", + + /** + * html target media view which should be rendered into pdf. + * List of types and parsing rules for future extensions: + * http://www.w3.org/TR/REC-html40/types.html + * screen, tty, tv, projection, handheld, print, braille, aural, all + * Note: aural is deprecated in CSS 2.1 because it is replaced by speech in CSS 3. + * Note, even though the generated pdf file is intended for print output, + * the desired content might be different (e.g. screen or projection view of html file). + * Therefore allow specification of content here. + */ + "default_media_type" => "screen", + + /** + * The default paper size. + * + * North America standard is "letter"; other countries generally "a4" + * + * @see CPDF_Adapter::PAPER_SIZES for valid sizes ('letter', 'legal', 'A4', etc.) + */ + "default_paper_size" => "a4", + + /** + * The default font family + * + * Used if no suitable fonts can be found. This must exist in the font folder. + * @var string + */ + "default_font" => "serif", + + /** + * Image DPI setting + * + * This setting determines the default DPI setting for images and fonts. The + * DPI may be overridden for inline images by explictly setting the + * image's width & height style attributes (i.e. if the image's native + * width is 600 pixels and you specify the image's width as 72 points, + * the image will have a DPI of 600 in the rendered PDF. The DPI of + * background images can not be overridden and is controlled entirely + * via this parameter. + * + * For the purposes of DOMPDF, pixels per inch (PPI) = dots per inch (DPI). + * If a size in html is given as px (or without unit as image size), + * this tells the corresponding size in pt. + * This adjusts the relative sizes to be similar to the rendering of the + * html page in a reference browser. + * + * In pdf, always 1 pt = 1/72 inch + * + * Rendering resolution of various browsers in px per inch: + * Windows Firefox and Internet Explorer: + * SystemControl->Display properties->FontResolution: Default:96, largefonts:120, custom:? + * Linux Firefox: + * about:config *resolution: Default:96 + * (xorg screen dimension in mm and Desktop font dpi settings are ignored) + * + * Take care about extra font/image zoom factor of browser. + * + * In images, size in pixel attribute, img css style, are overriding + * the real image dimension in px for rendering. + * + * @var int + */ + "dpi" => 96, + + /** + * Enable inline PHP + * + * If this setting is set to true then DOMPDF will automatically evaluate + * inline PHP contained within tags. + * + * Enabling this for documents you do not trust (e.g. arbitrary remote html + * pages) is a security risk. Set this option to false if you wish to process + * untrusted documents. + * + * @var bool + */ + "enable_php" => false, + + /** + * Enable inline Javascript + * + * If this setting is set to true then DOMPDF will automatically insert + * JavaScript code contained within tags. + * + * @var bool + */ + "enable_javascript" => true, + + /** + * Enable remote file access + * + * If this setting is set to true, DOMPDF will access remote sites for + * images and CSS files as required. + * This is required for part of test case www/test/image_variants.html through www/examples.php + * + * Attention! + * This can be a security risk, in particular in combination with DOMPDF_ENABLE_PHP and + * allowing remote access to dompdf.php or on allowing remote html code to be passed to + * $dompdf = new DOMPDF(, $dompdf->load_html(..., + * This allows anonymous users to download legally doubtful internet content which on + * tracing back appears to being downloaded by your server, or allows malicious php code + * in remote html pages to be executed by your server with your account privileges. + * + * @var bool + */ + "enable_remote" => true, + + /** + * A ratio applied to the fonts height to be more like browsers' line height + */ + "font_height_ratio" => 1.1, + + /** + * Use the more-than-experimental HTML5 Lib parser + */ + "enable_html5_parser" => false, + ), + + +); diff --git a/config/snappy.php b/config/snappy.php new file mode 100644 index 00000000..46d12ec0 --- /dev/null +++ b/config/snappy.php @@ -0,0 +1,52 @@ + [ + 'enabled' => true, + 'binary' => env('WKHTML_PDF_BINARY', '/usr/local/bin/wkhtmltopdf'), + 'timeout' => false, + 'options' => [], + 'env' => [], + ], + + 'image' => [ + 'enabled' => true, + 'binary' => env('WKHTML_IMG_BINARY', '/usr/local/bin/wkhtmltoimage'), + 'timeout' => false, + 'options' => [], + 'env' => [], + ], + +]; diff --git a/package.json b/package.json index 5e2e908c..28ff62ce 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "devDependencies": { "axios": "^0.19", - "bootstrap": "^4.3.1", + "bootstrap": "^4.4.1", "cross-env": "^7.0", "grunt": "^1.0.4", "grunt-contrib-clean": "^2.0.0", @@ -35,12 +35,12 @@ "dependencies": { "@activix/bootstrap-datetimepicker": "^2.0.7", "@claviska/jquery-minicolors": "^2.3.4", - "admin-lte": "^2.4.10", + "admin-lte": "^3.0.2", "animate.css": "^3.7.0", - "bootbox": "^5.2.0", + "bootbox": "^5.3.4", "bootstrap-chosen": "^1.4.2", "bootstrap-datepicker": "^1.8.0", - "bootstrap-fileinput": "^5.0.5", + "bootstrap-fileinput": "^5.0.8", "bootstrap-multiselect": "^0.9.13", "bootstrap-slider": "^10.6.2", "bootstrap-sweetalert": "^1.0.1", @@ -50,7 +50,7 @@ "bootstrap4-toggle": "^3.6.1", "chart.js": "^2.8.0", "datatables": "^1.10.18", - "datatables.net": "^1.10.19", + "datatables.net": "^1.10.20", "datatables.net-bs4": "^1.10.20", "datatables.net-buttons": "^1.5.6", "datatables.net-buttons-bs4": "^1.6.1", @@ -69,6 +69,7 @@ "datatables.net-select": "^1.3.0", "datatables.net-select-bs4": "^1.3.0", "daterangepicker": "^3.0.5", + "drmonty-datatables-plugins": "^1.10.12", "dropzone": "^5.5.1", "easy-pie-chart": "^2.1.7", "es6-promise": "^4.2.8", @@ -122,6 +123,7 @@ "pwstrength-bootstrap": "^3.0.3", "raphael": "^2.2.8", "screenfull": "^4.2.0", + "select2": "^4.0.13", "selectize": "^0.12.6", "slidebars": "^2.0.2", "summernote": "^0.8.12", diff --git a/resources/views/Shop/Admin/Articles/create.blade.php b/resources/views/Shop/Admin/Articles/create.blade.php index 58a7de4a..b1f5bd89 100644 --- a/resources/views/Shop/Admin/Articles/create.blade.php +++ b/resources/views/Shop/Admin/Articles/create.blade.php @@ -10,18 +10,6 @@ {{ Form::open(['route' => 'Shop.Admin.Articles.store', 'id' => 'article-form', 'autocomplete' => 'off', 'files' => true]) }} -
-
- - {{ __('articles.list.title') }} - - - - @include('components.button-save') - -
-
- @include('Shop.Admin.Articles.form') diff --git a/resources/views/Shop/Admin/Articles/form.blade.php b/resources/views/Shop/Admin/Articles/form.blade.php index 1de35777..41372b3c 100644 --- a/resources/views/Shop/Admin/Articles/form.blade.php +++ b/resources/views/Shop/Admin/Articles/form.blade.php @@ -2,68 +2,71 @@ @include('boilerplate::load.select2') @include('boilerplate::load.tinymce') -
-
-
-
- {{ Form::label('name', 'Nom') }} - @include('components.input', ['name' => 'name', 'value' => isset($name) ? $name : null, 'required' => true]) -
-
- {{ Form::label('family_id', 'Famille d\'articles') }} - @include('components.select', ['name' => 'family_id', 'list' => $families, 'value' => isset($family_id) ? $family_id : null, 'class' => 'select2 form-control']) -
-
-
-
- {{ Form::label('categories', 'Catégories') }} - @include('components.select', ['name' => 'categories', 'list' => $categories, 'value' => isset($category_id) ? $category_id : null, 'class' => 'select2 form-control', 'multiple' => true]) -
-
-
-
- {{ Form::label('model', 'Familles de produit') }} - @include('components.select', ['name' => 'model', 'id_name' => 'model', 'list' => $models, 'value' => isset($model) ? $model : null, 'class' => 'select2 form-control']) -
-
- {{ Form::label('model_id', 'Produit') }} - @include('components.select2', ['name' => 'model_id', 'id_name' => 'model_id', 'value' => isset($model_id) ? $model_id : null, 'class' => 'select2 form-control']) -
-
-
-
- {{ Form::label('tags', 'Tags') }} - @include('components.select', ['name' => 'tags', 'value' => isset($tags) ? $tags : null, 'class' => 'select2 form-control', 'multiple' => true]) -
-
-
-
- {{ Form::label('description', 'Description') }} - @include('components.textarea', ['name' => 'description', 'value' => isset($description) ? $description : null, 'class' => 'editor', 'required' => true]) -
-
+
+
+
+
+ -
-
- {{ Form::label('prices', 'Tarifs') }} +
+
+ @include('Shop.Admin.Articles.partials.characteristics') +
+ +
+ @include('Shop.Admin.Articles.partials.prices') +
+ +
+ @include('Shop.Admin.Articles.partials.shipping') +
+ +
+ @include('Shop.Admin.Articles.partials.stock') +
+ +
+ @include('Shop.Admin.Articles.partials.seo') +
+
-
-
-
- {{ Form::label('photo', 'Photos') }} - @include('components.file', ['name' => 'photo', 'value' => isset($photo) ? $photo : null, 'required' => true]) +
-
-
-
- @include('components.button-save') -
-
-
+ +@include('components.save') @push('js')