Merge branch 'evolutionsTickets' into develop
|
|
@ -12,9 +12,18 @@ class FaqQuestionsController extends Controller
|
|||
{
|
||||
use UpdateModelStatus;
|
||||
|
||||
public function index()
|
||||
public function index(Request $request)
|
||||
{
|
||||
$q = FaqQuestions::paginate();
|
||||
$q = FaqQuestions::with('theme');
|
||||
$this->sortQuery($q, ['utility']);
|
||||
if ($request->sort_col === 'utility' and $request->sort_way) {
|
||||
$q = $q->select('faq_questions.*');
|
||||
$q = $q->selectRaw(
|
||||
'(1 - faq_questions.negative_vote / faq_questions.positive_vote) AS `faq_questions_utility`'
|
||||
);
|
||||
$q = $q->orderBy('faq_questions_utility', $request->sort_way);
|
||||
}
|
||||
$q = $q->paginate();
|
||||
return view('bo.faq-questions.index', compact('q'));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ namespace App\Http\Controllers\Bo;
|
|||
|
||||
use App\Enums\OCBType;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\SearchRequest;
|
||||
use App\Http\Requests\StoreOcbBreeder;
|
||||
use App\Http\Requests\UpdateOcbBreeder;
|
||||
use App\Models\OCBBreeder;
|
||||
|
|
@ -14,10 +15,23 @@ class OCBBreedersController extends Controller
|
|||
{
|
||||
use UpdateModelStatus;
|
||||
|
||||
public function index(OCBType $type)
|
||||
public function index(SearchRequest $request, OCBType $type)
|
||||
{
|
||||
$b = OCBBreeder::where('ocbType', $type->value)->paginate();
|
||||
return view('bo.ocbbreeders.index', compact('b', 'type'));
|
||||
$b = OCBBreeder::where('ocbType', $type->value);
|
||||
if ($request->search) {
|
||||
$b = $this->searchQuery(
|
||||
$b,
|
||||
$request->search,
|
||||
'inuavs',
|
||||
'first_name',
|
||||
'last_name',
|
||||
['first_name', 'last_name'],
|
||||
['last_name', 'first_name'],
|
||||
);
|
||||
}
|
||||
$searchFields = trans('Nom, Prénom, Inuav');
|
||||
$b = $b->paginate();
|
||||
return view('bo.ocbbreeders.index', compact('b', 'type', 'searchFields'));
|
||||
}
|
||||
|
||||
public function create()
|
||||
|
|
|
|||
|
|
@ -27,12 +27,26 @@ class ProductsController extends Controller
|
|||
|
||||
public function index(SearchProduct $request)
|
||||
{
|
||||
$p = Products::orderBy('order', 'ASC');
|
||||
$p = Products::query()->with('range');
|
||||
if ($request->search) {
|
||||
$p = $p->where('name', 'LIKE', "%$request->search%");
|
||||
$p = $this->searchQuery(
|
||||
$p,
|
||||
$request->search,
|
||||
'name',
|
||||
'description',
|
||||
'ingredients',
|
||||
'tips',
|
||||
'tags',
|
||||
'seo_title',
|
||||
'seo_description',
|
||||
'info1',
|
||||
'info2'
|
||||
);
|
||||
}
|
||||
$this->sortQuery($p);
|
||||
$searchFields = trans('Nom, Desc., Ingr., Cons., Tags, Infos');
|
||||
$p = $p->paginate();
|
||||
return view('bo.products.index', compact('p'));
|
||||
return view('bo.products.index', compact('p', 'searchFields'));
|
||||
}
|
||||
|
||||
public function create()
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ use App\Enums\ArticleCategory;
|
|||
use App\Enums\NotificationType;
|
||||
use App\Events\NewNotification;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\SearchRequest;
|
||||
use App\Http\Requests\StoreRecipe;
|
||||
use App\Http\Requests\UpdateRecipe;
|
||||
use App\Models\Articles;
|
||||
|
|
@ -20,10 +21,34 @@ class RecipesController extends Controller
|
|||
{
|
||||
use UpdateModelStatus;
|
||||
|
||||
public function index()
|
||||
public function index(SearchRequest $request)
|
||||
{
|
||||
$r = Recipes::paginate();
|
||||
return view('bo.recipes.index', compact('r'));
|
||||
$r = Recipes::with('products.range');
|
||||
if ($request->search) {
|
||||
$r = $this->searchQuery(
|
||||
$r,
|
||||
$request->search,
|
||||
'title',
|
||||
'catch_phrase',
|
||||
'seo_title',
|
||||
'seo_description',
|
||||
'ingredients',
|
||||
'preparation',
|
||||
'advice'
|
||||
);
|
||||
}
|
||||
$r = $this->sortQuery($r, ['range_id']);
|
||||
// handle ignore columns (range_id which depends on the product used)
|
||||
if ($request->sort_col === 'range_id' and $request->sort_way) {
|
||||
$r = $r->select('recipes.*');
|
||||
$r = $r->join('recipes_products', 'recipes.id', '=', 'recipes_products.recipe_id');
|
||||
$r = $r->join('products', 'products.id', '=', 'recipes_products.product_id');
|
||||
$r = $r->join('ranges', 'products.range_id', '=', 'ranges.id');
|
||||
$r = $r->orderBy('ranges.name', $request->sort_way);
|
||||
}
|
||||
$searchFields = trans('Titre, Description, Ingredient, Préparation, Conseils');
|
||||
$r = $r->paginate();
|
||||
return view('bo.recipes.index', compact('r', 'searchFields'));
|
||||
}
|
||||
|
||||
public function create()
|
||||
|
|
@ -71,7 +96,7 @@ class RecipesController extends Controller
|
|||
public function edit(Recipes $r)
|
||||
{
|
||||
$c = ConsumptionTimes::all();
|
||||
$p = Products::all();
|
||||
$p = Products::with(['recipes', 'consumptionTimes'])->get();
|
||||
$a = Articles::where('type', ArticleCategory::actu())->get();
|
||||
$raIds = [];
|
||||
foreach ($r->articles as $recipe_article) {
|
||||
|
|
|
|||
|
|
@ -2,14 +2,90 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
|
||||
class Controller extends BaseController
|
||||
{
|
||||
use AuthorizesRequests;
|
||||
use DispatchesJobs;
|
||||
use ValidatesRequests;
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @param Builder $query The eloquent query builder
|
||||
* @param string $search The query string
|
||||
* @param string|array ...$field Either a simple array or a string
|
||||
* In case of a string the two fields would be concatenate to make the search
|
||||
* @return Builder
|
||||
*/
|
||||
protected function searchQuery(
|
||||
Builder $query,
|
||||
string $search,
|
||||
...$field
|
||||
): Builder {
|
||||
if (count($field)) {
|
||||
$table = $query->getModel()->getTable();
|
||||
$query = $query->where(function ($q) use ($field, $search, $table) {
|
||||
foreach ($field as $f) {
|
||||
$f = str_replace('?', '\?', $f);
|
||||
if (is_array($f)) {
|
||||
$q->orWhereRaw(
|
||||
sprintf("UPPER(CONCAT(%s)) LIKE UPPER(?)", collect($f)->map(function ($q) use ($table) {
|
||||
return "`$table`.`$q`";
|
||||
})->implode(', \' \', ')),
|
||||
["%$search%"]
|
||||
);
|
||||
} else {
|
||||
$q->orWhereRaw("UPPER(`$table`.`$f`) LIKE UPPER(?)", ["%$search%"]);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort columns with a query
|
||||
*
|
||||
* @param Builder $query
|
||||
* @param array $ignore
|
||||
* @return Builder
|
||||
*/
|
||||
protected function sortQuery(Builder $query, array $ignore = []): Builder
|
||||
{
|
||||
$rName = request()->route()->getName();
|
||||
$table = $query->getModel()->getTable();
|
||||
if (request()->sort_col) {
|
||||
Session::put("$rName.sort_col", request()->sort_col);
|
||||
} else {
|
||||
Session::remove("$rName.sort_col");
|
||||
}
|
||||
if (request()->sort_way) {
|
||||
Session::put("$rName.sort_way", request()->sort_way);
|
||||
} else {
|
||||
Session::remove("$rName.sort_way");
|
||||
}
|
||||
if (request()->sort_col and request()->sort_way) {
|
||||
if (
|
||||
!isset($ignore) or
|
||||
(isset($ignore) and !in_array(request()->sort_col, $ignore))
|
||||
) {
|
||||
$query = $query->orderBy(\sprintf("$table.%s", request()->sort_col), request()->sort_way);
|
||||
}
|
||||
} elseif (Schema::hasColumn($table, 'order')) {
|
||||
$query = $query->orderBy('order', 'ASC');
|
||||
Session::put("$rName.sort_col", 'order');
|
||||
Session::put("$rName.sort_way", 'asc');
|
||||
}
|
||||
Session::save();
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,10 +9,29 @@ use Illuminate\Http\Request;
|
|||
|
||||
class FaqController extends Controller
|
||||
{
|
||||
/**
|
||||
* OrderBy utility
|
||||
* Working SQL query
|
||||
*
|
||||
* select * from `faq_themes`
|
||||
* inner join `faq_questions` on `faq_themes`.`id` = `faq_questions`.`faq_themes_id`
|
||||
* inner JOIN (
|
||||
* SELECT (1 - faq_questions.negative_vote / faq_questions.positive_vote) AS `faq_questions_utility`
|
||||
* FROM `faq_questions`
|
||||
* ) b on `faq_themes`.`id` = `faq_questions`.`faq_themes_id`
|
||||
* order by `faq_questions_utility` desc;
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('front.faq.index', [
|
||||
'themes' => FaqThemes::with('questions')->get()
|
||||
'themes' => FaqThemes::with(['questions' => function ($q) {
|
||||
return $q->select('faq_questions.*')
|
||||
->selectRaw(
|
||||
'(1 - faq_questions.negative_vote / faq_questions.positive_vote) AS `faq_questions_utility`'
|
||||
)->orderBy('faq_questions_utility', 'desc');
|
||||
}])->orderBy('order')->get()
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Lib\Utils;
|
||||
use Closure;
|
||||
|
||||
class XssSanitizer
|
||||
|
|
@ -19,6 +20,7 @@ class XssSanitizer
|
|||
array_walk_recursive($inputs, function (&$input, $name) use ($params) {
|
||||
if (in_array($name, $params)) {
|
||||
$input = clean($input);
|
||||
$input = Utils::assertNoInternalUrls($name, $input);
|
||||
} else {
|
||||
$input = strip_tags($input);
|
||||
}
|
||||
|
|
|
|||
30
app/Http/Requests/SearchRequest.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class SearchRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return auth()->check();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'search' => 'sometimes|string|min:1'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,11 @@
|
|||
|
||||
namespace App\Lib;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
// phpcs:disable Generic.Files.LineLength.TooLong
|
||||
class Utils
|
||||
{
|
||||
|
|
@ -92,7 +97,7 @@ class Utils
|
|||
* @param string|null $to
|
||||
* @return void
|
||||
*/
|
||||
public static function mbStrtr($str, $from, $to = null)
|
||||
public static function mbStrtr($str, $from, $to = null): string
|
||||
{
|
||||
if (is_array($from)) {
|
||||
$from = array_map('utf8_decode', $from);
|
||||
|
|
@ -101,4 +106,40 @@ class Utils
|
|||
}
|
||||
return utf8_encode(strtr(utf8_decode($str), utf8_decode($from), utf8_decode($to)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert That no Back Office url is present on txt
|
||||
*
|
||||
* @param string $field
|
||||
* @param string $text
|
||||
* @return string
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
*/
|
||||
public static function assertNoInternalUrls(string $field, string $text): string
|
||||
{
|
||||
$routes = Route::getRoutes();
|
||||
// url replace and email replace
|
||||
$text = preg_replace_callback(
|
||||
'/(?P<url>(?:http[s]?:\/\/.)?(?:www\.)?[-a-zA-Z0-9@%._\+~#=]{2,256}\.[a-z]{2,6}\b(?:[-a-zA-Z0-9@:%_\+.~#?&\/\/=]*))/',
|
||||
function ($matches) use ($routes, $field) {
|
||||
$match = collect($matches)->first() ?? '';
|
||||
$url = $match;
|
||||
try {
|
||||
$request = Request::create($url);
|
||||
// if a route is match then it do not throws exception
|
||||
if ($routes->match($request)->getPrefix() === 'bo') {
|
||||
// removes the matched url
|
||||
throw ValidationException::withMessages([
|
||||
$field => trans($field) . " : Il est interdit de coller une url du Back Office Le Gaulois dans ce champ"
|
||||
]);
|
||||
}
|
||||
return $match;
|
||||
} catch (NotFoundHttpException $e) {
|
||||
return $match;
|
||||
}
|
||||
},
|
||||
$text
|
||||
);
|
||||
return $text;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 6 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 9 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 161 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 89 KiB |
3
resources/sass/front/_header.scss
vendored
|
|
@ -362,6 +362,9 @@ body > div > header {
|
|||
}
|
||||
}
|
||||
}
|
||||
&.color-vegetal nav {
|
||||
background-color: $vegetalTitle;
|
||||
}
|
||||
& .menu-toggle {
|
||||
display: block;
|
||||
}
|
||||
|
|
|
|||
8
resources/sass/front/_sub_header.scss
vendored
|
|
@ -699,13 +699,19 @@
|
|||
|
||||
& .infos {
|
||||
margin: 0 auto;
|
||||
width: 80%;
|
||||
width: auto;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
|
||||
& > li {
|
||||
line-height: 27px;
|
||||
font-family: "CreamyScriptRegular";
|
||||
color: $color5;
|
||||
font-size: 3em;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
&:before {
|
||||
font-family: "icomoon";
|
||||
|
|
|
|||
21
resources/sass/front/pages/recipes/_show.scss
vendored
|
|
@ -114,15 +114,20 @@
|
|||
margin-bottom: 0.2em !important;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
}
|
||||
ul {
|
||||
padding-left: 1.5em;
|
||||
|
||||
&::before {
|
||||
content: "• ";
|
||||
color: $color6;
|
||||
font-size: 1.7em;
|
||||
left: 0;
|
||||
line-height: 1em;
|
||||
position: absolute;
|
||||
top: -0.1em;
|
||||
& > li {
|
||||
&::before {
|
||||
content: "• ";
|
||||
color: $color6;
|
||||
font-size: 1.7em;
|
||||
left: 0;
|
||||
line-height: 1em;
|
||||
position: absolute;
|
||||
top: -0.1em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,15 +65,15 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">Entrée *</label>
|
||||
<custom-ckeditor name="entree" dbtext="{{ $m->entree }}"></custom-ckeditor>
|
||||
<custom-ckeditor name="entree" dbtext="{{ old('entree') ?? $m->entree }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">Plat *</label>
|
||||
<custom-ckeditor name="meal" dbtext="{{ $m->meal }}"></custom-ckeditor>
|
||||
<custom-ckeditor name="meal" dbtext="{{ old('meal') ?? $m->meal }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">Dessert *</label>
|
||||
<custom-ckeditor name="dessert" dbtext="{{ $m->dessert }}"></custom-ckeditor>
|
||||
<custom-ckeditor name="dessert" dbtext="{{ old('dessert') ?? $m->dessert }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Dashboard') }}</div>
|
||||
<div class="card-header">{{ __('Tableau de bord') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
</div>
|
||||
@endif
|
||||
|
||||
{{ __('You are logged in!') }}
|
||||
{{ __('Vous êtes connecté!') }}
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -12,11 +12,14 @@
|
|||
<table class="table text-center">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col">Question</th>
|
||||
<th scope="col">Thème</th>
|
||||
<th scope="col">Utilité</th>
|
||||
<th scope="col">Publié ?</th>
|
||||
<th scope="col"></th>
|
||||
@include('bo.modules.tableColSorter', [
|
||||
'cols' => [
|
||||
'question' => 'Question',
|
||||
'faq_themes_id' => 'Thème',
|
||||
'utility' => 'Utilité',
|
||||
'status' => 'Publié ?'
|
||||
]
|
||||
])
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
|
|||
37
resources/views/bo/modules/searchBar.blade.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
@php
|
||||
$routeName = request()->route()->getName();
|
||||
$iArgs = [];
|
||||
if(request()->sort_col) {
|
||||
$iArgs['sort_col'] = request()->sort_col;
|
||||
}
|
||||
|
||||
if(request()->search) {
|
||||
$iArgs['search'] = request()->sort_way;
|
||||
}
|
||||
@endphp
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
<form id="searchForm" action="{{ request()->url() }}">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<label class="input-group-text" for="searchField">{{ $searchFields }}</label>
|
||||
</div>
|
||||
@if(request()->sort_col)
|
||||
<input class="d-none" type="text" name="sort_col" value="{{ request()->sort_col }}">
|
||||
@endif
|
||||
@if(request()->sort_way)
|
||||
<input class="d-none" type="text" name="sort_way" value="{{ request()->sort_way }}">
|
||||
@endif
|
||||
<input type="search" id="searchField" name="search" class="form-control" value="{{ request()->search }}" placeholder="{{ __('Vos mots clés ici...') }}"/>
|
||||
<div class="input-group-append">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-search"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-danger" onclick="$('#searchField').val('');$('#searchForm').submit();">
|
||||
<i class="fas fa-backspace"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
42
resources/views/bo/modules/tableColSorter.blade.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
@php
|
||||
$route = request()->route();
|
||||
$routeName = $route->getName();
|
||||
$noOrder = request()->sort_col and request()->sort_way;
|
||||
@endphp
|
||||
<tr>
|
||||
@foreach($cols as $col => $colname)
|
||||
@php
|
||||
$iArgs = ['sort_col' => $col];
|
||||
if(request()->search) {
|
||||
$iArgs['search'] = request()->search;
|
||||
}
|
||||
@endphp
|
||||
{{-- NO Sort for order column --}}
|
||||
@if($col === 'order')
|
||||
@if($noOrder) @continue @endif
|
||||
<th scope="col">
|
||||
<span class="text-nowrap">{{ $colname }}</span>
|
||||
</th>
|
||||
@continue
|
||||
@endif
|
||||
<th scope="col">
|
||||
<span class="text-nowrap">
|
||||
{{ $colname }}
|
||||
@if(!session("$routeName.sort_way") or session("$routeName.sort_col") !== $col or (session("$routeName.sort_way") === 'desc' and session("$routeName.sort_col") === $col))
|
||||
<a class="col_sort text-info lead asc" href="{{ request()->fullUrlWithQuery(array_merge($iArgs, ['sort_way' => 'asc'])) }}"> ↓ </a>
|
||||
@endif
|
||||
@if(!session("$routeName.sort_way") or session("$routeName.sort_col") !== $col or (session("$routeName.sort_way") === 'asc' and session("$routeName.sort_col") === $col))
|
||||
<a class="col_sort text-info lead desc" href="{{ request()->fullUrlWithQuery(array_merge($iArgs, ['sort_way' => 'desc'])) }}"> ↑ </a>
|
||||
@endif
|
||||
</span>
|
||||
</th>
|
||||
@endforeach
|
||||
{{-- Buttons Col --}}
|
||||
<th scope="col">
|
||||
@if($noOrder)
|
||||
<a class="btn btn-small btn-danger" href="{{ route("$routeName", isset($iArgs['search']) ? ['search' => $iArgs['search']] : []) }}">
|
||||
<i class="fa fa-eraser"></i>
|
||||
</a>
|
||||
@endif
|
||||
</th>
|
||||
</tr>
|
||||
|
|
@ -129,7 +129,7 @@
|
|||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-10 offset-md-1">
|
||||
<moment-strates dbdatas="{{ session('strates') !== null ? session('strates') : $strates }}" name="strates"></moment-strates>
|
||||
<moment-strates dbdatas="{{ old('strates') ?? (session('strates') !== null ? session('strates') : $strates) }}" name="strates"></moment-strates>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -142,7 +142,7 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">Texte de la remontée</label>
|
||||
<custom-ckeditor name="featured_text" dbtext="{{ $m->featured_text }}"></custom-ckeditor>
|
||||
<custom-ckeditor name="featured_text" dbtext="{{ old('featured_text') ?? $m->featured_text }}"></custom-ckeditor>
|
||||
</div>
|
||||
<featured-types name="featured_type" namechoice="featured_ids[]" dbfeaturedtypes='@json($featuredTypes)'
|
||||
dbrecipes='@json($recipes)' dbarticles='@json($articles)' dbproducts='@json($products)'
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">Contenu</label>
|
||||
<custom-ckeditor name="content" dbtext="{{ $ocb->content }}"></custom-ckeditor>
|
||||
<custom-ckeditor name="content" dbtext="{{ old('content') ?? $ocb->content }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-4">Type *</label>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@include('bo.modules.searchBar')
|
||||
{{ $b->withQueryString()->links()}}
|
||||
<table class="table text-center">
|
||||
<thead class="thead-dark">
|
||||
|
|
|
|||
|
|
@ -8,25 +8,19 @@
|
|||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form action="{{ url()->full() }}" method="get">
|
||||
<div class="input-group mb-3">
|
||||
<input name="search" type="text" class="form-control" value="{{ request()->search }}" placeholder="{{ __('tapez ici votre recherche') }}" aria-label="Recherche d'un produit">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-secondary" type="submit">Chercher</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@include('bo.modules.searchBar')
|
||||
{{ $p->withQueryString()->links() }}
|
||||
<table class="table text-center">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col">Nom</th>
|
||||
<th scope="col">Gamme</th>
|
||||
<th scope="col">Produit star ?</th>
|
||||
<th scope="col">Publié ?</th>
|
||||
<th scope="col">Ordre</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
@include('bo.modules.tableColSorter', [
|
||||
'cols' => [
|
||||
'name' => 'Nom',
|
||||
'range_id' => 'Gamme',
|
||||
'star' => 'Produit star ?',
|
||||
'status' => 'Publié ?',
|
||||
'order' => 'Ordre',
|
||||
]
|
||||
])
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($p as $product)
|
||||
|
|
@ -51,6 +45,7 @@
|
|||
@endif
|
||||
</a>
|
||||
</td>
|
||||
@if(!request()->sort_col and !request()->sort_way)
|
||||
<td>
|
||||
@if ($loop->first)
|
||||
<a href="{{route('bo.products.change-order', ['id' => $product->id, 'action' => 'down'])}}" class="btn-link text-decoration-none">
|
||||
|
|
@ -69,6 +64,7 @@
|
|||
</a>
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
<td><a href="{{route('bo.products.edit', $product->id)}}" class="btn btn-sm btn-primary">Éditer</a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -81,18 +81,18 @@
|
|||
<div class="form-group">
|
||||
<label class="col-md-8 col-form-label">Produit associé 1</label>
|
||||
<select class="custom-select" name="associated_product1">
|
||||
<option value="" @if (isset($r) and !$r->products()->count())selected @endif>Aucune</option>
|
||||
<option value="" @if (isset($r) and !$r->products->count())selected @endif>Aucune</option>
|
||||
@foreach ($p as $product)
|
||||
<option id="product_{{$product->id}}" data-ct="{{$product->consumptionTimes->id}}" value="{{$product->id}}" @if (isset($r) and $r->products()->first() && $r->products()->first()->id === $product->id)selected @endif>{{$product->name}}</option>
|
||||
<option id="product_{{$product->id}}" data-ct="{{$product->consumptionTimes->id}}" value="{{$product->id}}" @if (isset($r) and $r->products->first() && $r->products->first()->id === $product->id)selected @endif>{{$product->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-8 col-form-label">Produit associé 2</label>
|
||||
<select class="custom-select" name="associated_product2">
|
||||
<option value="" @if (isset($r) and !$r->products()->count())selected @endif>Aucune</option>
|
||||
<option value="" @if (isset($r) and !$r->products->count())selected @endif>Aucune</option>
|
||||
@foreach ($p as $product)
|
||||
<option value="{{$product->id}}" @if (isset($r) and $r->products()->skip(1)->first() and $r->products()->skip(1)->first()->id === $product->id)selected @endif>{{$product->name}}</option>
|
||||
<option value="{{$product->id}}" @if (isset($r) and $r->products->skip(1)->first() and $r->products->skip(1)->first()->id === $product->id)selected @endif>{{$product->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,15 +8,17 @@
|
|||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@include('bo.modules.searchBar')
|
||||
{{ $r->withQueryString()->links() }}
|
||||
<table class="table text-center">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col">Nom</th>
|
||||
<th scope="col">Gamme</th>
|
||||
<th scope="col">Publié ?</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
@include('bo.modules.tableColSorter', [
|
||||
'cols' => [
|
||||
'title' => 'Titre',
|
||||
'range_id' => 'Gamme',
|
||||
'status' => 'Publié ?'
|
||||
]
|
||||
])
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($r as $recipe)
|
||||
|
|
|
|||
|
|
@ -29,9 +29,10 @@
|
|||
</div>
|
||||
<div class="clear"></div>
|
||||
</section>
|
||||
<section class="map">
|
||||
{{-- Ticket 149 removed this item (facturé) --}}
|
||||
{{-- <section class="map">
|
||||
<google-map-markers></google-map-markers>
|
||||
</section>
|
||||
</section> --}}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<div class="product-vegetal">
|
||||
<div class="content" id="bloc-vegetal">
|
||||
<img src="{{ asset('assets/images/produit/logo_gamme.png') }}" alt="Le Végétal - Le Gaulois">
|
||||
<img src="{{ asset('assets/images/le-vegetal/logo_gamme.png') }}" alt="Le Végétal - Le Gaulois">
|
||||
<p>Pour tous ceux qui aiment le visuel et la texture de la viande et qui souhaitent diversifier leur alimentation et leurs <strong>sources de protéines</strong>, Le Gaulois a développé <strong>une gamme 100% GOURMANDE, SANS VIANDE.</strong></p>
|
||||
<h6>Les atouts de la gamme</h6>
|
||||
<p>Le Gaulois a mis tout son savoir-faire dans l’élaboration de sa gamme Le Gaulois Végétal : des recettes gourmandes, de qualité, destinées à toute la famille.</p>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="content">
|
||||
<picture>
|
||||
<source srcset="{{ asset('assets/images/le-vegetal/logo_gamme.webp') }}" type="image/webp">
|
||||
<img class="logo-lgl-vegetal" src="{{ asset('assets/images/le-vegetal/logo_gamme.png') }}" alt="Le Gaulois - Le Vegetal/>
|
||||
<img class="logo-lgl-vegetal" src="{{ asset('assets/images/le-vegetal/logo_gamme.png') }}" alt="Le Gaulois - Le Vegetal"/>
|
||||
</picture>
|
||||
@desktop
|
||||
<div class="schema-desktop">
|
||||
|
|
|
|||
|
|
@ -93,7 +93,8 @@
|
|||
</picture>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{{-- Ticket 148 removed this menu entry (facturé) --}}
|
||||
{{-- <li>
|
||||
<i class="fa fa-chevron-right" aria-hidden="true"></i>
|
||||
<a href="{{ route('ocb.testimonials') }}">
|
||||
{{ __('Témoignage des éleveurs engagés dans la démarche') }}
|
||||
|
|
@ -101,7 +102,7 @@
|
|||
<img src="{{ asset('assets/images/ocb/logo-oui-contour.png') }}" alt="{{__('Oui c\'est Bon! - Le Gaulois') }}">
|
||||
</picture>
|
||||
</a>
|
||||
</li>
|
||||
</li> --}}
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
|
|
|||