Fix on AdminLTE 3, and add some features

This commit is contained in:
Ludovic CANDELLIER
2020-05-09 01:05:55 +02:00
parent d0e3bb6251
commit 86a073cad7
27 changed files with 670 additions and 95 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace App\DataTables\Shop;
use Yajra\DataTables\Html\Column;
use App\DataTables\ParentDataTable as DataTable;
use App\Models\Shop\ArticlePrice;
class ArticlePricessDataTable extends DataTable
{
public $model_name = 'ArticlePrices';
public function query(ArticlePrice $model)
{
$model = $model::with(['Article', 'ArticleAttributes']);
return self::buildQuery($model);
}
protected function getColumns()
{
return [
Column::make('name'),
Column::computed('action')
->exportable(false)
->printable(false)
->width(120)
->addClass('text-center'),
];
}
}

View File

@@ -6,6 +6,7 @@ use Illuminate\Http\Request;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Repositories\Shop\Articles; use App\Repositories\Shop\Articles;
use App\Repositories\Shop\ArticleAttributeFamilies;
use App\Repositories\Shop\ArticleFamilies; use App\Repositories\Shop\ArticleFamilies;
use App\Repositories\Shop\Categories; use App\Repositories\Shop\Categories;
use App\DataTables\Shop\ArticlesDataTable; use App\DataTables\Shop\ArticlesDataTable;
@@ -27,6 +28,7 @@ class ArticleController extends Controller
$data = []; $data = [];
$data['categories'] = Categories::getOptions(); $data['categories'] = Categories::getOptions();
$data['families'] = ArticleFamilies::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']; $data['models'] = ['App\Models\Botanic\Specie' => 'Espèces', 'App\Models\Botanic\Variety' => 'Variétés'];
return view('Shop.Admin.Articles.create', $data); return view('Shop.Admin.Articles.create', $data);
} }

View File

@@ -12,7 +12,7 @@ class Botanic
$menu->add('Botanique', [ 'permission' => 'backend_access', 'icon' => 'leaf' ]) $menu->add('Botanique', [ 'permission' => 'backend_access', 'icon' => 'leaf' ])
->id('botanic') ->id('botanic')
->activeIfRoute('botanic') ->activeIfRoute('botanic')
->order(2); ->order(4);
$menu->addTo('botanic', 'Familles', [ 'route' => 'Botanic.Admin.Families.index', 'permission' => 'backend_access' ]) $menu->addTo('botanic', 'Familles', [ 'route' => 'Botanic.Admin.Families.index', 'permission' => 'backend_access' ])
->activeIfRoute(['Botanic.Admin.Families.*'])->order(1); ->activeIfRoute(['Botanic.Admin.Families.*'])->order(1);

21
app/Menu/Customers.php Normal file
View File

@@ -0,0 +1,21 @@
<?php
namespace App\Menu;
use Sebastienheyd\Boilerplate\Menu\Builder;
class Customers
{
public function make(Builder $menu)
{
$menu->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);
}
}

26
app/Menu/Orders.php Normal file
View File

@@ -0,0 +1,26 @@
<?php
namespace App\Menu;
use Sebastienheyd\Boilerplate\Menu\Builder;
class Orders
{
public function make(Builder $menu)
{
$menu->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);
}
}

View File

@@ -3,33 +3,31 @@
namespace App\Menu; namespace App\Menu;
use Sebastienheyd\Boilerplate\Menu\Builder; use Sebastienheyd\Boilerplate\Menu\Builder;
use App\Repositories\Users;
class Shop class Shop
{ {
public function make(Builder $menu) public function make(Builder $menu)
{ {
$menu->add('Commerce', [ 'permission' => 'backend_access', 'icon' => 'shopping-basket' ]) $menu->add('Catalogue', [ 'permission' => 'backend_access', 'icon' => 'store' ])
->id('shop') ->id('shop')
->activeIfRoute('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' ]) $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' ]) $menu->addTo('shop', 'Familles d\'articles', [ 'route' => 'Shop.Admin.ArticleFamilies.index', 'permission' => 'backend_access' ])
->activeIfRoute(['Shop.Admin.ArticleFamilies.*'])->order(3); ->activeIfRoute(['Shop.Admin.ArticleFamilies.*'])->order(3);
$menu->addTo('shop', 'Familles d\'attributs', [ 'route' => 'Shop.Admin.ArticleAttributeFamilies.index', 'permission' => 'backend_access' ]) $menu->addTo('shop', 'Familles d\'attributs', [ 'route' => 'Shop.Admin.ArticleAttributeFamilies.index', 'permission' => 'backend_access' ])
->activeIfRoute(['Shop.Admin.ArticleAttributeFamilies.*'])->order(4); ->activeIfRoute(['Shop.Admin.ArticleAttributeFamilies.*'])->order(4);
$menu->addTo('shop', 'Attributs', [ 'route' => 'Shop.Admin.ArticleAttributeValues.index', 'permission' => 'backend_access' ]) $menu->addTo('shop', 'Attributs', [ 'route' => 'Shop.Admin.ArticleAttributeValues.index', 'permission' => 'backend_access' ])
->activeIfRoute(['Shop.Admin.ArticleAttributeValues.*'])->order(5); ->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);
} }
} }

View File

@@ -30,9 +30,9 @@ class Article extends Model
return $this->hasMany('App\Models\Shop\ArticlePrice'); 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() public function Categories()

View File

@@ -2,17 +2,27 @@
namespace App\Models\Shop; 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'); 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);
}
} }

View File

@@ -9,8 +9,14 @@ class ArticleAttributeValue extends Model
protected $guarded = ['id']; protected $guarded = ['id'];
protected $table = 'shop_article_attribute_values'; protected $table = 'shop_article_attribute_values';
public function attribute_family() public function AttributeFamily()
{ {
return $this->belongsTo('App\Models\Shop\ArticleAttributeFamily'); return $this->belongsTo('App\Models\Shop\ArticleAttributeFamily');
} }
public function scopeByFamily($query, $attribute_family_id)
{
return $query->where('attribute_family_id', $attribute_family_id);
}
} }

View File

@@ -0,0 +1,17 @@
<?php
namespace App\Models\Shop;
use Illuminate\Database\Eloquent\Model;
class ArticleComponent extends Model
{
protected $guarded = ['id'];
protected $table = 'shop_article_components';
public function Article()
{
return $this->belongsTo('App\Models\Shop\Article');
}
}

View File

@@ -13,9 +13,9 @@ class ArticlePrice extends Model
return $this->belongsTo('App\Models\Shop\Article'); 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) public function scopeByArticle($query, $id)

View File

@@ -25,6 +25,11 @@ class ArticleAttributeFamilies
return ArticleAttributeFamily::find($id); return ArticleAttributeFamily::find($id);
} }
public static function getOptions()
{
return ArticleAttributeFamily::get()->pluck('name','id')->toArray();
}
public static function store($data) public static function store($data)
{ {
$id = isset($data['id']) ? $data['id'] : false; $id = isset($data['id']) ? $data['id'] : false;

View File

@@ -25,6 +25,16 @@ class ArticleAttributeValues
return ArticleAttributeValue::find($id); 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) public static function store($data)
{ {
$id = isset($data['id']) ? $data['id'] : false; $id = isset($data['id']) ? $data['id'] : false;

View File

@@ -62,7 +62,9 @@
"rtconner/laravel-tagging": "^3.2", "rtconner/laravel-tagging": "^3.2",
"rutorika/sortable": "^6.0", "rutorika/sortable": "^6.0",
"santigarcor/laratrust": "^5.2", "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", "sensiolabs/security-checker": "^6.0",
"sheub/ban-france-provider": "^1.0@dev", "sheub/ban-france-provider": "^1.0@dev",
"smajohusic/laravel-mail-logger": "^1.0", "smajohusic/laravel-mail-logger": "^1.0",

View File

@@ -0,0 +1,5 @@
<?php
return [
'layouts_path' => env('EMAIL_LAYOUTS_PATH', resource_path('views/email-layouts')),
];

View File

@@ -0,0 +1,68 @@
<?php
return [
'base_url' => '/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_.*',
],
];

244
config/dompdf.php Normal file
View File

@@ -0,0 +1,244 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Settings
|--------------------------------------------------------------------------
|
| Set some default values. It is possible to add all defines that can be set
| in dompdf_config.inc.php. You can also override the entire config file.
|
*/
'show_warnings' => 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, <img> 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 <script type="text/php"> ... </script> 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 <script type="text/javascript"> ... </script> 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,
),
);

52
config/snappy.php Normal file
View File

@@ -0,0 +1,52 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Snappy PDF / Image Configuration
|--------------------------------------------------------------------------
|
| This option contains settings for PDF generation.
|
| Enabled:
|
| Whether to load PDF / Image generation.
|
| Binary:
|
| The file path of the wkhtmltopdf / wkhtmltoimage executable.
|
| Timout:
|
| The amount of time to wait (in seconds) before PDF / Image generation is stopped.
| Setting this to false disables the timeout (unlimited processing time).
|
| Options:
|
| The wkhtmltopdf command options. These are passed directly to wkhtmltopdf.
| See https://wkhtmltopdf.org/usage/wkhtmltopdf.txt for all options.
|
| Env:
|
| The environment variables to set while running the wkhtmltopdf process.
|
*/
'pdf' => [
'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' => [],
],
];

View File

@@ -11,7 +11,7 @@
}, },
"devDependencies": { "devDependencies": {
"axios": "^0.19", "axios": "^0.19",
"bootstrap": "^4.3.1", "bootstrap": "^4.4.1",
"cross-env": "^7.0", "cross-env": "^7.0",
"grunt": "^1.0.4", "grunt": "^1.0.4",
"grunt-contrib-clean": "^2.0.0", "grunt-contrib-clean": "^2.0.0",
@@ -35,12 +35,12 @@
"dependencies": { "dependencies": {
"@activix/bootstrap-datetimepicker": "^2.0.7", "@activix/bootstrap-datetimepicker": "^2.0.7",
"@claviska/jquery-minicolors": "^2.3.4", "@claviska/jquery-minicolors": "^2.3.4",
"admin-lte": "^2.4.10", "admin-lte": "^3.0.2",
"animate.css": "^3.7.0", "animate.css": "^3.7.0",
"bootbox": "^5.2.0", "bootbox": "^5.3.4",
"bootstrap-chosen": "^1.4.2", "bootstrap-chosen": "^1.4.2",
"bootstrap-datepicker": "^1.8.0", "bootstrap-datepicker": "^1.8.0",
"bootstrap-fileinput": "^5.0.5", "bootstrap-fileinput": "^5.0.8",
"bootstrap-multiselect": "^0.9.13", "bootstrap-multiselect": "^0.9.13",
"bootstrap-slider": "^10.6.2", "bootstrap-slider": "^10.6.2",
"bootstrap-sweetalert": "^1.0.1", "bootstrap-sweetalert": "^1.0.1",
@@ -50,7 +50,7 @@
"bootstrap4-toggle": "^3.6.1", "bootstrap4-toggle": "^3.6.1",
"chart.js": "^2.8.0", "chart.js": "^2.8.0",
"datatables": "^1.10.18", "datatables": "^1.10.18",
"datatables.net": "^1.10.19", "datatables.net": "^1.10.20",
"datatables.net-bs4": "^1.10.20", "datatables.net-bs4": "^1.10.20",
"datatables.net-buttons": "^1.5.6", "datatables.net-buttons": "^1.5.6",
"datatables.net-buttons-bs4": "^1.6.1", "datatables.net-buttons-bs4": "^1.6.1",
@@ -69,6 +69,7 @@
"datatables.net-select": "^1.3.0", "datatables.net-select": "^1.3.0",
"datatables.net-select-bs4": "^1.3.0", "datatables.net-select-bs4": "^1.3.0",
"daterangepicker": "^3.0.5", "daterangepicker": "^3.0.5",
"drmonty-datatables-plugins": "^1.10.12",
"dropzone": "^5.5.1", "dropzone": "^5.5.1",
"easy-pie-chart": "^2.1.7", "easy-pie-chart": "^2.1.7",
"es6-promise": "^4.2.8", "es6-promise": "^4.2.8",
@@ -122,6 +123,7 @@
"pwstrength-bootstrap": "^3.0.3", "pwstrength-bootstrap": "^3.0.3",
"raphael": "^2.2.8", "raphael": "^2.2.8",
"screenfull": "^4.2.0", "screenfull": "^4.2.0",
"select2": "^4.0.13",
"selectize": "^0.12.6", "selectize": "^0.12.6",
"slidebars": "^2.0.2", "slidebars": "^2.0.2",
"summernote": "^0.8.12", "summernote": "^0.8.12",

View File

@@ -10,18 +10,6 @@
{{ Form::open(['route' => 'Shop.Admin.Articles.store', 'id' => 'article-form', 'autocomplete' => 'off', 'files' => true]) }} {{ Form::open(['route' => 'Shop.Admin.Articles.store', 'id' => 'article-form', 'autocomplete' => 'off', 'files' => true]) }}
<div class="row">
<div class="col-sm-12 mbl">
<a href="{{ route("Shop.Admin.Articles.index") }}" class="btn btn-default">
{{ __('articles.list.title') }}
</a>
<span class="btn-group pull-right">
@include('components.button-save')
</span>
</div>
</div>
@include('Shop.Admin.Articles.form') @include('Shop.Admin.Articles.form')
</form> </form>

View File

@@ -2,68 +2,71 @@
@include('boilerplate::load.select2') @include('boilerplate::load.select2')
@include('boilerplate::load.tinymce') @include('boilerplate::load.tinymce')
<div class="row"> <div class="row mt-3">
<div class="col-md-8">
<div class="row">
<div class="col-6">
{{ Form::label('name', 'Nom') }}
@include('components.input', ['name' => 'name', 'value' => isset($name) ? $name : null, 'required' => true])
</div>
<div class="col-6">
{{ 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'])
</div>
</div>
<div class="row">
<div class="col-12"> <div class="col-12">
{{ Form::label('categories', 'Catégories') }} <div class="card card-primary card-outline card-outline-tabs">
@include('components.select', ['name' => 'categories', 'list' => $categories, 'value' => isset($category_id) ? $category_id : null, 'class' => 'select2 form-control', 'multiple' => true]) <div class="card-header p-0 border-bottom-0">
</div> <ul class="nav nav-tabs" role="tablist">
</div> <li class="nav-item">
<div class="row"> <a href="#characteristics" class="nav-link active" data-toggle="tab" aria-expanded="true">
<div class="col-6"> Caractéristiques
{{ Form::label('model', 'Familles de produit') }} </a>
@include('components.select', ['name' => 'model', 'id_name' => 'model', 'list' => $models, 'value' => isset($model) ? $model : null, 'class' => 'select2 form-control']) </li>
</div> <li class="nav-item">
<div class="col-6"> <a href="#prices" class="nav-link" data-toggle="tab" aria-expanded="true">
{{ Form::label('model_id', 'Produit') }} Tarifs
@include('components.select2', ['name' => 'model_id', 'id_name' => 'model_id', 'value' => isset($model_id) ? $model_id : null, 'class' => 'select2 form-control']) @if(isset($prices_count))<span class="badge">{{ $prices_count }}</span>@endif
</div> </a>
</div> </li>
<div class="row"> <li class="nav-item">
<div class="col-12"> <a href="#shipping" class="nav-link" data-toggle="tab" aria-expanded="true">
{{ Form::label('tags', 'Tags') }} Livraison
@include('components.select', ['name' => 'tags', 'value' => isset($tags) ? $tags : null, 'class' => 'select2 form-control', 'multiple' => true]) @if(isset($shipping_count))<span class="badge">{{ $shipping_count }}</span>@endif
</div> </a>
</div> </li>
<div class="row"> <li class="nav-item">
<div class="col-12"> <a href="#stock" class="nav-link" data-toggle="tab" aria-expanded="true">
{{ Form::label('description', 'Description') }} Quantités
@include('components.textarea', ['name' => 'description', 'value' => isset($description) ? $description : null, 'class' => 'editor', 'required' => true]) @if(isset($stock_count))<span class="badge">{{ $stock_count }}</span>@endif
</div> </a>
</li>
<li class="nav-item">
<a href="#seo" class="nav-link" data-toggle="tab" aria-expanded="true">
Référencement
</a>
</li>
</ul>
<div class="tab-content p-3">
<div class="tab-pane active" id="characteristics">
@include('Shop.Admin.Articles.partials.characteristics')
</div> </div>
<div class="row"> <div class="tab-pane" id="prices">
<div class="col-12"> @include('Shop.Admin.Articles.partials.prices')
{{ Form::label('prices', 'Tarifs') }} </div>
<div class="tab-pane" id="shipping">
@include('Shop.Admin.Articles.partials.shipping')
</div>
<div class="tab-pane" id="stock">
@include('Shop.Admin.Articles.partials.stock')
</div>
<div class="tab-pane" id="seo">
@include('Shop.Admin.Articles.partials.seo')
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-4">
{{ Form::label('photo', 'Photos') }} </div>
@include('components.file', ['name' => 'photo', 'value' => isset($photo) ? $photo : null, 'required' => true])
</div> </div>
</div> </div>
<div class="row">
<div class="col-md-8"> @include('components.save')
<div class="float-right mt-3">
@include('components.button-save')
</div>
</div>
</div>
@push('js') @push('js')
<script> <script>

View File

@@ -0,0 +1,47 @@
<div class="row">
<div class="col-md-8">
<div class="row">
<div class="col-8">
{{ Form::label('name', 'Nom') }}
@include('components.input', ['name' => 'name', 'value' => isset($name) ? $name : null, 'required' => true])
</div>
<div class="col-4">
{{ 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'])
</div>
</div>
<div class="row">
<div class="col-12">
{{ 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])
</div>
</div>
<div class="row">
<div class="col-6">
{{ 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'])
</div>
<div class="col-6">
{{ 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'])
</div>
</div>
<div class="row">
<div class="col-12">
{{ Form::label('tags', 'Tags') }}
@include('components.select', ['name' => 'tags', 'value' => isset($tags) ? $tags : null, 'class' => 'select2 form-control', 'multiple' => true])
</div>
</div>
<div class="row">
<div class="col-12">
{{ Form::label('description', 'Description') }}
@include('components.textarea', ['name' => 'description', 'value' => isset($description) ? $description : null, 'class' => 'editor', 'required' => true])
</div>
</div>
</div>
<div class="col-md-4">
{{ Form::label('photo', 'Photos') }}
@include('components.file', ['name' => 'photo', 'value' => isset($photo) ? $photo : null, 'required' => true])
</div>
</div>

View File

@@ -0,0 +1,31 @@
<div class="row">
<div class="col-md-12">
<button class="btn btn-success" data-toggle="modal" data-targer="#add_price"><i class="fa fa-plus"></i> Ajouter</button>
</div>
</div>
<div class="modal fade" id="modal-default" aria-hidden="true" style="display: none;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Ajout d'un tarif</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
{{ Form::label('attribute_family_id', 'Familles d\'attributs') }}
@include('components.select', ['name' => 'attribute_family_id', 'value' => (isset($attribute_value['attribute_family_id'])) ? $attribute_value['attribute_family_id'] : null, 'list' => $attribute_families, 'required' => true])
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>

View File

@@ -0,0 +1,7 @@
<div class="row pb-5">
<div class="col-12">
<div class="text-center mt-3">
@include('components.button-save')
</div>
</div>
</div>