change icons, css, add routing to merchandise, add mail templater, fixes
This commit is contained in:
9
app/Http/Controllers/Admin/Core/Mail/Controller.php
Normal file
9
app/Http/Controllers/Admin/Core/Mail/Controller.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Core\Mail;
|
||||
|
||||
use App\Http\Controllers\Controller as ParentController;
|
||||
|
||||
class Controller extends ParentController
|
||||
{
|
||||
}
|
||||
26
app/Http/Controllers/Admin/Core/Mail/MailLogController.php
Normal file
26
app/Http/Controllers/Admin/Core/Mail/MailLogController.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Core\Mail;
|
||||
|
||||
use App\Datatables\Admin\Core\Mail\MailLogsDataTable;
|
||||
use App\Repositories\Core\Mail\MailLogs;
|
||||
|
||||
class MailLogController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
// $this->middleware('ability:admin');
|
||||
}
|
||||
|
||||
public function index(MailLogsDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('admin.Core.Mail.MailLog.index', $data ?? []);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['message'] = MailLogs::getParsed($id);
|
||||
|
||||
return view('admin.Core.Mail.MailLog.modal', $data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Core\Mail;
|
||||
|
||||
use App\Datatables\Admin\Core\Mail\MailTemplatesDataTable;
|
||||
use App\Repositories\Core\Mail\MailTemplates;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class MailTemplateController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
// $this->middleware('ability:admin');
|
||||
}
|
||||
|
||||
public function index(MailTemplatesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Admin.Core.Mail.MailTemplate.index', $data ?? []);
|
||||
}
|
||||
|
||||
public function modalCreate()
|
||||
{
|
||||
$data = MailTemplates::init();
|
||||
return view('Admin.Core.Mail.MailTemplate.modal', $data ?? []);
|
||||
}
|
||||
|
||||
public function modalEdit($id = false)
|
||||
{
|
||||
$data = MailTemplates::init();
|
||||
$data['mail_template'] = MailTemplates::edit($id);
|
||||
|
||||
return view('Admin.Core.Mail.MailTemplate.modal', $data);
|
||||
}
|
||||
|
||||
public function storeAjax(Request $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
unset($data['proengsoft_jsvalidation']);
|
||||
$ret = MailTemplates::store($data);
|
||||
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
|
||||
public function destroy(Request $request, $id = false)
|
||||
{
|
||||
$id = $id ?? $request->input('id');
|
||||
MailTemplates::destroy($id);
|
||||
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
|
||||
public function getVarsByMailable($mailable)
|
||||
{
|
||||
$data['vars'] = MailTemplates::getVarsByMailable($mailable);
|
||||
|
||||
return view('Admin.Core.Mail.MailTemplate.partials.vars', $data);
|
||||
}
|
||||
|
||||
public function preview($template_id, $user_id)
|
||||
{
|
||||
return MailTemplates::preview($template_id, $user_id);
|
||||
}
|
||||
|
||||
public function modalPreview($template_id)
|
||||
{
|
||||
$data = MailTemplates::getDataFormodalPreview($template_id);
|
||||
|
||||
return view('Admin.Core.Mail.MailTemplate.partials.modalPreview', $data);
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,9 @@ class ArticleNatureController extends Controller
|
||||
public function edit($id)
|
||||
{
|
||||
$data['article_nature'] = ArticleNatures::get($id);
|
||||
$data['product_types'] = ArticleNatures::getProductTypes();
|
||||
// dump($data);
|
||||
// exit;
|
||||
return view('Admin.Shop.ArticleNatures.edit', $data);
|
||||
}
|
||||
|
||||
@@ -42,8 +45,9 @@ class ArticleNatureController extends Controller
|
||||
return ArticleNatures::destroy($id);
|
||||
}
|
||||
|
||||
public static function getOptions($product_type)
|
||||
public static function getOptions(Request $request)
|
||||
{
|
||||
return response()->json(['0' => ''] + ArticleNatures::getOptionsByProductType($product_type));
|
||||
$data = ArticleNatures::getOptionsByProductTypeModel($request->input('product_type'));
|
||||
return response()->json(['0' => ''] + $data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ class ArticleController extends Controller
|
||||
{
|
||||
$data['article'] = Articles::getArticleToSell($id);
|
||||
// $data['breadcrumb'] = Categories::getAncestorsByCategory($category_id);
|
||||
$data['offers2'] = Articles::getSiblings($id)->toArray();
|
||||
// dump($data);
|
||||
// exit;
|
||||
return view('Shop.Articles.show', $data);
|
||||
|
||||
@@ -10,6 +10,7 @@ use App\Repositories\Shop\Categories;
|
||||
use App\Repositories\Shop\TagGroups;
|
||||
|
||||
use App\Datatables\Shop\CategoriesDataTable;
|
||||
use App\Repositories\Shop\ArticleNatures;
|
||||
|
||||
class CategoryController extends Controller
|
||||
{
|
||||
@@ -18,43 +19,52 @@ class CategoryController extends Controller
|
||||
return $dataTable->render('Shop.Categories.list');
|
||||
}
|
||||
|
||||
public function show(Request $request, $category_id)
|
||||
public function show(Request $request, $category_id, $article_nature_id = false)
|
||||
{
|
||||
switch ($request->input('article_nature')) {
|
||||
case 'semences':
|
||||
$product_type = 'botanic';
|
||||
$article_nature_id = 1;
|
||||
break;
|
||||
case 'plants':
|
||||
$product_type = 'botanic';
|
||||
$article_nature_id = 2;
|
||||
break;
|
||||
case 'legumes':
|
||||
$product_type = 'botanic';
|
||||
$article_nature_id = 3;
|
||||
break;
|
||||
default:
|
||||
$product_type = 'botanic';
|
||||
$article_nature_id = 1;
|
||||
break;
|
||||
if ($article_nature_id) {
|
||||
$product_type = ArticleNatures::getProductType($article_nature_id);
|
||||
dump($product_type);
|
||||
exit;
|
||||
} else {
|
||||
// $product_type = Articles::getProductTypeByCategory($category_id);
|
||||
// dump($product_type);
|
||||
switch ($request->input('article_nature')) {
|
||||
case 'semences':
|
||||
$product_type = 'botanic';
|
||||
$article_nature_id = 1;
|
||||
break;
|
||||
case 'plants':
|
||||
$product_type = 'botanic';
|
||||
$article_nature_id = 2;
|
||||
break;
|
||||
case 'legumes':
|
||||
$product_type = 'botanic';
|
||||
$article_nature_id = 3;
|
||||
break;
|
||||
default:
|
||||
$product_type = 'botanic';
|
||||
$article_nature_id = 1;
|
||||
break;
|
||||
}
|
||||
// $product_type = ArticleNatures::getProductType($article_nature_id);
|
||||
// dump($product_type);
|
||||
}
|
||||
$data = [
|
||||
'category' => Categories::getFull($category_id),
|
||||
'breadcrumb' => Categories::getAncestorsByCategory($category_id),
|
||||
'display_by_rows' => $request->input('display_by_rows') ?? false,
|
||||
'product_type' => $product_type,
|
||||
'article_nature' => $request->input('article_nature'),
|
||||
'article_nature' => $article_nature_id,
|
||||
'tags_selected' => $request->input('tags') ?? [],
|
||||
'articles' => Articles::getArticlesToSell([
|
||||
'category_id' => $category_id,
|
||||
'tags' => $request->input('tags') ?? [],
|
||||
'product_type' => $product_type,
|
||||
'product_type' => $product_type ?? false,
|
||||
'article_nature_id' => $article_nature_id ?? false,
|
||||
]),
|
||||
'tags' => TagGroups::getWithTagsAndCountOffers($category_id),
|
||||
];
|
||||
// dump($data);
|
||||
// exit;
|
||||
return view('Shop.Shelves.shelve', $data);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user