added conviction page
This commit is contained in:
parent
d61f05640d
commit
3f15d48355
17 changed files with 665 additions and 71 deletions
77
app/Http/Controllers/Bo/ConvictionpageController.php
Normal file
77
app/Http/Controllers/Bo/ConvictionpageController.php
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\Bo\Convictionpages\UpdateConvictionpageRequest;
|
||||
use App\Models\Convictionpage;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ConvictionpageController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create the controller instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->authorizeResource(Convictionpage::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function index(): \Illuminate\Contracts\View\View
|
||||
{
|
||||
/** @var \Illuminate\Database\Eloquent\Builder $convictionpageModels */
|
||||
$convictionpageModels = Convictionpage::query();
|
||||
|
||||
/** Sort columns with a query */
|
||||
$this->sortQuery($convictionpageModels);
|
||||
|
||||
/** Custom pagination */
|
||||
$convictionpageModels = $this->paginate($convictionpageModels);
|
||||
|
||||
return view('bo.pages.convictionpages.index', compact('convictionpageModels'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param App\Models\Convictionpage $convictionpage
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function edit(Convictionpage $convictionpage): \Illuminate\Contracts\View\View
|
||||
{
|
||||
return view('bo.pages.convictionpages.edit', ['convictionpageModel' => $convictionpage]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\Bo\Convictionpages\UpdateConvictionpageRequest $request
|
||||
* @param \App\Models\Convictionpage $convictionpage
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function update(
|
||||
UpdateConvictionpageRequest $request,
|
||||
Convictionpage $convictionpage
|
||||
): \Illuminate\Http\RedirectResponse {
|
||||
return DB::transaction(function () use ($request, $convictionpage) {
|
||||
$convictionpage->fill($request->validated());
|
||||
|
||||
if ($convictionpage->saveOrFail()) {
|
||||
return redirect()->route('bo.convictionpages.edit', $convictionpage)
|
||||
->with('success', __('crud.messages.has_been_updated', [
|
||||
'model' => Str::ucfirst(__('models.classes.convictionpage'))
|
||||
]));
|
||||
}
|
||||
return redirect()->route('bo.convictionpages.edit', $convictionpage)
|
||||
->with('error', __('crud.messages.cannot_be_updated', [
|
||||
'model' => Str::ucfirst(__('models.classes.convictionpage'))
|
||||
]));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Bo\Convictionpages;
|
||||
|
||||
use App\Traits\Requests\HasPicture;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreConvictionpageRequest extends FormRequest
|
||||
{
|
||||
use HasPicture;
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return auth('backend')->check();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'key_feed' => 'required|numeric',
|
||||
'key_earth_1' => 'required|numeric',
|
||||
'key_earth_2' => 'required|numeric',
|
||||
'key_together_1' => 'required|numeric',
|
||||
'key_together_2' => 'required|numeric',
|
||||
'key_together_3' => 'required|numeric',
|
||||
'key_together_4' => 'required|numeric',
|
||||
'key_territory' => 'required|numeric',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Bo\Convictionpages;
|
||||
|
||||
class UpdateConvictionpageRequest extends StoreConvictionpageRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return \array_merge(
|
||||
parent::rules()
|
||||
);
|
||||
}
|
||||
}
|
||||
43
app/Policies/ConvictionpagePolicy.php
Normal file
43
app/Policies/ConvictionpagePolicy.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Enums\Users\RoleEnum;
|
||||
use App\Models\User;
|
||||
use App\Policies\Rules\UserStaticRules;
|
||||
|
||||
class ConvictionpagePolicy
|
||||
{
|
||||
/**
|
||||
* Determine whether the user can view any models.
|
||||
*
|
||||
* @param \App\Models\User $authUser
|
||||
* @return boolean
|
||||
*/
|
||||
public function viewAny(User $authUser): bool
|
||||
{
|
||||
return UserStaticRules::atLeastRole($authUser, RoleEnum::admin);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can view the model.
|
||||
*
|
||||
* @param \App\Models\User $authUser
|
||||
* @return boolean
|
||||
*/
|
||||
public function view(User $authUser): bool
|
||||
{
|
||||
return UserStaticRules::atLeastRole($authUser, RoleEnum::admin);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can update the model.
|
||||
*
|
||||
* @param \App\Models\User $authUser
|
||||
* @return boolean
|
||||
*/
|
||||
public function update(User $authUser): bool
|
||||
{
|
||||
return UserStaticRules::atLeastRole($authUser, RoleEnum::admin);
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Providers;
|
||||
|
||||
use App\Models\Commitment;
|
||||
use App\Models\Convictionpage;
|
||||
use App\Models\Explorerpage;
|
||||
use App\Models\Homepage;
|
||||
use App\Models\Range;
|
||||
|
|
@ -58,6 +59,7 @@ class RouteServiceProvider extends ServiceProvider
|
|||
Route::model('stamp', Stamp::class);
|
||||
Route::model('explorerpage', Explorerpage::class);
|
||||
Route::model('product', Product::class);
|
||||
Route::model('convictionpage', Convictionpage::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -13,5 +13,6 @@ return [
|
|||
'explorerpage' => 'explorer page',
|
||||
'commitment' => 'commitment',
|
||||
'product' => 'product',
|
||||
'convictionpage' => 'conviction page',
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -246,9 +246,9 @@ return [
|
|||
'picture_2' => 'picture two',
|
||||
'picture_3' => 'picture three',
|
||||
'presentation_title' => 'presentation title',
|
||||
'title_part1' => 'title part one',
|
||||
'title_part2' => 'title part two',
|
||||
'title_part3' => 'title part three',
|
||||
'title_part1' => 'title part one',
|
||||
'title_part2' => 'title part two',
|
||||
'title_part3' => 'title part three',
|
||||
'category' => 'category',
|
||||
'publish_at' => 'publication date',
|
||||
'unpublish_at' => 'end of publication date',
|
||||
|
|
@ -257,5 +257,13 @@ return [
|
|||
'cooking_advice' => 'cooking advice',
|
||||
'ingredients' => 'ingredients',
|
||||
'nutritionnal_values' => 'nutritionnal values',
|
||||
'key_feed' => 'key number for "feed well"',
|
||||
'key_earth_1' => 'key number for "respect the earth" 1',
|
||||
'key_earth_2' => 'key number for "respect the earth" 2',
|
||||
'key_together_1' => 'key number for "live together" 1',
|
||||
'key_together_2' => 'key number for "live together" 2',
|
||||
'key_together_3' => 'key number for "live together" 3',
|
||||
'key_together_4' => 'key number for "live together" 4',
|
||||
'key_territory' => 'key number for "integrate its territory"',
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -13,5 +13,6 @@ return [
|
|||
'stamp' => 'tampon',
|
||||
'explorerpage' => 'page explorateur',
|
||||
'product' => 'produit',
|
||||
'convictionpage' => 'page conviction',
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -259,5 +259,13 @@ return [
|
|||
'cooking_advice' => 'conseil de réchauffage',
|
||||
'ingredients' => 'ingrédients',
|
||||
'nutritionnal_values' => 'valeurs nutritionnelles',
|
||||
'key_feed' => 'chiffre clé "bien nourrir"',
|
||||
'key_earth_1' => 'Chiffre clé "respecter la terre" 1',
|
||||
'key_earth_2' => 'Chiffre clé "respecter la terre" 2',
|
||||
'key_together_1' => 'Chiffre clé "vivre ensemble" 1',
|
||||
'key_together_2' => 'Chiffre clé "vivre ensemble" 2',
|
||||
'key_together_3' => 'Chiffre clé "vivre ensemble" 3',
|
||||
'key_together_4' => 'Chiffre clé "vivre ensemble" 4',
|
||||
'key_territory' => 'Chiffre clé "intégrer son territoire"',
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -6,32 +6,14 @@
|
|||
{{ __('Accueil') }}
|
||||
</a>
|
||||
</li>
|
||||
@can('viewAny', \App\Models\StaticPage::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.static_pages.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.static_pages.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(trans_choice('models.classes.static_page', '*'))->title()]) }}">
|
||||
{{ Str::of(trans_choice('models.classes.static_page', '*'))->title() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\Commitment::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.commitments.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.commitments.index') }}"
|
||||
<a class="nav-link @if (request()->routeIs('bo.commitments.*')) active @endif" data-bs-toggle="tooltip" href="{{ route('bo.commitments.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(__('models.classes.commitment'))->plural()]) }}">
|
||||
{{ Str::of(__('models.classes.commitment'))->plural()->ucfirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\News::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.news.*')) active @endif" data-bs-toggle="tooltip" href="{{ route('bo.news.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(__('models.classes.news'))->plural()->title()]) }}">
|
||||
{{ Str::of(__('models.classes.news'))->plural()->title() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\SeasonalSection::class)
|
||||
<li>
|
||||
<a class="nav-link @if (request()->routeIs('bo.seasonalsections.*')) active @endif" data-bs-toggle="tooltip"
|
||||
|
|
@ -41,15 +23,6 @@
|
|||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\Homepage::class)
|
||||
<li>
|
||||
<a class="nav-link @if (request()->routeIs('bo.homepages.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.homepages.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(__('models.classes.homepage'))->plural()]) }}">
|
||||
{{ Str::of(__('models.classes.homepage'))->plural()->ucfirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\Stamp::class)
|
||||
<li>
|
||||
<a class="nav-link @if (request()->routeIs('bo.stamps.*')) active @endif" data-bs-toggle="tooltip" href="{{ route('bo.stamps.index') }}"
|
||||
|
|
@ -58,15 +31,61 @@
|
|||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\Explorerpage::class)
|
||||
@can('viewAny', \App\Models\Convictionpage::class)
|
||||
<li>
|
||||
<a class="nav-link @if (request()->routeIs('bo.explorerpages.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.explorerpages.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(__('models.classes.explorerpage'))->plural()]) }}">
|
||||
{{ Str::of(__('models.classes.explorerpage'))->plural()->ucfirst() }}
|
||||
<a class="nav-link @if (request()->routeIs('bo.convictionpages.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.convictionpages.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(__('models.classes.convictionpage'))->plural()]) }}">
|
||||
{{ Str::of(__('models.classes.convictionpage'))->plural()->ucfirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
<li class="nav-item">
|
||||
<div class="dropdown">
|
||||
<a class="nav-link @if (request()->routeIs('bo.static_pages.*') || request()->routeIs('bo.static_pages.*')) active @endif dropdown-toggle" data-bs-toggle="dropdown" type="button"
|
||||
aria-expanded="false">
|
||||
{{ Str::of(trans_choice('models.classes.static_page', '*'))->title() }}
|
||||
</a>
|
||||
<ol class="dropdown-menu">
|
||||
@can('viewAny', \App\Models\StaticPage::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.static_pages.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.static_pages.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(trans_choice('models.classes.static_page', '*'))->title()]) }}">
|
||||
{{ Str::of(trans_choice('models.classes.static_page', '*'))->title() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\News::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.news.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.news.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(__('models.classes.news'))->plural()->title()]) }}">
|
||||
{{ Str::of(__('models.classes.news'))->plural()->title() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\Homepage::class)
|
||||
<li>
|
||||
<a class="nav-link @if (request()->routeIs('bo.homepages.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.homepages.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(__('models.classes.homepage'))->plural()]) }}">
|
||||
{{ Str::of(__('models.classes.homepage'))->plural()->ucfirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\Explorerpage::class)
|
||||
<li>
|
||||
<a class="nav-link @if (request()->routeIs('bo.explorerpages.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.explorerpages.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(__('models.classes.explorerpage'))->plural()]) }}">
|
||||
{{ Str::of(__('models.classes.explorerpage'))->plural()->ucfirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
</ol>
|
||||
</div>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<div class="dropdown">
|
||||
<a class="nav-link @if (request()->routeIs('bo.products.*') || request()->routeIs('bo.ranges.*')) active @endif dropdown-toggle" data-bs-toggle="dropdown" type="button"
|
||||
|
|
|
|||
40
resources/views/bo/pages/convictionpages/edit.blade.php
Normal file
40
resources/views/bo/pages/convictionpages/edit.blade.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
@extends('bo.layout', ['brParam' => $convictionpageModel])
|
||||
|
||||
@section('title', trans_choice('crud.meta.title.edit', 0, ['model' => __('models.classes.convictionpage')]))
|
||||
@section('description', trans_choice('crud.meta.description.edit', 0, ['model' => __('models.classes.convictionpage')]))
|
||||
@section('breadcrumb',
|
||||
request()->route()->getName())
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" href="{{ route('bo.convictionpages.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::plural(__('models.classes.convictionpage'))]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $convictionpageModel])
|
||||
</div>
|
||||
<div class="mb-md-0 mb-2">
|
||||
<form class="btn-group confirmDeleteTS" action="{{ route('bo.convictionpages.edit', $convictionpageModel) }}" method="POST"
|
||||
novalidate>
|
||||
<button class="btn btn-primary" id="formSubmitClone" data-bs-toggle="tooltip" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => __('models.classes.convictionpage')]) }}">
|
||||
{{ Str::ucfirst(__('crud.actions.save')) }}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<form action="{{ route('bo.convictionpages.update', $convictionpageModel) }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
@include('bo.pages.convictionpages.form')
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<button class="btn btn-primary" id="formSubmit" data-bs-toggle="tooltip" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => __('models.classes.convictionpage')]) }}">
|
||||
{{ Str::ucfirst(__('crud.actions.save')) }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
||||
254
resources/views/bo/pages/convictionpages/form.blade.php
Normal file
254
resources/views/bo/pages/convictionpages/form.blade.php
Normal file
|
|
@ -0,0 +1,254 @@
|
|||
<div class="row">
|
||||
{{-- KEY_FEED --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border p-3">
|
||||
<legend>{{ Str::ucfirst(__('validation.custom.key_feed')) }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.int-number', [
|
||||
'id' => 'convictionpageKeyFeed',
|
||||
'label' => __(':field :inter:model', [
|
||||
'field' => Str::ucfirst(__('validation.custom.key_feed')),
|
||||
'inter' => __('validation.custom.of_the.female'),
|
||||
'model' => __('models.classes.convictionpage'),
|
||||
]),
|
||||
'step' => 0.01,
|
||||
'name' => 'key_feed',
|
||||
'required' => true,
|
||||
'model' => $convictionpageModel ?? null,
|
||||
'helper' => __('validation.numeric', [
|
||||
'attribute' => __(':field :inter:model', [
|
||||
'field' => __('validation.custom.key_feed'),
|
||||
'inter' => __('validation.custom.of_the.female'),
|
||||
'model' => __('models.classes.convictionpage'),
|
||||
]),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- KEY_EARTH_1 --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border p-3">
|
||||
<legend>{{ Str::ucfirst(__('validation.custom.key_earth_1')) }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.int-number', [
|
||||
'id' => 'convictionpageKeyEarth1',
|
||||
'label' => __(':field :inter:model', [
|
||||
'field' => Str::ucfirst(__('validation.custom.key_earth_1')),
|
||||
'inter' => __('validation.custom.of_the.female'),
|
||||
'model' => __('models.classes.convictionpage'),
|
||||
]),
|
||||
'step' => 0.01,
|
||||
'name' => 'key_earth_1',
|
||||
'required' => true,
|
||||
'model' => $convictionpageModel ?? null,
|
||||
'helper' => __('validation.numeric', [
|
||||
'attribute' => __(':field :inter:model', [
|
||||
'field' => __('validation.custom.key_earth_1'),
|
||||
'inter' => __('validation.custom.of_the.female'),
|
||||
'model' => __('models.classes.convictionpage'),
|
||||
]),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- KEY_EARTH_2 --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border p-3">
|
||||
<legend>{{ Str::ucfirst(__('validation.custom.key_earth_2')) }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.int-number', [
|
||||
'id' => 'convictionpageKeyEarth2',
|
||||
'label' => __(':field :inter:model', [
|
||||
'field' => Str::ucfirst(__('validation.custom.key_earth_2')),
|
||||
'inter' => __('validation.custom.of_the.female'),
|
||||
'model' => __('models.classes.convictionpage'),
|
||||
]),
|
||||
'step' => 0.01,
|
||||
'name' => 'key_earth_2',
|
||||
'required' => true,
|
||||
'model' => $convictionpageModel ?? null,
|
||||
'helper' => __('validation.numeric', [
|
||||
'attribute' => __(':field :inter:model', [
|
||||
'field' => __('validation.custom.key_earth_2'),
|
||||
'inter' => __('validation.custom.of_the.female'),
|
||||
'model' => __('models.classes.convictionpage'),
|
||||
]),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- KEY_TOGETHER_1 --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border p-3">
|
||||
<legend>{{ Str::ucfirst(__('validation.custom.key_together_1')) }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.int-number', [
|
||||
'id' => 'convictionpageKeyTogether1',
|
||||
'label' => __(':field :inter:model', [
|
||||
'field' => Str::ucfirst(__('validation.custom.key_together_1')),
|
||||
'inter' => __('validation.custom.of_the.female'),
|
||||
'model' => __('models.classes.convictionpage'),
|
||||
]),
|
||||
'step' => 0.01,
|
||||
'name' => 'key_together_1',
|
||||
'required' => true,
|
||||
'model' => $convictionpageModel ?? null,
|
||||
'helper' => __('validation.numeric', [
|
||||
'attribute' => __(':field :inter:model', [
|
||||
'field' => __('validation.custom.key_together_1'),
|
||||
'inter' => __('validation.custom.of_the.female'),
|
||||
'model' => __('models.classes.convictionpage'),
|
||||
]),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- KEY_TOGETHER_2 --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border p-3">
|
||||
<legend>{{ Str::ucfirst(__('validation.custom.key_together_2')) }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.int-number', [
|
||||
'id' => 'convictionpageKeyTogether2',
|
||||
'label' => __(':field :inter:model', [
|
||||
'field' => Str::ucfirst(__('validation.custom.key_together_2')),
|
||||
'inter' => __('validation.custom.of_the.female'),
|
||||
'model' => __('models.classes.convictionpage'),
|
||||
]),
|
||||
'step' => 0.01,
|
||||
'name' => 'key_together_2',
|
||||
'required' => true,
|
||||
'model' => $convictionpageModel ?? null,
|
||||
'helper' => __('validation.numeric', [
|
||||
'attribute' => __(':field :inter:model', [
|
||||
'field' => __('validation.custom.key_together_2'),
|
||||
'inter' => __('validation.custom.of_the.female'),
|
||||
'model' => __('models.classes.convictionpage'),
|
||||
]),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- KEY_TOGETHER_3 --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border p-3">
|
||||
<legend>{{ Str::ucfirst(__('validation.custom.key_together_3')) }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.int-number', [
|
||||
'id' => 'convictionpageKeyTogether3',
|
||||
'label' => __(':field :inter:model', [
|
||||
'field' => Str::ucfirst(__('validation.custom.key_feed')),
|
||||
'inter' => __('validation.custom.of_the.female'),
|
||||
'model' => __('models.classes.convictionpage'),
|
||||
]),
|
||||
'step' => 0.01,
|
||||
'name' => 'key_together_3',
|
||||
'required' => true,
|
||||
'model' => $convictionpageModel ?? null,
|
||||
'helper' => __('validation.numeric', [
|
||||
'attribute' => __(':field :inter:model', [
|
||||
'field' => __('validation.custom.key_together_3'),
|
||||
'inter' => __('validation.custom.of_the.female'),
|
||||
'model' => __('models.classes.convictionpage'),
|
||||
]),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- KEY_TOGETHER_4 --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border p-3">
|
||||
<legend>{{ Str::ucfirst(__('validation.custom.key_together_4')) }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.int-number', [
|
||||
'id' => 'convictionpageKeyTogether4',
|
||||
'label' => __(':field :inter:model', [
|
||||
'field' => Str::ucfirst(__('validation.custom.key_together_4')),
|
||||
'inter' => __('validation.custom.of_the.female'),
|
||||
'model' => __('models.classes.convictionpage'),
|
||||
]),
|
||||
'step' => 0.01,
|
||||
'name' => 'key_together_4',
|
||||
'required' => true,
|
||||
'model' => $convictionpageModel ?? null,
|
||||
'helper' => __('validation.numeric', [
|
||||
'attribute' => __(':field :inter:model', [
|
||||
'field' => __('validation.custom.key_together_4'),
|
||||
'inter' => __('validation.custom.of_the.female'),
|
||||
'model' => __('models.classes.convictionpage'),
|
||||
]),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- KEY_TERRITORY --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border p-3">
|
||||
<legend>{{ Str::ucfirst(__('validation.custom.key_territory')) }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.int-number', [
|
||||
'id' => 'convictionpageKeyTerritory',
|
||||
'label' => __(':field :inter:model', [
|
||||
'field' => Str::ucfirst(__('validation.custom.key_territory')),
|
||||
'inter' => __('validation.custom.of_the.female'),
|
||||
'model' => __('models.classes.convictionpage'),
|
||||
]),
|
||||
'step' => 0.01,
|
||||
'name' => 'key_territory',
|
||||
'required' => true,
|
||||
'model' => $convictionpageModel ?? null,
|
||||
'helper' => __('validation.numeric', [
|
||||
'attribute' => __(':field :inter:model', [
|
||||
'field' => __('validation.custom.key_territory'),
|
||||
'inter' => __('validation.custom.of_the.female'),
|
||||
'model' => __('models.classes.convictionpage'),
|
||||
]),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<p><b>* {{ __('crud.helpers.required_fields') }}</b></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
<script nonce="{{ $nonce }}">
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
// Submit button clone.
|
||||
const submit = document.getElementById('formSubmit')
|
||||
submitClone = document.getElementById('formSubmitClone');
|
||||
submitClone.addEventListener('click', (event) => {
|
||||
event.preventDefault();
|
||||
submit.click('');
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
<table class="table-hover table-fix-action m-0 table">
|
||||
@if (count($convictionpageModels) > 0)
|
||||
<thead>
|
||||
@include('bo.modules.table-col-sorter', [
|
||||
'cols' => [
|
||||
'key_feed' => Str::ucfirst(__('validation.custom.key_feed')),
|
||||
'key_earth_1' => Str::ucfirst(__('validation.custom.key_earth_1')),
|
||||
'key_earth_2' => Str::ucfirst(__('validation.custom.key_earth_2')),
|
||||
'key_together_1' => Str::ucfirst(__('validation.custom.key_together_1')),
|
||||
'key_together_2' => Str::ucfirst(__('validation.custom.key_together_2')),
|
||||
'key_together_3' => Str::ucfirst(__('validation.custom.key_together_3')),
|
||||
'key_together_4' => Str::ucfirst(__('validation.custom.key_together_4')),
|
||||
'key_territory' => Str::ucfirst(__('validation.custom.key_territory')),
|
||||
'updated_at' => Str::ucfirst(__('validation.attributes.updated_at')),
|
||||
],
|
||||
])
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($convictionpageModels as $convictionpageModel)
|
||||
<tr class="border-bottom list-item">
|
||||
<td class="text-center align-middle">{{ $convictionpageModel->key_feed }}</td>
|
||||
<td class="text-center align-middle">{{ $convictionpageModel->key_earth_1 }}</td>
|
||||
<td class="text-center align-middle">{{ $convictionpageModel->key_earth_2 }}</td>
|
||||
<td class="text-center align-middle">{{ $convictionpageModel->key_together_1 }}</td>
|
||||
<td class="text-center align-middle">{{ $convictionpageModel->key_together_2 }}</td>
|
||||
<td class="text-center align-middle">{{ $convictionpageModel->key_together_3 }}</td>
|
||||
<td class="text-center align-middle">{{ $convictionpageModel->key_together_4 }}</td>
|
||||
<td class="text-center align-middle">{{ $convictionpageModel->key_territory }}</td>
|
||||
<td class="text-center align-middle">
|
||||
<span class="badge bg-secondary">{{ $convictionpageModel->updated_at->isoFormat('LLLL') }}</span>
|
||||
</td>
|
||||
@php
|
||||
$routeName = request()
|
||||
->route()
|
||||
->getName();
|
||||
@endphp
|
||||
<td class="text-end align-middle">
|
||||
@canAny(['update'], $convictionpageModel)
|
||||
<form class="btn-group confirmDeleteTS" action="{{ route('bo.convictionpages.edit', $convictionpageModel) }}"
|
||||
method="POST" novalidate>
|
||||
@can('update', $convictionpageModel)
|
||||
<a class="btn btn-sm btn-primary" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.convictionpages.edit', ['convictionpage' => $convictionpageModel]) }}"
|
||||
title="{{ Str::ucfirst(__('crud.actions.update')) }}">
|
||||
<i class="fa-solid fa-pencil"></i>
|
||||
</a>
|
||||
@endcan
|
||||
</form>
|
||||
@else
|
||||
<span class="text-danger" data-bs-toggle="tooltip" title="{{ __('list.right') }}">
|
||||
<i class="fa-solid fa-ban"></i>
|
||||
</span>
|
||||
@endcan
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@else
|
||||
<tr>
|
||||
<td class="border-0">{{ __('crud.other.no_model_found', ['model' => __('models.classes.convictionpage')]) }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
16
resources/views/bo/pages/convictionpages/index.blade.php
Normal file
16
resources/views/bo/pages/convictionpages/index.blade.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
@extends('bo.layout')
|
||||
|
||||
@section('title',
|
||||
Str::of(__('models.classes.convictionpage'))->plural()->ucfirst())
|
||||
@section('description', trans_choice('crud.meta.description.index', 0, ['model' => Str::plural(__('models.classes.convictionpage'))]))
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap">
|
||||
@include('modules.breadcrumbs.breadcrumb-body')
|
||||
</div>
|
||||
|
||||
<div class="table-responsive mb-3">
|
||||
@include('bo.pages.convictionpages.index-list')
|
||||
</div>
|
||||
{{ $convictionpageModels->links() }}
|
||||
@endsection
|
||||
|
|
@ -9,49 +9,39 @@
|
|||
of the input. || string || OPTIONNAL || null
|
||||
$required || Is the field required ? || boolean || OPTIONNAL || false
|
||||
$value || The default value of the input. || integer || OPTIONNAL || 0
|
||||
$step || The step of the input. || integer || OPTIONNAL || 1
|
||||
$step || The step of the input. || integer|float || OPTIONNAL || 1
|
||||
$unsigned || Is the value unsigned ? || boolean || OPTIONNAL || false
|
||||
$min || The min value of the input. || integer || OPTIONNAL || !empty($unsigned) ? 0 : -2147483648
|
||||
$max || The max value of the input. || integer || OPTIONNAL || !empty($unsigned) ? 4294967295 : 2147483647
|
||||
$model || The model we're creating/editing || Model class || OPTIONNAL || null
|
||||
--}}
|
||||
|
||||
@if(!empty($label))
|
||||
<label for="{{ $id }}" class="col-form-label">
|
||||
<b>{{ $label }} {{ $required ?? false ? '*' : '' }}</b>
|
||||
</label>
|
||||
@if (!empty($label))
|
||||
<label class="col-form-label" for="{{ $id }}">
|
||||
<b>{{ $label }} {{ $required ?? false ? '*' : '' }}</b>
|
||||
</label>
|
||||
@endif
|
||||
@if(isset($appendText))
|
||||
<div class="input-group">
|
||||
@endif
|
||||
<input id="{{ $id }}"
|
||||
name="{{ $name }}"
|
||||
type="number"
|
||||
value="{{ Str::replace(',', '.', strval(old($name, $value ?? $model->{$name} ?? 0))) }}"
|
||||
class="form-control @if($errors->has($name)) is-invalid @endif"
|
||||
@if (isset($appendText))
|
||||
<div class="input-group">
|
||||
@endif
|
||||
<input class="form-control @if ($errors->has($name)) is-invalid @endif" id="{{ $id }}" name="{{ $name }}"
|
||||
type="number" value="{{ Str::replace(',', '.', strval(old($name, $value ?? ($model->{$name} ?? 0)))) }}"
|
||||
aria-describedby="{{ $id }}Help"
|
||||
@if(!empty($step))
|
||||
step="{{ Str::replace(',', '.', strval($step)) }}"
|
||||
@else step="1"
|
||||
@endif
|
||||
@if(!empty($max))
|
||||
max="{{ $max }}"
|
||||
@if (!empty($step)) step="{{ Str::replace(',', '.', strval($step)) }}"
|
||||
@else step="1" @endif
|
||||
@if (!empty($max)) max="{{ $max }}"
|
||||
@else
|
||||
max="{{ !empty($unsigned) ? '4294967295' : '2147483647' }}"
|
||||
@endif
|
||||
@if(!empty($min)) min="{{ $min }}"
|
||||
max="{{ !empty($unsigned) ? '4294967295' : '2147483647' }}" @endif
|
||||
@if (!empty($min)) min="{{ $min }}"
|
||||
@else
|
||||
min="{{ !empty($unsigned) ? '0' : '-2147483648' }}"
|
||||
@endif
|
||||
@if(!empty($required))
|
||||
required
|
||||
@endif>
|
||||
@if(isset($appendText))
|
||||
min="{{ !empty($unsigned) ? '0' : '-2147483648' }}" @endif
|
||||
@if (!empty($required)) required @endif>
|
||||
@if (isset($appendText))
|
||||
<label class="input-group-text">{{ $appendText }}</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@include('modules.input-error', [
|
||||
'inputName' => $name,
|
||||
'helperId' => '{{ $id }}Help',
|
||||
'helper' => $helper
|
||||
'helper' => $helper,
|
||||
])
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
use App\Models\ActivityLog;
|
||||
use App\Models\Commitment;
|
||||
use App\Models\Convictionpage;
|
||||
use App\Models\Explorerpage;
|
||||
use App\Models\Homepage;
|
||||
use App\Models\Range;
|
||||
|
|
@ -202,3 +203,15 @@ Breadcrumbs::for('bo.products.duplicate', function (Generator $trail) {
|
|||
$trail->parent('bo.products.index');
|
||||
$trail->push(Str::ucfirst(trans('crud.actions.duplicate')));
|
||||
});
|
||||
|
||||
// * CONVICTIONPAGES
|
||||
Breadcrumbs::for('bo.convictionpages.index', function (Generator $trail) {
|
||||
$trail->push(
|
||||
Str::of(trans('models.classes.convictionpage'))->plural()->ucfirst(),
|
||||
route('bo.convictionpages.index', ['sort_col' => 'updated_at', 'sort_way' => 'desc'])
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for('bo.convictionpages.edit', function (Generator $trail, Convictionpage $convictionpage) {
|
||||
$trail->parent('bo.convictionpages.index');
|
||||
$trail->push(Str::ucfirst(trans('crud.actions.edit')), route('bo.convictionpages.edit', $convictionpage));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
use App\Http\Controllers\Bo\ActivityLogsController;
|
||||
use App\Http\Controllers\Bo\CommitmentController;
|
||||
use App\Http\Controllers\Bo\ConvictionpageController;
|
||||
use App\Http\Controllers\Bo\DashboardController;
|
||||
use App\Http\Controllers\Bo\ExplorerpageController;
|
||||
use App\Http\Controllers\Bo\HomepageController;
|
||||
|
|
@ -46,9 +47,7 @@ Route::prefix('bo')
|
|||
])->name('users.duplicate');
|
||||
|
||||
// * COMMITMENTS
|
||||
Route::resource('commitments', CommitmentController::class)->except(['show'])
|
||||
->withoutMiddleware('htmlsanitize')
|
||||
->middleware('htmlsanitize:content');
|
||||
Route::resource('commitments', CommitmentController::class)->except(['show']);
|
||||
Route::get('/commitments/{commitment}/duplicate', [
|
||||
CommitmentController::class, 'duplicate'
|
||||
])->name('commitments.duplicate');
|
||||
|
|
@ -129,8 +128,7 @@ Route::prefix('bo')
|
|||
])->name('stamps.duplicate');
|
||||
|
||||
// * EXPLORERPAGE
|
||||
Route::resource('explorerpages', ExplorerpageController::class)->only(['index', 'edit', 'update'])
|
||||
->withoutMiddleware('htmlsanitize');
|
||||
Route::resource('explorerpages', ExplorerpageController::class)->only(['index', 'edit', 'update']);
|
||||
|
||||
// * PRODUCTS
|
||||
Route::resource('products', ProductController::class)->except('show')
|
||||
|
|
@ -146,6 +144,9 @@ Route::prefix('bo')
|
|||
ProductController::class, 'duplicate'
|
||||
])->name('products.duplicate');
|
||||
|
||||
// * CONVICTIONPAGES
|
||||
Route::resource('convictionpages', ConvictionpageController::class)->only(['index', 'edit', 'update']);
|
||||
|
||||
Route::middleware('can:isConceptor')->group(function () {
|
||||
// * ACTIVITY LOGS.
|
||||
Route::resource('activity_logs', ActivityLogsController::class)->only(['index', 'show']);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue