Updated with the last version of base project

This commit is contained in:
Noah Lancien 2023-10-18 16:25:43 +02:00
parent f47d3f6fd1
commit 1564eb8bc3
13 changed files with 62 additions and 54 deletions

View file

@ -90,7 +90,7 @@ class UserPolicy
*
* @param \App\Models\User $authUser
* @param \App\Models\User $user
* @return booleanean
* @return boolean
*/
public function forceDelete(User $authUser, User $user): bool
{
@ -104,7 +104,7 @@ class UserPolicy
*
* @param \App\Models\User $authUser
* @param \App\Models\User $user
* @return booleanean
* @return boolean
*/
public function duplicate(User $authUser, User $user): bool
{
@ -118,7 +118,7 @@ class UserPolicy
*
* @param \App\Models\User $authUser
* @param \App\Models\User $user
* @return booleanean
* @return boolean
*/
public function changePublished(User $authUser, User $user): bool
{

View file

@ -21,7 +21,7 @@ return new class extends Migration
$table->timestamp('email_verified_at')->nullable();
$table->string('password')->comment('Password of the user account.');
$table->rememberToken();
$table->boolean('role')->comment('Role of the user who defines the rights/access.');
$table->unsignedTinyInteger('role')->comment('Role of the user who defines the rights/access.');
$table->boolean('published')->comment('The user is acivated or not.');
$table->timestamp('published_at')->nullable()->comment('The date on which the user was acivated.');
$table->timestamps();

View file

@ -217,7 +217,7 @@ return [
'custom' => [
'event' => 'évènement',
'model' => 'élément ciblé',
'order' => 'order',
'order' => 'ordre',
'publication' => 'publication',
'activated' => 'activé',
'target' => 'cible',

View file

@ -33,6 +33,7 @@
@import "bootstrap/scss/transitions";
@import "bootstrap/scss/type";
@import "bootstrap/scss/utilities";
@import "bootstrap/scss/modal";
@import "bootstrap/scss/close";
@import "bootstrap/scss/card";
@import "bootstrap/scss/breadcrumb";

View file

@ -27,7 +27,7 @@
<li>
<a class="dropdown-item @if (request()->routeIs('bo.activity_logs.*')) active @endif" data-bs-toggle="tooltip"
href="{{ route('bo.activity_logs.index') }}"
title="{{ __('crud.helpers.list_all', ['model' => trans_choice('models.classes.activity_log', 1)]) }}">
title="{{ __('crud.helpers.list_all', ['model' => trans_choice('models.classes.activity_log', '*')]) }}">
{{ Str::of(trans_choice('models.classes.activity_log', '*'))->ucfirst() }}
</a>
</li>

View file

@ -1,20 +1,28 @@
<td class="text-center align-middle">
@can('changeOrder', $model)
<div class="d-flex justify-content-center align-items-center">
<a class="@if ($loop->first and $models->onFirstPage()) invisible @endif"
href="{{ route('bo.' . $routeName . '.change-order', [Str::singular($routeName) => $model, 'direction' => 'up']) }}">
<form class="@if ($loop->first and $models->onFirstPage()) invisible @endif"
action="{{ route('bo.' . $routeName . '.change-order', [Str::singular($routeName) => $model, 'direction' => 'up']) }}"
method="POST"
>
@csrf
@method('PATCH')
<button class="btn btn-sm btn-outline-secondary @if ($loop->first and $models->onFirstPage()) disabled @endif" data-bs-toggle="tooltip"
type="submit" title="{{ __('crud.other.up') }}">
<i class="fas fa-arrow-up"></i>
</button>
</a>
<a class="@if ($loop->last and $models->currentPage() === $models->lastPage()) invisible @endif"
href="{{ route('bo.' . $routeName . '.change-order', [Str::singular($routeName) => $model, 'direction' => 'down']) }}">
</form>
<form class="@if ($loop->last and $models->currentPage() === $models->lastPage()) invisible @endif"
action="{{ route('bo.' . $routeName . '.change-order', [Str::singular($routeName) => $model, 'direction' => 'down']) }}"
method="POST"
>
@csrf
@method('PATCH')
<button class="btn btn-sm btn-outline-secondary @if ($loop->last and $models->currentPage() === $models->lastPage()) disabled @endif ms-1" data-bs-toggle="tooltip"
type="submit" title="{{ __('crud.other.down') }}">
<i class="fas fa-arrow-down"></i>
</button>
</a>
</form>
</div>
@else
<span class="text-danger" data-bs-toggle="tooltip" title="{{ __('crud.other.right') }}">

View file

@ -2,6 +2,7 @@
@can('changePublished', $model)
<form action="{{ route('bo.' . $routeName . '.change-published', $model->getRouteKey()) }}" method="POST">
@csrf
@method('PATCH')
<button class="btn btn-sm @if ($model->published) btn-primary @else btn-danger @endif" data-bs-toggle="tooltip"
type="submit" title="{{ __($model->published ? __('crud.other.unpublish') : __('crud.other.publish')) }}">
@if ($model->published)

View file

@ -1,7 +1,7 @@
@extends('bo.layout')
@section('title', __('models.classes.activity_log'))
@section('description', __('Liste de tous les :model', ['model' => trans_choice('models.classes.activity', '*')]))
@section('title', Str::ucfirst(trans_choice('models.classes.activity_log', '*')))
@section('description', __('Liste de tous les :model', ['model' => trans_choice('models.classes.activity_log', '*')]))
@section('content')
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap">

View file

@ -5,29 +5,27 @@
@section('breadcrumb', 'no')
@section('content')
<div class="container">
<div class="row">
<div class="col">
<div class="card text-center">
<div class="card-header fw-bold">
<h1 class="h2 fw-bold">{{ __('Dashboard') }}</h1>
</div>
<div class="card-body">
<h5 class="card-title">
{{ __('Bonjour :first_name :last_name !', [
'first_name' => auth('backend')->user()->first_name,
'last_name' => auth('backend')->user()->last_name,
]) }}
</h5>
<p class="card-text m-0">
{{ __('Bienvenue dans le back-office, où vous pouvez gérer votre application web.') }}
</p>
<p class="card-text">
{{ __('Pour tout problème ou évolution souhaitée, veuillez nous contacter via notre outil : ') }}
<a data-bs-toggle="tooltip" href="https://support.uwil.fr/" title="{{ __('Accéder à notre outil de ticketing') }}"
target="blank">https://support.uwil.fr/</a>.
</p>
</div>
<div class="row">
<div class="col">
<div class="card text-center">
<div class="card-header fw-bold">
<h1 class="h2 fw-bold">{{ __('Dashboard') }}</h1>
</div>
<div class="card-body">
<h5 class="card-title">
{{ __('Bonjour :first_name :last_name !', [
'first_name' => auth('backend')->user()->first_name,
'last_name' => auth('backend')->user()->last_name,
]) }}
</h5>
<p class="card-text m-0">
{{ __('Bienvenue dans le back-office, où vous pouvez gérer votre application web.') }}
</p>
<p class="card-text">
{{ __('Pour tout problème ou évolution souhaitée, veuillez nous contacter via notre outil : ') }}
<a data-bs-toggle="tooltip" href="https://support.uwil.fr/" title="{{ __('Accéder à notre outil de ticketing') }}"
target="blank">https://support.uwil.fr/</a>.
</p>
</div>
</div>
</div>

View file

@ -1,6 +1,6 @@
@extends('bo.layout')
@section('title', __('models.classes.user'))
@section('title', Str::ucfirst(__('models.classes.user')))
@section('description', __('Liste de tous les :model', ['model' => Str::plural(__('models.classes.user'))]))
@section('content')

View file

@ -1,29 +1,29 @@
{{--
VARIABLE || COMMENT || TYPE || REQUIRED || DEFAULT
VARIABLE || COMMENT || TYPE || REQUIRED || DEFAULT
$id || The id of the input tag. || string || REQUIRED ||
$name || The name of the input tag. || string || REQUIRED ||
$helper || The helper of the input. || string || REQUIRED ||
$label || The text displayed as a label. || string || OPTIONNAL || null
$required || Is the field required ? || boolean || OPTIONNAL || false
$value || The default value of the input. || string || OPTIONNAL || ''
$placeholder || The placeholder of the input. || string || OPTIONNAL || __('A beautiful title')
$hasWordCounter || Is the WordCounter needed ? || boolean || OPTIONNAL || false
$model || The model we're creating/editing || Model class || OPTIONNAL || null
$id || The id of the select tag. || string || REQUIRED ||
$name || The name of the input tag. || string || REQUIRED ||
$helper || The helper of the input. || string || REQUIRED ||
$associatedModels || The models of the relation. || Collection || REQUIRED ||
$foreignLabel || The field to display. || string || REQUIRED ||
$label || The text displayed as a label. || string || OPTIONNAL || null
$size || The number of lines to display. || integer || OPTIONNAL || null
$required || Is the field required ? || boolean || OPTIONNAL || false
$model || The model we're creating/editing || Model class || OPTIONNAL || null
--}}
@if(!empty($label))
<label for="{{ $name }}" class="col-form-label"><b>{{ $label }} *</b></label>
<label for="{{ $id }}" class="col-form-label"><b>{{ $label }} *</b></label>
@endif
<select
id="{{ $name }}"
id="{{ $id }}"
class="form-select @if($errors->has($name)) is-invalid @endif"
name="{{ $name }}"
@if(!empty($size))
size="{{ $size }}"
@endif
aria-describedby="{{ $id }}Help"
@if(!empty($label))
@if(!empty($required))
required
@endif>
@foreach ($associatedModels as $associatedModel)

View file

@ -7,7 +7,7 @@
$label || The text displayed as a label. || string || OPTIONNAL || null
$required || Is the field required ? || boolean || OPTIONNAL || false
$value || The default value of the input. || string || OPTIONNAL || ''
$file || The accepted files extensions. || string || OPTIONNAL || 'pdf'
$file || The accepted files extensions. || string || OPTIONNAL || '.pdf'
$model || The model we're creating/editing || Model class || OPTIONNAL || null
--}}
@ -23,7 +23,7 @@
class="form-control @if($errors->has($name)) is-invalid @endif"
id="{{ $id }}"
aria-describedby="{{ $id }}Help"
accept="{{ $file ?? pdf }}"
accept="{{ $file ?? '.pdf' }}"
@if(!empty($required))
required
@endif>

View file

@ -29,7 +29,7 @@ Route::prefix('bo')
// * USERS.
Route::resource('users', UsersController::class)->except('show');
Route::post('/users/{user}/change-published', [
Route::patch('/users/{user}/change-published', [
UsersController::class, 'changePublished'
])->name('users.change-published');
Route::get('/users/{user}/duplicate', [