Premier commit

This commit is contained in:
jeremy bayse
2026-02-09 11:27:21 +01:00
commit 89a369964d
114 changed files with 17837 additions and 0 deletions

View File

@@ -0,0 +1,208 @@
@extends('layouts.app')
@section('content')
@section('title', 'Tableau de Bord')
@section('content')
<div class="row g-4 mb-4">
<!-- Stats Cards -->
<div class="col-md-3">
<div class="card shadow-sm border-start border-4 border-primary">
<div class="card-body">
<h5 class="card-title text-muted">Nombre de contrats</h5>
<h2 class="display-6">{{ $contractStats['total'] }}</h2>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card shadow-sm border-start border-4 border-success">
<div class="card-body">
<h5 class="card-title text-muted">Actifs</h5>
<h2 class="display-6">{{ $contractStats['active'] }}</h2>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card shadow-sm border-start border-4 border-warning">
<div class="card-body">
<h5 class="card-title text-muted">Expire bientôt</h5>
<h2 class="display-6">{{ $contractStats['expiring_soon'] }}</h2>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card shadow-sm border-start border-4 border-danger">
<div class="card-body">
<h5 class="card-title text-muted">Expirés</h5>
<h2 class="display-6">{{ $contractStats['expired'] }}</h2>
</div>
</div>
</div>
</div>
<div class="row mb-4">
<div class="col-12">
<div class="card shadow-sm border-0">
<div class="card-header border-bottom-0 pt-3 pb-0 d-flex justify-content-between align-items-center">
<h5 class="card-title fw-bold text-white mb-0">
<i class="bi bi-sticky me-2"></i>Bloc-Note
</h5>
<small class="text-muted"></small>
</div>
<div class="card-body">
<form action="{{ route('dashboard.note.update') }}" method="POST">
@csrf
<div class="input-group">
<textarea name="note" class="form-control" rows="3" placeholder="Écrivez un message ici...">{{ $dashboardNote }}</textarea>
<button class="btn btn-warning text-dark" type="submit">Enregistrer</button>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="row mb-4">
<div class="col-12">
<div class="card shadow-sm border-0">
<div class="card-header border-bottom-0 pt-4 pb-0">
<h5 class="card-title fw-bold text-white mb-0">
<i class="bi bi-calendar-event me-2"></i>Prochaines Expirations
</h5>
<p class="text-muted small mb-0"></p>
</div>
<div class="card-body">
@if($upcomingContracts->isEmpty())
<p class="text-center text-muted py-4">Aucun contrat n'arrive à échéance prochainement.</p>
@else
<div class="timeline-wrapper">
<div class="timeline">
@foreach($upcomingContracts as $contract)
@php
$diffInDays = now()->startOfDay()->diffInDays($contract->end_date->startOfDay(), false);
$statusClass = 'normal';
if ($diffInDays < 0) {
$statusClass = 'expired';
} elseif ($diffInDays < 30) {
$statusClass = 'urgent';
} elseif ($diffInDays < 90) {
$statusClass = 'soon';
}
@endphp
<div class="timeline-item {{ $statusClass }}">
<!-- Date Label -->
<div class="timeline-date">
{{ $contract->end_date->format('d M Y') }}
<br>
<small class="{{ $diffInDays < 0 ? 'text-secondary' : ($diffInDays < 30 ? 'text-danger' : 'text-muted') }}">
@if($diffInDays < 0)
Expiré
@elseif($diffInDays == 0)
Aujourd'hui
@else
J-{{ $diffInDays }}
@endif
</small>
</div>
<!-- Dot on the line -->
<div class="timeline-dot" title="{{ $contract->status }}"></div>
<!-- Content Below -->
<a href="{{ route('contracts.show', $contract) }}" class="timeline-content text-start">
<h6 class="text-truncate" title="{{ $contract->name }}">{{ $contract->name }}</h6>
<small class="d-block text-secondary">{{ $contract->provider }}</small>
<span class="badge rounded-pill bg-light text-dark border mt-1">
{{ number_format($contract->amount, 0, ',', ' ') }} {{ $contract->currency }}
</span>
</a>
</div>
@endforeach
</div>
</div>
@endif
</div>
</div>
</div>
</div>
<div class="row">
<!-- Links Section -->
<div class="col-md-12 mb-4">
<div class="card shadow-sm">
<div class="card-header border-bottom-0">
<h5 class="mb-0 text-white">Ressources</h5>
</div>
<div class="card-body">
<div class="d-flex flex-wrap gap-3">
@forelse($links as $link)
<a href="{{ $link->url }}" target="_blank" class="btn btn-outline-{{ $link->color ?? 'primary' }} d-flex align-items-center gap-2">
@if($link->icon) <i class="bi {{ $link->icon }}"></i> @endif
{{ $link->title }}
</a>
@empty
<p class="text-muted mb-0">Aucun lien configuré.</p>
@endforelse
</div>
</div>
</div>
</div>
</div>
<div class="row">
<!-- Types Chart / Distribution (simplified list here) -->
<div class="col-md-6 mb-4">
<div class="card h-100 shadow-sm">
<div class="card-header border-bottom-0">
<h5 class="mb-0 text-white">Répartition par Type</h5>
</div>
<div class="card-body">
<ul class="list-group list-group-flush">
@foreach($contractStats['by_type'] as $type => $stat)
<li class="list-group-item d-flex justify-content-between align-items-center">
{{ ucfirst(str_replace('_', ' ', $type)) }}
<span class="badge bg-secondary pill">{{ $stat->count }}</span>
</li>
@endforeach
</ul>
</div>
</div>
</div>
<!-- Recent Activity -->
<div class="col-md-6 mb-4">
<div class="card h-100 shadow-sm">
<div class="card-header border-bottom-0">
<h5 class="mb-0 text-white">Dernières Activités (Audit Logs)</h5>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-striped mb-0 small">
<thead>
<tr>
<th>Action</th>
<th>Utilisateur</th>
<th>Temps</th>
</tr>
</thead>
<tbody>
@foreach($recentLogs as $log)
<tr>
<td>
<span class="d-block text-truncate" style="max-width: 150px;" title="{{ $log->description }}">
{{ $log->action }}
</span>
</td>
<td>{{ $log->user->name ?? 'Système' }}</td>
<td>{{ $log->created_at->diffForHumans() }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
@endsection