Tons of corrections + service stats
This commit is contained in:
parent
70e55f6732
commit
1d07b4fb8f
42 changed files with 629 additions and 775 deletions
|
|
@ -93,14 +93,14 @@ class ServiceController extends Controller
|
|||
->route('bo.services.edit', $service)
|
||||
->with('success', trans(
|
||||
':model a été créé.',
|
||||
['model' => Str::singular(trans('models.classes.services'))]
|
||||
['model' => Str::singular(trans('models.classes.service'))]
|
||||
));
|
||||
}
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', trans(
|
||||
':model n\'a pas été créé.',
|
||||
['model' => Str::singular(trans('models.classes.services'))]
|
||||
['model' => Str::singular(trans('models.classes.service'))]
|
||||
));
|
||||
});
|
||||
}
|
||||
|
|
@ -137,14 +137,14 @@ class ServiceController extends Controller
|
|||
->route('bo.services.edit', $service)
|
||||
->with('success', trans(
|
||||
':model a été mis à jour.',
|
||||
['model' => Str::singular(trans('models.classes.services'))]
|
||||
['model' => Str::singular(trans('models.classes.service'))]
|
||||
));
|
||||
}
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', trans(
|
||||
':model n\'a pas été mis à jour.',
|
||||
['model' => Str::singular(trans('models.classes.services'))]
|
||||
['model' => Str::singular(trans('models.classes.service'))]
|
||||
));
|
||||
});
|
||||
}
|
||||
|
|
@ -174,13 +174,13 @@ class ServiceController extends Controller
|
|||
return redirect()->route('bo.services.index')
|
||||
->with('success', trans(
|
||||
':model a été supprimé.',
|
||||
['model' => Str::singular(trans('models.classes.services'))]
|
||||
['model' => Str::singular(trans('models.classes.service'))]
|
||||
));
|
||||
}
|
||||
return redirect()->back()
|
||||
->with('error', trans(
|
||||
':model n\'a pas pu être supprimé.',
|
||||
['model' => Str::singular(trans('models.classes.services'))]
|
||||
['model' => Str::singular(trans('models.classes.service'))]
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,11 @@
|
|||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\Bo\StatsByBrandRequest;
|
||||
use App\Models\ArcadiaBrand;
|
||||
use App\Models\ArcadiaBrandStat;
|
||||
use App\Http\Requests\Bo\StatsByServiceRequest;
|
||||
use App\Models\Service;
|
||||
use App\Models\ServiceStat;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use League\Csv\Writer;
|
||||
|
|
@ -17,58 +18,61 @@ use League\Csv\Writer;
|
|||
class StatsController extends Controller
|
||||
{
|
||||
/**
|
||||
* Shows stats by brand.
|
||||
* Shows stats by service.
|
||||
*
|
||||
* @param \App\Http\Requests\Bo\StatsByBrandRequest $request
|
||||
* @param \App\Http\Requests\Bo\StatsByServiceRequest $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function viewStatsByBrand(StatsByBrandRequest $request)
|
||||
public function viewStatsByService(StatsByServiceRequest $request)
|
||||
{
|
||||
$stats = null;
|
||||
if ($request->has('brand')) {
|
||||
/** @var \Illuminate\Database\Eloquent\Collection<\App\Models\ArcadiaBrandStat> */
|
||||
$stats = ArcadiaBrandStat::query()->whereDate('created_at', '>=', $request->start)
|
||||
->whereDate('created_at', '<=', $request->end)
|
||||
->whereHas('arcadiaBrand', fn (Builder $q) => $q->where('id', $request->brand))
|
||||
if ($request->has('service')) {
|
||||
/** @var \Illuminate\Database\Eloquent\Collection<\App\Models\ServiceStat> */
|
||||
$stats = ServiceStat::query()
|
||||
->with('service')
|
||||
->whereDate('date', '>=', $request->start)
|
||||
->whereDate('date', '<=', $request->end)
|
||||
->whereHas('service', fn (Builder $q) => $q->where('id', $request->service))
|
||||
->get();
|
||||
}
|
||||
return view('bo.pages.stats.view-stats-by-brands', \compact('stats'));
|
||||
return view('bo.pages.stats.view-stats-by-services', \compact('stats'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Exports stats by brand as a csv file.
|
||||
* Exports stats by service as a csv file.
|
||||
*
|
||||
* @param \App\Http\Requests\StatsByBrandRequest $request
|
||||
* @param \App\Http\Requests\Bo\StatsByServiceRequest $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function exportByBrandCsv(StatsByBrandRequest $request): \Illuminate\Http\Response
|
||||
public function exportByBrandCsv(StatsByServiceRequest $request): Response
|
||||
{
|
||||
/** @var \App\Models\ArcadiaBrand */
|
||||
$brand = ArcadiaBrand::query()->findOrFail($request->brand);
|
||||
/** @var \Illuminate\Database\Eloquent\Collection<\App\Models\ArcadiaBrandStat> */
|
||||
$stats = ArcadiaBrandStat::query()->with('arcadiaBrand')
|
||||
->whereHas('arcadiaBrand', fn (Builder $q) => $q->where('id', $request->brand))
|
||||
->whereDate('created_at', '>=', $request->start)
|
||||
->whereDate('created_at', '<=', $request->end)
|
||||
/** @var \App\Models\Service */
|
||||
$service = Service::query()->findOrFail($request->service);
|
||||
/** @var \Illuminate\Database\Eloquent\Collection<\App\Models\ServiceStat> */
|
||||
$stats = ServiceStat::query()
|
||||
->with('service.arcadiaBrand')
|
||||
->whereDate('date', '>=', $request->start)
|
||||
->whereDate('date', '<=', $request->end)
|
||||
->whereHas('service', fn (Builder $q) => $q->where('id', $request->service))
|
||||
->get();
|
||||
|
||||
$columns = Schema::getColumnListing((new ArcadiaBrandStat())->getTable());
|
||||
$columns = Arr::where($columns, fn ($value) => !in_array($value, ['created_at', 'brand_id']));
|
||||
$columns = Schema::getColumnListing((new ServiceStat())->getTable());
|
||||
$columns = Arr::where($columns, fn ($value) => !in_array($value, ['date', 'service_id']));
|
||||
/** @var array<string> $columns */
|
||||
|
||||
$header = '"date";"marque";' . implode(';', $columns);
|
||||
$header = '"date";"service";' . implode(';', $columns);
|
||||
|
||||
$w = Writer::createFromString($header . PHP_EOL);
|
||||
$w->setDelimiter(';');
|
||||
$w->setEnclosure('"');
|
||||
$w->setOutputBOM(Writer::BOM_UTF8);
|
||||
|
||||
/** @var \App\Models\ArcadiaBrandStat $stat */
|
||||
/** @var \App\Models\ServiceStat $stat */
|
||||
foreach ($stats as $stat) {
|
||||
/** @var array<string,string> $cols */
|
||||
$cols = [
|
||||
$stat->created_at->isoFormat('YYYY-MM-DD'),
|
||||
$stat->arcadiaBrand->label
|
||||
$stat->date->isoFormat('YYYY-MM-DD'),
|
||||
$service->label
|
||||
];
|
||||
foreach ($columns as $colname) {
|
||||
$cols[] = $stat->{$colname};
|
||||
|
|
@ -79,7 +83,7 @@ class StatsController extends Controller
|
|||
'Content-Encoding' => 'none',
|
||||
'Content-Type' => 'text/csv; charset=UTF-8',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
'Content-Disposition' => "attachment; filename=\"Statistiques du $request->start au $request->end pour $brand->label.csv\"",
|
||||
'Content-Disposition' => "attachment; filename=\"Statistiques du {$request->start} au {$request->end} pour {$service->name}.csv\"",
|
||||
'Content-Description' => 'File Transfer',
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,12 +92,12 @@ class UsersController extends Controller
|
|||
if ($user->saveOrFail()) {
|
||||
return redirect()->route('bo.users.edit', $user->id)
|
||||
->with('success', __('crud.messages.has_been_created', [
|
||||
'model' => Str::singular(__('models.classes.users'))
|
||||
'model' => __('models.classes.user')
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
->with('error', __('crud.messages.cannot_be_created', [
|
||||
'model' => Str::singular(__('models.classes.users'))
|
||||
'model' => __('models.classes.user')
|
||||
]));
|
||||
});
|
||||
}
|
||||
|
|
@ -129,12 +129,12 @@ class UsersController extends Controller
|
|||
if ($user->saveOrFail()) {
|
||||
return redirect()->route('bo.users.edit', $user->id)
|
||||
->with('success', __('crud.messages.has_been_updated', [
|
||||
'model' => Str::singular(__('models.classes.users'))
|
||||
'model' => __('models.classes.user')
|
||||
]));
|
||||
}
|
||||
return redirect()->route('bo.users.edit', $user->id)
|
||||
->with('error', __('crud.messages.cannot_be_updated', [
|
||||
'model' => Str::singular(__('models.classes.users'))
|
||||
'model' => __('models.classes.user')
|
||||
]));
|
||||
});
|
||||
}
|
||||
|
|
@ -150,12 +150,12 @@ class UsersController extends Controller
|
|||
if ($user->deleteOrFail()) {
|
||||
return redirect()->route('bo.users.index')
|
||||
->with('success', __('crud.messages.has_been_deleted', [
|
||||
'model' => Str::singular(__('models.classes.users'))
|
||||
'model' => __('models.classes.user')
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
->with('error', __('crud.messages.cannot_be_deleted', [
|
||||
'model' => Str::singular(__('models.classes.users'))
|
||||
'model' => __('models.classes.user')
|
||||
]));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use Illuminate\Validation\ValidationException;
|
|||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class StatsByBrandRequest extends FormRequest
|
||||
class StatsByServiceRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* @property integer $active Le nombre de comptes actifs (dernière connexion inférieure à 6 mois).
|
||||
* @property integer $inactive Le nombre de comptes inactifs (dernière connexion supérieure à 6 mois)
|
||||
* @property integer $old_accounts Le nombre d’anciens comptes (date de création supérieure à 6 mois
|
||||
* @property integer $new_accounts Le nombre de nouveaux comptes (date de création inférieure à 6 mois)
|
||||
* @property integer $total_accounts Le nombre de comptes total
|
||||
* @property integer $total_opt_in Le nombre d’optins (single optin compris)
|
||||
* @property integer $arcadia_brand_id Foreign key Arcadia Brand.
|
||||
* @property-read \Illuminate\Support\Carbon $created_at Created date.
|
||||
*
|
||||
* @property-read \App\Models\ArcadiaBrand $arcadiaBrand Get the brand that owns the BrandStat.
|
||||
*/
|
||||
class ArcadiaBrandStat extends Model
|
||||
{
|
||||
/**
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $fillable = [
|
||||
'active',
|
||||
'inactive',
|
||||
'old_accounts',
|
||||
'new_accounts',
|
||||
'total_accounts',
|
||||
'total_opt_in',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $casts = [
|
||||
'created_at' => 'date',
|
||||
];
|
||||
|
||||
/**
|
||||
* Perform any actions required after the model boots.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::creating(function (self $model) {
|
||||
if (!$model->created_at) {
|
||||
$model->created_at = now();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// * RELATIONS
|
||||
|
||||
/**
|
||||
* Get the Arcadia Brand that owns the ArcadiaBrandStat
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function arcadiaBrand(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(ArcadiaBrand::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -7,10 +7,12 @@ use Illuminate\Database\Eloquent\Model;
|
|||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* @property integer $id The service id.
|
||||
* @property string $name The service name.
|
||||
* @property string $bearer_token The service name.
|
||||
* @property string $bearer_pwd The service name.
|
||||
* @property integer $id The service id.
|
||||
* @property \Carbon\Carbon $date La journée concernée.
|
||||
* @property integer $nb_calls Le nombre d'appels du service pour la journée.
|
||||
* @property integer $service_id Service foreign key.
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
* @package App\Models
|
||||
*/
|
||||
class ServiceStat extends Model
|
||||
|
|
@ -24,6 +26,16 @@ class ServiceStat extends Model
|
|||
*/
|
||||
protected $fillable = ['date'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'date' => 'immutable_date',
|
||||
'nb_calls' => 'int',
|
||||
];
|
||||
|
||||
/**
|
||||
* The model's attributes.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ use Illuminate\Support\Carbon;
|
|||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\RateLimiter;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Illuminate\Support\Pluralizer;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
|
|
@ -44,6 +45,8 @@ class AppServiceProvider extends ServiceProvider
|
|||
\strtoupper(config('app.locale'))
|
||||
));
|
||||
Carbon::setLocale(config('app.locale'));
|
||||
// * I18n
|
||||
Pluralizer::useLanguage('french');
|
||||
|
||||
// * Force bootstrap paginator
|
||||
Paginator::useBootstrap();
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Cache\RateLimiting\Limit;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
use Illuminate\Http\Request;
|
||||
|
|
@ -44,8 +43,6 @@ class RouteServiceProvider extends ServiceProvider
|
|||
->namespace($this->namespace)
|
||||
->group(base_path('routes/api.php'));
|
||||
});
|
||||
|
||||
Route::model('user', User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "uwil/laravel-base-project",
|
||||
"name": "uwil/flucollector",
|
||||
"version": "1.0.0",
|
||||
"type": "project",
|
||||
"description": "Laravel base project reference.",
|
||||
|
|
|
|||
|
|
@ -1,47 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateArcadiaBrandStatsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('arcadia_brand_stats', function (Blueprint $table) {
|
||||
$table->unsignedInteger('active')
|
||||
->comment('Le nombre de comptes actifs (dernière connexion inférieure à 6 mois)');
|
||||
$table->unsignedInteger('inactive')
|
||||
->comment('Le nombre de comptes inactifs (dernière connexion supérieure à 6 mois)');
|
||||
$table->unsignedInteger('old_accounts')
|
||||
->comment('Le nombre d’anciens comptes (date de création supérieure à 6 mois');
|
||||
$table->unsignedInteger('new_accounts')
|
||||
->comment('Le nombre de nouveaux comptes (date de création inférieure à 6 mois)');
|
||||
$table->unsignedInteger('total_accounts')
|
||||
->comment('Le nombre de comptes total');
|
||||
$table->unsignedInteger('total_opt_in')
|
||||
->comment('Le nombre d’optins (single optin compris)');
|
||||
|
||||
$table->timestamp('created_at')->nullable();
|
||||
|
||||
$table->foreignId('arcadia_brand_id')->constrained('arcadia_brands');
|
||||
|
||||
$table->index(['arcadia_brand_id', 'created_at']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('arcadia_brand_stats');
|
||||
}
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ class CreateServiceStats extends Migration
|
|||
$table->id();
|
||||
|
||||
$table->foreignId('service_id')->comment('Le clé primaire du service.')->constrained('services');
|
||||
$table->date('date')->comment('Le journée concernée.');
|
||||
$table->date('date')->comment('La journée concernée.');
|
||||
$table->unsignedBigInteger('nb_calls')->default(0)
|
||||
->comment('Le nombre d\'appels du service pour la journée.');
|
||||
|
||||
|
|
|
|||
|
|
@ -490,7 +490,7 @@
|
|||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[122]]></codMarq>
|
||||
<libMarq><![CDATA[NATURE & RESPECT]]></libMarq>
|
||||
<libMarq><![CDATA[NATURE & RESPECT]]></libMarq>
|
||||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[123]]></codMarq>
|
||||
|
|
@ -2518,7 +2518,7 @@
|
|||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[629]]></codMarq>
|
||||
<libMarq><![CDATA[GRILL & FUN]]></libMarq>
|
||||
<libMarq><![CDATA[GRILL & FUN]]></libMarq>
|
||||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[630]]></codMarq>
|
||||
|
|
@ -2678,7 +2678,7 @@
|
|||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[669]]></codMarq>
|
||||
<libMarq><![CDATA[HENRIK & CO]]></libMarq>
|
||||
<libMarq><![CDATA[HENRIK & CO]]></libMarq>
|
||||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[670]]></codMarq>
|
||||
|
|
@ -2698,7 +2698,7 @@
|
|||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[674]]></codMarq>
|
||||
<libMarq><![CDATA[HARI&CO]]></libMarq>
|
||||
<libMarq><![CDATA[HARI&CO]]></libMarq>
|
||||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[675]]></codMarq>
|
||||
|
|
@ -2754,11 +2754,11 @@
|
|||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[688]]></codMarq>
|
||||
<libMarq><![CDATA[GOURMET & RESPECT]]></libMarq>
|
||||
<libMarq><![CDATA[GOURMET & RESPECT]]></libMarq>
|
||||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[689]]></codMarq>
|
||||
<libMarq><![CDATA[COCK&CROWN]]></libMarq>
|
||||
<libMarq><![CDATA[COCK&CROWN]]></libMarq>
|
||||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[690]]></codMarq>
|
||||
|
|
@ -2886,15 +2886,15 @@
|
|||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[721]]></codMarq>
|
||||
<libMarq><![CDATA[NAT & VIE VEGGIE]]></libMarq>
|
||||
<libMarq><![CDATA[NAT & VIE VEGGIE]]></libMarq>
|
||||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[722]]></codMarq>
|
||||
<libMarq><![CDATA[SELECT & GO]]></libMarq>
|
||||
<libMarq><![CDATA[SELECT & GO]]></libMarq>
|
||||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[723]]></codMarq>
|
||||
<libMarq><![CDATA[BON & VEGETARIEN - U]]></libMarq>
|
||||
<libMarq><![CDATA[BON & VEGETARIEN - U]]></libMarq>
|
||||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[724]]></codMarq>
|
||||
|
|
@ -3618,7 +3618,7 @@
|
|||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[904]]></codMarq>
|
||||
<libMarq><![CDATA[BON & ENGAGE]]></libMarq>
|
||||
<libMarq><![CDATA[BON & ENGAGE]]></libMarq>
|
||||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[905]]></codMarq>
|
||||
|
|
@ -3786,7 +3786,7 @@
|
|||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[946]]></codMarq>
|
||||
<libMarq><![CDATA[TOQUES & TARTES]]></libMarq>
|
||||
<libMarq><![CDATA[TOQUES & TARTES]]></libMarq>
|
||||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[947]]></codMarq>
|
||||
|
|
@ -3842,7 +3842,7 @@
|
|||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[960]]></codMarq>
|
||||
<libMarq><![CDATA[TRADITION & RESPECT]]></libMarq>
|
||||
<libMarq><![CDATA[TRADITION & RESPECT]]></libMarq>
|
||||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[961]]></codMarq>
|
||||
|
|
@ -3918,7 +3918,7 @@
|
|||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[979]]></codMarq>
|
||||
<libMarq><![CDATA[MARKS & SPENCER]]></libMarq>
|
||||
<libMarq><![CDATA[MARKS & SPENCER]]></libMarq>
|
||||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[980]]></codMarq>
|
||||
|
|
@ -3942,7 +3942,7 @@
|
|||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[985]]></codMarq>
|
||||
<libMarq><![CDATA[FARMA & CO]]></libMarq>
|
||||
<libMarq><![CDATA[FARMA & CO]]></libMarq>
|
||||
</dam>
|
||||
<dam>
|
||||
<codMarq><![CDATA[986]]></codMarq>
|
||||
|
|
|
|||
|
|
@ -2,29 +2,29 @@
|
|||
|
||||
return [
|
||||
'actions' => [
|
||||
'list' => 'List',
|
||||
'view' => 'View',
|
||||
'create' => 'Create',
|
||||
'duplicate' => 'Duplicate',
|
||||
'update' => 'Update',
|
||||
'delete' => 'Delete',
|
||||
'save' => 'Save',
|
||||
'edit' => 'Edit',
|
||||
'list' => 'list',
|
||||
'view' => 'view',
|
||||
'create' => 'create',
|
||||
'duplicate' => 'duplicate',
|
||||
'update' => 'update',
|
||||
'delete' => 'delete',
|
||||
'save' => 'save',
|
||||
'edit' => 'edit',
|
||||
],
|
||||
|
||||
'helpers' => [
|
||||
'list' => 'List',
|
||||
'list_all' => 'List all :model',
|
||||
'create_model' => 'Create :model',
|
||||
'view_model' => 'View :model',
|
||||
'update_model' => 'Update :model',
|
||||
'duplicate_model' => 'Duplicate :model',
|
||||
'delete_model' => 'Delete :model',
|
||||
'save_model' => 'Save :model',
|
||||
'edit_model' => 'Edit :model',
|
||||
'no_results' => 'No results for :models',
|
||||
'publish' => 'Publish',
|
||||
'unpublish' => 'Unpublish',
|
||||
'list' => 'list',
|
||||
'list_all' => 'list all :model',
|
||||
'create_model' => 'create :model',
|
||||
'view_model' => 'view :model',
|
||||
'update_model' => 'update :model',
|
||||
'duplicate_model' => 'duplicate :model',
|
||||
'delete_model' => 'delete :model',
|
||||
'save_model' => 'save :model',
|
||||
'edit_model' => 'edit :model',
|
||||
'no_results' => 'no results for :models',
|
||||
'publish' => 'publish',
|
||||
'unpublish' => 'unpublish',
|
||||
],
|
||||
|
||||
'libs' => [
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@
|
|||
|
||||
return [
|
||||
'classes' => [
|
||||
'users' => 'Users',
|
||||
'arcadia_brands' => 'Brands',
|
||||
'xml_incos' => 'Inco Sheets',
|
||||
'services' => 'Services',
|
||||
'user' => 'user',
|
||||
'arcadia_brand' => 'brand',
|
||||
'xml_inco' => 'inco sheet',
|
||||
'service' => 'service',
|
||||
'service_stat' => 'statistic per service|statistics per service',
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -2,29 +2,29 @@
|
|||
|
||||
return [
|
||||
'actions' => [
|
||||
'list' => 'Liste',
|
||||
'view' => 'Voir',
|
||||
'create' => 'Créer',
|
||||
'duplicate' => 'Dupliquer',
|
||||
'update' => 'Éditer',
|
||||
'delete' => 'Supprimer',
|
||||
'save' => 'Sauvegarder',
|
||||
'edit' => 'Mettre à jour',
|
||||
'list' => 'liste',
|
||||
'view' => 'voir',
|
||||
'create' => 'créer',
|
||||
'duplicate' => 'dupliquer',
|
||||
'update' => 'éditer',
|
||||
'delete' => 'supprimer',
|
||||
'save' => 'sauvegarder',
|
||||
'edit' => 'mettre à jour',
|
||||
],
|
||||
|
||||
'helpers' => [
|
||||
'list' => 'Liste',
|
||||
'list_all' => 'Lister tous les :model',
|
||||
'create_model' => 'Créer :model',
|
||||
'view_model' => 'Voir :model',
|
||||
'update_model' => 'Éditer :model',
|
||||
'duplicate_model' => 'Dupliquer :model',
|
||||
'delete_model' => 'Supprimer :model',
|
||||
'save_model' => 'Sauvegarder :model',
|
||||
'edit_model' => 'Mettre à jour :model',
|
||||
'no_results' => 'Aucun résultat pour :model',
|
||||
'publish' => 'Publié',
|
||||
'unpublish' => 'Dépublié',
|
||||
'list' => 'liste',
|
||||
'list_all' => 'lister tous les :model',
|
||||
'create_model' => 'créer :model',
|
||||
'view_model' => 'voir :model',
|
||||
'update_model' => 'éditer :model',
|
||||
'duplicate_model' => 'dupliquer :model',
|
||||
'delete_model' => 'supprimer :model',
|
||||
'save_model' => 'sauvegarder :model',
|
||||
'edit_model' => 'mettre à jour :model',
|
||||
'no_results' => 'aucun résultat pour :model',
|
||||
'publish' => 'publié',
|
||||
'unpublish' => 'dépublié',
|
||||
],
|
||||
|
||||
'libs' => [
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@
|
|||
|
||||
return [
|
||||
'classes' => [
|
||||
'users' => 'Utilisateurs',
|
||||
'arcadia_brands' => 'Marques',
|
||||
'xml_incos' => 'Fiches Inco',
|
||||
'services' => 'Services',
|
||||
'user' => 'utilisateur',
|
||||
'arcadia_brand' => 'marque',
|
||||
'xml_inco' => 'fiche inco|fiches inco',
|
||||
'service' => 'service',
|
||||
'service_stat' => 'statistique par service|statistiques par service',
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@
|
|||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.users.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.users.index', ['sort_col' => 'updated_at', 'sort_way' => 'desc']) }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.users')]) }}">
|
||||
{{ __('models.classes.users') }}
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.user')]) }}">
|
||||
{{ Str::of(__('models.classes.user'))->plural()->title() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
|
|
@ -19,31 +19,31 @@
|
|||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.services.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.services.index', ['sort_col' => 'updated_at', 'sort_way' => 'desc']) }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.services')]) }}">
|
||||
{{ __('models.classes.services') }}
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.service')]) }}">
|
||||
{{ Str::of(__('models.classes.service'))->plural()->title() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.brands.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.brands.index', ['sort_col' => 'updated_at', 'sort_way' => 'desc']) }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.arcadia_brands')]) }}">
|
||||
{{ __('models.classes.arcadia_brands') }}
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.arcadia_brand')]) }}">
|
||||
{{ Str::of(__('models.classes.arcadia_brand'))->plural()->title() }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.xml_incos.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.xml_incos.index', ['sort_col' => 'updated_at', 'sort_way' => 'desc']) }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.xml_incos')]) }}">
|
||||
{{ __('models.classes.xml_incos') }}
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(__('models.classes.xml_inco'))->plural()->title()]) }}">
|
||||
{{ Str::of(trans_choice('models.classes.xml_inco', '*'))->title() }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link @if (request()->routeIs('bo.stats.*')) active @endif dropdown-toggle" id="navbarDarkDropdownStats"
|
||||
data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">{{ __('Statistiques') }}</a>
|
||||
data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">{{ Str::plural(__('Statistique')) }}</a>
|
||||
<ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="navbarDarkDropdownStats">
|
||||
<li><a class="dropdown-item"
|
||||
href="{{ route('bo.stats.viewByBrand') }}">{{ __('Statistiques par :model', ['model' => Str::singular(__('models.classes.arcadia_brands'))]) }}</a>
|
||||
href="{{ route('bo.stats.view-by-service') }}">{{ Str::ucfirst(trans_choice('models.classes.service_stat', '*')) }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<form action="{{ request()->fullUrlWithQuery(['rst' => null]) }}">
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group my-3">
|
||||
<label class="input-group-text" for="brandSelect">{{ __('Filter par Marque') }}</label>
|
||||
<select class="form-select" id="brandSelect">
|
||||
<option value="0" @if (!request()->brand) selected @endif>{{ __('Sélectionnez une marque..') }}</option>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<div class="col-12">
|
||||
@include('bo.partials.inputs.int-number', [
|
||||
'id' => 'brandFirstname',
|
||||
'label' => __('Id Arcadia de la :model', ['model' => Str::singular(__('models.classes.arcadia_brands'))]),
|
||||
'label' => __('Id Arcadia de la :model', ['model' => __('models.classes.arcadia_brand')]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'id',
|
||||
'required' => false,
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
<div class="col-12">
|
||||
@include('bo.partials.inputs.varchar', [
|
||||
'id' => 'brandLabel',
|
||||
'label' => __('Libellé de la :model', ['model' => Str::singular(__('models.classes.arcadia_brands'))]),
|
||||
'label' => __('Libellé de la :model', ['model' => __('models.classes.arcadia_brand')]),
|
||||
'hasWordCounter' => false,
|
||||
'name' => 'label',
|
||||
'required' => false,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
@extends('bo.layout')
|
||||
|
||||
@section('title', __('models.classes.arcadia_brands'))
|
||||
@section('description', __('Liste de tous les :model', ['model' => __('models.classes.arcadia_brands')]))
|
||||
@section('title', __('models.classes.arcadia_brand'))
|
||||
@section('description',
|
||||
__('Liste de tous les :model', [
|
||||
'model' => Str::of(__('models.classes.arcadia_brand'))->plural()->title(),
|
||||
]))
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap">
|
||||
|
|
@ -39,7 +42,7 @@
|
|||
</tbody>
|
||||
@else
|
||||
<tr>
|
||||
<td class="border-0">{{ __('crud.other.no_model_found', ['model' => __('models.classes.arcadia_brands')]) }}</td>
|
||||
<td class="border-0">{{ __('crud.other.no_model_found', ['model' => __('models.classes.arcadia_brand')]) }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
@extends('bo.layout', ['brParam' => $brandModel])
|
||||
|
||||
@section('title', __('Édition d\'un :model', ['model' => Str::singular(__('models.classes.arcadia_brands'))]))
|
||||
@section('description', __('Édition d\'un :model déjà existant', ['model' => Str::singular(__('models.classes.arcadia_brands'))]))
|
||||
@section('title', __('Édition d\'un :model', ['model' => __('models.classes.arcadia_brand')]))
|
||||
@section('description', __('Édition d\'un :model déjà existant', ['model' => __('models.classes.arcadia_brand')]))
|
||||
@section('breadcrumb',
|
||||
request()->route()->getName())
|
||||
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
href="{{ route('bo.brands.index', ['sort_col' => 'updated_at', 'sort_way' => 'desc']) }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.arcadia_brands')]) }}">
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.arcadia_brand')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $brandModel])
|
||||
|
|
|
|||
|
|
@ -1,18 +1,20 @@
|
|||
@extends('bo.layout')
|
||||
|
||||
@section('title', sprintf('%s - %s', __('models.classes.services'), Str::ucfirst(__('création'))))
|
||||
@section('description', __('Création d\'une :model', ['model' => __('models.classes.services')]))
|
||||
@section('title', sprintf('%s - %s', __('models.classes.service'), Str::ucfirst(__('création'))))
|
||||
@section('description', __('Création d\'une :model', ['model' => __('models.classes.service')]))
|
||||
@section('metaIndex', 'noindex,nofollow')
|
||||
@section('breadcrumb',
|
||||
request()->route()->getName())
|
||||
|
||||
@section('content')
|
||||
<div class="card border-0">
|
||||
<div class="card-header bg-light">
|
||||
<div class="card-header">
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
@can('viewAny', \App\Models\Service::class)
|
||||
<a class="btn btn-primary text-decoration-none me-2" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.services.index') }}"
|
||||
title="{{ __('Retourner sur la liste des :model', ['model' => __('models.classes.services')]) }}">
|
||||
title="{{ __('Retourner sur la liste des :model', ['model' => __('models.classes.service')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@endcan
|
||||
|
|
@ -21,14 +23,14 @@
|
|||
@can('create', \App\Models\Service::class)
|
||||
<div class="col-12 col-md-4 d-flex justify-content-center justify-content-md-end align-items-center">
|
||||
<button class="btn btn-primary" id="formSubmitClone" data-bs-toggle="tooltip" type="button"
|
||||
title="{{ __('Sauvegarder cette :model', ['model' => Str::singular(__('models.classes.services'))]) }}">
|
||||
title="{{ __('Sauvegarder cette :model', ['model' => __('models.classes.service')]) }}">
|
||||
{{ __('Sauvegarder') }}
|
||||
</button>
|
||||
</div>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body bg-white">
|
||||
<div class="card-body">
|
||||
<form action="{{ route('bo.services.store') }}" method="POST">
|
||||
@csrf
|
||||
@include('bo.pages.services.form')
|
||||
|
|
@ -36,7 +38,7 @@
|
|||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<button class="btn btn-primary" id="formSubmit" data-bs-toggle="tooltip" type="submit"
|
||||
title="{{ __('Sauvegarder cette :model', ['model' => Str::singular(__('models.classes.services'))]) }}">{{ __('Sauvegarder') }}</button>
|
||||
title="{{ __('Sauvegarder cette :model', ['model' => __('models.classes.service')]) }}">{{ __('Sauvegarder') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
|
|
|
|||
|
|
@ -1,34 +1,36 @@
|
|||
@extends('bo.layout')
|
||||
@extends('bo.layout', ['brParam' => $serviceModel])
|
||||
|
||||
@section('title', sprintf('%s - %s', __('models.classes.services'), Str::ucfirst(__('édition'))))
|
||||
@section('description', __('Édition d\'une :model', ['model' => __('models.classes.services')]))
|
||||
@section('title', sprintf('%s - %s', __('models.classes.service'), Str::ucfirst(__('édition'))))
|
||||
@section('description', __('Édition d\'une :model', ['model' => __('models.classes.service')]))
|
||||
@section('metaIndex', 'noindex,nofollow')
|
||||
@section('breadcrumb',
|
||||
request()->route()->getName())
|
||||
|
||||
@section('content')
|
||||
<div class="card border-0">
|
||||
<div class="card-header bg-light">
|
||||
<div class="card-header">
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
@can('viewAny', \App\Models\Service::class)
|
||||
<a class="btn btn-primary text-decoration-none me-2" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.services.index') }}"
|
||||
title="{{ __('Retourner sur la liste des :model', ['model' => __('models.classes.services')]) }}">
|
||||
title="{{ __('Retourner sur la liste des :model', ['model' => __('models.classes.service')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@endcan
|
||||
@include('modules.breadcrumbs.breadcrumb-body')
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $serviceModel])
|
||||
</div>
|
||||
@can('update', $serviceModel)
|
||||
<div class="col-12 col-md-4 d-flex justify-content-center justify-content-md-end align-items-center">
|
||||
<button class="btn btn-primary" id="formSubmitClone" data-bs-toggle="tooltip" type="button"
|
||||
title="{{ __('Sauvegarder cette :model', ['model' => Str::singular(__('models.classes.services'))]) }}">
|
||||
title="{{ __('Sauvegarder cette :model', ['model' => __('models.classes.service')]) }}">
|
||||
{{ __('Sauvegarder') }}
|
||||
</button>
|
||||
</div>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body bg-white">
|
||||
<div class="card-body">
|
||||
<form action="{{ route('bo.services.update', $serviceModel->id) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
|
@ -37,7 +39,7 @@
|
|||
<div class="col text-center">
|
||||
@can('update', $serviceModel)
|
||||
<button class="btn btn-primary" id="formSubmit" data-bs-toggle="tooltip" type="submit"
|
||||
title="{{ __('Sauvegarder ce :model', ['model' => Str::singular(__('models.classes.services'))]) }}">
|
||||
title="{{ __('Sauvegarder ce :model', ['model' => __('models.classes.service')]) }}">
|
||||
{{ __('Sauvegarder') }}
|
||||
</button>
|
||||
@endcan
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@
|
|||
<div class="col-12 mb-3">
|
||||
@include('bo.partials.inputs.varchar', [
|
||||
'id' => 'serviceName',
|
||||
'label' => __('Nom du :model', ['model' => Str::singular(__('models.classes.services'))]),
|
||||
'label' => __('Nom du :model', ['model' => __('models.classes.service')]),
|
||||
'name' => 'name',
|
||||
'model' => $serviceModel ?? null,
|
||||
'required' => true,
|
||||
'helper' => __('validation.between.string', [
|
||||
'attribute' => __(':model', ['model' => Str::singular(__('models.classes.services'))]),
|
||||
'attribute' => __(':model', ['model' => __('models.classes.service')]),
|
||||
'min' => 5,
|
||||
'max' => 160,
|
||||
]),
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
'helper' => __(
|
||||
'Selectionner une :model qui sera associée parmis la liste (une seule et unique marque doit être choisie).',
|
||||
[
|
||||
'model' => Str::singular(__('models.classes.arcadia_brands')),
|
||||
'model' => __('models.classes.arcadia_brand'),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<div class="table-responsive">
|
||||
<table class="table-hover fix-action m-0 table">
|
||||
<div class="table-responsive mb-3">
|
||||
<table class="table-hover table-fix-action m-0 table">
|
||||
<thead class="border-dark border-top-0 border-start-0 border-end-0 border-2">
|
||||
@php
|
||||
$cols = [
|
||||
|
|
@ -20,12 +20,12 @@
|
|||
@if ($serviceModels->count())
|
||||
@foreach ($serviceModels as $serviceModel)
|
||||
<tr>
|
||||
<td class="bg-white text-center align-middle">{{ $serviceModel->name }}</td>
|
||||
<td class="bg-white text-center align-middle">{{ $serviceModel->arcadiaBrand->label }}</td>
|
||||
<td class="bg-white text-center align-middle">
|
||||
<td class="text-center align-middle">{{ $serviceModel->name }}</td>
|
||||
<td class="text-center align-middle">{{ $serviceModel->arcadiaBrand->label }}</td>
|
||||
<td class="text-center align-middle">
|
||||
<span class="badge bg-warning text-dark text-wrap">{{ $serviceModel->bearer_token_date }}</span>
|
||||
</td>
|
||||
<td class="bg-white text-center align-middle">
|
||||
<td class="text-center align-middle">
|
||||
<form id="generateToken" action="{{ route('bo.generate-token-service', $serviceModel) }}" method="POST">
|
||||
@csrf
|
||||
<button class="btn btn-success" data-bs-toggle="tooltip"
|
||||
|
|
@ -34,22 +34,22 @@
|
|||
</button>
|
||||
</form>
|
||||
</td>
|
||||
<td class="bg-white text-center align-middle">
|
||||
<span class="badge bg-warning text-dark text-wrap">{{ $serviceModel->created_at }}</span>
|
||||
<td class="text-center align-middle">
|
||||
<span class="badge bg-warning text-bg-warning text-wrap">{{ $serviceModel->created_at }}</span>
|
||||
</td>
|
||||
<td class="bg-white text-end align-middle">
|
||||
<td class="text-end align-middle">
|
||||
<div class="btn-group">
|
||||
@can('view', $serviceModel)
|
||||
<a class="btn btn-sm btn-warning" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.services.show', $serviceModel) }}"
|
||||
title="{{ __('Afficher ce :model', ['model' => Str::singular(__('models.classes.services'))]) }}">
|
||||
title="{{ __('Afficher ce :model', ['model' => __('models.classes.service')]) }}">
|
||||
<i class="fa-solid fa-eye"></i>
|
||||
</a>
|
||||
@endcan
|
||||
@can('update', $serviceModel)
|
||||
<a class="btn btn-sm btn-primary" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.services.edit', $serviceModel->id) }}"
|
||||
title="{{ __('Modifier ce :model', ['model' => Str::singular(__('models.classes.services'))]) }}">
|
||||
title="{{ __('Modifier ce :model', ['model' => __('models.classes.service')]) }}">
|
||||
<i class="fa-solid fa-pencil"></i>
|
||||
</a>
|
||||
@endcan
|
||||
|
|
@ -59,8 +59,8 @@
|
|||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td class="bg-white text-center" colspan="6">
|
||||
<span class="h3">{{ __('Aucun résultat pour les :models', ['models' => __('models.classes.services')]) }}
|
||||
<td class="text-center" colspan="6">
|
||||
<span class="h3">{{ __('Aucun résultat pour les :models', ['models' => __('models.classes.service')]) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -1,40 +1,30 @@
|
|||
@extends('bo.layout')
|
||||
|
||||
@section('title', sprintf('%s - %s', __('models.classes.services'), Str::ucfirst(__('liste'))))
|
||||
@section('description', __('Listage de toutes les :model', ['model' => __('models.classes.services')]))
|
||||
@section('title', sprintf('%s - %s', __('models.classes.service'), Str::ucfirst(__('liste'))))
|
||||
@section('description', __('Listage de toutes les :model', ['model' => __('models.classes.service')]))
|
||||
@section('metaIndex', 'noindex,nofollow')
|
||||
|
||||
@section('content')
|
||||
<div class="row w-100 mx-auto">
|
||||
<div class="col p-0">
|
||||
<div class="card rounded-0 border-0">
|
||||
<div class="card-header bg-light">
|
||||
<div class="row w-100 mx-auto">
|
||||
<div class="col p-0">
|
||||
@include('modules.breadcrumbs.breadcrumb-body')
|
||||
</div>
|
||||
<div class="col-md-3 d-flex align-items-center p-0">
|
||||
<div class="input-group justify-content-end">
|
||||
@can('create', \App\Models\Service::class)
|
||||
<a class="btn btn-primary" data-bs-toggle="tooltip" href="{{ route('bo.services.create') }}"
|
||||
title="{{ __('Ajouter une :model', ['model' => Str::singular(__('models.classes.services'))]) }}">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
</a>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body bg-white">
|
||||
@include('bo.modules.search-bar-brand')
|
||||
<div class="row w-100 mx-auto">
|
||||
<div class="col p-0">
|
||||
@include('bo.pages.services.index-list')
|
||||
</div>
|
||||
</div>
|
||||
{{ $serviceModels->links() }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap">
|
||||
@include('modules.breadcrumbs.breadcrumb-body')
|
||||
<div class="input-group justify-content-end">
|
||||
@can('create', \App\Models\Service::class)
|
||||
<a class="btn btn-primary" data-bs-toggle="tooltip" data-bs-placement="top" href="{{ route('bo.users.create') }}"
|
||||
title="{{ __('crud.helpers.create_model', ['model' => __('models.classes.service')]) }}">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
</a>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
@include('bo.modules.search-bar-brand')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
@include('bo.pages.services.index-list')
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{{ $serviceModels->links() }}
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -1,33 +1,33 @@
|
|||
@extends('bo.layout')
|
||||
@extends('bo.layout', ['brParam' => $serviceModel])
|
||||
|
||||
@section('title', sprintf('%s - %s', __('models.classes.services'), Str::ucfirst(__('aperçu'))))
|
||||
@section('description', __('Aperçu d\'un :model', ['model' => __('models.classes.services')]))
|
||||
@section('title', sprintf('%s - %s', __('models.classes.service'), Str::ucfirst(__('aperçu'))))
|
||||
@section('description', __('Aperçu d\'un :model', ['model' => __('models.classes.service')]))
|
||||
@section('metaIndex', 'noindex,nofollow')
|
||||
@section('breadcrumb',
|
||||
request()->route()->getName())
|
||||
|
||||
@section('content')
|
||||
<div class="card border-0">
|
||||
<div class="card-header bg-light">
|
||||
<div class="card-header">
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
@can('viewAny', \App\Models\Service::class)
|
||||
<a class="btn btn-primary text-decoration-none me-2" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.services.index') }}"
|
||||
title="{{ __('Retourner sur la liste des :model', ['model' => __('models.classes.services')]) }}">
|
||||
title="{{ __('Retourner sur la liste des :model', ['model' => __('models.classes.service')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@endcan
|
||||
@include('breadcrumbs.breadcrumb-body')
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $serviceModel])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body bg-white">
|
||||
<div class="card-body">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col">
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center mb-2 flex-wrap py-0">
|
||||
<h1 class="h2">{{ __('Informations du service') }} {{ $serviceModel->name }} -
|
||||
{{ Str::singular(__('models.classes.arcadia_brands')) }} {{ $serviceModel->arcadiaBrand->label }}</h1>
|
||||
{{ __('models.classes.arcadia_brand') }} {{ $serviceModel->arcadiaBrand->label }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
<tbody>
|
||||
<tr>
|
||||
<td class="w-50"><b>{{ __('Nom') }}</b></td>
|
||||
<td class="w-50">{{ $serviceModel->label }}</td>
|
||||
<td class="w-50">{{ $serviceModel->name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>{{ __('Marque') }}</b></td>
|
||||
|
|
|
|||
|
|
@ -1,237 +0,0 @@
|
|||
@extends('bo.layout')
|
||||
|
||||
@section('title', __('Statistiques par marque'))
|
||||
@section('description', __('La page de statistiques par marque avec une plage de dates donnée'))
|
||||
@section('metaIndex', 'noindex,nofollow')
|
||||
|
||||
@section('content')
|
||||
<div class="row w-100 mx-auto">
|
||||
<div class="col p-0">
|
||||
<div class="card rounded-0 border-0">
|
||||
<div class="card-header bg-light">
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
@include('modules.breadcrumbs.breadcrumb-body')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body bg-white">
|
||||
<div class="row justify-content-end">
|
||||
<div class="col-12">
|
||||
<form action="{{ url()->current() }}">
|
||||
<div class="input-group mb-3">
|
||||
<button class="btn btn-secondary date today" type="button">{{ __('Aujourd\'hui') }}</button>
|
||||
<button class="btn btn-secondary date month" type="button">{{ __('Ce mois-ci') }}</button>
|
||||
<button class="btn btn-secondary date year" type="button">{{ __('Cette année') }}</button>
|
||||
<span class="input-group-text">{{ __('Début') }}</span>
|
||||
<input class="form-control date start" name="start" type="date"
|
||||
value="{{ request()->start ??now()->startOfMonth()->isoFormat('YYYY-MM-DD') }}" required>
|
||||
<span class="input-group-text">{{ __('Fin') }}</span>
|
||||
<input class="form-control date end" name="end" type="date"
|
||||
value="{{ request()->end ??now()->endOfMonth()->isoFormat('YYYY-MM-DD') }}" required>
|
||||
<select class="form-select" name="brand" required>
|
||||
<option value="" @if (!request()->brand) selected @endif>
|
||||
{{ __('Sélectionnez une marque') }}</option>
|
||||
@foreach (\App\Models\ArcadiaBrand::all() as $brand)
|
||||
<option value="{{ $brand->id }}" @if (request()->brand == $brand->id) selected @endif>
|
||||
{{ $brand->label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<button class="btn btn-primary" type="submit">
|
||||
{{ __('Visualiser') }}
|
||||
</button>
|
||||
</div>
|
||||
@if ($stats)
|
||||
<div class="input-group justify-content-end mb-3">
|
||||
<span class="input-group-text">{{ __('Export des données') }}</span>
|
||||
<button class="btn btn-success" id="StatsCSV"
|
||||
data-request="{{ route('bo.stats.viewByBrandExportCsv') }}?brand={{ urlencode(request()->brand) }}&start={{ urlencode(request()->start) }}&end={{ urlencode(request()->end) }}"
|
||||
type="button">
|
||||
{{ __('CSV') }}
|
||||
</button>
|
||||
<button class="btn btn-danger" id="StatsPDF" type="button">
|
||||
{{ __('PDF') }}
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@if ($stats)
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-10">
|
||||
<canvas id="chart"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
<script @if (isset($nonce)) nonce="{{ $nonce }}" @endif>
|
||||
Date.prototype.getFromFormat = function(format) {
|
||||
var yyyy = this.getFullYear().toString();
|
||||
format = format.replace(/yyyy/g, yyyy)
|
||||
var mm = (this.getMonth() + 1).toString();
|
||||
format = format.replace(/mm/g, (mm[1] ? mm : "0" + mm[0]));
|
||||
var dd = this.getDate().toString();
|
||||
format = format.replace(/dd/g, (dd[1] ? dd : "0" + dd[0]));
|
||||
var hh = this.getHours().toString();
|
||||
format = format.replace(/hh/g, (hh[1] ? hh : "0" + hh[0]));
|
||||
var ii = this.getMinutes().toString();
|
||||
format = format.replace(/ii/g, (ii[1] ? ii : "0" + ii[0]));
|
||||
var ss = this.getSeconds().toString();
|
||||
format = format.replace(/ss/g, (ss[1] ? ss : "0" + ss[0]));
|
||||
return format;
|
||||
};
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
let inputStart = document.getElementsByClassName('date start')[0];
|
||||
let inputEnd = document.getElementsByClassName('date end')[0];
|
||||
document.querySelectorAll('button.date').forEach((item) => {
|
||||
item.addEventListener('click', (e) => {
|
||||
if (e.target.classList.contains('today')) {
|
||||
inputStart.value = (new Date()).getFromFormat('yyyy-mm-dd');
|
||||
inputEnd.value = (new Date()).getFromFormat('yyyy-mm-dd');
|
||||
return;
|
||||
}
|
||||
if (e.target.classList.contains('month')) {
|
||||
inputStart.value = (new Date()).getFromFormat('yyyy-mm-') + '01';
|
||||
inputEnd.value = (new Date()).getFromFormat('yyyy-mm-') +
|
||||
new Date((new Date()).getFromFormat('yyyy'), (new Date()).getFromFormat('mm'), 0).getDate();
|
||||
return;
|
||||
}
|
||||
if (e.target.classList.contains('year')) {
|
||||
inputStart.value = (new Date()).getFromFormat('yyyy') + '-01-01';
|
||||
inputEnd.value = (new Date()).getFromFormat('yyyy') + '-12-31';
|
||||
return;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
@if ($stats)
|
||||
let colors = {
|
||||
active: '#EF476F',
|
||||
inactive: '#FFD166',
|
||||
old_accounts: '#06D6A0',
|
||||
new_accounts: '#118AB2',
|
||||
total_accounts: '#073B4C',
|
||||
total_opt_in: '#EB5E28',
|
||||
};
|
||||
let chart = document.getElementById('chart');
|
||||
if (chart) {
|
||||
// Chart JS Thing
|
||||
const config = {
|
||||
type: 'line',
|
||||
data: {
|
||||
datasets: [{
|
||||
label: 'actifs',
|
||||
borderColor: colors.active,
|
||||
data: @json(
|
||||
$stats->map(function ($brandStat) {
|
||||
return ['y' => $brandStat->active, 'x' => $brandStat->created_at->isoFormat('YYYY-MM-DD')];
|
||||
})),
|
||||
fill: false,
|
||||
cubicInterpolationMode: 'monotone',
|
||||
},
|
||||
{
|
||||
label: 'inactifs',
|
||||
borderColor: colors.inactive,
|
||||
data: @json(
|
||||
$stats->map(function ($brandStat) {
|
||||
return ['y' => $brandStat->inactive, 'x' => $brandStat->created_at->isoFormat('YYYY-MM-DD')];
|
||||
})),
|
||||
fill: false,
|
||||
cubicInterpolationMode: 'monotone',
|
||||
},
|
||||
{
|
||||
label: 'vieux comptes',
|
||||
borderColor: colors.old_accounts,
|
||||
data: @json(
|
||||
$stats->map(function ($brandStat) {
|
||||
return ['y' => $brandStat->old_accounts, 'x' => $brandStat->created_at->isoFormat('YYYY-MM-DD')];
|
||||
})),
|
||||
fill: false,
|
||||
cubicInterpolationMode: 'monotone',
|
||||
},
|
||||
{
|
||||
label: 'nouveaux comptes',
|
||||
borderColor: colors.new_accounts,
|
||||
data: @json(
|
||||
$stats->map(function ($brandStat) {
|
||||
return ['y' => $brandStat->new_accounts, 'x' => $brandStat->created_at->isoFormat('YYYY-MM-DD')];
|
||||
})),
|
||||
fill: false,
|
||||
cubicInterpolationMode: 'monotone',
|
||||
},
|
||||
{
|
||||
label: 'total comptes',
|
||||
borderColor: colors.total_accounts,
|
||||
data: @json(
|
||||
$stats->map(function ($brandStat) {
|
||||
return ['y' => $brandStat->total_accounts, 'x' => $brandStat->created_at->isoFormat('YYYY-MM-DD')];
|
||||
})),
|
||||
fill: true,
|
||||
cubicInterpolationMode: 'monotone',
|
||||
},
|
||||
{
|
||||
label: 'total optins',
|
||||
borderColor: colors.total_opt_in,
|
||||
data: @json(
|
||||
$stats->map(function ($brandStat) {
|
||||
return ['y' => $brandStat->total_opt_in, 'x' => $brandStat->created_at->isoFormat('YYYY-MM-DD')];
|
||||
})),
|
||||
fill: false,
|
||||
cubicInterpolationMode: 'monotone',
|
||||
},
|
||||
]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
@if (count($stats) < 180)
|
||||
animation: true,
|
||||
@else
|
||||
// Turn off animations and data parsing for performance
|
||||
animation: false,
|
||||
@endif
|
||||
parsing: true,
|
||||
plugins: {
|
||||
title: {
|
||||
display: true,
|
||||
text: '{{ __('Les statistiques crm par jour') }}'
|
||||
},
|
||||
|
||||
decimation: {
|
||||
enabled: false,
|
||||
algorithm: 'min-max',
|
||||
},
|
||||
},
|
||||
scales: {
|
||||
x: {
|
||||
display: true,
|
||||
},
|
||||
y: {
|
||||
display: true,
|
||||
beginAtZero: false,
|
||||
type: 'logarithmic'
|
||||
}
|
||||
},
|
||||
elements: {
|
||||
point: {
|
||||
radius: @if (count($stats) < 180)
|
||||
3
|
||||
@else
|
||||
0
|
||||
@endif
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
const chart = new ChartJS(
|
||||
document.getElementById('chart'),
|
||||
config
|
||||
);
|
||||
}
|
||||
@endif
|
||||
});
|
||||
</script>
|
||||
183
resources/views/bo/pages/stats/view-stats-by-services.blade.php
Normal file
183
resources/views/bo/pages/stats/view-stats-by-services.blade.php
Normal file
|
|
@ -0,0 +1,183 @@
|
|||
@extends('bo.layout')
|
||||
|
||||
@section('title', __('Statistiques par marque'))
|
||||
@section('description', __('La page de statistiques par marque avec une plage de dates donnée'))
|
||||
@section('metaIndex', 'noindex,nofollow')
|
||||
@section('breadcrumb',
|
||||
request()->route()->getName())
|
||||
|
||||
@section('content')
|
||||
<div class="row w-100 mx-auto">
|
||||
<div class="col p-0">
|
||||
<div class="card rounded-0 border-0">
|
||||
<div class="card-header bg-light">
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
@include('modules.breadcrumbs.breadcrumb-body')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body bg-white">
|
||||
<div class="row justify-content-end">
|
||||
<div class="col-12">
|
||||
<form action="{{ url()->current() }}">
|
||||
<div class="input-group mb-3">
|
||||
<button class="btn btn-secondary date today" type="button">{{ __('Aujourd\'hui') }}</button>
|
||||
<button class="btn btn-secondary date month" type="button">{{ __('Ce mois-ci') }}</button>
|
||||
<button class="btn btn-secondary date year" type="button">{{ __('Cette année') }}</button>
|
||||
<span class="input-group-text">{{ __('Début') }}</span>
|
||||
<input class="form-control date start" name="start" type="date"
|
||||
value="{{ request()->start ??now()->startOfMonth()->isoFormat('YYYY-MM-DD') }}" required>
|
||||
<span class="input-group-text">{{ __('Fin') }}</span>
|
||||
<input class="form-control date end" name="end" type="date"
|
||||
value="{{ request()->end ??now()->endOfMonth()->isoFormat('YYYY-MM-DD') }}" required>
|
||||
<select class="form-select" name="service" required>
|
||||
<option value="" @if (!request()->service) selected @endif>
|
||||
{{ __('Sélectionnez une marque') }}</option>
|
||||
@foreach (\App\Models\Service::all() as $service)
|
||||
<option value="{{ $service->id }}" @if (request()->service == $service->id) selected @endif>
|
||||
{{ $service->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<button class="btn btn-primary" type="submit">
|
||||
{{ __('Visualiser') }}
|
||||
</button>
|
||||
</div>
|
||||
@if ($stats)
|
||||
<div class="input-group justify-content-end mb-3">
|
||||
<span class="input-group-text">{{ __('Export des données') }}</span>
|
||||
<button class="btn btn-success" id="StatsCSV"
|
||||
data-request="{{ route('bo.stats.view-by-service-export-csv') }}?service={{ urlencode(request()->service) }}&start={{ urlencode(request()->start) }}&end={{ urlencode(request()->end) }}"
|
||||
type="button">
|
||||
{{ __('CSV') }}
|
||||
</button>
|
||||
<button class="btn btn-danger" id="StatsPDF" type="button">
|
||||
{{ __('PDF') }}
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@if ($stats)
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-10">
|
||||
<canvas id="chart"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script @if (isset($nonce)) nonce="{{ $nonce }}" @endif>
|
||||
Date.prototype.getFromFormat = function(format) {
|
||||
var yyyy = this.getFullYear().toString();
|
||||
format = format.replace(/yyyy/g, yyyy)
|
||||
var mm = (this.getMonth() + 1).toString();
|
||||
format = format.replace(/mm/g, (mm[1] ? mm : "0" + mm[0]));
|
||||
var dd = this.getDate().toString();
|
||||
format = format.replace(/dd/g, (dd[1] ? dd : "0" + dd[0]));
|
||||
var hh = this.getHours().toString();
|
||||
format = format.replace(/hh/g, (hh[1] ? hh : "0" + hh[0]));
|
||||
var ii = this.getMinutes().toString();
|
||||
format = format.replace(/ii/g, (ii[1] ? ii : "0" + ii[0]));
|
||||
var ss = this.getSeconds().toString();
|
||||
format = format.replace(/ss/g, (ss[1] ? ss : "0" + ss[0]));
|
||||
return format;
|
||||
};
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
let inputStart = document.getElementsByClassName('date start')[0];
|
||||
let inputEnd = document.getElementsByClassName('date end')[0];
|
||||
document.querySelectorAll('button.date').forEach((item) => {
|
||||
item.addEventListener('click', (e) => {
|
||||
if (e.target.classList.contains('today')) {
|
||||
inputStart.value = (new Date()).getFromFormat('yyyy-mm-dd');
|
||||
inputEnd.value = (new Date()).getFromFormat('yyyy-mm-dd');
|
||||
return;
|
||||
}
|
||||
if (e.target.classList.contains('month')) {
|
||||
inputStart.value = (new Date()).getFromFormat('yyyy-mm-') + '01';
|
||||
inputEnd.value = (new Date()).getFromFormat('yyyy-mm-') +
|
||||
new Date((new Date()).getFromFormat('yyyy'), (new Date()).getFromFormat('mm'), 0).getDate();
|
||||
return;
|
||||
}
|
||||
if (e.target.classList.contains('year')) {
|
||||
inputStart.value = (new Date()).getFromFormat('yyyy') + '-01-01';
|
||||
inputEnd.value = (new Date()).getFromFormat('yyyy') + '-12-31';
|
||||
return;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
@if ($stats)
|
||||
let colors = {
|
||||
nb_calls: '#EF476F',
|
||||
};
|
||||
let chart = document.getElementById('chart');
|
||||
if (chart) {
|
||||
// Chart JS Thing
|
||||
const config = {
|
||||
type: 'line',
|
||||
data: {
|
||||
datasets: [{
|
||||
label: 'appels',
|
||||
borderColor: colors.active,
|
||||
data: @json($stats->map(fn($serviceStat) => ['y' => $serviceStat->nb_calls, 'x' => $serviceStat->date->isoFormat('YYYY-MM-DD')])),
|
||||
fill: false,
|
||||
cubicInterpolationMode: 'monotone',
|
||||
}, ]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
@if (count($stats) < 180)
|
||||
animation: true,
|
||||
@else
|
||||
// Turn off animations and data parsing for performance
|
||||
animation: false,
|
||||
@endif
|
||||
parsing: true,
|
||||
plugins: {
|
||||
title: {
|
||||
display: true,
|
||||
text: '{{ __('Les statistiques crm par jour') }}'
|
||||
},
|
||||
|
||||
decimation: {
|
||||
enabled: false,
|
||||
algorithm: 'min-max',
|
||||
},
|
||||
},
|
||||
scales: {
|
||||
x: {
|
||||
display: true,
|
||||
},
|
||||
y: {
|
||||
display: true,
|
||||
beginAtZero: true,
|
||||
type: 'logarithmic'
|
||||
}
|
||||
},
|
||||
elements: {
|
||||
point: {
|
||||
radius: @if (count($stats) < 180)
|
||||
3
|
||||
@else
|
||||
0
|
||||
@endif
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
const chart = new ChartJS(
|
||||
document.getElementById('chart'),
|
||||
config
|
||||
);
|
||||
}
|
||||
@endif
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
|
@ -1,46 +1,37 @@
|
|||
@extends('bo.layout', ['brParam' => $userModel])
|
||||
|
||||
@section('title', __('Création d\'un :model', ['model' => Str::singular(__('models.classes.users'))]))
|
||||
@section('description', __('Création d\'un tout nouveau :model', ['model' => Str::singular(__('models.classes.users'))]))
|
||||
@section('breadcrumb', request()->route()->getName())
|
||||
@section('title', __('Création d\'un :model', ['model' => __('models.classes.user')]))
|
||||
@section('description', __('Création d\'un tout nouveau :model', ['model' => __('models.classes.user')]))
|
||||
@section('breadcrumb',
|
||||
request()->route()->getName())
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-3">
|
||||
<div class="d-flex flex-row align-items-start">
|
||||
<a href="{{ route('bo.users.index', ['sort_col' => 'updated_at', 'sort_way' => 'desc']) }}"
|
||||
class="btn btn-primary text-decoration-none m-0"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.users')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $userModel])
|
||||
</div>
|
||||
<div class="mb-2 mb-md-0">
|
||||
<button id="formSubmitClone"
|
||||
type="submit"
|
||||
class="btn btn-primary"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.users'))]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<form action="{{ route('bo.users.store') }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@include('bo.pages.users.form')
|
||||
<div class="row mt-3">
|
||||
<div class="col text-center">
|
||||
<button id="formSubmit"
|
||||
type="submit"
|
||||
class="btn btn-primary"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.users'))]) }}">
|
||||
<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" data-bs-placement="top"
|
||||
href="{{ route('bo.users.index', ['sort_col' => 'updated_at', 'sort_way' => 'desc']) }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.user')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $userModel])
|
||||
</div>
|
||||
<div class="mb-md-0 mb-2">
|
||||
<button class="btn btn-primary" id="formSubmitClone" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => __('models.classes.user')]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form action="{{ route('bo.users.store') }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@include('bo.pages.users.form')
|
||||
<div class="row mt-3">
|
||||
<div class="col text-center">
|
||||
<button class="btn btn-primary" id="formSubmit" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => __('models.classes.user')]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -1,69 +1,53 @@
|
|||
@extends('bo.layout', ['brParam' => $userModel])
|
||||
|
||||
@section('title', __('Édition d\'un :model', ['model' => Str::singular(__('models.classes.users'))]))
|
||||
@section('description', __('Édition d\'un :model déjà existant', ['model' => Str::singular(__('models.classes.users'))]))
|
||||
@section('breadcrumb', request()->route()->getName())
|
||||
@section('title', __('Édition d\'un :model', ['model' => __('models.classes.user')]))
|
||||
@section('description', __('Édition d\'un :model déjà existant', ['model' => __('models.classes.user')]))
|
||||
@section('breadcrumb',
|
||||
request()->route()->getName())
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-3">
|
||||
<div class="d-flex flex-row align-items-start">
|
||||
<a href="{{ route('bo.users.index', ['sort_col' => 'updated_at', 'sort_way' => 'desc']) }}"
|
||||
class="btn btn-primary text-decoration-none m-0"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.users')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $userModel])
|
||||
</div>
|
||||
<div class="mb-2 mb-md-0">
|
||||
<form action="{{ route('bo.users.destroy', $userModel->id) }}"
|
||||
method="POST"
|
||||
class="confirmDeleteTS">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<div class="btn-group" role="group">
|
||||
<a class="btn btn-secondary"
|
||||
href="{{ route('bo.users.duplicate', ['user' => $userModel->id]) }}"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('crud.helpers.duplicate_model', ['model' => Str::singular(__('models.classes.users'))]) }}">
|
||||
<i class="fa-solid fa-copy"></i>
|
||||
</a>
|
||||
<button id="formSubmitClone"
|
||||
type="submit"
|
||||
class="btn btn-primary"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.users'))]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
<button type="submit"
|
||||
class="btn btn-danger"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('crud.helpers.delete_model', ['model' => Str::singular(__('models.classes.users'))]) }}">
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<form action="{{ route('bo.users.update', $userModel->id) }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
@include('bo.pages.users.form')
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<button id="formSubmit"
|
||||
type="submit"
|
||||
class="btn btn-primary"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.users'))]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
<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" data-bs-placement="top"
|
||||
href="{{ route('bo.users.index', ['sort_col' => 'updated_at', 'sort_way' => 'desc']) }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.user')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $userModel])
|
||||
</div>
|
||||
<div class="mb-md-0 mb-2">
|
||||
<form class="confirmDeleteTS" action="{{ route('bo.users.destroy', $userModel->id) }}" method="POST">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<div class="btn-group" role="group">
|
||||
<a class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
href="{{ route('bo.users.duplicate', ['user' => $userModel->id]) }}"
|
||||
title="{{ __('crud.helpers.duplicate_model', ['model' => __('models.classes.user')]) }}">
|
||||
<i class="fa-solid fa-copy"></i>
|
||||
</a>
|
||||
<button class="btn btn-primary" id="formSubmitClone" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => __('models.classes.user')]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
<button class="btn btn-danger" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.delete_model', ['model' => __('models.classes.user')]) }}">
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form action="{{ route('bo.users.update', $userModel->id) }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
@include('bo.pages.users.form')
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<button class="btn btn-primary" id="formSubmit" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => __('models.classes.user')]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
<div class="row">
|
||||
{{-- FIRSTNAME --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
<fieldset class="h-100 border bg-white p-3">
|
||||
<legend>{{ __('Prénom') }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.varchar', [
|
||||
'id' => 'userFirstname',
|
||||
'label' => __('Prénom de l\':model', ['model' => Str::singular(__('models.classes.users'))]),
|
||||
'label' => __('Prénom de l\':model', ['model' => __('models.classes.user')]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'firstname',
|
||||
'required' => true,
|
||||
'model' => $userModel ?? null,
|
||||
'helper' => __('validation.between.string', [
|
||||
'attribute' => __('prénom de l\':model', ['model' => Str::singular(__('models.classes.users'))]),
|
||||
'attribute' => __('prénom de l\':model', ['model' => __('models.classes.user')]),
|
||||
'min' => 3,
|
||||
'max' => 255
|
||||
'max' => 255,
|
||||
]),
|
||||
'placeholder' => __('Un beau prénom'),
|
||||
])
|
||||
|
|
@ -25,21 +25,21 @@
|
|||
</div>
|
||||
{{-- LASTNAME --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
<fieldset class="h-100 border bg-white p-3">
|
||||
<legend>{{ __('Nom') }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.varchar', [
|
||||
'id' => 'userLastname',
|
||||
'label' => __('Nom de l\':model', ['model' => Str::singular(__('models.classes.users'))]),
|
||||
'label' => __('Nom de l\':model', ['model' => __('models.classes.user')]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'lastname',
|
||||
'required' => true,
|
||||
'model' => $userModel ?? null,
|
||||
'helper' => __('validation.between.string', [
|
||||
'attribute' => __('nom de l\':model', ['model' => Str::singular(__('models.classes.users'))]),
|
||||
'attribute' => __('nom de l\':model', ['model' => __('models.classes.user')]),
|
||||
'min' => 3,
|
||||
'max' => 255
|
||||
'max' => 255,
|
||||
]),
|
||||
'placeholder' => __('Un beau nom'),
|
||||
])
|
||||
|
|
@ -49,21 +49,21 @@
|
|||
</div>
|
||||
{{-- EMAIL --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
<fieldset class="h-100 border bg-white p-3">
|
||||
<legend>{{ __('E-mail') }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.varchar', [
|
||||
'id' => 'userEmail',
|
||||
'label' => __('E-mail de l\':model', ['model' => Str::singular(__('models.classes.users'))]),
|
||||
'label' => __('E-mail de l\':model', ['model' => __('models.classes.user')]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'email',
|
||||
'required' => true,
|
||||
'model' => $userModel ?? null,
|
||||
'helper' => __('validation.between.string', [
|
||||
'attribute' => __('E-mail de l\':model', ['model' => Str::singular(__('models.classes.users'))]),
|
||||
'attribute' => __('E-mail de l\':model', ['model' => __('models.classes.user')]),
|
||||
'min' => 3,
|
||||
'max' => 255
|
||||
'max' => 255,
|
||||
]),
|
||||
'placeholder' => __('aaaa.bbb@gmail.com'),
|
||||
])
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
</div>
|
||||
{{-- ROLE --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
<fieldset class="h-100 border bg-white p-3">
|
||||
<legend>{{ __('Rôle') }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
|
@ -92,24 +92,27 @@
|
|||
</div>
|
||||
{{-- PASSWORD --}}
|
||||
<div class="col-12 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
<fieldset class="h-100 border bg-white p-3">
|
||||
<legend>{{ __('Mot de passe') }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
@include('bo.partials.inputs.varchar-password', [
|
||||
'id' => 'userPassword',
|
||||
'label' => __('Mot de passe de l\':model', ['model' => Str::singular(__('models.classes.users'))]),
|
||||
'label' => __('Mot de passe de l\':model', ['model' => __('models.classes.user')]),
|
||||
'name' => 'password',
|
||||
'hasWordCounter' => true,
|
||||
'required' => false,
|
||||
'model' => null,
|
||||
'helper' => __('Doît respecter certaines contraintes (8 caractères minimum, lettres, chiffres, caractères spéciaux).'),
|
||||
'helper' => __(
|
||||
'Doît respecter certaines contraintes (8 caractères minimum, lettres, chiffres, caractères spéciaux).'),
|
||||
])
|
||||
</div>
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
@include('bo.partials.inputs.varchar-password', [
|
||||
'id' => 'userPassword_confirmation',
|
||||
'label' => __('Confirmation du mot de passe de l\':model', ['model' => Str::singular(__('models.classes.users'))]),
|
||||
'label' => __('Confirmation du mot de passe de l\':model', [
|
||||
'model' => __('models.classes.user'),
|
||||
]),
|
||||
'name' => 'password_confirmation',
|
||||
'hasWordCounter' => true,
|
||||
'required' => false,
|
||||
|
|
@ -122,14 +125,14 @@
|
|||
</div>
|
||||
{{-- STATUS --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
<fieldset class="h-100 border bg-white p-3">
|
||||
<legend>{{ __('Visibilité') }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.tinyint-boolean', [
|
||||
'id' => 'userPublished',
|
||||
'name' => 'published',
|
||||
'label' => __('État de publication de l\':model', ['model' => Str::singular(__('models.classes.users'))]),
|
||||
'label' => __('État de publication de l\':model', ['model' => __('models.classes.user')]),
|
||||
'helper' => __('Deux réponses possibles : oui ou non.'),
|
||||
'model' => $userModel ?? null,
|
||||
])
|
||||
|
|
@ -140,26 +143,26 @@
|
|||
</div>
|
||||
|
||||
@push('scripts')
|
||||
<script nonce="{{ $nonce }}">
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
// Submit button clone.
|
||||
const submit = document.getElementById('formSubmit')
|
||||
<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('');
|
||||
})
|
||||
submitClone.addEventListener('click', (event) => {
|
||||
event.preventDefault();
|
||||
submit.click('');
|
||||
})
|
||||
|
||||
// If we edit the password, the confirmation is required.
|
||||
const passwordInput = document.getElementById('userPassword');
|
||||
const confirmPasswordInput = document.getElementById('userPassword_confirmation');
|
||||
passwordInput.addEventListener('input', () => {
|
||||
if (passwordInput.value !== '') {
|
||||
confirmPasswordInput.required = true;
|
||||
} else {
|
||||
confirmPasswordInput.required = false;
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
// If we edit the password, the confirmation is required.
|
||||
const passwordInput = document.getElementById('userPassword');
|
||||
const confirmPasswordInput = document.getElementById('userPassword_confirmation');
|
||||
passwordInput.addEventListener('input', () => {
|
||||
if (passwordInput.value !== '') {
|
||||
confirmPasswordInput.required = true;
|
||||
} else {
|
||||
confirmPasswordInput.required = false;
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
@extends('bo.layout')
|
||||
|
||||
@section('title', __('models.classes.users'))
|
||||
@section('description', __('Liste de tous les :model', ['model' => __('models.classes.users')]))
|
||||
@section('title', __('models.classes.user'))
|
||||
@section('description', __('Liste de tous les :model', ['model' => __('models.classes.user')]))
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap">
|
||||
@include('modules.breadcrumbs.breadcrumb-body')
|
||||
@can('isConceptor')
|
||||
<a class="btn btn-primary float-right" data-bs-toggle="tooltip" data-bs-placement="top" href="{{ route('bo.users.create') }}"
|
||||
title="{{ __('crud.helpers.create_model', ['model' => Str::singular(__('models.classes.users'))]) }}">
|
||||
title="{{ __('crud.helpers.create_model', ['model' => __('models.classes.user')]) }}">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
</a>
|
||||
@endcan
|
||||
|
|
@ -76,7 +76,7 @@
|
|||
</tbody>
|
||||
@else
|
||||
<tr>
|
||||
<td class="border-0">{{ __('crud.other.no_model_found', ['model' => __('models.classes.users')]) }}</td>
|
||||
<td class="border-0">{{ __('crud.other.no_model_found', ['model' => __('models.classes.user')]) }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<div class="col-12">
|
||||
@include('bo.partials.inputs.int-number', [
|
||||
'id' => 'xmlIncoId',
|
||||
'label' => __('Id Arcadia de la :model', ['model' => Str::lower(__('models.classes.xml_incos'))]),
|
||||
'label' => __('Id Arcadia de la :model', ['model' => Str::lower(__('models.classes.xml_inco'))]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'id',
|
||||
'required' => false,
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
<div class="col-12">
|
||||
@include('bo.partials.inputs.varchar', [
|
||||
'id' => 'xmlIncoName',
|
||||
'label' => __('Nom de la :model', ['model' => Str::lower(__('models.classes.xml_incos'))]),
|
||||
'label' => __('Nom de la :model', ['model' => Str::lower(__('models.classes.xml_inco'))]),
|
||||
'hasWordCounter' => false,
|
||||
'name' => 'name',
|
||||
'required' => false,
|
||||
|
|
@ -61,9 +61,9 @@
|
|||
<fieldset class="h-100 border bg-white p-3">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
{{ __(':model associée', ['model' => Str::singular(__('models.classes.arcadia_brands'))]) }} : <a
|
||||
{{ __(':model associée', ['model' => __('models.classes.arcadia_brand')]) }} : <a
|
||||
href="{{ route('bo.brands.show', $xmlIncoModel->arcadiaBrand) }}"
|
||||
title="{{ __('Voir la :model', ['model' => Str::singular(__('models.classes.arcadia_brands'))]) }}">
|
||||
title="{{ __('Voir la :model', ['model' => __('models.classes.arcadia_brand')]) }}">
|
||||
{{ $xmlIncoModel->arcadiaBrand->label }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
@extends('bo.layout')
|
||||
|
||||
@section('title', __('models.classes.xml_incos'))
|
||||
@section('description', __('Liste de tous les :model', ['model' => __('models.classes.xml_incos')]))
|
||||
@section('title', __('models.classes.xml_inco'))
|
||||
@section('description', __('Liste de tous les :model', ['model' => __('models.classes.xml_inco')]))
|
||||
@section('breadcrumb',
|
||||
request()->route()->getName())
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap">
|
||||
|
|
@ -41,7 +43,7 @@
|
|||
</tbody>
|
||||
@else
|
||||
<tr>
|
||||
<td class="border-0">{{ __('crud.other.no_model_found', ['model' => __('models.classes.xml_incos')]) }}</td>
|
||||
<td class="border-0">{{ __('crud.other.no_model_found', ['model' => __('models.classes.xml_inco')]) }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
@extends('bo.layout', ['brParam' => $xmlIncoModel])
|
||||
|
||||
@section('title', __('Édition d\'un :model', ['model' => Str::singular(__('models.classes.xml_incos'))]))
|
||||
@section('description', __('Édition d\'un :model déjà existant', ['model' => Str::singular(__('models.classes.xml_incos'))]))
|
||||
@section('title', __('Édition d\'un :model', ['model' => __('models.classes.xml_inco')]))
|
||||
@section('description', __('Édition d\'un :model déjà existant', ['model' => __('models.classes.xml_inco')]))
|
||||
@section('breadcrumb',
|
||||
request()->route()->getName())
|
||||
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
href="{{ route('bo.xml_incos.index', ['sort_col' => 'updated_at', 'sort_way' => 'desc']) }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.xml_incos')]) }}">
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.xml_inco')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $xmlIncoModel])
|
||||
|
|
|
|||
|
|
@ -1,12 +1,7 @@
|
|||
@hasSection('breadcrumb')
|
||||
@if(Breadcrumbs::exists(app()->view->getSections()['breadcrumb']))
|
||||
{{ call_user_func_array('Breadcrumbs::render', array_merge(
|
||||
[app()->view->getSections()['breadcrumb']],
|
||||
!empty($brParam) ? (is_array($brParam) ? $brParam : [$brParam]) : []
|
||||
)) }}
|
||||
@endif
|
||||
@elseif(request()->route() != null)
|
||||
@if(Breadcrumbs::exists(request()->route()->getName()))
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endif
|
||||
@if (Breadcrumbs::exists(app()->view->getSections()['breadcrumb']))
|
||||
{{ call_user_func_array('Breadcrumbs::render', array_merge([app()->view->getSections()['breadcrumb']], Arr::wrap($brParam ?? []))) }}
|
||||
@endif
|
||||
@elseif(Breadcrumbs::exists(request()->route()->getName()))
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
@hasSection('breadcrumb')
|
||||
@if(Breadcrumbs::exists(app()->view->getSections()['breadcrumb']))
|
||||
{{ Breadcrumbs::view('breadcrumbs::json-ld', app()->view->getSections()['breadcrumb'], $brParam ?? null) }}
|
||||
@endif
|
||||
@elseif(request()->route() != null)
|
||||
@if (Breadcrumbs::exists(request()->route()->getName()))
|
||||
{{ Breadcrumbs::view('breadcrumbs::json-ld', request()->route()->getName()) }}
|
||||
@endif
|
||||
@if (Breadcrumbs::exists(app()->view->getSections()['breadcrumb']))
|
||||
{{ call_user_func_array(
|
||||
'Breadcrumbs::view',
|
||||
array_merge(['breadcrumbs::json-ld', app()->view->getSections()['breadcrumb']], Arr::wrap($brParam ?? [])),
|
||||
) }}
|
||||
@endif
|
||||
@elseif(Breadcrumbs::exists(request()->route()->getName()))
|
||||
{{ Breadcrumbs::view('breadcrumbs::json-ld',request()->route()->getName()) }}
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
@if (count($breadcrumbs))
|
||||
<ol class="breadcrumb flex-nowrap @if(!Request::is('bo/*')) w-100 m-0 @else m-0 @endif">
|
||||
@foreach ($breadcrumbs as $breadcrumb)
|
||||
@if ($breadcrumb->url && !$loop->last)
|
||||
<li class="breadcrumb-item d-flex">
|
||||
<a class="text-decoration-none @if(!Request::is('bo/*')) text-white py-3 @else text-dark h2 ps-2 m-0 fw-bold @endif" href="{{ $breadcrumb->url }}">
|
||||
{{ $breadcrumb->title }}
|
||||
</a>
|
||||
</li>
|
||||
@else
|
||||
<li class="breadcrumb-item d-flex align-items-center flex-grow-1 active @if(Request::is('bo/*')) text-dark h2 m-0 fw-bold @endif">
|
||||
{{ $breadcrumb->title }}
|
||||
</li>
|
||||
@endif
|
||||
@endforeach
|
||||
</ol>
|
||||
<ol class="breadcrumb justify-content-center w-100 m-0">
|
||||
@foreach ($breadcrumbs as $breadcrumb)
|
||||
@if ($breadcrumb->url && !$loop->last)
|
||||
<li class="breadcrumb-item d-flex">
|
||||
<a class="h2 fw-bold m-0 ps-2" href="{{ $breadcrumb->url }}">
|
||||
{{ $breadcrumb->title }}
|
||||
</a>
|
||||
</li>
|
||||
@else
|
||||
<li class="breadcrumb-item btn-games d-flex align-items-center flex-grow-1 active text-dark h2 fw-bold m-0">
|
||||
{{ $breadcrumb->title }}
|
||||
</li>
|
||||
@endif
|
||||
@endforeach
|
||||
</ol>
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -1,19 +1 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use App\Http\Controllers\Api\V1\ApiController as V1ApiController;
|
||||
use App\Http\Controllers\Api\V1\XmlIncoController as V1XmlIncoController;
|
||||
|
||||
Route::prefix('v1')->name('apiV1.')->group(function () {
|
||||
|
||||
// * PUBLIC
|
||||
Route::get('/ping', [V1ApiController::class, 'ping'])->name('ping');
|
||||
|
||||
// * PRIVATE
|
||||
Route::middleware('auth:api')->group(function () {
|
||||
Route::prefix('inco')->name('incos.')->group(function () {
|
||||
Route::get('/', [V1XmlIncoController::class, 'index'])->name('index');
|
||||
Route::get('/{xmlinco}', [V1XmlIncoController::class, 'show'])->name('show');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,22 +1,81 @@
|
|||
<?php
|
||||
|
||||
use App\Models\ArcadiaBrand;
|
||||
use App\Models\Service;
|
||||
use App\Models\User;
|
||||
use App\Models\XmlInco;
|
||||
use Diglactic\Breadcrumbs\Breadcrumbs;
|
||||
use Diglactic\Breadcrumbs\Generator;
|
||||
use illuminate\Support\Str;
|
||||
|
||||
// * USERS
|
||||
Breadcrumbs::for('bo.users.index', function (Generator $trail) {
|
||||
$trail->push(trans('Users'), route('bo.users.index', ['sort_col' => 'updated_at', 'sort_way' => 'desc']));
|
||||
$trail->push(
|
||||
Str::of(trans('models.classes.user'))->plural()->ucfirst(),
|
||||
route('bo.users.index', ['sort_col' => 'updated_at', 'sort_way' => 'desc'])
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for('bo.users.create', function (Generator $trail) {
|
||||
$trail->parent('bo.users.index');
|
||||
$trail->push(trans('Create'), route('bo.users.create'));
|
||||
$trail->push(Str::ucfirst(trans('crud.actions.create')), route('bo.users.create'));
|
||||
});
|
||||
Breadcrumbs::for('bo.users.edit', function (Generator $trail, User $user) {
|
||||
$trail->parent('bo.users.index');
|
||||
$trail->push(trans('Edit'), route('bo.users.edit', $user->id));
|
||||
$trail->push(Str::ucfirst(trans('crud.actions.edit')), route('bo.users.edit', $user));
|
||||
});
|
||||
Breadcrumbs::for('bo.users.duplicate', function (Generator $trail, User $user) {
|
||||
$trail->parent('bo.users.index');
|
||||
$trail->push(trans('Duplicate'), route('bo.users.duplicate', $user->id));
|
||||
$trail->push(Str::ucfirst(trans('crud.actions.duplicate')), route('bo.users.duplicate', $user));
|
||||
});
|
||||
|
||||
// * BRANDS
|
||||
Breadcrumbs::for('bo.brands.index', function (Generator $trail) {
|
||||
$trail->push(
|
||||
Str::of(trans('models.classes.arcadia_brand'))->plural()->ucfirst(),
|
||||
route('bo.brands.index', ['sort_col' => 'updated_at', 'sort_way' => 'desc'])
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for('bo.brands.show', function (Generator $trail, ArcadiaBrand $brand) {
|
||||
$trail->parent('bo.brands.index');
|
||||
$trail->push(Str::ucfirst(trans('crud.actions.view')), route('bo.brands.show', $brand));
|
||||
});
|
||||
|
||||
// * SERVICES
|
||||
Breadcrumbs::for('bo.services.index', function (Generator $trail) {
|
||||
$trail->push(
|
||||
Str::of(trans('models.classes.service'))->plural()->ucfirst(),
|
||||
route('bo.services.index', ['sort_col' => 'updated_at', 'sort_way' => 'desc'])
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for('bo.services.create', function (Generator $trail) {
|
||||
$trail->parent('bo.services.index');
|
||||
$trail->push(Str::ucfirst(trans('crud.actions.create')), route('bo.services.create'));
|
||||
});
|
||||
Breadcrumbs::for('bo.services.edit', function (Generator $trail, Service $service) {
|
||||
$trail->parent('bo.services.index');
|
||||
$trail->push(Str::ucfirst(trans('crud.actions.edit')), route('bo.services.edit', $service));
|
||||
});
|
||||
Breadcrumbs::for('bo.services.show', function (Generator $trail, Service $service) {
|
||||
$trail->parent('bo.services.index');
|
||||
$trail->push(Str::ucfirst(trans('crud.actions.view')), route('bo.services.show', $service));
|
||||
});
|
||||
|
||||
// * INCO
|
||||
Breadcrumbs::for('bo.xml_incos.index', function (Generator $trail) {
|
||||
$trail->push(
|
||||
Str::of(trans_choice('models.classes.xml_inco', '*'))->ucfirst(),
|
||||
route('bo.xml_incos.index', ['sort_col' => 'updated_at', 'sort_way' => 'desc'])
|
||||
);
|
||||
});
|
||||
Breadcrumbs::for('bo.xml_incos.show', function (Generator $trail, XmlInco $xml_inco) {
|
||||
$trail->parent('bo.xml_incos.index');
|
||||
$trail->push(Str::ucfirst(trans('crud.actions.view')), route('bo.xml_incos.show', $xml_inco));
|
||||
});
|
||||
|
||||
// * STATS
|
||||
Breadcrumbs::for('bo.stats.view-by-service', function (Generator $trail) {
|
||||
$trail->push(
|
||||
Str::of(trans_choice('models.classes.service_stat', '*'))->ucfirst(),
|
||||
route('bo.stats.view-by-service')
|
||||
);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -56,9 +56,9 @@ Route::prefix('bo')
|
|||
->name('generate-token-service');
|
||||
|
||||
// * Stats
|
||||
Route::match(['get', 'post'], '/stats/brand', [StatsController::class, 'viewStatsByBrand'])
|
||||
->name('stats.viewByBrand');
|
||||
Route::match(['get', 'post'], '/stats/brand', [StatsController::class, 'viewStatsByService'])
|
||||
->name('stats.view-by-service');
|
||||
Route::get('/stats/brand/csv', [StatsController::class, 'exportByBrandCsv'])
|
||||
->name('stats.viewByBrandExportCsv');
|
||||
->name('stats.view-by-service-export-csv');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue