Compare commits

34 Commits

Author SHA1 Message Date
jeremy bayse
174f229b5d Fix layout stability: sticky sidebar in Show and sticky filters in Index with layout height correction 2026-04-21 06:50:32 +02:00
jeremy bayse
2216de1a02 Refactoring AI candidate analysis: UI improvements, data normalization, provider management and real-time score clamping 2026-04-21 06:41:37 +02:00
jeremy bayse
abfe01190b feat: add AI service configuration and candidate dossier PDF template 2026-04-19 21:44:49 +02:00
jeremy bayse
d924765b94 feat(ai): refactor AI prompts and add bypass option to Job Positions 2026-04-19 21:24:56 +02:00
jeremy bayse
205c24182d feat: implementation des logs de connexion et correction du chemin de stockage des documents 2026-04-19 17:28:13 +02:00
jeremy bayse
f3d630d741 feat: implementation des dossiers candidats PDF, gestion des entretiens et optimisation de l'analyse IA 2026-04-19 15:35:16 +02:00
jeremy bayse
4017e3d9c5 feat(ai): optimize candidate analysis and implement batch processing 2026-04-19 08:28:28 +02:00
jeremy bayse
b728686605 docs: generate comprehensive README.md with project features 2026-04-18 08:41:55 +02:00
jeremy bayse
589e9956f9 UI: lock application to light mode globally (disabled dark mode detection) 2026-04-16 19:16:48 +02:00
jeremy bayse
d6e5b44e47 Admin: implementation of the 'is_selected' feature for candidates for interviews 2026-04-16 19:08:52 +02:00
jeremy bayse
c4ab5c97b2 Admin: Super Admin can bypass the 7-day AI analysis restriction 2026-04-16 18:55:53 +02:00
jeremy bayse
84a9c6bb14 Fix: New registered candidates visibility (profile creation and tenant scope adjustment) 2026-04-16 18:31:23 +02:00
jeremy bayse
957947cc0b fix: quiz questions not showing - reload quiz freshly in show(), fix v-if guard in QuizInterface 2026-04-14 19:55:05 +02:00
jeremy bayse
6e4eb62553 fix: bypass tenant scope in AttemptController::destroy - null quiz title caused 500 when admin deletes attempt 2026-04-14 19:51:06 +02:00
jeremy bayse
c74d8e14ec fix: null quiz crash in admin candidate show - load attempts.quiz withoutGlobalScopes + null guard in Vue template 2026-04-14 19:49:12 +02:00
jeremy bayse
e93a17f324 refactor: fix BelongsToTenant trait to exempt candidates globally - removes all withoutGlobalScopes() workarounds 2026-04-14 19:38:42 +02:00
jeremy bayse
49ee91c601 fix: bypass tenant scope in recalculateScore - null quiz when candidate finishes quiz 2026-04-14 19:35:26 +02:00
jeremy bayse
479a7e35d1 fix: bypass tenant scope in AttemptController::show - candidates (no tenant_id) were getting 404 on quiz start 2026-04-14 19:24:29 +02:00
jeremy bayse
de6938d2e6 fix: bypass BelongsToTenant global scope when loading candidate quizzes on dashboard - candidates have no tenant_id 2026-04-14 19:20:20 +02:00
jeremy bayse
91213cc371 fix: sync quizzes unconditionally - was not removing quizzes when quiz_ids was empty 2026-04-14 19:15:15 +02:00
jeremy bayse
af4502859b fix: QuizInterface crash on undefined text_content - add null guards and safe optional chaining 2026-04-14 19:09:58 +02:00
jeremy bayse
107e2d0a1d design: darken nav bar elements for high contrast - Dashboard and NavLink text fix 2026-04-14 19:08:06 +02:00
jeremy bayse
71672509b6 design: fix candidate layout with full light theme, no dark mode dependencies, high contrast throughout 2026-04-14 19:06:17 +02:00
jeremy bayse
351bdda2a1 design: complete UI harmonization with full dark mode support and high contrast for candidate dashboard 2026-04-14 19:02:38 +02:00
jeremy bayse
21d4aaee59 design: premium candidate dashboard with high contrast and better layout 2026-04-14 18:59:09 +02:00
jeremy bayse
ec1fe91b35 feat: link quizzes to job positions and filter candidate dashboard accordingly 2026-04-14 18:30:13 +02:00
jeremy bayse
8c577cfaa7 fix: display flash messages on admin users index to show generated passwords 2026-04-14 18:24:44 +02:00
jeremy bayse
4a137fc511 feat: implement admin user management interface and routes for CRUD operations and password resets 2026-04-14 18:17:33 +02:00
jeremy bayse
e68108a2b1 feat: implement candidate details page with Chart.js radar visualization and AI analysis integration 2026-04-14 18:13:17 +02:00
jeremy bayse
4810ca9d9c feat: allow super admin to update candidate tenant on profile page 2026-03-30 17:03:20 +02:00
jeremy bayse
7ece2036c1 chore: track version in VERSION file and increment to 1.0.2 2026-03-29 11:52:41 +02:00
jeremy bayse
d0ecfa3e96 feat: add versioning system and display in footer (v1.0.1) 2026-03-29 11:52:08 +02:00
jeremy bayse
38fe4a22d6 feat: automatic tenant_id sync for candidates from job position 2026-03-29 11:25:53 +02:00
jeremy bayse
a3057aae6f fix: allow super_admin role on users table 2026-03-29 11:05:45 +02:00
68 changed files with 4777 additions and 1287 deletions

View File

@@ -0,0 +1,7 @@
{
"permissions": {
"allow": [
"Bash(npm run *)"
]
}
}

View File

@@ -1,7 +1,8 @@
APP_NAME=Laravel
APP_NAME=Recru.IT
# PRODUCTION: Set to 'production' and set APP_DEBUG=false
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_DEBUG=false
APP_URL=http://localhost
APP_LOCALE=en
@@ -18,7 +19,8 @@ BCRYPT_ROUNDS=12
LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
# PRODUCTION: Use 'error' to avoid exposing sensitive data in logs
LOG_LEVEL=error
DB_CONNECTION=sqlite
# DB_HOST=127.0.0.1
@@ -29,7 +31,8 @@ DB_CONNECTION=sqlite
SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
# SECURITY: Must be 'true' in production to encrypt session data at rest
SESSION_ENCRYPT=true
SESSION_PATH=/
SESSION_DOMAIN=null

5
.gitignore vendored
View File

@@ -22,3 +22,8 @@
Homestead.json
Homestead.yaml
Thumbs.db
# Debug & temporary scripts (never commit these)
fix_*.php
test-*.php
scratch/

View File

@@ -1,58 +1,79 @@
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
# 🚀 RecruIT - QuizzCabm
<p align="center">
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
</p>
**RecruIT** (also known as QuizzCabm) is a high-performance, multi-tenant SaaS application designed to streamline and revolutionize the recruitment process through automated assessments, AI analysis, and data-driven decision making.
## About Laravel
## ✨ Main Features
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
### 🏢 Multi-Tenant Architecture
* **Organizational Isolation**: Manage multiple independent companies (tenants) within a single instance.
* **Custom Environments**: Each tenant has its own isolated set of candidates, job positions, and quizzes.
- [Simple, fast routing engine](https://laravel.com/docs/routing).
- [Powerful dependency injection container](https://laravel.com/docs/container).
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
- [Robust background job processing](https://laravel.com/docs/queues).
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
### 👤 Advanced Candidate Management
* **Centralized Tracking**: Monitor candidate progression from application to final selection.
* **Rich Profiles**: Linked profiles with CVs, LinkedIn URLs, phone numbers, and internal recruiter notes.
* **Status Management**: Dynamic statuses and a selection toggle (`is_selected`) for "Shortlisted" candidates.
Laravel is accessible, powerful, and provides tools required for large, robust applications.
### 🎓 Dynamic Quiz System
* **Automated Skill Assessment**: Create and manage customizable quizzes for specific job positions.
* **Real-time Scoring**: Automatic calculation of quiz scores with support for manual adjusted scoring if needed.
* **Attempt Tracking**: Monitor when candidates start and finish their assessments.
## Learning Laravel
### 🤖 AI-Powered Analysis
* **Automated Screening**: Integrated AI analysis to evaluate candidate profiles and documents.
* **Smart Insights**: Get data-driven summaries of candidate strengths and weaknesses.
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
### 📊 Precision Scoring System
* **Weighted Global Score**: A proprietary algorithm calculates a score out of 20 by balancing:
* **CV Evaluation** (20 pts)
* **Motivation** (10 pts)
* **Interview Performance** (30 pts)
* **Best Quiz Attempt** (20 pts)
* **Comparative Dashboard**: Visual tools to compare candidates side-by-side.
In addition, [Laracasts](https://laracasts.com) contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
### 🛠️ Administrative Excellence
* **Dashboard Analytics**: High-level statistics on candidate throughput, average scores, and top performers.
* **User & Role Management**: Secure access control for administrators and recruiters.
* **Data Integrity**: Built-in backup systems and audit logs of administrative actions.
You can also watch bite-sized lessons with real-world projects on [Laravel Learn](https://laravel.com/learn), where you will be guided through building a Laravel application from scratch while learning PHP fundamentals.
## 💻 Tech Stack
## Agentic Development
* **Backend**: [Laravel 13+](https://laravel.com) (PHP 8.3+)
* **Frontend**: [Vue 3](https://vuejs.org/) via [Inertia.js](https://inertiajs.com/)
* **Styling**: [Tailwind CSS](https://tailwindcss.com/)
* **Interactivity**: [Ziggy](https://github.com/tighten/ziggy) for Laravel routing in JS
* **Parsing**: [PDFParser](https://www.pdfparser.org/) for automated document reading
Laravel's predictable structure and conventions make it ideal for AI coding agents like Claude Code, Cursor, and GitHub Copilot. Install [Laravel Boost](https://laravel.com/docs/ai) to supercharge your AI workflow:
## 🚀 Getting Started
```bash
composer require laravel/boost --dev
### Prerequisites
* PHP 8.3+
* Composer
* Node.js & NPM
php artisan boost:install
```
### Installation
Boost provides your agent 15+ tools and skills that help agents build Laravel applications while following best practices.
1. **Clone the repository**
```bash
git clone <repository-url>
cd QuizzCabm
```
## Contributing
2. **Run Initialization Script**
RecruIT comes with a built-in setup command:
```bash
composer run setup
```
*This command will install dependencies (PHP & NPM), generate the application key, run migrations, and build assets.*
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
3. **Environment Configuration**
Edit your `.env` file to configure your database and other service providers.
## Code of Conduct
4. **Start the Development Server**
```bash
composer run dev
```
*This starts the Laravel server, Vite dev server, and the queue listener concurrently.*
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
## 📜 License
## Security Vulnerabilities
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
## License
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
This project is licensed under the MIT License.

1
VERSION Normal file
View File

@@ -0,0 +1 @@
1.0.2

View File

@@ -0,0 +1,23 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Attributes\Description;
use Illuminate\Console\Attributes\Signature;
use Illuminate\Console\Command;
use App\Models\LoginLog;
#[Signature('app:cleanup-login-logs')]
#[Description('Supprime les logs de connexion datant de plus de 1 mois')]
class CleanupLoginLogs extends Command
{
/**
* Execute the console command.
*/
public function handle()
{
$count = LoginLog::where('login_at', '<', now()->subMonth())->delete();
$this->info("{$count} logs de connexion supprimés.");
}
}

View File

@@ -23,7 +23,10 @@ class AIAnalysisController extends Controller
}
// Restriction: Une analyse tous les 7 jours maximum par candidat
if ($candidate->ai_analysis && isset($candidate->ai_analysis['analyzed_at'])) {
// Tout admin peut outrepasser cette restriction s'il utilise l'option 'force'
$shouldCheckRestriction = !$request->input('force', false);
if ($shouldCheckRestriction && $candidate->ai_analysis && isset($candidate->ai_analysis['analyzed_at'])) {
$lastAnalysis = Carbon::parse($candidate->ai_analysis['analyzed_at']);
if ($lastAnalysis->diffInDays(now()) < 7) {
return response()->json([

View File

@@ -0,0 +1,131 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\Candidate;
use Barryvdh\DomPDF\Facade\Pdf;
use Illuminate\Http\Request;
class CandidateExportController extends Controller
{
public function exportDossier(Candidate $candidate)
{
$candidate->load([
'user',
'jobPosition',
'tenant',
'attempts.quiz.questions',
'attempts.answers.option',
'attempts.answers.question',
'documents'
]);
$filename = 'Dossier_' . str_replace(' ', '_', $candidate->user->name) . '_' . date('Ymd') . '.pdf';
// 1. Generate Main Report with DomPDF
$pdfReport = Pdf::loadView('pdfs.candidate-dossier', [
'candidate' => $candidate
]);
$reportBinary = $pdfReport->output();
// 2. Setup FPDI for merging
$mergedPdf = new \setasign\Fpdi\Fpdi();
// Add Main Report Pages
$reportTmp = tempnam(sys_get_temp_dir(), 'pdf_report_');
file_put_contents($reportTmp, $reportBinary);
try {
$pageCount = $mergedPdf->setSourceFile($reportTmp);
for ($pageNo = 1; $pageNo <= $pageCount; $pageNo++) {
$templateId = $mergedPdf->importPage($pageNo);
$size = $mergedPdf->getTemplateSize($templateId);
$mergedPdf->AddPage($size['orientation'], [$size['width'], $size['height']]);
$mergedPdf->useTemplate($templateId);
}
} catch (\Exception $e) {
\Log::error('FPDI Error on report: ' . $e->getMessage());
}
@unlink($reportTmp);
// 3. Append Candidate Documents (CV, Letter)
foreach ($candidate->documents as $doc) {
if (\Storage::disk('local')->exists($doc->file_path)) {
$filePath = \Storage::disk('local')->path($doc->file_path);
try {
$pageCount = $mergedPdf->setSourceFile($filePath);
for ($pageNo = 1; $pageNo <= $pageCount; $pageNo++) {
$templateId = $mergedPdf->importPage($pageNo);
$size = $mergedPdf->getTemplateSize($templateId);
$mergedPdf->AddPage($size['orientation'], [$size['width'], $size['height']]);
$mergedPdf->useTemplate($templateId);
}
} catch (\Exception $e) {
\Log::warning('Could not merge document ID ' . $doc->id . ': ' . $e->getMessage());
// Add a professional placeholder page for unmergable documents
$mergedPdf->AddPage('P', 'A4');
$mergedPdf->SetFont('Arial', 'B', 16);
$mergedPdf->SetTextColor(0, 79, 130); // Primary color
$mergedPdf->Ln(50);
$mergedPdf->Cell(0, 20, utf8_decode("DOCUMENT JOINT : " . strtoupper($doc->type)), 0, 1, 'C');
$mergedPdf->SetFont('Arial', 'I', 12);
$mergedPdf->Cell(0, 10, utf8_decode($doc->original_name), 0, 1, 'C');
$mergedPdf->Ln(30);
$mergedPdf->SetFont('Arial', '', 11);
$mergedPdf->SetTextColor(100, 100, 100);
$mergedPdf->MultiCell(0, 8, utf8_decode("Ce document n'a pas pu être fusionné automatiquement au dossier car son format est trop récent (PDF 1.5+).\n\nPour garantir l'intégrité de la mise en page, veuillez consulter ce document séparément via l'interface du tableau de bord candidat."), 0, 'C');
$mergedPdf->Ln(20);
$mergedPdf->SetDrawColor(224, 176, 76); // Highlight color
$mergedPdf->Line(60, $mergedPdf->GetY(), 150, $mergedPdf->GetY());
}
}
}
return response($mergedPdf->Output('S'), 200, [
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="' . $filename . '"',
'Cache-Control' => 'no-cache, no-store, must-revalidate',
'Pragma' => 'no-cache',
'Expires' => '0',
]);
}
public function exportZip(Candidate $candidate)
{
$candidate->load(['user', 'jobPosition', 'tenant', 'attempts.quiz.questions', 'attempts.answers.option', 'attempts.answers.question', 'documents']);
$baseName = 'Dossier_' . str_replace(' ', '_', $candidate->user->name) . '_' . date('Ymd');
$zipPath = tempnam(sys_get_temp_dir(), 'candidate_zip_');
$zip = new \ZipArchive();
if ($zip->open($zipPath, \ZipArchive::CREATE | \ZipArchive::OVERWRITE) !== true) {
return back()->with('error', 'Impossible de créer le fichier ZIP.');
}
// 1. Add the main report (Rapport CABM)
$pdfReport = Pdf::loadView('pdfs.candidate-dossier', [
'candidate' => $candidate
]);
$zip->addFromString($baseName . '/Rapport_Synthese_CABM.pdf', $pdfReport->output());
// 2. Add original documents
foreach ($candidate->documents as $doc) {
if (\Storage::disk('local')->exists($doc->file_path)) {
$content = \Storage::disk('local')->get($doc->file_path);
// Sanitize original name or use type
$ext = pathinfo($doc->original_name, PATHINFO_EXTENSION);
$fileName = strtoupper($doc->type) . '_' . $doc->original_name;
$zip->addFromString($baseName . '/Documents_Originaux/' . $fileName, $content);
}
}
$zip->close();
return response()->download($zipPath, $baseName . '.zip')->deleteFileAfterSend(true);
}
}

View File

@@ -0,0 +1,27 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\LoginLog;
use Inertia\Inertia;
class LoginLogController extends Controller
{
public function index()
{
if (!auth()->user()->isSuperAdmin()) {
abort(403, 'Unauthorized. Super Admin only.');
}
$logs = LoginLog::with('user.tenant')
->orderBy('login_at', 'desc')
->paginate(50);
return Inertia::render('Admin/Logs', [
'logs' => $logs
]);
}
}

View File

@@ -19,7 +19,9 @@ class AttemptController extends Controller
$this->authorizeAdmin();
$candidateName = $attempt->candidate->user->name;
$quizTitle = $attempt->quiz->title;
// Bypass tenant scope: admin may delete attempts for cross-tenant quizzes
$quiz = Quiz::withoutGlobalScopes()->find($attempt->quiz_id);
$quizTitle = $quiz?->title ?? "Quiz #{$attempt->quiz_id}";
DB::transaction(function () use ($attempt, $candidateName, $quizTitle) {
// Log the action
@@ -74,22 +76,37 @@ class AttemptController extends Controller
$candidate->update(['status' => 'en_cours']);
}
$quiz->load(['questions.options']);
// Reload quiz with questions FRESHLY (avoid any cached state from model binding)
$quizData = Quiz::with(['questions' => function($q) {
$q->orderBy('id')->with('options');
}])
->find($quiz->id);
return Inertia::render('Candidate/QuizInterface', [
'quiz' => $quiz,
'attempt' => $attempt->load('answers')
'quiz' => $quizData,
'attempt' => $attempt->load('answers'),
]);
}
public function saveAnswer(Request $request, Attempt $attempt)
{
// Security: Verify the authenticated user owns this attempt
$candidate = auth()->user()->candidate;
if (!$candidate || $attempt->candidate_id !== $candidate->id) {
abort(403, 'You are not authorized to submit answers for this attempt.');
}
$request->validate([
'question_id' => 'required|exists:questions,id',
'option_id' => 'nullable|exists:options,id',
'text_content' => 'nullable|string',
]);
// Extra guard: prevent answering a finished attempt
if ($attempt->finished_at) {
return response()->json(['error' => 'This attempt is already finished.'], 403);
}
Answer::updateOrCreate(
[
'attempt_id' => $attempt->id,
@@ -106,6 +123,12 @@ class AttemptController extends Controller
public function finish(Attempt $attempt)
{
// Security: Verify the authenticated user owns this attempt
$candidate = auth()->user()->candidate;
if (!$candidate || $attempt->candidate_id !== $candidate->id) {
abort(403, 'You are not authorized to finish this attempt.');
}
if ($attempt->finished_at) {
return redirect()->route('dashboard');
}
@@ -126,7 +149,7 @@ class AttemptController extends Controller
$this->authorizeAdmin();
$request->validate([
'score' => 'required|numeric|min:0'
'score' => 'required|numeric|min:0|max:' . $answer->question->points
]);
$answer->update(['score' => $request->score]);

View File

@@ -41,6 +41,12 @@ class RegisteredUserController extends Controller
'name' => $request->name,
'email' => $request->email,
'password' => Hash::make($request->password),
'role' => 'candidate',
]);
// Create the associated candidate record so they appear in the lists
$user->candidate()->create([
'status' => 'en_attente',
]);
event(new Registered($user));

View File

@@ -11,6 +11,11 @@ class BackupController extends Controller
{
public function download()
{
// Security: Only super admins can download backups containing all tenant data
if (!auth()->user()->isSuperAdmin()) {
abort(403, 'Seuls les super administrateurs peuvent télécharger des sauvegardes.');
}
$databaseName = env('DB_DATABASE');
$userName = env('DB_USERNAME');
$password = env('DB_PASSWORD');

View File

@@ -81,25 +81,42 @@ class CandidateController extends Controller
$candidate->load([
'user',
'documents',
'attempts.quiz',
'attempts.answers.question',
'attempts.answers.option',
'jobPosition'
'jobPosition',
'tenant'
]);
return \Inertia\Inertia::render('Admin/Candidates/Show', [
// Load attempts with quiz bypassing tenant scope
// (admin may view candidates whose quizzes belong to other tenants)
$candidate->setRelation(
'attempts',
$candidate->attempts()
->with([
'quiz' => fn($q) => $q->withoutGlobalScopes(),
'answers.question',
'answers.option',
])
->get()
);
$data = [
'candidate' => $candidate,
'jobPositions' => \App\Models\JobPosition::all(),
'ai_config' => [
'default' => env('AI_DEFAULT_PROVIDER', 'ollama'),
'enabled_providers' => array_filter([
'ollama' => true, // Toujours dispo car local ou simulé
'providers' => array_keys(array_filter([
'ollama' => true,
'openai' => !empty(env('OPENAI_API_KEY')),
'anthropic' => !empty(env('ANTHROPIC_API_KEY')),
'gemini' => !empty(env('GEMINI_API_KEY')),
], function($v) { return $v; })
])),
]
]);
];
if (auth()->user()->isSuperAdmin()) {
$data['tenants'] = \App\Models\Tenant::orderBy('name')->get();
}
return \Inertia\Inertia::render('Admin/Candidates/Show', $data);
}
public function destroy(Candidate $candidate)
@@ -122,8 +139,20 @@ class CandidateController extends Controller
$request->validate([
'cv' => 'nullable|file|mimes:pdf|max:5120',
'cover_letter' => 'nullable|file|mimes:pdf|max:5120',
'name' => 'nullable|string|max:255',
'email' => 'nullable|string|email|max:255|unique:users,email,' . $candidate->user_id,
'phone' => 'nullable|string|max:255',
'linkedin_url' => 'nullable|url|max:255',
]);
// Update User info if name or email present
if ($request->has('name') || $request->has('email')) {
$candidate->user->update($request->only(['name', 'email']));
}
// Update Candidate info
$candidate->update($request->only(['phone', 'linkedin_url']));
if ($request->hasFile('cv')) {
$this->replaceDocument($candidate, $request->file('cv'), 'cv');
}
@@ -132,20 +161,24 @@ class CandidateController extends Controller
$this->replaceDocument($candidate, $request->file('cover_letter'), 'cover_letter');
}
return back()->with('success', 'Documents mis à jour avec succès.');
return back()->with('success', 'Profil mis à jour avec succès.');
}
public function updateNotes(Request $request, Candidate $candidate)
{
$request->validate([
'notes' => 'nullable|string',
'interview_details' => 'nullable|array',
'interview_score' => 'nullable|numeric|min:0|max:30',
]);
$candidate->update([
'notes' => $request->notes,
'interview_details' => $request->interview_details,
'interview_score' => $request->has('interview_score') ? $request->interview_score : $candidate->interview_score,
]);
return back()->with('success', 'Notes mises à jour avec succès.');
return back()->with('success', 'Entretien mis à jour avec succès.');
}
public function updateScores(Request $request, Candidate $candidate)
@@ -174,6 +207,30 @@ class CandidateController extends Controller
return back()->with('success', 'Fiche de poste associée au candidat.');
}
public function updateTenant(Request $request, Candidate $candidate)
{
if (!auth()->user()->isSuperAdmin()) {
abort(403);
}
$request->validate([
'tenant_id' => 'nullable|exists:tenants,id',
]);
$candidate->update([
'tenant_id' => $request->tenant_id,
]);
// Also update the associated user's tenant_id if it exists
if ($candidate->user) {
$candidate->user->update([
'tenant_id' => $request->tenant_id,
]);
}
return back()->with('success', 'Structure de rattachement mise à jour avec succès.');
}
public function resetPassword(Candidate $candidate)
{
$password = Str::random(10);
@@ -196,6 +253,15 @@ class CandidateController extends Controller
$this->storeDocument($candidate, $file, $type);
}
public function toggleSelection(Candidate $candidate)
{
$candidate->update([
'is_selected' => !$candidate->is_selected
]);
return back()->with('success', 'Statut de sélection mis à jour.');
}
private function storeDocument(Candidate $candidate, $file, string $type)
{
if (!$file) {

View File

@@ -13,8 +13,9 @@ class JobPositionController extends Controller
$this->authorizeAdmin();
return Inertia::render('Admin/JobPositions/Index', [
'jobPositions' => JobPosition::with('tenant')->get(),
'tenants' => \App\Models\Tenant::orderBy('name')->get()
'jobPositions' => JobPosition::with(['tenant', 'quizzes'])->get(),
'tenants' => \App\Models\Tenant::orderBy('name')->get(),
'quizzes' => \App\Models\Quiz::all()
]);
}
@@ -27,17 +28,23 @@ class JobPositionController extends Controller
'description' => 'required|string',
'requirements' => 'nullable|array',
'ai_prompt' => 'nullable|string',
'ai_bypass_base_prompt' => 'boolean',
'tenant_id' => 'nullable|exists:tenants,id',
'quiz_ids' => 'nullable|array',
'quiz_ids.*' => 'exists:quizzes,id',
]);
JobPosition::create([
$jobPosition = JobPosition::create([
'title' => $request->title,
'description' => $request->description,
'requirements' => $request->requirements,
'ai_prompt' => $request->ai_prompt,
'ai_bypass_base_prompt' => $request->boolean('ai_bypass_base_prompt'),
'tenant_id' => auth()->user()->isSuperAdmin() ? $request->tenant_id : auth()->user()->tenant_id,
]);
$jobPosition->quizzes()->sync($request->input('quiz_ids', []));
return back()->with('success', 'Fiche de poste créée avec succès.');
}
@@ -50,7 +57,10 @@ class JobPositionController extends Controller
'description' => 'required|string',
'requirements' => 'nullable|array',
'ai_prompt' => 'nullable|string',
'ai_bypass_base_prompt' => 'boolean',
'tenant_id' => 'nullable|exists:tenants,id',
'quiz_ids' => 'nullable|array',
'quiz_ids.*' => 'exists:quizzes,id',
]);
$jobPosition->update([
@@ -58,9 +68,12 @@ class JobPositionController extends Controller
'description' => $request->description,
'requirements' => $request->requirements,
'ai_prompt' => $request->ai_prompt,
'ai_bypass_base_prompt' => $request->boolean('ai_bypass_base_prompt'),
'tenant_id' => auth()->user()->isSuperAdmin() ? $request->tenant_id : auth()->user()->tenant_id,
]);
$jobPosition->quizzes()->sync($request->input('quiz_ids', []));
return back()->with('success', 'Fiche de poste mise à jour.');
}

View File

@@ -94,4 +94,18 @@ class UserController extends Controller
return back()->with('success', 'Administrateur supprimé.');
}
public function resetPassword(User $user)
{
if (!auth()->user()->isSuperAdmin()) {
abort(403, 'Unauthorized action.');
}
$password = Str::random(10);
$user->update([
'password' => Hash::make($password)
]);
return back()->with('success', 'Nouveau mot de passe généré pour ' . $user->name . ' : ' . $password);
}
}

View File

@@ -39,6 +39,7 @@ class HandleInertiaRequests extends Middleware
'error' => $request->session()->get('error'),
],
'app_env' => config('app.env'),
'app_version' => config('app.version'),
];
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace App\Listeners;
use Illuminate\Auth\Events\Login;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use App\Models\LoginLog;
use Illuminate\Http\Request;
class LogSuccessfulLogin
{
protected $request;
public function __construct(Request $request)
{
$this->request = $request;
}
public function handle(Login $event): void
{
LoginLog::create([
'user_id' => $event->user->id,
'ip_address' => $this->request->ip(),
'user_agent' => $this->request->userAgent(),
'login_at' => now(),
]);
}
}

View File

@@ -11,13 +11,27 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Traits\BelongsToTenant;
#[Fillable(['user_id', 'job_position_id', 'phone', 'linkedin_url', 'status', 'notes', 'cv_score', 'motivation_score', 'interview_score', 'ai_analysis', 'tenant_id'])]
#[Fillable(['user_id', 'job_position_id', 'phone', 'linkedin_url', 'status', 'is_selected', 'notes', 'cv_score', 'motivation_score', 'interview_score', 'interview_details', 'ai_analysis', 'tenant_id'])]
class Candidate extends Model
{
use HasFactory, BelongsToTenant;
protected static function booted()
{
static::creating(function ($candidate) {
if ($candidate->job_position_id && !$candidate->tenant_id) {
$jobPosition = JobPosition::find($candidate->job_position_id);
if ($jobPosition) {
$candidate->tenant_id = $jobPosition->tenant_id;
}
}
});
}
protected $casts = [
'ai_analysis' => 'array',
'is_selected' => 'boolean',
'interview_details' => 'array',
];
public function jobPosition(): BelongsTo

View File

@@ -9,17 +9,24 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Traits\BelongsToTenant;
#[Fillable(['title', 'description', 'requirements', 'ai_prompt', 'tenant_id'])]
#[Fillable(['title', 'description', 'requirements', 'ai_prompt', 'ai_bypass_base_prompt', 'gemini_cache_id', 'gemini_cache_expires_at', 'tenant_id'])]
class JobPosition extends Model
{
use HasFactory, BelongsToTenant;
protected $casts = [
'requirements' => 'array',
'ai_bypass_base_prompt' => 'boolean',
'gemini_cache_expires_at' => 'datetime',
];
public function candidates(): HasMany
{
return $this->hasMany(Candidate::class);
}
public function quizzes()
{
return $this->belongsToMany(Quiz::class);
}
}

16
app/Models/LoginLog.php Normal file
View File

@@ -0,0 +1,16 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Attributes\Fillable;
#[Fillable(['user_id', 'ip_address', 'user_agent', 'login_at'])]
class LoginLog extends Model
{
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}

View File

@@ -19,4 +19,9 @@ class Quiz extends Model
{
return $this->hasMany(Question::class);
}
public function jobPositions()
{
return $this->belongsToMany(JobPosition::class);
}
}

View File

@@ -73,53 +73,174 @@ class AIAnalysisService
}
/**
* Call the AI API (using a placeholder for now, or direct Http call).
* Call the AI API.
*/
protected function callAI(Candidate $candidate, string $cvText, ?string $letterText, ?string $provider = null)
{
$provider = $provider ?: env('AI_DEFAULT_PROVIDER', 'ollama');
$jobTitle = $candidate->jobPosition->title;
$jobDesc = $candidate->jobPosition->description;
$requirements = implode(", ", $candidate->jobPosition->requirements ?? []);
$job = $candidate->jobPosition;
// --- BYPASS LOGIC ---
if ($job->ai_bypass_base_prompt && !empty($job->ai_prompt)) {
$staticPrompt = $job->ai_prompt;
// We still append the JSON requirement to ensure the frontend doesn't crash,
// unless the user specifically asked for "pure" takeover.
// Most users want to control the "logic" not the "serialization format".
if (!str_contains(strtolower($staticPrompt), 'json')) {
$staticPrompt .= "\n\nRéponds UNIQUEMENT en JSON pur. Format attendu:\n" . config('ai.defaults.json_format');
}
} else {
// --- STANDARD LOGIC ---
// Base instructions from config
$baseInstruction = config('ai.defaults.base_instruction');
$jsonFormat = config('ai.defaults.json_format');
$prompt = "Tu es un expert en recrutement technique. Analyse le CV (et la lettre de motivation si présente) d'un candidat pour le poste de '{$jobTitle}' attache une grande importance aux compétences techniques et à l'expérience du candidat, mais aussi à sa capacité à s'intégrer dans une équipe et à sa motivation.
$staticPrompt = "{$baseInstruction} Ton rôle est d'analyser le profil d'un candidat pour le poste de '{$job->title}'.\n\n";
$staticPrompt .= "DESCRIPTION DU POSTE:\n{$job->description}\n\n";
if (!empty($job->requirements)) {
$staticPrompt .= "COMPÉTENCES REQUISES:\n" . implode(", ", $job->requirements) . "\n\n";
}
if (!$job->ai_prompt) {
// Default generalist analysis instructions
$staticPrompt .= "CONSIGNES D'ANALYSE:\n" . config('ai.defaults.analysis_instructions') . "\n\n";
} else {
// Specific instructions from the job position
$staticPrompt .= "CONSIGNES D'ANALYSE SPÉCIFIQUES:\n" . $job->ai_prompt . "\n\n";
}
$staticPrompt .= "FORMAT DE RÉPONSE ATTENDU:\n{$jsonFormat}\n";
}
DESCRIPTION DU POSTE:
{$jobDesc}
COMPÉTENCES REQUISES:
{$requirements}
CONTENU DU CV:
{$cvText}
CONTENU DE LA LETTRE DE MOTIVATION:
" . ($letterText ?? "Non fournie") . "
CONTEXTE ADDITIONNEL & INSTRUCTIONS PARTICULIÈRES:
" . ($candidate->jobPosition->ai_prompt ?? "Aucune instruction spécifique.") . "
Fournis une analyse structurée en JSON avec les clés suivantes:
- match_score: note de 0 à 100
- summary: résumé de 3-4 phrases sur le profil et la ville d'origine du candidat
- strengths: liste des points forts par rapport au poste
- gaps: liste des compétences manquantes ou points de vigilance
- verdict: une conclusion (Favorable, Très Favorable, Réservé, Défavorable)
Réponds UNIQUEMENT en JSON pur.";
$staticPrompt .= "\nRéponds UNIQUEMENT en JSON pur, sans texte avant ou après. Assure-toi que le JSON est valide.";
// Dynamic Part: The candidate data (Not cached)
$dynamicPrompt = "CONTENU DU CV DU CANDIDAT:\n{$cvText}\n\nCONTENU DE LA LETTRE DE MOTIVATION:\n" . ($letterText ?? "Non fournie");
// Full prompt for providers not using context caching
$fullPrompt = $staticPrompt . "\n\n" . $dynamicPrompt;
$analysis = match ($provider) {
'openai' => $this->callOpenAI($prompt),
'anthropic' => $this->callAnthropic($prompt),
'gemini' => $this->callGemini($prompt),
default => $this->callOllama($prompt),
'openai' => $this->callOpenAI($fullPrompt),
'anthropic' => $this->callAnthropic($fullPrompt),
'gemini' => $this->callGemini($dynamicPrompt, $staticPrompt, $job),
default => $this->callOllama($fullPrompt),
};
// Inject metadata for display and tracking
$analysis['provider'] = $provider;
$analysis['analyzed_at'] = now()->toIso8601String();
// Normalize keys for frontend compatibility
$normalized = $this->normalizeAnalysis($analysis);
return $analysis;
// Inject metadata
$normalized['provider'] = $provider;
$normalized['analyzed_at'] = now()->toIso8601String();
return $normalized;
}
/**
* Normalize the AI response keys to ensure frontend compatibility.
*/
protected function normalizeAnalysis(array $data): array
{
$normalized = $data;
// Map custom keys to standard keys if they exist
if (isset($data['score_global']) && !isset($data['match_score'])) {
$normalized['match_score'] = $data['score_global'];
}
if (isset($data['score']) && !isset($data['match_score'])) {
$normalized['match_score'] = $data['score'];
}
if (isset($data['points_forts']) && !isset($data['strengths'])) {
$normalized['strengths'] = $data['points_forts'];
}
if (isset($data['points_faibles']) && !isset($data['gaps'])) {
$normalized['gaps'] = $data['points_faibles'];
}
if (isset($data['recommandation']) && !isset($data['verdict'])) {
$normalized['verdict'] = $data['recommandation'];
}
if (isset($data['synthese']) && !isset($data['summary'])) {
$normalized['summary'] = $data['synthese'];
}
// List-specific normalization (handle list of objects or strings)
$cleanList = function($list) {
if (!is_array($list)) return [];
return array_map(function($item) {
if (is_array($item)) {
$type = $item['type'] ?? $item['title'] ?? $item['category'] ?? null;
$desc = $item['description'] ?? $item['value'] ?? $item['content'] ?? null;
if ($type && $desc) return "{$type} : {$desc}";
if ($desc) return $desc;
if ($type) return $type;
return json_encode($item);
}
return (string) $item;
}, $list);
};
if (isset($normalized['strengths'])) {
$normalized['strengths'] = $cleanList($normalized['strengths']);
}
if (isset($normalized['gaps'])) {
$normalized['gaps'] = $cleanList($normalized['gaps']);
}
if (isset($normalized['elements_bloquants'])) {
$normalized['elements_bloquants'] = $cleanList($normalized['elements_bloquants']);
}
// Ensure match_score is a numeric value and handle common AI formatting quirks
if (isset($normalized['match_score'])) {
$scoreValue = $normalized['match_score'];
if (is_string($scoreValue)) {
// If AI returns something like "18/20", take the first part
if (str_contains($scoreValue, '/')) {
$scoreValue = explode('/', $scoreValue)[0];
}
// Convert comma to dot for European decimals
$scoreValue = str_replace(',', '.', $scoreValue);
// Keep only digits and the first decimal point
$scoreValue = preg_replace('/[^0-9.]/', '', $scoreValue);
}
$num = (float)$scoreValue;
// If the AI returned a ratio beneath 1 (e.g. 0.85 for 85%), scale it up
if ($num > 0 && $num < 1.1 && !is_int($normalized['match_score'])) {
// But be careful: a score of "1" might honestly be 1/100
// but 0.95 is almost certainly a ratio.
if ($num < 1 || str_contains((string)$normalized['match_score'], '.')) {
$num *= 100;
}
}
// Cap at 100
$normalized['match_score'] = (int) min(100, round($num));
}
// Ensure default keys exist even if empty
$normalized['match_score'] = $normalized['match_score'] ?? 0;
$normalized['summary'] = $normalized['summary'] ?? "Pas de résumé généré.";
$normalized['verdict'] = $normalized['verdict'] ?? "Indéterminé";
$normalized['strengths'] = $normalized['strengths'] ?? [];
$normalized['gaps'] = $normalized['gaps'] ?? [];
$normalized['scores_detailles'] = $normalized['scores_detailles'] ?? null;
$normalized['elements_bloquants'] = $normalized['elements_bloquants'] ?? [];
$normalized['questions_entretien_suggerees'] = $normalized['questions_entretien_suggerees'] ?? [];
return $normalized;
}
protected function callOllama(string $prompt)
@@ -181,7 +302,7 @@ class AIAnalysisService
'content-type' => 'application/json'
])->timeout(60)->post('https://api.anthropic.com/v1/messages', [
'model' => 'claude-3-5-sonnet-20240620',
'max_tokens' => 1024,
'max_tokens' => 2048,
'messages' => [['role' => 'user', 'content' => $prompt]]
]);
@@ -196,29 +317,122 @@ class AIAnalysisService
return $this->getSimulatedAnalysis();
}
protected function callGemini(string $prompt)
protected function callGemini(string $dynamicPrompt, ?string $staticPrompt = null, ?\App\Models\JobPosition $job = null)
{
$apiKey = env('GEMINI_API_KEY');
if (!$apiKey) return $this->getSimulatedAnalysis();
try {
$response = Http::timeout(60)->post("https://generativelanguage.googleapis.com/v1/models/gemini-2.5-flash:generateContent?key=" . $apiKey, [
'contents' => [['parts' => [['text' => $prompt]]]]
]);
// Models to try in order (Updated for 2026 models)
$models = [
'gemini-3.1-flash-lite-preview',
'gemini-3-flash-preview',
'gemini-1.5-flash-latest'
];
if ($response->successful()) {
$text = $response->json('candidates.0.content.parts.0.text');
return json_decode($this->extractJson($text), true);
} else {
Log::error("Gemini API Error: " . $response->status() . " - " . $response->body());
foreach ($models as $model) {
try {
$version = (str_contains($model, '2.0') || str_contains($model, '3.')) ? 'v1beta' : 'v1';
$url = "https://generativelanguage.googleapis.com/{$version}/models/{$model}:generateContent?key=" . $apiKey;
$generationConfig = [
'temperature' => 0.2,
'responseMimeType' => 'application/json'
];
$payload = [
'generationConfig' => $generationConfig,
'contents' => [
['role' => 'user', 'parts' => [['text' => $dynamicPrompt]]]
]
];
// Attempt to use Context Caching if static prompt and job are provided
if ($staticPrompt && $job && $version === 'v1beta') {
$cacheId = $this->getOrCreateContextCache($job, $staticPrompt, $model);
if ($cacheId) {
$payload['cachedContent'] = $cacheId;
// When using cache, the static part is already in the cache
} else {
// Fallback: prepend static part if cache fails
$payload['contents'][0]['parts'][0]['text'] = $staticPrompt . "\n\n" . $dynamicPrompt;
}
} else if ($staticPrompt) {
// Non-cached fallback
$payload['contents'][0]['parts'][0]['text'] = $staticPrompt . "\n\n" . $dynamicPrompt;
}
$response = Http::timeout(60)->post($url, $payload);
if ($response->successful()) {
$candidate = $response->json('candidates.0');
if (isset($candidate['finishReason']) && $candidate['finishReason'] !== 'STOP') {
Log::warning("Gemini warning: Analysis finished with reason " . $candidate['finishReason']);
}
$text = $candidate['content']['parts'][0]['text'] ?? null;
if ($text) {
$json = $this->extractJson($text);
$decoded = json_decode($json, true);
if ($decoded) return $decoded;
}
} else {
Log::error("Gemini API Error ($model): " . $response->status() . " - " . $response->body());
}
} catch (\Exception $e) {
Log::error("Gemini Connection Failed ($model): " . $e->getMessage());
}
} catch (\Exception $e) {
Log::error("Gemini Connection Failed: " . $e->getMessage());
}
return $this->getSimulatedAnalysis();
}
/**
* Get or create a Gemini Context Cache for a specific Job Position.
*/
protected function getOrCreateContextCache(\App\Models\JobPosition $job, string $staticPrompt, string $model)
{
if (strlen($staticPrompt) < 120000) {
return null;
}
// Check if we already have a valid cache for this job
if ($job->gemini_cache_id && $job->gemini_cache_expires_at && $job->gemini_cache_expires_at->isFuture()) {
// Basic verification: the cache is tied to a specific model
// We assume the stored cache is for the primary model
return $job->gemini_cache_id;
}
$apiKey = env('GEMINI_API_KEY');
try {
// Create Context Cache (TTL of 1 hour)
$response = Http::timeout(30)->post("https://generativelanguage.googleapis.com/v1beta/cachedContents?key=" . $apiKey, [
'model' => "models/{$model}",
'contents' => [
['role' => 'user', 'parts' => [['text' => $staticPrompt]]]
],
'ttl' => '3600s'
]);
if ($response->successful()) {
$cacheId = $response->json('name');
$job->update([
'gemini_cache_id' => $cacheId,
'gemini_cache_expires_at' => now()->addHour()
]);
return $cacheId;
}
// Log l'erreur pour comprendre pourquoi le cache a été refusé
Log::warning("Gemini Cache Refused: " . $response->body());
} catch (\Exception $e) {
Log::error("Gemini Cache Lifecycle Error: " . $e->getMessage());
}
return null;
}
private function extractJson($string)
{
preg_match('/\{.*\}/s', $string, $matches);
@@ -229,7 +443,7 @@ class AIAnalysisService
{
return [
'match_score' => 75,
'summary' => "Analyse simulée (IA non connectée ou erreur API). Le candidat semble avoir une solide expérience mais certains points techniques doivent être vérifiés.",
'summary' => "Analyse simulée (IA non connectée ou erreur API). Le candidat peut avoir un profil intéressant mais une vérification manuelle est nécessaire.",
'strengths' => ["Expérience pertinente", "Bonne présentation"],
'gaps' => ["Compétences spécifiques à confirmer"],
'verdict' => "Favorable"

View File

@@ -13,13 +13,19 @@ trait BelongsToTenant
if (Auth::check()) {
$user = Auth::user();
// Super admins see everything
if ($user->role === 'super_admin') {
// Super admins see everything
return;
}
// All other users (admins and candidates) are filtered by their tenant.
// This includes candidates, who must only see data from their own organization.
// Resources with a null tenant_id are considered global and always visible.
if ($user->tenant_id) {
$builder->where('tenant_id', $user->tenant_id);
$builder->where(function ($query) use ($user) {
$query->where('tenant_id', $user->tenant_id)
->orWhereNull('tenant_id');
});
}
}
});

View File

@@ -7,11 +7,15 @@
"license": "MIT",
"require": {
"php": "^8.3",
"barryvdh/laravel-dompdf": "^3.1",
"fpdf/fpdf": "^1.86",
"inertiajs/inertia-laravel": "^2.0",
"laravel/framework": "^13.0",
"laravel/sanctum": "^4.0",
"laravel/tinker": "^3.0",
"setasign/fpdi": "2.6",
"smalot/pdfparser": "^2.12",
"tecnickcom/tcpdf": "^6.11",
"tightenco/ziggy": "^2.0"
},
"require-dev": {

720
composer.lock generated
View File

@@ -4,8 +4,85 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "6b34d5dd0c12bcfc3d1253f72a392749",
"content-hash": "d92de938914aa91aa69bd500464d10d5",
"packages": [
{
"name": "barryvdh/laravel-dompdf",
"version": "v3.1.2",
"source": {
"type": "git",
"url": "https://github.com/barryvdh/laravel-dompdf.git",
"reference": "ee3b72b19ccdf57d0243116ecb2b90261344dedc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/barryvdh/laravel-dompdf/zipball/ee3b72b19ccdf57d0243116ecb2b90261344dedc",
"reference": "ee3b72b19ccdf57d0243116ecb2b90261344dedc",
"shasum": ""
},
"require": {
"dompdf/dompdf": "^3.0",
"illuminate/support": "^9|^10|^11|^12|^13.0",
"php": "^8.1"
},
"require-dev": {
"larastan/larastan": "^2.7|^3.0",
"orchestra/testbench": "^7|^8|^9.16|^10|^11.0",
"phpro/grumphp": "^2.5",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"extra": {
"laravel": {
"aliases": {
"PDF": "Barryvdh\\DomPDF\\Facade\\Pdf",
"Pdf": "Barryvdh\\DomPDF\\Facade\\Pdf"
},
"providers": [
"Barryvdh\\DomPDF\\ServiceProvider"
]
},
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"autoload": {
"psr-4": {
"Barryvdh\\DomPDF\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Barry vd. Heuvel",
"email": "barryvdh@gmail.com"
}
],
"description": "A DOMPDF Wrapper for Laravel",
"keywords": [
"dompdf",
"laravel",
"pdf"
],
"support": {
"issues": "https://github.com/barryvdh/laravel-dompdf/issues",
"source": "https://github.com/barryvdh/laravel-dompdf/tree/v3.1.2"
},
"funding": [
{
"url": "https://fruitcake.nl",
"type": "custom"
},
{
"url": "https://github.com/barryvdh",
"type": "github"
}
],
"time": "2026-02-21T08:51:10+00:00"
},
{
"name": "brick/math",
"version": "0.14.8",
@@ -377,6 +454,161 @@
],
"time": "2024-02-05T11:56:58+00:00"
},
{
"name": "dompdf/dompdf",
"version": "v3.1.5",
"source": {
"type": "git",
"url": "https://github.com/dompdf/dompdf.git",
"reference": "f11ead23a8a76d0ff9bbc6c7c8fd7e05ca328496"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dompdf/dompdf/zipball/f11ead23a8a76d0ff9bbc6c7c8fd7e05ca328496",
"reference": "f11ead23a8a76d0ff9bbc6c7c8fd7e05ca328496",
"shasum": ""
},
"require": {
"dompdf/php-font-lib": "^1.0.0",
"dompdf/php-svg-lib": "^1.0.0",
"ext-dom": "*",
"ext-mbstring": "*",
"masterminds/html5": "^2.0",
"php": "^7.1 || ^8.0"
},
"require-dev": {
"ext-gd": "*",
"ext-json": "*",
"ext-zip": "*",
"mockery/mockery": "^1.3",
"phpunit/phpunit": "^7.5 || ^8 || ^9 || ^10 || ^11",
"squizlabs/php_codesniffer": "^3.5",
"symfony/process": "^4.4 || ^5.4 || ^6.2 || ^7.0"
},
"suggest": {
"ext-gd": "Needed to process images",
"ext-gmagick": "Improves image processing performance",
"ext-imagick": "Improves image processing performance",
"ext-zlib": "Needed for pdf stream compression"
},
"type": "library",
"autoload": {
"psr-4": {
"Dompdf\\": "src/"
},
"classmap": [
"lib/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1"
],
"authors": [
{
"name": "The Dompdf Community",
"homepage": "https://github.com/dompdf/dompdf/blob/master/AUTHORS.md"
}
],
"description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter",
"homepage": "https://github.com/dompdf/dompdf",
"support": {
"issues": "https://github.com/dompdf/dompdf/issues",
"source": "https://github.com/dompdf/dompdf/tree/v3.1.5"
},
"time": "2026-03-03T13:54:37+00:00"
},
{
"name": "dompdf/php-font-lib",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/dompdf/php-font-lib.git",
"reference": "a6e9a688a2a80016ac080b97be73d3e10c444c9a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/a6e9a688a2a80016ac080b97be73d3e10c444c9a",
"reference": "a6e9a688a2a80016ac080b97be73d3e10c444c9a",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": "^7.1 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^7.5 || ^8 || ^9 || ^10 || ^11 || ^12"
},
"type": "library",
"autoload": {
"psr-4": {
"FontLib\\": "src/FontLib"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1-or-later"
],
"authors": [
{
"name": "The FontLib Community",
"homepage": "https://github.com/dompdf/php-font-lib/blob/master/AUTHORS.md"
}
],
"description": "A library to read, parse, export and make subsets of different types of font files.",
"homepage": "https://github.com/dompdf/php-font-lib",
"support": {
"issues": "https://github.com/dompdf/php-font-lib/issues",
"source": "https://github.com/dompdf/php-font-lib/tree/1.0.2"
},
"time": "2026-01-20T14:10:26+00:00"
},
{
"name": "dompdf/php-svg-lib",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/dompdf/php-svg-lib.git",
"reference": "8259ffb930817e72b1ff1caef5d226501f3dfeb1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/8259ffb930817e72b1ff1caef5d226501f3dfeb1",
"reference": "8259ffb930817e72b1ff1caef5d226501f3dfeb1",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": "^7.1 || ^8.0",
"sabberworm/php-css-parser": "^8.4 || ^9.0"
},
"require-dev": {
"phpunit/phpunit": "^7.5 || ^8 || ^9 || ^10 || ^11"
},
"type": "library",
"autoload": {
"psr-4": {
"Svg\\": "src/Svg"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0-or-later"
],
"authors": [
{
"name": "The SvgLib Community",
"homepage": "https://github.com/dompdf/php-svg-lib/blob/master/AUTHORS.md"
}
],
"description": "A library to read, parse and export to PDF SVG files.",
"homepage": "https://github.com/dompdf/php-svg-lib",
"support": {
"issues": "https://github.com/dompdf/php-svg-lib/issues",
"source": "https://github.com/dompdf/php-svg-lib/tree/1.0.2"
},
"time": "2026-01-02T16:01:13+00:00"
},
{
"name": "dragonmantank/cron-expression",
"version": "v3.6.0",
@@ -508,6 +740,59 @@
],
"time": "2025-03-06T22:45:56+00:00"
},
{
"name": "fpdf/fpdf",
"version": "1.86.1",
"source": {
"type": "git",
"url": "https://github.com/coreydoughty/Fpdf.git",
"reference": "2034ab9f7b03b8294933d7fd27828d13963368e5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/coreydoughty/Fpdf/zipball/2034ab9f7b03b8294933d7fd27828d13963368e5",
"reference": "2034ab9f7b03b8294933d7fd27828d13963368e5",
"shasum": ""
},
"require": {
"php": ">=5.6.0"
},
"type": "library",
"extra": {
"laravel": {
"aliases": {
"FPDF": "Fpdf\\Fpdf"
}
}
},
"autoload": {
"psr-4": {
"Fpdf\\": "src/Fpdf"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Corey Doughty",
"email": "corey@doughty.ca"
}
],
"description": "FPDF Composer Wrapper",
"homepage": "https://github.com/coreydoughty/Fpdf",
"keywords": [
"fpdf",
"pdf",
"wrapper"
],
"support": {
"issues": "https://github.com/coreydoughty/Fpdf/issues",
"source": "https://github.com/coreydoughty/Fpdf/tree/1.86.1"
},
"time": "2025-12-08T14:03:59+00:00"
},
{
"name": "fruitcake/php-cors",
"version": "v1.4.0",
@@ -2158,6 +2443,73 @@
],
"time": "2026-03-08T20:05:35+00:00"
},
{
"name": "masterminds/html5",
"version": "2.10.0",
"source": {
"type": "git",
"url": "https://github.com/Masterminds/html5-php.git",
"reference": "fcf91eb64359852f00d921887b219479b4f21251"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Masterminds/html5-php/zipball/fcf91eb64359852f00d921887b219479b4f21251",
"reference": "fcf91eb64359852f00d921887b219479b4f21251",
"shasum": ""
},
"require": {
"ext-dom": "*",
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8 || ^9"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
}
},
"autoload": {
"psr-4": {
"Masterminds\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Matt Butcher",
"email": "technosophos@gmail.com"
},
{
"name": "Matt Farina",
"email": "matt@mattfarina.com"
},
{
"name": "Asmir Mustafic",
"email": "goetas@gmail.com"
}
],
"description": "An HTML5 parser and serializer.",
"homepage": "http://masterminds.github.io/html5-php",
"keywords": [
"HTML5",
"dom",
"html",
"parser",
"querypath",
"serializer",
"xml"
],
"support": {
"issues": "https://github.com/Masterminds/html5-php/issues",
"source": "https://github.com/Masterminds/html5-php/tree/2.10.0"
},
"time": "2025-07-25T09:04:22+00:00"
},
{
"name": "monolog/monolog",
"version": "3.10.0",
@@ -3433,6 +3785,158 @@
},
"time": "2025-12-14T04:43:48+00:00"
},
{
"name": "sabberworm/php-css-parser",
"version": "v9.3.0",
"source": {
"type": "git",
"url": "https://github.com/MyIntervals/PHP-CSS-Parser.git",
"reference": "88dbd0f7f91abbfe4402d0a3071e9ff4d81ed949"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MyIntervals/PHP-CSS-Parser/zipball/88dbd0f7f91abbfe4402d0a3071e9ff4d81ed949",
"reference": "88dbd0f7f91abbfe4402d0a3071e9ff4d81ed949",
"shasum": ""
},
"require": {
"ext-iconv": "*",
"php": "^7.2.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
"thecodingmachine/safe": "^1.3 || ^2.5 || ^3.4"
},
"require-dev": {
"php-parallel-lint/php-parallel-lint": "1.4.0",
"phpstan/extension-installer": "1.4.3",
"phpstan/phpstan": "1.12.32 || 2.1.32",
"phpstan/phpstan-phpunit": "1.4.2 || 2.0.8",
"phpstan/phpstan-strict-rules": "1.6.2 || 2.0.7",
"phpunit/phpunit": "8.5.52",
"rawr/phpunit-data-provider": "3.3.1",
"rector/rector": "1.2.10 || 2.2.8",
"rector/type-perfect": "1.0.0 || 2.1.0",
"squizlabs/php_codesniffer": "4.0.1",
"thecodingmachine/phpstan-safe-rule": "1.2.0 || 1.4.1"
},
"suggest": {
"ext-mbstring": "for parsing UTF-8 CSS"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "9.4.x-dev"
}
},
"autoload": {
"files": [
"src/Rule/Rule.php",
"src/RuleSet/RuleContainer.php"
],
"psr-4": {
"Sabberworm\\CSS\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Raphael Schweikert"
},
{
"name": "Oliver Klee",
"email": "github@oliverklee.de"
},
{
"name": "Jake Hotson",
"email": "jake.github@qzdesign.co.uk"
}
],
"description": "Parser for CSS Files written in PHP",
"homepage": "https://www.sabberworm.com/blog/2010/6/10/php-css-parser",
"keywords": [
"css",
"parser",
"stylesheet"
],
"support": {
"issues": "https://github.com/MyIntervals/PHP-CSS-Parser/issues",
"source": "https://github.com/MyIntervals/PHP-CSS-Parser/tree/v9.3.0"
},
"time": "2026-03-03T17:31:43+00:00"
},
{
"name": "setasign/fpdi",
"version": "v2.6.0",
"source": {
"type": "git",
"url": "https://github.com/Setasign/FPDI.git",
"reference": "a6db878129ec6c7e141316ee71872923e7f1b7ad"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Setasign/FPDI/zipball/a6db878129ec6c7e141316ee71872923e7f1b7ad",
"reference": "a6db878129ec6c7e141316ee71872923e7f1b7ad",
"shasum": ""
},
"require": {
"ext-zlib": "*",
"php": "^5.6 || ^7.0 || ^8.0"
},
"conflict": {
"setasign/tfpdf": "<1.31"
},
"require-dev": {
"phpunit/phpunit": "~5.7",
"setasign/fpdf": "~1.8.6",
"setasign/tfpdf": "~1.33",
"squizlabs/php_codesniffer": "^3.5",
"tecnickcom/tcpdf": "~6.2"
},
"suggest": {
"setasign/fpdf": "FPDI will extend this class but as it is also possible to use TCPDF or tFPDF as an alternative. There's no fixed dependency configured."
},
"type": "library",
"autoload": {
"psr-4": {
"setasign\\Fpdi\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jan Slabon",
"email": "jan.slabon@setasign.com",
"homepage": "https://www.setasign.com"
},
{
"name": "Maximilian Kresse",
"email": "maximilian.kresse@setasign.com",
"homepage": "https://www.setasign.com"
}
],
"description": "FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF. Because it is also possible to use FPDI with TCPDF, there are no fixed dependencies defined. Please see suggestions for packages which evaluates the dependencies automatically.",
"homepage": "https://www.setasign.com/fpdi",
"keywords": [
"fpdf",
"fpdi",
"pdf"
],
"support": {
"issues": "https://github.com/Setasign/FPDI/issues",
"source": "https://github.com/Setasign/FPDI/tree/v2.6.0"
},
"funding": [
{
"url": "https://tidelift.com/funding/github/packagist/setasign/fpdi",
"type": "tidelift"
}
],
"time": "2023-12-11T16:03:32+00:00"
},
{
"name": "smalot/pdfparser",
"version": "v2.12.4",
@@ -5985,6 +6489,220 @@
],
"time": "2026-02-15T10:53:20+00:00"
},
{
"name": "tecnickcom/tcpdf",
"version": "6.11.2",
"source": {
"type": "git",
"url": "https://github.com/tecnickcom/TCPDF.git",
"reference": "e1e2ade18e574e963473f53271591edd8c0033ec"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/e1e2ade18e574e963473f53271591edd8c0033ec",
"reference": "e1e2ade18e574e963473f53271591edd8c0033ec",
"shasum": ""
},
"require": {
"ext-curl": "*",
"php": ">=7.1.0"
},
"type": "library",
"autoload": {
"classmap": [
"config",
"include",
"tcpdf.php",
"tcpdf_barcodes_1d.php",
"tcpdf_barcodes_2d.php",
"include/tcpdf_colors.php",
"include/tcpdf_filters.php",
"include/tcpdf_font_data.php",
"include/tcpdf_fonts.php",
"include/tcpdf_images.php",
"include/tcpdf_static.php",
"include/barcodes/datamatrix.php",
"include/barcodes/pdf417.php",
"include/barcodes/qrcode.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0-or-later"
],
"authors": [
{
"name": "Nicola Asuni",
"email": "info@tecnick.com",
"role": "lead"
}
],
"description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
"homepage": "http://www.tcpdf.org/",
"keywords": [
"PDFD32000-2008",
"TCPDF",
"barcodes",
"datamatrix",
"pdf",
"pdf417",
"qrcode"
],
"support": {
"issues": "https://github.com/tecnickcom/TCPDF/issues",
"source": "https://github.com/tecnickcom/TCPDF/tree/6.11.2"
},
"funding": [
{
"url": "https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ",
"type": "custom"
}
],
"time": "2026-03-03T08:58:10+00:00"
},
{
"name": "thecodingmachine/safe",
"version": "v3.4.0",
"source": {
"type": "git",
"url": "https://github.com/thecodingmachine/safe.git",
"reference": "705683a25bacf0d4860c7dea4d7947bfd09eea19"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thecodingmachine/safe/zipball/705683a25bacf0d4860c7dea4d7947bfd09eea19",
"reference": "705683a25bacf0d4860c7dea4d7947bfd09eea19",
"shasum": ""
},
"require": {
"php": "^8.1"
},
"require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.4",
"phpstan/phpstan": "^2",
"phpunit/phpunit": "^10",
"squizlabs/php_codesniffer": "^3.2"
},
"type": "library",
"autoload": {
"files": [
"lib/special_cases.php",
"generated/apache.php",
"generated/apcu.php",
"generated/array.php",
"generated/bzip2.php",
"generated/calendar.php",
"generated/classobj.php",
"generated/com.php",
"generated/cubrid.php",
"generated/curl.php",
"generated/datetime.php",
"generated/dir.php",
"generated/eio.php",
"generated/errorfunc.php",
"generated/exec.php",
"generated/fileinfo.php",
"generated/filesystem.php",
"generated/filter.php",
"generated/fpm.php",
"generated/ftp.php",
"generated/funchand.php",
"generated/gettext.php",
"generated/gmp.php",
"generated/gnupg.php",
"generated/hash.php",
"generated/ibase.php",
"generated/ibmDb2.php",
"generated/iconv.php",
"generated/image.php",
"generated/imap.php",
"generated/info.php",
"generated/inotify.php",
"generated/json.php",
"generated/ldap.php",
"generated/libxml.php",
"generated/lzf.php",
"generated/mailparse.php",
"generated/mbstring.php",
"generated/misc.php",
"generated/mysql.php",
"generated/mysqli.php",
"generated/network.php",
"generated/oci8.php",
"generated/opcache.php",
"generated/openssl.php",
"generated/outcontrol.php",
"generated/pcntl.php",
"generated/pcre.php",
"generated/pgsql.php",
"generated/posix.php",
"generated/ps.php",
"generated/pspell.php",
"generated/readline.php",
"generated/rnp.php",
"generated/rpminfo.php",
"generated/rrd.php",
"generated/sem.php",
"generated/session.php",
"generated/shmop.php",
"generated/sockets.php",
"generated/sodium.php",
"generated/solr.php",
"generated/spl.php",
"generated/sqlsrv.php",
"generated/ssdeep.php",
"generated/ssh2.php",
"generated/stream.php",
"generated/strings.php",
"generated/swoole.php",
"generated/uodbc.php",
"generated/uopz.php",
"generated/url.php",
"generated/var.php",
"generated/xdiff.php",
"generated/xml.php",
"generated/xmlrpc.php",
"generated/yaml.php",
"generated/yaz.php",
"generated/zip.php",
"generated/zlib.php"
],
"classmap": [
"lib/DateTime.php",
"lib/DateTimeImmutable.php",
"lib/Exceptions/",
"generated/Exceptions/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHP core functions that throw exceptions instead of returning FALSE on error",
"support": {
"issues": "https://github.com/thecodingmachine/safe/issues",
"source": "https://github.com/thecodingmachine/safe/tree/v3.4.0"
},
"funding": [
{
"url": "https://github.com/OskarStark",
"type": "github"
},
{
"url": "https://github.com/shish",
"type": "github"
},
{
"url": "https://github.com/silasjoisten",
"type": "github"
},
{
"url": "https://github.com/staabm",
"type": "github"
}
],
"time": "2026-02-04T18:08:13+00:00"
},
{
"name": "tightenco/ziggy",
"version": "v2.6.2",

37
config/ai.php Normal file
View File

@@ -0,0 +1,37 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| AI Service Configuration
|--------------------------------------------------------------------------
|
| This file contains the default prompts and settings for the AI analysis.
|
*/
'defaults' => [
'base_instruction' => "Tu es un expert en recrutement expérimenté. Ton rôle est d'analyser le profil d'un candidat avec impartialité et précision.",
'analysis_instructions' => "Attache une grande importance à l'adéquation entre le parcours du candidat et les besoins du poste, tant sur le plan technique que sur les savoir-être.",
'json_format' => "Fournis une analyse structurée en JSON avec les clés suivantes impérativement:
- match_score: note de 0 à 100 (nombre entier)
- summary: résumé de 3-4 phrases sur le profil
- strengths: liste des points forts par rapport au poste
- gaps: liste des compétences manquantes ou points de vigilance
- verdict: une conclusion (Favorable, Très Favorable, Réservé, Défavorable)
- scores_detailles: un objet avec des clés (ex: technique, experience, soft_skills) contenant 'score' (0-100) et 'justification'
- elements_bloquants: liste des points critiques qui pourraient invalider la candidature (ou liste vide si aucun)
- questions_entretien_suggerees: liste de 5 questions pertinentes à poser au candidat lors de l'entretien",
],
'providers' => [
'default' => env('AI_DEFAULT_PROVIDER', 'ollama'),
'ollama' => [
'url' => env('OLLAMA_URL', 'http://localhost:11434/api/generate'),
'model' => env('OLLAMA_MODEL', 'mistral'),
],
// ...
]
];

View File

@@ -123,4 +123,6 @@ return [
'store' => env('APP_MAINTENANCE_STORE', 'database'),
],
'version' => trim(file_exists(base_path('VERSION')) ? file_get_contents(base_path('VERSION')) : '1.0.0'),
];

View File

@@ -32,7 +32,7 @@ return [
'local' => [
'driver' => 'local',
'root' => storage_path('app/private'),
'root' => storage_path('app'),
'serve' => true,
'throw' => false,
'report' => false,

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->string('role')->default('candidate')->change();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->enum('role', ['admin', 'candidate'])->default('candidate')->change();
});
}
};

View File

@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('job_position_quiz', function (Blueprint $table) {
$table->id();
$table->foreignId('job_position_id')->constrained()->cascadeOnDelete();
$table->foreignId('quiz_id')->constrained()->cascadeOnDelete();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('job_position_quiz');
}
};

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('candidates', function (Blueprint $table) {
$table->boolean('is_selected')->default(false)->after('status');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('candidates', function (Blueprint $table) {
$table->dropColumn('is_selected');
});
}
};

View File

@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('job_positions', function (Blueprint $table) {
$table->string('gemini_cache_id')->nullable()->after('ai_prompt');
$table->timestamp('gemini_cache_expires_at')->nullable()->after('gemini_cache_id');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('job_positions', function (Blueprint $table) {
$table->dropColumn(['gemini_cache_id', 'gemini_cache_expires_at']);
});
}
};

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('candidates', function (Blueprint $table) {
$table->json('interview_details')->nullable()->after('interview_score');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('candidates', function (Blueprint $table) {
$table->dropColumn('interview_details');
});
}
};

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('login_logs', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained()->onDelete('cascade');
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->timestamp('login_at')->useCurrent();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('login_logs');
}
};

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('job_positions', function (Blueprint $table) {
$table->boolean('ai_bypass_base_prompt')->default(false)->after('ai_prompt');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('job_positions', function (Blueprint $table) {
$table->dropColumn('ai_bypass_base_prompt');
});
}
};

View File

@@ -1,17 +0,0 @@
<?php
require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$kernel->bootstrap();
use App\Models\Attempt;
$attempts = Attempt::whereNull('max_score')->get();
foreach ($attempts as $attempt) {
if ($attempt->quiz) {
$max = $attempt->quiz->questions->sum('points');
$attempt->update(['max_score' => $max]);
echo "Updated attempt {$attempt->id} with max_score {$max}\n";
}
}

30
package-lock.json generated
View File

@@ -6,6 +6,8 @@
"": {
"dependencies": {
"@tailwindcss/typography": "^0.5.19",
"chart.js": "^4.5.1",
"date-fns": "^4.1.0",
"marked": "^17.0.4"
},
"devDependencies": {
@@ -195,6 +197,12 @@
"@jridgewell/sourcemap-codec": "^1.4.14"
}
},
"node_modules/@kurkle/color": {
"version": "0.3.4",
"resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.4.tgz",
"integrity": "sha512-M5UknZPHRu3DEDWoipU6sE8PdkZ6Z/S+v4dD+Ke8IaNlpdSQah50lz1KtcFBa2vsdOnwbbnxJwVM4wty6udA5w==",
"license": "MIT"
},
"node_modules/@napi-rs/wasm-runtime": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.1.tgz",
@@ -1266,6 +1274,18 @@
"node": ">=8"
}
},
"node_modules/chart.js": {
"version": "4.5.1",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.5.1.tgz",
"integrity": "sha512-GIjfiT9dbmHRiYi6Nl2yFCq7kkwdkp1W/lp2J99rX0yo9tgJGn3lKQATztIjb5tVtevcBtIdICNWqlq5+E8/Pw==",
"license": "MIT",
"dependencies": {
"@kurkle/color": "^0.3.0"
},
"engines": {
"pnpm": ">=8"
}
},
"node_modules/chokidar": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
@@ -1403,6 +1423,16 @@
"dev": true,
"license": "MIT"
},
"node_modules/date-fns": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-4.1.0.tgz",
"integrity": "sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==",
"license": "MIT",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/kossnocorp"
}
},
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",

View File

@@ -22,6 +22,8 @@
},
"dependencies": {
"@tailwindcss/typography": "^0.5.19",
"chart.js": "^4.5.1",
"date-fns": "^4.1.0",
"marked": "^17.0.4"
}
}

View File

@@ -1,3 +1,4 @@
@import './tokens.css';
@tailwind base;
@tailwind components;
@tailwind utilities;
@tailwind utilities;

271
resources/css/tokens.css Normal file
View File

@@ -0,0 +1,271 @@
/**
* design-tokens/tokens.css
* Variables CSS globales RecruitQuizz / CABM
* À importer dans resources/css/app.css :
* @import '../../../design-tokens/tokens.css';
*/
/* ─── COULEURS ────────────────────────────────────────────────────────────── */
:root {
/* Primaires */
--color-primary: #1a4b8c;
--color-primary-dark: #122f5a;
--color-primary-light: #3a7abf;
--color-primary-soft: rgba(26, 75, 140, 0.08);
/* Accent */
--color-accent: #c8102e;
--color-accent-soft: rgba(200, 16, 46, 0.10);
/* Or (highlight) */
--color-gold: #f5a800;
--color-gold-soft: rgba(245, 168, 0, 0.12);
--color-gold-on: #3a2800; /* texte sur fond or */
/* Neutres warm */
--color-bg: #f0ece4; /* fond global */
--color-surface: #faf9f7; /* cartes */
--color-sand: #e8e0d0; /* sable */
--color-border: rgba(45, 45, 45, 0.07);
/* Texte */
--color-text: #2d2d2d;
--color-text-muted: rgba(45, 45, 45, 0.50);
--color-text-faint: rgba(45, 45, 45, 0.28);
/* Sémantiques */
--color-success: #10b981;
--color-success-soft: rgba(16, 185, 129, 0.10);
--color-warning: #f5a800;
--color-danger: #c8102e;
--color-info: #3a7abf;
/* Sidebar */
--sidebar-bg: #1a4b8c;
--sidebar-text: rgba(255, 255, 255, 0.72);
--sidebar-active-bg: #f5a800;
--sidebar-active-text: #3a2800;
--sidebar-border: rgba(255, 255, 255, 0.07);
--sidebar-width: 220px;
--sidebar-width-sm: 64px;
/* Layout */
--header-height: 60px;
--navbar-height: 40px;
}
/* ─── DARK MODE ───────────────────────────────────────────────────────────── */
.dark {
--color-primary: #4a8fd4;
--color-primary-soft: rgba(74, 143, 212, 0.12);
--color-bg: #0f1923;
--color-surface: #162130;
--color-border: rgba(255, 255, 255, 0.06);
--color-text: #e8e8e8;
--color-text-muted: rgba(232, 232, 232, 0.50);
--color-text-faint: rgba(232, 232, 232, 0.25);
--color-success: #34d399;
--color-success-soft: rgba(16, 185, 129, 0.12);
--color-accent: #ff4d6a;
--sidebar-bg: #0a111a;
--sidebar-border: rgba(255, 255, 255, 0.05);
}
/* ─── TYPOGRAPHIE ─────────────────────────────────────────────────────────── */
:root {
--font-sans: 'Nunito', 'Helvetica Neue', Arial, sans-serif;
--font-serif: 'Merriweather', Georgia, serif;
--font-mono: 'JetBrains Mono', 'Fira Code', monospace;
/* Échelle */
--text-2xs: 0.625rem; /* 10px — labels uppercase */
--text-xs: 0.75rem; /* 12px */
--text-sm: 0.8125rem; /* 13px */
--text-base: 0.875rem; /* 14px */
--text-md: 1rem; /* 16px */
--text-lg: 1.0625rem; /* 17px */
--text-xl: 1.125rem; /* 18px */
--text-2xl: 1.25rem; /* 20px */
--text-3xl: 1.5rem; /* 24px */
--text-4xl: 2rem; /* 32px */
}
/* ─── ESPACEMENT ──────────────────────────────────────────────────────────── */
:root {
--space-1: 4px;
--space-2: 8px;
--space-3: 12px;
--space-4: 16px;
--space-5: 20px;
--space-6: 24px;
--space-7: 28px;
--space-8: 32px;
--space-10: 40px;
--space-12: 48px;
--space-16: 64px;
}
/* ─── RAYONS ──────────────────────────────────────────────────────────────── */
:root {
--radius-sm: 6px;
--radius: 8px;
--radius-md: 10px;
--radius-lg: 12px;
--radius-xl: 14px;
--radius-2xl: 16px;
--radius-3xl: 20px;
--radius-full: 9999px;
/* Tokens sémantiques */
--radius-card: 16px;
--radius-btn: 10px;
--radius-badge: 20px;
--radius-input: 10px;
}
/* ─── OMBRES ──────────────────────────────────────────────────────────────── */
:root {
--shadow-xs: 0 1px 3px rgba(0,0,0,0.05);
--shadow-sm: 0 1px 4px rgba(0,0,0,0.07);
--shadow: 0 2px 8px rgba(0,0,0,0.09);
--shadow-md: 0 4px 16px rgba(0,0,0,0.10);
--shadow-lg: 0 8px 28px rgba(0,0,0,0.12);
--shadow-primary: 0 4px 16px rgba(26,75,140,0.20);
--shadow-gold: 0 4px 16px rgba(245,168,0,0.30);
--shadow-accent: 0 4px 16px rgba(200,16,46,0.18);
}
/* ─── TRANSITIONS ─────────────────────────────────────────────────────────── */
:root {
--transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
--transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
--transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
--transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* ─── COMPOSANTS DE BASE ──────────────────────────────────────────────────── */
/* --- Carte --- */
.rq-card {
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: var(--radius-card);
box-shadow: var(--shadow-sm);
}
/* --- Bouton primaire (or) --- */
.rq-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
padding: 10px 20px;
border: none;
border-radius: var(--radius-btn);
font-family: var(--font-sans);
font-weight: 800;
font-size: var(--text-sm);
text-transform: uppercase;
letter-spacing: 0.08em;
cursor: pointer;
transition: all var(--transition);
}
.rq-btn-primary {
background: var(--color-gold);
color: var(--color-gold-on);
box-shadow: var(--shadow-gold);
}
.rq-btn-primary:hover {
filter: brightness(1.06);
transform: translateY(-1px);
box-shadow: 0 6px 20px rgba(245,168,0,0.40);
}
.rq-btn-ghost {
background: transparent;
color: var(--color-text);
border: 1.5px solid var(--color-border);
}
.rq-btn-ghost:hover {
background: var(--color-primary-soft);
border-color: var(--color-primary);
color: var(--color-primary);
}
/* --- Input --- */
.rq-input {
width: 100%;
padding: 10px 14px;
border-radius: var(--radius-input);
border: 1.5px solid var(--color-border);
background: var(--color-surface);
color: var(--color-text);
font-family: var(--font-sans);
font-size: var(--text-base);
font-weight: 600;
outline: none;
transition: border-color var(--transition);
}
.rq-input:focus {
border-color: var(--color-primary);
box-shadow: 0 0 0 3px var(--color-primary-soft);
}
/* --- Badge statut --- */
.rq-badge {
display: inline-block;
padding: 3px 10px;
border-radius: var(--radius-badge);
font-size: var(--text-2xs);
font-weight: 800;
text-transform: uppercase;
letter-spacing: 0.12em;
}
.rq-badge--pending { background: rgba(45,45,45,0.06); color: rgba(45,45,45,0.55); }
.rq-badge--ongoing { background: rgba(58,122,191,0.10); color: #1a4b8c; }
.rq-badge--done { background: rgba(16,185,129,0.10); color: #059669; }
.rq-badge--rejected { background: rgba(200,16,46,0.10); color: #c8102e; }
.dark .rq-badge--pending { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.45); }
.dark .rq-badge--ongoing { background: rgba(58,122,191,0.20); color: #7ab8f5; }
.dark .rq-badge--done { background: rgba(16,185,129,0.15); color: #34d399; }
.dark .rq-badge--rejected { background: rgba(255,77,106,0.15); color: #ff8099; }
/* --- Label section uppercase --- */
.rq-label {
font-size: var(--text-2xs);
font-weight: 900;
text-transform: uppercase;
letter-spacing: 0.16em;
color: var(--color-text-faint);
}
/* --- Score bar --- */
.rq-score-bar {
height: 5px;
background: rgba(45,45,45,0.08);
border-radius: 99px;
overflow: hidden;
}
.rq-score-bar__fill {
height: 100%;
border-radius: 99px;
transition: width 0.4s ease;
}
.rq-score-bar__fill--high { background: var(--color-success); }
.rq-score-bar__fill--mid { background: var(--color-gold); }
.rq-score-bar__fill--low { background: var(--color-accent); }
/* --- Animations utilitaires --- */
@keyframes rq-fade-in {
from { opacity: 0; transform: translateY(6px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes rq-slide-in {
from { opacity: 0; transform: translateX(-8px); }
to { opacity: 1; transform: translateX(0); }
}
.rq-animate-fade { animation: rq-fade-in 0.2s ease-out; }
.rq-animate-slide { animation: rq-slide-in 0.2s ease-out; }

View File

@@ -12,7 +12,8 @@ defineProps({
<template>
<Link
:href="href"
class="block w-full px-4 py-2 text-start text-sm leading-5 text-gray-700 transition duration-150 ease-in-out hover:bg-gray-100 focus:bg-gray-100 focus:outline-none"
class="block w-full px-4 py-2 text-start text-sm font-semibold leading-5 transition duration-150 ease-in-out focus:outline-none"
style="color:#1e293b;"
>
<slot />
</Link>

View File

@@ -14,8 +14,8 @@ const props = defineProps({
const classes = computed(() =>
props.active
? 'inline-flex items-center px-1 pt-1 border-b-2 border-indigo-400 text-sm font-medium leading-5 text-gray-900 focus:outline-none focus:border-indigo-700 transition duration-150 ease-in-out'
: 'inline-flex items-center px-1 pt-1 border-b-2 border-transparent text-sm font-medium leading-5 text-gray-500 hover:text-gray-700 hover:border-gray-300 focus:outline-none focus:text-gray-700 focus:border-gray-300 transition duration-150 ease-in-out',
? 'inline-flex items-center px-1 pt-1 border-b-2 border-indigo-600 text-sm font-bold leading-5 text-indigo-700 focus:outline-none transition duration-150 ease-in-out'
: 'inline-flex items-center px-1 pt-1 border-b-2 border-transparent text-sm font-bold leading-5 text-slate-700 hover:text-indigo-600 hover:border-indigo-400 focus:outline-none transition duration-150 ease-in-out',
);
</script>

View File

@@ -1,6 +1,6 @@
<template>
<button
class="inline-flex items-center rounded-md border border-transparent bg-gray-800 px-4 py-2 text-xs font-semibold uppercase tracking-widest text-white transition duration-150 ease-in-out hover:bg-gray-700 focus:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 active:bg-gray-900"
class="inline-flex items-center justify-center rounded-xl border border-transparent bg-highlight px-6 py-3 font-subtitle text-xs font-bold uppercase tracking-widest text-[#3a2800] shadow-md shadow-highlight/20 transition-all duration-300 ease-in-out hover:-translate-y-0.5 hover:brightness-110 hover:shadow-lg hover:shadow-highlight/30 focus:outline-none focus:ring-2 focus:ring-highlight/50 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"
>
<slot />
</button>

View File

@@ -0,0 +1,35 @@
<script setup>
/**
* RqBadge.vue — Badge de statut candidat
*
* @prop status 'en_attente' | 'en_cours' | 'termine' | 'refuse'
* @prop label Override du texte affiché (optionnel)
*/
const props = defineProps({
status: { type: String, required: true },
label: { type: String, default: null },
});
const labels = {
en_attente: 'En attente',
en_cours: 'En cours',
termine: 'Terminé',
refuse: 'Refusé',
};
const displayLabel = props.label ?? labels[props.status] ?? props.status;
</script>
<template>
<span
:class="[
'inline-block px-2.5 py-0.5 rounded-full text-2xs font-black uppercase tracking-[0.12em]',
status === 'en_attente' && 'bg-ink/5 text-ink/55',
status === 'en_cours' && 'bg-primary/10 text-primary',
status === 'termine' && 'bg-success/10 text-success',
status === 'refuse' && 'bg-accent/10 text-accent',
]"
>
{{ displayLabel }}
</span>
</template>

View File

@@ -0,0 +1,45 @@
<script setup>
/**
* RqButton.vue — Bouton principal RecruitQuizz
*
* @prop variant 'primary' | 'ghost' | 'danger' | 'outline'
* @prop size 'sm' | 'md' | 'lg'
* @prop disabled Boolean
* @prop loading Boolean — affiche un spinner
* @prop icon SVG path string optionnel (gauche du label)
*/
defineProps({
variant: { type: String, default: 'primary' },
size: { type: String, default: 'md' },
disabled: { type: Boolean, default: false },
loading: { type: Boolean, default: false },
});
</script>
<template>
<button
v-bind="$attrs"
:disabled="disabled || loading"
:class="[
// Base
'inline-flex items-center justify-center gap-1.5 font-sans font-extrabold uppercase tracking-[0.08em] transition-all duration-150 select-none focus:outline-none focus:ring-2 focus:ring-offset-2 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed',
// Size
size === 'sm' && 'text-2xs px-3.5 py-2 rounded-lg',
size === 'md' && 'text-xs px-5 py-2.5 rounded-[10px]',
size === 'lg' && 'text-sm px-7 py-3.5 rounded-[10px]',
// Variant
variant === 'primary' && 'bg-highlight text-highlight-dark shadow-gold hover:brightness-105 hover:-translate-y-px hover:shadow-lg focus:ring-highlight/50',
variant === 'ghost' && 'bg-transparent text-ink border border-ink/10 hover:bg-primary/5 hover:border-primary hover:text-primary focus:ring-primary/30',
variant === 'outline' && 'bg-transparent text-primary border-2 border-primary hover:bg-primary hover:text-white focus:ring-primary/30',
variant === 'danger' && 'bg-accent/10 text-accent border border-accent/20 hover:bg-accent hover:text-white focus:ring-accent/30',
]"
>
<!-- Spinner -->
<svg v-if="loading" class="animate-spin h-4 w-4 opacity-70" viewBox="0 0 24 24" fill="none">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"/>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"/>
</svg>
<slot />
</button>
</template>

View File

@@ -0,0 +1,33 @@
<script setup>
/**
* RqCard.vue — Carte conteneur RecruitQuizz
*
* @prop padding 'none' | 'sm' | 'md' | 'lg'
* @prop hover Boolean — active l'effet de survol (lift)
* @prop accent 'primary' | 'gold' | 'green' | 'red' — bordure colorée en bas
*/
defineProps({
padding: { type: String, default: 'md' },
hover: { type: Boolean, default: false },
accent: { type: String, default: null },
});
</script>
<template>
<div
:class="[
'bg-surface rounded-2xl border border-ink/[0.07] shadow-sm',
hover && 'transition-all duration-200 hover:-translate-y-0.5 hover:shadow-md',
accent === 'primary' && 'border-b-2 border-b-primary',
accent === 'gold' && 'border-b-2 border-b-highlight',
accent === 'green' && 'border-b-2 border-b-success',
accent === 'red' && 'border-b-2 border-b-accent',
padding === 'none' && 'overflow-hidden',
padding === 'sm' && 'p-4',
padding === 'md' && 'p-5',
padding === 'lg' && 'p-6',
]"
>
<slot />
</div>
</template>

View File

@@ -0,0 +1,65 @@
<script setup>
/**
* RqInput.vue — Champ de saisie RecruitQuizz
*
* @prop modelValue String (v-model)
* @prop placeholder String
* @prop type String (text, email, password, search…)
* @prop icon 'search' | 'mail' | 'lock' — icône préfixe
* @prop error String — message d'erreur
* @prop label String — label au-dessus du champ
*/
import { computed } from 'vue';
const props = defineProps({
modelValue: { type: String, default: '' },
placeholder: { type: String, default: '' },
type: { type: String, default: 'text' },
icon: { type: String, default: null },
error: { type: String, default: null },
label: { type: String, default: null },
});
const emit = defineEmits(['update:modelValue']);
const iconPaths = {
search: 'M11 17.25a6.25 6.25 0 110-12.5 6.25 6.25 0 010 12.5zM16 16l4.5 4.5',
mail: 'M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2zM22 6l-10 7L2 6',
lock: 'M19 11H5a2 2 0 00-2 2v7a2 2 0 002 2h14a2 2 0 002-2v-7a2 2 0 00-2-2zM7 11V7a5 5 0 0110 0v4',
};
</script>
<template>
<div class="flex flex-col gap-1.5 w-full">
<!-- Label -->
<label v-if="label" class="text-2xs font-black uppercase tracking-[0.14em] text-ink/50">
{{ label }}
</label>
<!-- Input wrapper -->
<div class="relative">
<!-- Icon -->
<span v-if="icon" class="absolute left-3 top-1/2 -translate-y-1/2 text-ink/30 pointer-events-none">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path :d="iconPaths[icon]" />
</svg>
</span>
<input
:type="type"
:value="modelValue"
:placeholder="placeholder"
@input="emit('update:modelValue', $event.target.value)"
:class="[
'w-full rounded-[10px] border bg-surface font-sans text-sm font-semibold text-ink placeholder:text-ink/30 outline-none transition-all duration-150',
'focus:border-primary focus:ring-2 focus:ring-primary/15',
icon ? 'pl-9 pr-4 py-2.5' : 'px-4 py-2.5',
error ? 'border-accent focus:border-accent focus:ring-accent/15' : 'border-ink/10',
]"
/>
</div>
<!-- Error -->
<p v-if="error" class="text-2xs font-bold text-accent">{{ error }}</p>
</div>
</template>

View File

@@ -0,0 +1,38 @@
<script setup>
/**
* RqScoreBar.vue — Barre de score pondéré
*
* @prop value Number — score actuel
* @prop max Number — score maximum (défaut 20)
* @prop showLabel Boolean — affiche "X/max" à droite
*/
import { computed } from 'vue';
const props = defineProps({
value: { type: Number, required: true },
max: { type: Number, default: 20 },
showLabel: { type: Boolean, default: true },
});
const pct = computed(() => Math.min(100, (props.value / props.max) * 100));
const colorClass = computed(() => {
if (pct.value >= 80) return 'bg-success';
if (pct.value >= 60) return 'bg-highlight';
return 'bg-accent';
});
</script>
<template>
<div class="flex items-center gap-2.5 w-full">
<div class="flex-1 h-[5px] bg-ink/[0.07] rounded-full overflow-hidden">
<div
:class="['h-full rounded-full transition-all duration-500', colorClass]"
:style="{ width: `${pct}%` }"
/>
</div>
<span v-if="showLabel" class="text-xs font-black text-ink tabular-nums min-w-[44px] text-right">
{{ value }}<span class="text-[9px] text-ink/40 font-semibold">/{{ max }}</span>
</span>
</div>
</template>

View File

@@ -0,0 +1,54 @@
<script setup>
/**
* RqStatCard.vue — Carte KPI dashboard admin
*
* @prop label String — libellé (ex: "Total Candidats")
* @prop value String | Number — valeur principale
* @prop sub String — sous-texte (ex: "+3 ce mois")
* @prop color 'primary' | 'gold' | 'green' | 'sky' | 'red'
* @prop unit String — unité affichée après la valeur (ex: "/ 20")
*/
import { computed } from 'vue';
const props = defineProps({
label: { type: String, required: true },
value: { type: [String, Number], required: true },
sub: { type: String, default: null },
color: { type: String, default: 'primary' },
unit: { type: String, default: null },
});
const colorMap = {
primary: { text: 'text-primary', glow: 'from-primary/10' },
gold: { text: 'text-highlight', glow: 'from-highlight/15' },
green: { text: 'text-success', glow: 'from-success/10' },
sky: { text: 'text-primary-light', glow: 'from-primary-light/10' },
red: { text: 'text-accent', glow: 'from-accent/10' },
};
const c = computed(() => colorMap[props.color] ?? colorMap.primary);
</script>
<template>
<div class="relative bg-surface rounded-2xl border border-ink/[0.07] shadow-sm p-5 overflow-hidden
transition-all duration-200 hover:-translate-y-0.5 hover:shadow-md group cursor-default">
<!-- Label -->
<p class="text-2xs font-black uppercase tracking-[0.18em] text-ink/40 mb-2.5">
{{ label }}
</p>
<!-- Value -->
<p :class="['font-serif font-black leading-none', c.text]"
style="font-size: clamp(1.75rem, 2.5vw, 2.25rem);">
{{ value }}
<span v-if="unit" class="text-base font-sans font-bold text-ink/30 ml-1">{{ unit }}</span>
</p>
<!-- Sub -->
<p v-if="sub" class="mt-1.5 text-2xs font-semibold text-ink/40">{{ sub }}</p>
<!-- Decorative blob -->
<div :class="['absolute bottom-0 right-0 w-20 h-20 rounded-full bg-gradient-radial to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500', c.glow]" />
</div>
</template>

View File

@@ -1,154 +1,264 @@
<script setup>
/**
* AdminLayout.vue — Layout principal admin redesigné
* RecruitQuizz v2.4
*
* Changements vs version précédente :
* - Sidebar 220px (collapsible → 64px) avec transition douce
* - Header 60px épuré, titre avec accent bar or
* - Fond neutral (#f0ece4) sur le contenu principal
* - Items nav : rounded-xl, active bg-highlight text-highlight-dark
* - Footer sidebar : avatar + nom + version + logout
*/
import { ref } from 'vue';
import { Link } from '@inertiajs/vue3';
import ApplicationLogo from '@/Components/ApplicationLogo.vue';
import { Link, usePage } from '@inertiajs/vue3';
import Dropdown from '@/Components/Dropdown.vue';
import DropdownLink from '@/Components/DropdownLink.vue';
import EnvironmentBanner from '@/Components/EnvironmentBanner.vue';
const page = usePage();
const isSidebarOpen = ref(true);
// ─── Navigation ────────────────────────────────────────────────────────────
const navItems = [
{
route: 'dashboard',
label: 'Tableau de bord',
icon: 'M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2V9z M9 22V12h6v10',
},
{
route: 'admin.candidates.index',
match: 'admin.candidates.*',
label: 'Candidats',
icon: 'M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2 M9 11a4 4 0 100-8 4 4 0 000 8z M23 21v-2a4 4 0 00-3-3.87 M16 3.13a4 4 0 010 7.75',
},
{
route: 'admin.quizzes.index',
match: 'admin.quizzes.*',
label: 'Quiz',
icon: 'M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2M9 12l2 2 4-4',
},
{
route: 'admin.job-positions.index',
match: 'admin.job-positions.*',
label: 'Fiches de Poste',
icon: 'M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16z',
},
{
route: 'admin.comparative',
label: 'Comparateur',
icon: 'M18 20V10 M12 20V4 M6 20v-6',
},
];
const superAdminItems = [
{
route: 'admin.tenants.index',
match: 'admin.tenants.*',
label: 'Structures',
icon: 'M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4',
},
{
route: 'admin.users.index',
match: 'admin.users.*',
label: 'Équipe SaaS',
icon: 'M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z',
},
{
route: 'admin.logs.index',
match: 'admin.logs.*',
label: 'Logs connexion',
icon: 'M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01',
},
];
const isActive = (item) => {
if (item.match) return route().current(item.match);
return route().current(item.route);
};
</script>
<template>
<EnvironmentBanner />
<div class="min-h-screen bg-slate-50 dark:bg-slate-900 flex text-slate-900 dark:text-slate-100">
<!-- Sidebar -->
<div class="h-screen flex bg-neutral font-sans text-ink selection:bg-highlight selection:text-highlight-dark overflow-hidden">
<!-- Sidebar -->
<aside
:class="[isSidebarOpen ? 'w-64' : 'w-20']"
class="hidden md:flex flex-col bg-white dark:bg-slate-800 border-r border-slate-200 dark:border-slate-700 transition-all duration-300"
:class="[
isSidebarOpen ? 'w-[220px]' : 'w-16',
'hidden md:flex flex-col bg-primary shadow-xl z-20 transition-all duration-300 shrink-0'
]"
>
<div class="h-16 flex items-center px-6 border-b border-slate-200 dark:border-slate-700">
<!-- Logo -->
<div class="h-[60px] flex items-center border-b border-white/[0.07] px-4 shrink-0">
<Link :href="route('dashboard')" class="flex items-center gap-3 overflow-hidden">
<ApplicationLogo class="h-8 w-8 fill-indigo-600" />
<span v-if="isSidebarOpen" class="font-bold text-xl tracking-tight whitespace-nowrap">Recrut.IT</span>
<!-- Icône -->
<div class="w-[30px] h-[30px] bg-highlight rounded-lg flex items-center justify-center shrink-0 shadow-gold">
<svg class="w-4 h-4 text-highlight-dark" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>
</svg>
</div>
<!-- Wordmark -->
<Transition name="fade">
<span v-if="isSidebarOpen" class="font-serif font-black text-[17px] text-white tracking-tight whitespace-nowrap">
RECRU<span class="text-highlight italic">IT</span>
</span>
</Transition>
</Link>
</div>
<nav class="flex-1 py-6 px-3 space-y-1">
<Link
:href="route('dashboard')"
class="flex items-center gap-3 px-3 py-2 rounded-lg transition-colors"
:class="[route().current('dashboard') ? 'bg-indigo-50 text-indigo-600 dark:bg-indigo-900/50 dark:text-indigo-400' : 'hover:bg-slate-50 dark:hover:bg-slate-700/50']"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" />
</svg>
<span v-if="isSidebarOpen">Tableau de bord</span>
</Link>
<!-- Nav principale -->
<nav class="flex-1 px-2.5 py-4 space-y-0.5 overflow-y-auto scrollbar-thin scrollbar-thumb-white/10 scrollbar-track-transparent">
<!-- Items principaux -->
<template v-for="item in navItems" :key="item.route">
<Link
:href="route(item.route)"
:title="!isSidebarOpen ? item.label : undefined"
:class="[
'flex items-center gap-3 px-3 py-2.5 rounded-xl transition-all duration-150 font-sans font-bold text-[12.5px] tracking-[0.01em]',
isSidebarOpen ? '' : 'justify-center',
isActive(item)
? 'bg-highlight text-highlight-dark shadow-md shadow-highlight/20'
: 'text-white/70 hover:bg-white/10 hover:text-white',
]"
>
<svg class="w-[17px] h-[17px] shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path :d="item.icon"/>
</svg>
<span v-if="isSidebarOpen" class="truncate">{{ item.label }}</span>
</Link>
</template>
<Link
:href="route('admin.candidates.index')"
class="flex items-center gap-3 px-3 py-2 rounded-lg transition-colors"
:class="[route().current('admin.candidates.*') ? 'bg-indigo-50 text-indigo-600 dark:bg-indigo-900/50 dark:text-indigo-400' : 'hover:bg-slate-50 dark:hover:bg-slate-700/50']"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z" />
</svg>
<span v-if="isSidebarOpen">Candidats</span>
</Link>
<!-- Section super admin -->
<template v-if="$page.props.auth.user.role === 'super_admin'">
<div class="pt-4 pb-2">
<div
v-if="isSidebarOpen"
class="px-3 text-[9px] font-black uppercase tracking-[0.18em] text-white/25"
>Configuration</div>
<div v-else class="h-px w-8 mx-auto bg-white/10" />
</div>
<Link
:href="route('admin.quizzes.index')"
class="flex items-center gap-3 px-3 py-2 rounded-lg transition-colors"
:class="[route().current('admin.quizzes.*') ? 'bg-indigo-50 text-indigo-600 dark:bg-indigo-900/50 dark:text-indigo-400' : 'hover:bg-slate-50 dark:hover:bg-slate-700/50']"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<span v-if="isSidebarOpen">Quiz</span>
</Link>
<Link
:href="route('admin.job-positions.index')"
class="flex items-center gap-3 px-3 py-2 rounded-lg transition-colors"
:class="[route().current('admin.job-positions.*') ? 'bg-indigo-50 text-indigo-600 dark:bg-indigo-900/50 dark:text-indigo-400' : 'hover:bg-slate-50 dark:hover:bg-slate-700/50']"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
<span v-if="isSidebarOpen">Fiches de Poste</span>
</Link>
<Link
:href="route('admin.comparative')"
class="flex items-center gap-3 px-3 py-2 rounded-lg transition-colors"
:class="[route().current('admin.comparative') ? 'bg-indigo-50 text-indigo-600 dark:bg-indigo-900/50 dark:text-indigo-400' : 'hover:bg-slate-50 dark:hover:bg-slate-700/50']"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
</svg>
<span v-if="isSidebarOpen">Comparateur</span>
</Link>
<Link
v-if="$page.props.auth.user.role === 'super_admin'"
:href="route('admin.tenants.index')"
class="flex items-center gap-3 px-3 py-2 rounded-lg transition-colors"
:class="[route().current('admin.tenants.*') ? 'bg-indigo-50 text-indigo-600 dark:bg-indigo-900/50 dark:text-indigo-400' : 'hover:bg-slate-50 dark:hover:bg-slate-700/50']"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" />
</svg>
<span v-if="isSidebarOpen">Structures</span>
</Link>
<Link
v-if="$page.props.auth.user.role === 'super_admin'"
:href="route('admin.users.index')"
class="flex items-center gap-3 px-3 py-2 rounded-lg transition-colors"
:class="[route().current('admin.users.*') ? 'bg-indigo-50 text-indigo-600 dark:bg-indigo-900/50 dark:text-indigo-400' : 'hover:bg-slate-50 dark:hover:bg-slate-700/50']"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z" />
</svg>
<span v-if="isSidebarOpen">Équipe SaaS</span>
</Link>
<template v-for="item in superAdminItems" :key="item.route">
<Link
:href="route(item.route)"
:title="!isSidebarOpen ? item.label : undefined"
:class="[
'flex items-center gap-3 px-3 py-2.5 rounded-xl transition-all duration-150 font-sans font-bold text-[12.5px] tracking-[0.01em]',
isSidebarOpen ? '' : 'justify-center',
isActive(item)
? 'bg-highlight text-highlight-dark shadow-md shadow-highlight/20'
: 'text-white/70 hover:bg-white/10 hover:text-white',
]"
>
<svg class="w-[17px] h-[17px] shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path :d="item.icon"/>
</svg>
<span v-if="isSidebarOpen" class="truncate">{{ item.label }}</span>
</Link>
</template>
</template>
</nav>
<div class="p-4 border-t border-slate-200 dark:border-slate-700">
<button
@click="isSidebarOpen = !isSidebarOpen"
class="flex items-center justify-center w-full h-10 rounded-lg bg-slate-100 dark:bg-slate-700 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"
>
<svg v-if="isSidebarOpen" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 19l-7-7 7-7m8 14l-7-7 7-7" />
</svg>
<svg v-else xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 5l7 7-7 7M5 5l7 7-7 7" />
</svg>
</button>
</div>
</aside>
<!-- Main Content -->
<div class="flex-1 flex flex-col min-w-0 overflow-hidden">
<header class="h-16 flex items-center justify-between px-8 bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700">
<div>
<h2 v-if="$slots.header" class="font-semibold text-lg">
<slot name="header" />
</h2>
</div>
<div class="flex items-center gap-4">
<!-- Footer sidebar : user + collapse -->
<div class="px-3 py-3 border-t border-white/[0.07] shrink-0">
<!-- User info (sidebar ouverte) -->
<div v-if="isSidebarOpen" class="flex items-center gap-2.5 mb-3">
<div class="w-8 h-8 rounded-full bg-highlight flex items-center justify-center text-[12px] font-black text-highlight-dark shrink-0">
{{ $page.props.auth.user.name.charAt(0) }}
</div>
<div class="overflow-hidden flex-1 min-w-0">
<div class="text-[12px] font-bold text-white truncate">{{ $page.props.auth.user.name }}</div>
<div class="text-[10px] text-white/40 truncate">{{ $page.props.auth.user.role }}</div>
</div>
<Dropdown align="right" width="48">
<template #trigger>
<button class="flex items-center gap-2 text-sm font-medium hover:text-indigo-600 transition-colors">
{{ $page.props.auth.user.name }}
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
<button class="p-1.5 rounded-lg text-white/40 hover:text-white hover:bg-white/10 transition-colors">
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/>
</svg>
</button>
</template>
<template #content>
<DropdownLink :href="route('profile.edit')">Profil</DropdownLink>
<DropdownLink :href="route('admin.backup')" as="a">Sauvegarde App</DropdownLink>
<DropdownLink :href="route('logout')" method="post" as="button">Déconnexion</DropdownLink>
<DropdownLink :href="route('profile.edit')">Paramètres du profil</DropdownLink>
<DropdownLink
v-if="$page.props.auth.user.role === 'super_admin'"
:href="route('admin.backup')"
as="a"
class="!text-primary-light font-bold"
>Sauvegarde BDD</DropdownLink>
<div class="border-t border-ink/5 my-1"/>
<DropdownLink :href="route('logout')" method="post" as="button" class="!text-accent font-bold">
Se déconnecter
</DropdownLink>
</template>
</Dropdown>
</div>
<!-- Collapse button -->
<button
@click="isSidebarOpen = !isSidebarOpen"
class="flex items-center justify-center w-full h-9 rounded-xl text-white/40 hover:bg-white/10 hover:text-white transition-all duration-200"
:title="isSidebarOpen ? 'Réduire' : 'Agrandir'"
>
<svg class="w-4 h-4 transition-transform duration-300" :class="isSidebarOpen ? '' : 'rotate-180'" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M15 18l-6-6 6-6"/>
</svg>
</button>
<!-- Version -->
<div v-if="isSidebarOpen" class="mt-2 text-center text-[9px] font-bold uppercase tracking-[0.12em] text-white/20">
v{{ $page.props.app_version }}
</div>
</div>
</aside>
<!-- Main -->
<div class="flex-1 flex flex-col min-w-0 overflow-hidden">
<!-- Header -->
<header class="h-[60px] shrink-0 flex items-center justify-between px-8 bg-surface border-b border-ink/[0.05] shadow-xs z-10">
<div class="flex items-center gap-3">
<!-- Accent bar -->
<div class="w-[3px] h-5 bg-highlight rounded-full hidden md:block" />
<!-- Page title -->
<h2 v-if="$slots.header" class="font-serif font-black text-[17px] text-primary tracking-tight">
<slot name="header" />
</h2>
</div>
<div class="flex items-center gap-3">
<!-- Slot pour actions contextuelles (ex: bouton "Nouveau") -->
<slot name="actions" />
<!-- Badge rôle -->
<span
v-if="$page.props.auth.user.role === 'super_admin'"
class="bg-gradient-to-r from-accent to-highlight text-white px-3 py-1 rounded-full text-[9px] font-black tracking-widest uppercase shadow-sm"
>GOD MODE</span>
<span
v-else-if="$page.props.auth.user.tenant"
class="bg-primary/10 text-primary px-3 py-1 rounded-full text-[9px] font-black tracking-widest uppercase border border-primary/20"
>{{ $page.props.auth.user.tenant.name }}</span>
</div>
</header>
<main class="flex-1 overflow-y-auto p-8">
<!-- Content -->
<main class="flex-1 overflow-y-auto p-7">
<slot />
</main>
</div>
</div>
</template>
<style scoped>
.fade-enter-active, .fade-leave-active { transition: opacity 0.15s ease; }
.fade-enter-from, .fade-leave-to { opacity: 0; }
/* Scrollbar sidebar Firefox */
.scrollbar-thin { scrollbar-width: thin; }
.scrollbar-thumb-white\/10 { scrollbar-color: rgba(255,255,255,0.1) transparent; }
</style>

View File

@@ -0,0 +1,203 @@
<script setup>
import { ref } from 'vue';
import { Link } from '@inertiajs/vue3';
import ApplicationLogo from '@/Components/ApplicationLogo.vue';
import Dropdown from '@/Components/Dropdown.vue';
import DropdownLink from '@/Components/DropdownLink.vue';
import EnvironmentBanner from '@/Components/EnvironmentBanner.vue';
const isSidebarOpen = ref(true);
</script>
<template>
<EnvironmentBanner />
<div class="min-h-screen bg-sand flex text-anthracite font-sans selection:bg-highlight selection:text-anthracite">
<!-- Sidebar -->
<aside
:class="[isSidebarOpen ? 'w-64' : 'w-20']"
class="hidden md:flex flex-col bg-primary transition-all duration-300 shadow-xl z-20"
>
<div class="h-16 flex items-center px-5 bg-primary/90 border-b border-white/10">
<Link :href="route('dashboard')" class="flex items-center gap-3 overflow-hidden ml-1">
<div class="w-8 h-8 bg-highlight rounded flex items-center justify-center shrink-0 shadow-sm shadow-highlight/20">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-[#3a2800]" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9l-.707.707M12 18v3m4.95-4.95l.707.707M12 3c-4.418 0-8 3.582-8 8 0 2.209.895 4.209 2.343 5.657L12 21l5.657-5.343A7.994 7.994 0 0020 11c0-4.418-3.582-8-8-8z" />
</svg>
</div>
<span v-if="isSidebarOpen" class="font-serif font-black text-xl tracking-tight whitespace-nowrap text-white">RECRU<span class="text-accent italic px-0.5">IT</span></span>
</Link>
</div>
<nav class="flex-1 py-6 px-3 space-y-1.5 overflow-y-auto custom-scrollbar">
<Link
:href="route('dashboard')"
class="flex items-center gap-3 px-3 py-2.5 rounded-xl transition-all duration-300 font-subtitle font-bold text-sm"
:class="[route().current('dashboard') ? 'bg-highlight text-[#3a2800] shadow-md shadow-highlight/20' : 'text-white/70 hover:bg-white/10 hover:text-white']"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" />
</svg>
<span v-if="isSidebarOpen" class="truncate">Tableau de bord</span>
</Link>
<Link
:href="route('admin.candidates.index')"
class="flex items-center gap-3 px-3 py-2.5 rounded-xl transition-all duration-300 font-subtitle font-bold text-sm"
:class="[route().current('admin.candidates.*') ? 'bg-highlight text-[#3a2800] shadow-md shadow-highlight/20' : 'text-white/70 hover:bg-white/10 hover:text-white']"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z" />
</svg>
<span v-if="isSidebarOpen" class="truncate">Candidats</span>
</Link>
<Link
:href="route('admin.quizzes.index')"
class="flex items-center gap-3 px-3 py-2.5 rounded-xl transition-all duration-300 font-subtitle font-bold text-sm"
:class="[route().current('admin.quizzes.*') ? 'bg-highlight text-[#3a2800] shadow-md shadow-highlight/20' : 'text-white/70 hover:bg-white/10 hover:text-white']"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<span v-if="isSidebarOpen" class="truncate">Quiz</span>
</Link>
<Link
:href="route('admin.job-positions.index')"
class="flex items-center gap-3 px-3 py-2.5 rounded-xl transition-all duration-300 font-subtitle font-bold text-sm"
:class="[route().current('admin.job-positions.*') ? 'bg-highlight text-[#3a2800] shadow-md shadow-highlight/20' : 'text-white/70 hover:bg-white/10 hover:text-white']"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
<span v-if="isSidebarOpen" class="truncate">Fiches de Poste</span>
</Link>
<Link
:href="route('admin.comparative')"
class="flex items-center gap-3 px-3 py-2.5 rounded-xl transition-all duration-300 font-subtitle font-bold text-sm"
:class="[route().current('admin.comparative') ? 'bg-highlight text-[#3a2800] shadow-md shadow-highlight/20' : 'text-white/70 hover:bg-white/10 hover:text-white']"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
</svg>
<span v-if="isSidebarOpen" class="truncate">Comparateur</span>
</Link>
<div v-if="$page.props.auth.user.role === 'super_admin'" class="pt-4 pb-2">
<div v-show="isSidebarOpen" class="px-3 text-[10px] font-black uppercase tracking-widest text-white/30">Configuration</div>
<div v-show="!isSidebarOpen" class="h-[1px] w-8 mx-auto bg-white/10"></div>
</div>
<Link
v-if="$page.props.auth.user.role === 'super_admin'"
:href="route('admin.tenants.index')"
class="flex items-center gap-3 px-3 py-2.5 rounded-xl transition-all duration-300 font-subtitle font-bold text-sm"
:class="[route().current('admin.tenants.*') ? 'bg-highlight text-[#3a2800] shadow-md shadow-highlight/20' : 'text-white/70 hover:bg-white/10 hover:text-white']"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" />
</svg>
<span v-if="isSidebarOpen" class="truncate">Structures</span>
</Link>
<Link
v-if="$page.props.auth.user.role === 'super_admin'"
:href="route('admin.users.index')"
class="flex items-center gap-3 px-3 py-2.5 rounded-xl transition-all duration-300 font-subtitle font-bold text-sm"
:class="[route().current('admin.users.*') ? 'bg-highlight text-[#3a2800] shadow-md shadow-highlight/20' : 'text-white/70 hover:bg-white/10 hover:text-white']"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z" />
</svg>
<span v-if="isSidebarOpen" class="truncate">Équipe SaaS</span>
</Link>
<Link
v-if="$page.props.auth.user.role === 'super_admin'"
:href="route('admin.logs.index')"
class="flex items-center gap-3 px-3 py-2.5 rounded-xl transition-all duration-300 font-subtitle font-bold text-sm"
:class="[route().current('admin.logs.*') ? 'bg-highlight text-[#3a2800] shadow-md shadow-highlight/20' : 'text-white/70 hover:bg-white/10 hover:text-white']"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01" />
</svg>
<span v-if="isSidebarOpen" class="truncate">Logs de connexion</span>
</Link>
</nav>
<div class="p-4 border-t border-white/10 bg-primary/80">
<button
@click="isSidebarOpen = !isSidebarOpen"
class="flex items-center justify-center w-full h-10 rounded-lg text-white/50 hover:bg-white/10 hover:text-white transition-all duration-300"
>
<svg v-if="isSidebarOpen" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 19l-7-7 7-7m8 14l-7-7 7-7" />
</svg>
<svg v-else xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 5l7 7-7 7M5 5l7 7-7 7" />
</svg>
</button>
<div v-show="isSidebarOpen" class="mt-4 text-[9px] font-bold uppercase tracking-widest text-[#3a7abf] text-center">
App v{{ $page.props.app_version }}
</div>
</div>
</aside>
<!-- Main Content -->
<div class="flex-1 flex flex-col min-w-0 overflow-hidden bg-neutral">
<header class="h-16 shrink-0 flex items-center justify-between px-8 bg-white border-b border-anthracite/5 shadow-sm z-10 relative">
<div>
<h2 v-if="$slots.header" class="font-serif font-black text-xl text-primary capitalize tracking-tight flex items-center gap-3">
<div class="w-1.5 h-6 bg-highlight rounded-full hidden md:block"></div>
<slot name="header" />
</h2>
</div>
<div class="flex items-center gap-4">
<Dropdown align="right" width="48">
<template #trigger>
<button class="flex items-center gap-2 text-sm font-subtitle font-bold hover:text-primary transition-colors cursor-pointer py-2">
<div class="w-8 h-8 rounded-full bg-sand flex items-center justify-center text-primary border border-primary/10">
{{ $page.props.auth.user.name.charAt(0) }}
</div>
<span class="hidden md:block">{{ $page.props.auth.user.name }}</span>
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-anthracite/40" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
</svg>
</button>
</template>
<template #content>
<DropdownLink :href="route('profile.edit')">Paramètres du profil</DropdownLink>
<DropdownLink :href="route('admin.backup')" as="a" class="!text-sky font-bold" v-if="$page.props.auth.user.role === 'super_admin'">Sauvegarde Base de données</DropdownLink>
<div class="border-t border-anthracite/5 my-1"></div>
<DropdownLink :href="route('logout')" method="post" as="button" class="!text-accent font-bold">Se déconnecter</DropdownLink>
</template>
</Dropdown>
</div>
</header>
<main class="flex-1 overflow-y-auto p-4 md:p-8">
<slot />
</main>
</div>
</div>
</template>
<style>
/* Firefox scrollbar config for sidebar */
.custom-scrollbar {
scrollbar-width: thin;
scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
.custom-scrollbar::-webkit-scrollbar {
width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
background-color: rgba(255, 255, 255, 0.1);
border-radius: 10px;
}
</style>

View File

@@ -14,10 +14,8 @@ const showingNavigationDropdown = ref(false);
<template>
<EnvironmentBanner />
<div>
<div class="min-h-screen bg-gray-100">
<nav
class="border-b border-gray-100 bg-white"
>
<div class="min-h-screen" style="background:#f8fafc;">
<nav style="border-bottom:1px solid #e2e8f0; background:white; box-shadow:0 1px 3px rgba(0,0,0,0.04);">
<!-- Primary Navigation Menu -->
<div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<div class="flex h-16 justify-between">
@@ -26,7 +24,7 @@ const showingNavigationDropdown = ref(false);
<div class="flex shrink-0 items-center">
<Link :href="route('dashboard')">
<ApplicationLogo
class="block h-9 w-auto fill-current text-gray-800"
class="block h-9 w-auto fill-indigo-600"
/>
</Link>
</div>
@@ -52,7 +50,7 @@ const showingNavigationDropdown = ref(false);
<span class="inline-flex rounded-md">
<button
type="button"
class="inline-flex items-center rounded-md border border-transparent bg-white px-3 py-2 text-sm font-medium leading-4 text-gray-500 transition duration-150 ease-in-out hover:text-gray-700 focus:outline-none"
style="display:inline-flex; align-items:center; border-radius:0.75rem; border:1.5px solid #e2e8f0; background:#f1f5f9; padding:0.5rem 1rem; font-size:0.875rem; font-weight:700; color:#0f172a; transition:all 0.15s ease;"
>
{{ $page.props.auth.user.name }}
@@ -183,7 +181,7 @@ const showingNavigationDropdown = ref(false);
<!-- Page Heading -->
<header
class="bg-white shadow"
style="background:white; border-bottom:1px solid #f1f5f9; box-shadow:none;"
v-if="$slots.header"
>
<div class="mx-auto max-w-7xl px-4 py-6 sm:px-6 lg:px-8">
@@ -195,6 +193,10 @@ const showingNavigationDropdown = ref(false);
<main>
<slot />
</main>
<footer class="pb-8 pt-4 text-center" style="background:#f8fafc;">
<span class="text-[10px] font-mono" style="color:#9ca3af;">v{{ $page.props.app_version }}</span>
</footer>
</div>
</div>
</template>

View File

@@ -6,19 +6,33 @@ import EnvironmentBanner from '@/Components/EnvironmentBanner.vue';
<template>
<EnvironmentBanner />
<div
class="flex min-h-screen flex-col items-center bg-gray-100 pt-6 sm:justify-center sm:pt-0"
>
<div>
<Link href="/">
<ApplicationLogo class="h-20 w-20 fill-current text-gray-500" />
</Link>
</div>
<div class="flex min-h-screen flex-col items-center justify-center bg-neutral pt-6 sm:pt-0 font-sans text-anthracite selection:bg-highlight selection:text-anthracite">
<div class="w-full max-w-md px-6">
<!-- Header and Logo -->
<div class="mb-8 flex flex-col justify-center items-center gap-4">
<Link href="/" class="flex flex-col items-center gap-3 group">
<div class="w-16 h-16 bg-primary rounded-xl flex items-center justify-center shadow-lg shadow-primary/30 group-hover:-translate-y-1 transition-all duration-300">
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9l-.707.707M12 18v3m4.95-4.95l.707.707M12 3c-4.418 0-8 3.582-8 8 0 2.209.895 4.209 2.343 5.657L12 21l5.657-5.343A7.994 7.994 0 0020 11c0-4.418-3.582-8-8-8z" />
</svg>
</div>
<span class="text-3xl font-serif font-black tracking-tight text-primary">RECRU<span class="text-accent italic px-1">IT</span></span>
<span class="text-xs font-subtitle uppercase tracking-[0.2em] text-anthracite/50 font-bold mt-1">Espace sécurisé</span>
</Link>
</div>
<div
class="mt-6 w-full overflow-hidden bg-white px-6 py-4 shadow-md sm:max-w-md sm:rounded-lg"
>
<slot />
<!-- Content Card -->
<div class="w-full overflow-hidden bg-white px-8 py-10 shadow-xl shadow-anthracite/5 rounded-3xl border border-anthracite/5">
<slot />
</div>
<!-- Footer Footer -->
<div class="mt-8 text-center">
<Link href="/" class="text-primary hover:text-highlight transition-colors text-sm font-subtitle font-bold">
&larr; Retour à l'accueil
</Link>
</div>
</div>
</div>
</template>

View File

@@ -2,6 +2,7 @@
import AdminLayout from '@/Layouts/AdminLayout.vue';
import { Head, useForm, Link, usePage, router } from '@inertiajs/vue3';
import { ref, computed } from 'vue';
import axios from 'axios';
const page = usePage();
const flashSuccess = computed(() => page.props.flash?.success);
@@ -43,17 +44,21 @@ const submit = () => {
const deleteCandidate = (id) => {
if (confirm('Voulez-vous vraiment supprimer ce candidat ?')) {
router.delete(route('admin.candidates.destroy', id));
router.delete(route('admin.candidates.destroy', id), { preserveScroll: true });
}
};
const toggleSelection = (id) => {
router.patch(route('admin.candidates.toggle-selection', id), {}, { preserveScroll: true });
};
const openPreview = (doc) => {
selectedDocument.value = doc;
};
// Sorting Logic
const sortKey = ref('user.name');
const sortOrder = ref(1); // 1 = asc, -1 = desc
const sortKey = ref('ai_analysis.match_score');
const sortOrder = ref(-1); // 1 = asc, -1 = desc
const sortBy = (key) => {
if (sortKey.value === key) {
@@ -69,11 +74,24 @@ const getNestedValue = (obj, path) => {
};
const selectedJobPosition = ref('');
const showOnlySelected = ref(false);
const filteredCandidates = computed(() => {
if (selectedJobPosition.value === '') return props.candidates;
if (selectedJobPosition.value === 'none') return props.candidates.filter(c => !c.job_position_id);
return props.candidates.filter(c => c.job_position_id === selectedJobPosition.value);
let result = props.candidates;
if (showOnlySelected.value) {
result = result.filter(c => c.is_selected);
}
if (selectedJobPosition.value !== '') {
if (selectedJobPosition.value === 'none') {
result = result.filter(c => !c.job_position_id);
} else {
result = result.filter(c => c.job_position_id === selectedJobPosition.value);
}
}
return result;
});
const sortedCandidates = computed(() => {
@@ -89,6 +107,61 @@ const sortedCandidates = computed(() => {
return 0;
});
});
const selectedIds = ref([]);
const isBatchAnalyzing = ref(false);
const analysisProgress = ref({ current: 0, total: 0 });
const toggleSelectAll = (e) => {
if (e.target.checked) {
selectedIds.value = sortedCandidates.value.map(c => c.id);
} else {
selectedIds.value = [];
}
};
const batchAnalyze = async () => {
if (selectedIds.value.length === 0) return;
if (!confirm(`Voulez-vous lancer l'analyse IA pour les ${selectedIds.value.length} candidats sélectionnés ?`)) {
return;
}
isBatchAnalyzing.value = true;
analysisProgress.value = { current: 0, total: selectedIds.value.length };
const results = { success: 0, errors: 0, details: [] };
// Copy the IDs to avoid issues if selection changes during process
const idsToProcess = [...selectedIds.value];
for (const id of idsToProcess) {
analysisProgress.value.current++;
try {
await axios.post(route('admin.candidates.analyze', id));
results.success++;
} catch (error) {
results.errors++;
const candidate = props.candidates.find(c => c.id === id);
results.details.push({
candidate: candidate?.user?.name || `ID #${id}`,
error: error.response?.data?.error || error.message
});
}
}
// Finished processing all
router.reload({
onSuccess: () => {
isBatchAnalyzing.value = false;
selectedIds.value = [];
alert(`Analyse terminée : ${results.success} succès, ${results.errors} erreurs.`);
if (results.details.length > 0) {
console.table(results.details);
}
}
});
};
</script>
<template>
@@ -99,207 +172,239 @@ const sortedCandidates = computed(() => {
Gestion des Candidats
</template>
<div class="flex justify-between items-end mb-8">
<div class="space-y-4">
<h3 class="text-2xl font-bold">Liste des Candidats</h3>
<div class="flex items-center gap-3">
<label class="text-sm font-medium text-slate-700 dark:text-slate-300">Filtrer par fiche de poste :</label>
<select
v-model="selectedJobPosition"
class="block w-64 rounded-xl border-slate-300 dark:border-slate-700 dark:bg-slate-900 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
>
<option value="">Toutes les fiches de poste</option>
<option value="none"> Non assigné (Candidature Spontanée)</option>
<option v-for="jp in jobPositions" :key="jp.id" :value="jp.id">
{{ jp.title }}
</option>
</select>
<div class="sticky top-[-28px] z-20 bg-neutral/80 backdrop-blur-xl -mx-7 px-7 pt-7 pb-6 mb-4 border-b border-ink/[0.03]">
<div class="flex flex-col md:flex-row justify-between items-start md:items-end gap-6">
<div class="space-y-4 w-full md:w-auto">
<h3 class="text-3xl font-serif font-black text-primary capitalize tracking-tight flex items-center gap-3">
<div class="w-1.5 h-8 bg-highlight rounded-full"></div>
Liste des Candidats
</h3>
<div class="flex flex-col sm:flex-row items-center gap-4">
<div class="flex items-center gap-3 bg-white p-2 rounded-xl border border-anthracite/5 shadow-sm min-w-max">
<label class="flex items-center gap-2 cursor-pointer px-2">
<input type="checkbox" v-model="showOnlySelected" class="rounded border-highlight/50 text-highlight focus:ring-highlight/20 cursor-pointer">
<span class="text-xs font-bold text-primary uppercase tracking-widest">Retenus uniquement</span>
</label>
</div>
<div class="flex items-center gap-3 w-full sm:w-auto">
<select
v-model="selectedJobPosition"
class="block w-full sm:w-72 rounded-xl border-anthracite/10 shadow-sm focus:border-primary focus:ring-primary/20 text-sm font-medium text-anthracite transition-all"
>
<option value="">Toutes les fiches de poste</option>
<option value="none" class="italic"> Candidature Spontanée</option>
<option v-for="jp in jobPositions" :key="jp.id" :value="jp.id">
{{ jp.title }}
</option>
</select>
</div>
</div>
</div>
<div class="flex items-center gap-4 w-full md:w-auto justify-end">
<div v-if="selectedIds.length > 0" class="flex items-center gap-3 animate-in fade-in slide-in-from-right-4 duration-300">
<span class="text-xs font-black uppercase tracking-widest text-primary/50">{{ selectedIds.length }} sélectionné(s)</span>
<PrimaryButton
@click="batchAnalyze"
:disabled="isBatchAnalyzing"
class="!bg-primary hover:!bg-primary/90 !text-white flex items-center gap-2 shadow-primary/20"
>
<svg v-if="isBatchAnalyzing" class="animate-spin h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
</svg>
<svg v-else xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9l-.707.707M12 21v-1m4.243-4.243l-.707-.707m2.828-9.9l-.707.707" />
</svg>
{{ isBatchAnalyzing ? `Analyse ${analysisProgress.current}/${analysisProgress.total}...` : 'Analyse IA groupée' }}
</PrimaryButton>
<div class="h-8 w-px bg-anthracite/10 mx-2 hidden sm:block"></div>
</div>
<PrimaryButton @click="isModalOpen = true">
Ajouter un Candidat
</PrimaryButton>
</div>
</div>
<PrimaryButton @click="isModalOpen = true">
Ajouter un Candidat
</PrimaryButton>
</div>
<!-- Flash Messages -->
<div v-if="flashSuccess" class="mb-8 p-6 bg-emerald-50 dark:bg-emerald-900/20 border border-emerald-200 dark:border-emerald-800 rounded-2xl flex items-center gap-4 animate-in fade-in slide-in-from-top-4 duration-500">
<div class="p-2 bg-emerald-500 rounded-lg text-white">
<div v-if="flashSuccess" class="mb-8 p-6 bg-emerald-50 border border-emerald-200 rounded-2xl flex items-center gap-4 animate-in fade-in slide-in-from-top-4 duration-500 shadow-sm">
<div class="p-2 bg-emerald-500 rounded-lg text-white shadow-sm">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
</svg>
</div>
<div>
<p class="font-bold text-emerald-800 dark:text-emerald-400">Succès !</p>
<p class="text-emerald-700 dark:text-emerald-500 text-sm">{{ flashSuccess }}</p>
<p class="font-bold text-emerald-800">Succès !</p>
<p class="text-emerald-700 text-sm font-medium">{{ flashSuccess }}</p>
</div>
</div>
<!-- Candidates Table -->
<div class="bg-white dark:bg-slate-800 rounded-xl shadow-sm border border-slate-200 dark:border-slate-700 overflow-hidden">
<table class="w-full text-left">
<thead class="bg-slate-50 dark:bg-slate-700/50 border-b border-slate-200 dark:border-slate-700">
<tr>
<th @click="sortBy('user.name')" class="px-6 py-4 font-semibold text-slate-700 dark:text-slate-300 cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-700/50 transition-colors">
<div class="flex items-center gap-2">
Nom
<svg v-show="sortKey === 'user.name'" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" :class="{ 'rotate-180': sortOrder === -1 }" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
</svg>
</div>
</th>
<th @click="sortBy('user.email')" class="px-6 py-4 font-semibold text-slate-700 dark:text-slate-300 cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-700/50 transition-colors">
<div class="flex items-center gap-2">
Email
<svg v-show="sortKey === 'user.email'" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" :class="{ 'rotate-180': sortOrder === -1 }" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
</svg>
</div>
</th>
<th @click="sortBy('tenant.name')" v-if="$page.props.auth.user.role === 'super_admin'" class="px-6 py-4 font-semibold text-slate-700 dark:text-slate-300 cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-700/50 transition-colors">
<div class="flex items-center gap-2">
Structure
<svg v-show="sortKey === 'tenant.name'" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" :class="{ 'rotate-180': sortOrder === -1 }" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
</svg>
</div>
</th>
<th @click="sortBy('job_position.title')" class="px-6 py-4 font-semibold text-slate-700 dark:text-slate-300 cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-700/50 transition-colors">
<div class="flex items-center gap-2">
Fiche de Poste
<svg v-show="sortKey === 'job_position.title'" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" :class="{ 'rotate-180': sortOrder === -1 }" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
</svg>
</div>
</th>
<th @click="sortBy('status')" class="px-6 py-4 font-semibold text-slate-700 dark:text-slate-300 cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-700/50 transition-colors">
<div class="flex items-center gap-2">
Statut
<svg v-show="sortKey === 'status'" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" :class="{ 'rotate-180': sortOrder === -1 }" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
</svg>
</div>
</th>
<th @click="sortBy('weighted_score')" class="px-6 py-4 font-semibold text-slate-700 dark:text-slate-300 cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-700/50 transition-colors">
<div class="flex items-center gap-2">
Score /20
<svg v-show="sortKey === 'weighted_score'" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" :class="{ 'rotate-180': sortOrder === -1 }" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
</svg>
</div>
</th>
<th @click="sortBy('ai_analysis.match_score')" class="px-6 py-4 font-semibold text-slate-700 dark:text-slate-300 cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-700/50 transition-colors">
<div class="flex items-center gap-2">
Adéquation IA
<svg v-show="sortKey === 'ai_analysis.match_score'" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" :class="{ 'rotate-180': sortOrder === -1 }" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
</svg>
</div>
</th>
<th class="px-6 py-4 font-semibold text-slate-700 dark:text-slate-300">Documents</th>
<th class="px-6 py-4 font-semibold text-slate-700 dark:text-slate-300 text-right">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-slate-200 dark:divide-slate-700">
<tr v-for="candidate in sortedCandidates" :key="candidate.id" class="hover:bg-slate-50/50 dark:hover:bg-slate-700/30 transition-colors">
<td class="px-6 py-4">
<div class="font-bold text-slate-900 dark:text-white">{{ candidate.user.name }}</div>
<div class="text-[10px] text-slate-500 font-bold uppercase tracking-tight">{{ candidate.phone }}</div>
</td>
<td class="px-6 py-4 text-sm text-slate-600 dark:text-slate-400">
{{ candidate.user.email }}
</td>
<td class="px-6 py-4 text-xs font-bold uppercase tracking-widest text-indigo-600 dark:text-indigo-400" v-if="$page.props.auth.user.role === 'super_admin'">
{{ candidate.tenant ? candidate.tenant.name : 'Aucun' }}
</td>
<td class="px-6 py-4 text-sm font-semibold text-slate-700 dark:text-slate-300">
{{ candidate.job_position ? candidate.job_position.title : 'Non assigné' }}
</td>
<td class="px-6 py-4 text-xs font-bold uppercase tracking-widest">
<span
class="px-3 py-1 rounded-lg"
:class="{
'bg-amber-50 text-amber-700 border border-amber-200 dark:bg-amber-900/20 dark:border-amber-800 dark:text-amber-400': candidate.status === 'en_attente',
'bg-indigo-50 text-indigo-700 border border-indigo-200 dark:bg-indigo-900/20 dark:border-indigo-800 dark:text-indigo-400': candidate.status === 'en_cours',
'bg-emerald-50 text-emerald-700 border border-emerald-200 dark:bg-emerald-900/20 dark:border-emerald-800 dark:text-emerald-400': candidate.status === 'termine'
}"
>
{{ candidate.status }}
</span>
</td>
<td class="px-6 py-4">
<div class="flex items-center gap-2">
<div class="w-12 h-1.5 bg-slate-100 dark:bg-slate-700 rounded-full overflow-hidden">
<div
class="h-full rounded-full transition-all duration-500"
:style="{ width: (candidate.weighted_score / 20) * 100 + '%' }"
:class="{
'bg-emerald-500': candidate.weighted_score >= 14,
'bg-amber-500': candidate.weighted_score >= 10 && candidate.weighted_score < 14,
'bg-rose-500': candidate.weighted_score < 10
}"
></div>
<div class="bg-white rounded-3xl shadow-sm border border-anthracite/5 overflow-hidden">
<div class="overflow-x-auto">
<table class="w-full text-left border-collapse">
<thead class="bg-neutral/50 border-b border-anthracite/5">
<tr>
<th class="w-12 px-8 py-5">
<input
type="checkbox"
:checked="selectedIds.length === sortedCandidates.length && sortedCandidates.length > 0"
@change="toggleSelectAll"
class="rounded border-anthracite/20 text-primary focus:ring-primary/20 cursor-pointer"
>
</th>
<th class="w-12 px-4 py-5"></th>
<th @click="sortBy('user.name')" class="px-8 py-5 text-[10px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40 cursor-pointer hover:text-primary transition-colors">
<div class="flex items-center gap-2">
Nom
<svg v-show="sortKey === 'user.name'" xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" :class="{ 'rotate-180': sortOrder === -1 }" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" /></svg>
</div>
<span class="font-black text-sm" :class="{
'text-emerald-600': candidate.weighted_score >= 14,
'text-amber-600': candidate.weighted_score >= 10 && candidate.weighted_score < 14,
'text-rose-600': candidate.weighted_score < 10
}">
{{ candidate.weighted_score }}
</th>
<th @click="sortBy('user.email')" class="px-8 py-5 text-[10px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40 cursor-pointer hover:text-primary transition-colors">
<div class="flex items-center gap-2">
Contact
<svg v-show="sortKey === 'user.email'" xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" :class="{ 'rotate-180': sortOrder === -1 }" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" /></svg>
</div>
</th>
<th @click="sortBy('tenant.name')" v-if="$page.props.auth.user.role === 'super_admin'" class="px-8 py-5 text-[10px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40 cursor-pointer hover:text-primary transition-colors">
<div class="flex items-center gap-2">
Structure
<svg v-show="sortKey === 'tenant.name'" xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" :class="{ 'rotate-180': sortOrder === -1 }" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" /></svg>
</div>
</th>
<th @click="sortBy('job_position.title')" class="px-8 py-5 text-[10px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40 cursor-pointer hover:text-primary transition-colors">
<div class="flex items-center gap-2">
Poste Ciblé
<svg v-show="sortKey === 'job_position.title'" xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" :class="{ 'rotate-180': sortOrder === -1 }" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" /></svg>
</div>
</th>
<th @click="sortBy('status')" class="px-8 py-5 text-[10px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40 cursor-pointer hover:text-primary transition-colors">
<div class="flex items-center gap-2">
Statut
<svg v-show="sortKey === 'status'" xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" :class="{ 'rotate-180': sortOrder === -1 }" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" /></svg>
</div>
</th>
<th @click="sortBy('weighted_score')" class="px-8 py-5 text-[10px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40 cursor-pointer hover:text-primary transition-colors">
<div class="flex items-center gap-2">
Score
<svg v-show="sortKey === 'weighted_score'" xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" :class="{ 'rotate-180': sortOrder === -1 }" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" /></svg>
</div>
</th>
<th @click="sortBy('ai_analysis.match_score')" class="px-8 py-5 text-[10px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40 cursor-pointer hover:text-primary transition-colors">
<div class="flex items-center gap-2">
IA Match
<svg v-show="sortKey === 'ai_analysis.match_score'" xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" :class="{ 'rotate-180': sortOrder === -1 }" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" /></svg>
</div>
</th>
<th class="px-8 py-5 text-[10px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40">Docs</th>
<th class="px-8 py-5 text-[10px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40 text-right">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-anthracite/5">
<tr v-for="candidate in sortedCandidates" :key="candidate.id" class="hover:bg-sand/30 transition-colors group" :class="{ 'bg-primary/5': selectedIds.includes(candidate.id) }">
<td class="px-8 py-5">
<input
type="checkbox"
:value="candidate.id"
v-model="selectedIds"
class="rounded border-anthracite/20 text-primary focus:ring-primary/20 cursor-pointer"
>
</td>
<td class="px-4 py-5 text-center">
<button @click="toggleSelection(candidate.id)" class="text-anthracite/20 hover:text-highlight hover:-translate-y-0.5 transition-all focus:outline-none" :class="{ '!text-highlight drop-shadow-sm scale-110': candidate.is_selected }" :title="candidate.is_selected ? 'Retirer des retenus' : 'Marquer comme retenu'">
<svg v-if="candidate.is_selected" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" />
</svg>
<svg v-else xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z" />
</svg>
</button>
</td>
<td class="px-8 py-5">
<Link :href="route('admin.candidates.show', candidate.id)" class="font-black text-primary group-hover:text-highlight transition-colors block">
{{ candidate.user.name }}
</Link>
<div class="text-[10px] text-anthracite/50 font-bold uppercase tracking-tight mt-0.5">{{ candidate.phone || 'Pas de numéro' }}</div>
</td>
<td class="px-8 py-5 text-xs text-anthracite/70 font-medium">
{{ candidate.user.email }}
</td>
<td class="px-8 py-5 text-[10px] font-black uppercase tracking-widest text-primary/60" v-if="$page.props.auth.user.role === 'super_admin'">
{{ candidate.tenant ? candidate.tenant.name : 'Aucune' }}
</td>
<td class="px-8 py-5 text-xs font-bold text-anthracite">
{{ candidate.job_position ? candidate.job_position.title : 'Non assigné' }}
</td>
<td class="px-8 py-5">
<span
class="px-3 py-1 text-[10px] font-black uppercase tracking-[0.15em] rounded-full"
:class="{
'bg-anthracite/5 text-anthracite/60 border border-anthracite/10': candidate.status === 'en_attente',
'bg-sky/10 text-sky border border-sky/20': candidate.status === 'en_cours',
'bg-emerald-50 text-emerald-700 border border-emerald-200': candidate.status === 'termine',
'bg-accent/10 text-accent border border-accent/20': candidate.status === 'refuse'
}"
>
{{ candidate.status }}
</span>
</div>
</td>
<td class="px-6 py-4">
<div v-if="candidate.ai_analysis" class="flex items-center gap-2">
<div
class="px-2 py-0.5 rounded text-[10px] font-black"
:class="[
candidate.ai_analysis.match_score >= 80 ? 'bg-emerald-100 text-emerald-700' :
candidate.ai_analysis.match_score >= 60 ? 'bg-amber-100 text-amber-700' :
'bg-red-100 text-red-700'
]"
>
{{ candidate.ai_analysis.match_score }}%
</td>
<td class="px-8 py-5">
<div class="inline-flex items-center gap-2 px-3 py-1 bg-primary/5 text-primary rounded-xl font-black text-sm border border-primary/10 shadow-sm">
{{ candidate.weighted_score }} <span class="opacity-50 text-[10px]">/ 20</span>
</div>
<span class="text-[10px] font-bold text-slate-400 uppercase truncate max-w-[60px]">{{ candidate.ai_analysis.verdict }}</span>
</div>
<span v-else class="text-[10px] text-slate-300 italic">Non analysé</span>
</td>
<td class="px-6 py-4">
<div class="flex gap-2">
<button
v-for="doc in candidate.documents"
:key="doc.id"
@click="openPreview(doc)"
class="p-2 bg-slate-100 dark:bg-slate-700 rounded-lg hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"
:title="doc.type.toUpperCase()"
>
<svg v-if="doc.type === 'cv'" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-indigo-600 dark:text-indigo-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
<svg v-else xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-emerald-600 dark:text-emerald-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
</svg>
</button>
</div>
</td>
<td class="px-6 py-4 text-right">
<div class="flex items-center justify-end gap-3">
<Link :href="route('admin.candidates.show', candidate.id)" class="text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 dark:hover:text-indigo-300 font-medium">Détails</Link>
<button @click="deleteCandidate(candidate.id)" class="p-2 text-slate-400 hover:text-red-600 transition-colors" title="Supprimer">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
</svg>
</button>
</div>
</td>
</tr>
<tr v-if="candidates.length === 0">
<td colspan="7" class="px-6 py-12 text-center text-slate-500 italic">
Aucun candidat trouvé.
</td>
</tr>
</tbody>
</table>
</td>
<td class="px-8 py-5">
<div v-if="candidate.ai_analysis" class="flex items-center gap-2">
<div
class="px-2 py-0.5 rounded-lg text-[10px] font-black shadow-sm"
:class="[
candidate.ai_analysis.match_score >= 80 ? 'bg-emerald-50 text-emerald-700 border border-emerald-200' :
candidate.ai_analysis.match_score >= 60 ? 'bg-highlight/10 text-[#3a2800] border border-highlight/30' :
'bg-accent/10 text-accent border border-accent/20'
]"
>
{{ candidate.ai_analysis.match_score }}%
</div>
<span class="text-[9px] font-bold text-anthracite/40 uppercase truncate max-w-[60px]" :title="candidate.ai_analysis.verdict">{{ candidate.ai_analysis.verdict }}</span>
</div>
<span v-else class="text-[9px] font-bold uppercase tracking-widest text-anthracite/30 italic">Non analysé</span>
</td>
<td class="px-8 py-5">
<div class="flex gap-1.5">
<button
v-for="doc in candidate.documents"
:key="doc.id"
@click="openPreview(doc)"
class="p-1.5 bg-neutral text-anthracite/40 rounded-lg hover:bg-primary/10 hover:text-primary transition-colors"
:title="doc.type.toUpperCase()"
>
<svg v-if="doc.type === 'cv'" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /></svg>
<svg v-else xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" /></svg>
</button>
<span v-if="candidate.documents.length === 0" class="text-anthracite/20 text-xs">-</span>
</div>
</td>
<td class="px-8 py-5 text-right">
<div class="flex items-center justify-end gap-2">
<Link :href="route('admin.candidates.show', candidate.id)" class="p-2 text-primary/40 hover:text-highlight hover:bg-highlight/10 rounded-xl transition-all" title="Détails">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" /></svg>
</Link>
<button @click="deleteCandidate(candidate.id)" class="p-2 text-anthracite/20 hover:text-accent hover:bg-accent/10 rounded-xl transition-all" title="Supprimer">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" /></svg>
</button>
</div>
</td>
</tr>
<tr v-if="candidates.length === 0">
<td colspan="11" class="px-8 py-16 text-center">
<div class="text-anthracite/40 italic font-medium font-subtitle">
Aucun candidat trouvé.
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Add Candidate Modal -->

File diff suppressed because it is too large Load Diff

View File

@@ -10,7 +10,8 @@ import InputError from '@/Components/InputError.vue';
const props = defineProps({
jobPositions: Array,
tenants: Array
tenants: Array,
quizzes: Array
});
const showingModal = ref(false);
@@ -21,7 +22,9 @@ const form = useForm({
description: '',
requirements: [],
ai_prompt: '',
ai_bypass_base_prompt: false,
tenant_id: '',
quiz_ids: [],
});
const openModal = (position = null) => {
@@ -31,7 +34,9 @@ const openModal = (position = null) => {
form.description = position.description;
form.requirements = position.requirements || [];
form.ai_prompt = position.ai_prompt || '';
form.ai_bypass_base_prompt = !!position.ai_bypass_base_prompt;
form.tenant_id = position.tenant_id || '';
form.quiz_ids = position.quizzes ? position.quizzes.map(q => q.id) : [];
} else {
form.reset();
}
@@ -201,6 +206,44 @@ const removeRequirement = (index) => {
placeholder="Ex: Sois particulièrement attentif à l'expérience sur des projets SaaS à forte charge. Favorise les candidats ayant travaillé en environnement Agile."
></textarea>
<InputError :message="form.errors.ai_prompt" />
<div class="mt-4 flex items-center">
<label class="relative inline-flex items-center cursor-pointer">
<input
type="checkbox"
v-model="form.ai_bypass_base_prompt"
class="sr-only peer"
>
<div class="w-11 h-6 bg-slate-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-indigo-300 dark:peer-focus:ring-indigo-800 rounded-full peer dark:bg-slate-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-indigo-600"></div>
<span class="ml-3 text-xs font-black uppercase tracking-widest text-indigo-900 dark:text-indigo-100">Ignorer le prompt de base (Utiliser exclusivement ce texte)</span>
</label>
</div>
</div>
<div v-if="quizzes && quizzes.length > 0">
<label class="block text-xs font-black uppercase tracking-widest text-slate-400 mb-4">Tests techniques associés</label>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
<div
v-for="quiz in quizzes"
:key="quiz.id"
class="flex items-center p-3 bg-slate-50 dark:bg-slate-900 rounded-2xl cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors"
@click="form.quiz_ids.includes(quiz.id) ? form.quiz_ids = form.quiz_ids.filter(id => id !== quiz.id) : form.quiz_ids.push(quiz.id)"
>
<div
class="w-5 h-5 rounded-md border-2 mr-3 flex items-center justify-center transition-all"
:class="form.quiz_ids.includes(quiz.id) ? 'bg-indigo-600 border-indigo-600' : 'border-slate-300 dark:border-slate-600'"
>
<svg v-if="form.quiz_ids.includes(quiz.id)" xmlns="http://www.w3.org/2000/svg" class="h-3 w-3 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M5 13l4 4L19 7" />
</svg>
</div>
<div>
<div class="text-xs font-bold leading-tight">{{ quiz.title }}</div>
<div class="text-[9px] text-slate-400 uppercase tracking-tighter">{{ quiz.duration_minutes }} min</div>
</div>
</div>
</div>
<InputError :message="form.errors.quiz_ids" />
</div>
<div>

View File

@@ -0,0 +1,88 @@
<script setup>
import { Head, Link } from '@inertiajs/vue3';
import AdminLayout from '@/Layouts/AdminLayout.vue';
import { format } from 'date-fns';
import { fr } from 'date-fns/locale';
const props = defineProps({
logs: Object // Paginated object
});
const formatDate = (dateString) => {
return format(new Date(dateString), 'PPP à HH:mm', { locale: fr });
};
</script>
<template>
<Head title="Logs de connexion" />
<AdminLayout>
<template #header>Logs de connexion</template>
<div class="mb-6 flex justify-between items-center">
<h1 class="text-2xl font-serif font-black text-primary capitalize tracking-tight flex items-center gap-3">
<div class="w-1.5 h-8 bg-highlight rounded-full"></div>
Historique des Connexions
</h1>
</div>
<div class="bg-white rounded-3xl shadow-sm border border-anthracite/5 overflow-hidden">
<div class="overflow-x-auto">
<table class="w-full text-left border-collapse">
<thead class="bg-neutral/50 border-b border-anthracite/5">
<tr>
<th class="px-8 py-5 text-[10px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40">Utilisateur</th>
<th class="px-8 py-5 text-[10px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40">Structure</th>
<th class="px-8 py-5 text-[10px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40">Adresse IP</th>
<th class="px-8 py-5 text-[10px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40">Date & Heure</th>
<th class="px-8 py-5 text-[10px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40">Appareil / Navigateur</th>
</tr>
</thead>
<tbody class="divide-y divide-anthracite/5">
<tr v-for="log in logs.data" :key="log.id" class="hover:bg-sand/30 transition-colors">
<td class="px-8 py-5">
<div class="font-bold text-primary">{{ log.user.name }}</div>
<div class="text-xs text-anthracite/50">{{ log.user.email }}</div>
</td>
<td class="px-8 py-5 text-xs font-bold text-anthracite">
{{ log.user.tenant ? log.user.tenant.name : 'Super Admin / Global' }}
</td>
<td class="px-8 py-5 text-xs font-mono text-anthracite/70">
{{ log.ip_address }}
</td>
<td class="px-8 py-5 text-xs font-bold text-anthracite">
{{ formatDate(log.login_at) }}
</td>
<td class="px-8 py-5 text-[10px] text-anthracite/50 max-w-xs truncate" :title="log.user_agent">
{{ log.user_agent }}
</td>
</tr>
<tr v-if="logs.data.length === 0">
<td colspan="5" class="px-8 py-16 text-center text-anthracite/40 italic">
Aucun log de connexion trouvé.
</td>
</tr>
</tbody>
</table>
</div>
<!-- Simple Pagination -->
<div v-if="logs.links.length > 3" class="px-8 py-4 bg-neutral/30 border-t border-anthracite/5 flex justify-center gap-2">
<Link
v-for="link in logs.links"
:key="link.label"
:href="link.url || '#'"
class="px-3 py-1 rounded-lg text-xs font-bold transition-all"
:class="[
link.active ? 'bg-primary text-white' : 'bg-white text-primary hover:bg-highlight hover:text-white',
!link.url ? 'opacity-50 cursor-not-allowed' : ''
]"
v-html="link.label"
/>
</div>
</div>
<div class="mt-6 p-4 bg-highlight/10 border border-highlight/20 rounded-2xl text-xs text-[#3a2800]/60 font-medium">
<p><strong>Note :</strong> Les logs sont conservés pendant une période de 1 mois. Un nettoyage automatique est effectué quotidiennement.</p>
</div>
</AdminLayout>
</template>

View File

@@ -1,8 +1,11 @@
<script setup>
import { Head, useForm, Link } from '@inertiajs/vue3';
import { ref } from 'vue';
import { Head, useForm, Link, usePage } from '@inertiajs/vue3';
import { ref, computed } from 'vue';
import AdminLayout from '@/Layouts/AdminLayout.vue';
const page = usePage();
const flashSuccess = computed(() => page.props.flash?.success);
const props = defineProps({
users: Array,
tenants: Array
@@ -51,6 +54,12 @@ const deleteUser = (user) => {
}
};
const resetPassword = (user) => {
if (confirm(`Êtes-vous sûr de vouloir réinitialiser le mot de passe de ${user.name} ? Un nouveau mot de passe sera généré aléatoirement.`)) {
form.post(route('admin.users.reset-password', user.id));
}
};
const cancel = () => {
isCreating.value = false;
editingUser.value = null;
@@ -63,6 +72,19 @@ const cancel = () => {
<AdminLayout>
<template #header>Équipe / Utilisateurs Admin</template>
<!-- Flash Messages -->
<div v-if="flashSuccess" class="mb-8 p-6 bg-emerald-50 dark:bg-emerald-900/20 border border-emerald-200 dark:border-emerald-800 rounded-xl flex items-center gap-4 animate-in fade-in slide-in-from-top-4 duration-500">
<div class="p-2 bg-emerald-500 rounded-lg text-white">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
</svg>
</div>
<div class="flex-1">
<p class="font-bold text-emerald-800 dark:text-emerald-400">Action réussie !</p>
<p class="text-emerald-700 dark:text-emerald-500 text-sm">{{ flashSuccess }}</p>
</div>
</div>
<div class="mb-6 flex justify-between items-center">
<h1 class="text-2xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-blue-500 to-indigo-500">
Administrateurs Plateforme
@@ -136,6 +158,9 @@ const cancel = () => {
{{ user.tenant ? user.tenant.name : (user.role === 'super_admin' ? 'Toutes les structures' : 'Aucun rattachement') }}
</td>
<td class="py-3 px-6 text-right space-x-2">
<button v-if="page.props.auth.user.role === 'super_admin'" @click="resetPassword(user)" class="text-orange-600 hover:text-orange-900 px-3 py-1 rounded bg-orange-50 hover:bg-orange-100 transition-colors" title="Réinitialiser le mot de passe">
MDP
</button>
<button @click="editUser(user)" class="text-indigo-600 hover:text-indigo-900 px-3 py-1 rounded bg-indigo-50 hover:bg-indigo-100 transition-colors">Modifier</button>
<button @click="deleteUser(user)" class="text-red-600 hover:text-red-900 px-3 py-1 rounded bg-red-50 hover:bg-red-100 transition-colors">Supprimer</button>
</td>

View File

@@ -31,69 +31,77 @@ const submit = () => {
<template>
<GuestLayout>
<Head title="Log in" />
<Head title="Connexion" />
<div v-if="status" class="mb-4 text-sm font-medium text-green-600">
<div v-if="status" class="mb-4 text-sm font-medium text-emerald-600 bg-emerald-50 p-3 rounded-lg">
{{ status }}
</div>
<form @submit.prevent="submit">
<div class="mb-8 text-center space-y-1">
<h2 class="text-2xl font-serif font-black text-primary">Bon retour !</h2>
<p class="text-anthracite/60 text-sm">Veuillez entrer vos identifiants.</p>
</div>
<form @submit.prevent="submit" class="space-y-5">
<div>
<InputLabel for="email" value="Email" />
<InputLabel for="email" value="Adresse Email" class="!font-subtitle !text-xs !uppercase !tracking-widest !text-anthracite/60 !mb-1" />
<TextInput
id="email"
type="email"
class="mt-1 block w-full"
class="mt-1 block w-full !rounded-xl !border-anthracite/10 focus:!border-primary focus:!ring-primary/20 shadow-sm transition-colors text-sm"
v-model="form.email"
required
autofocus
autocomplete="username"
placeholder="prenom.nom@exemple.com"
/>
<InputError class="mt-2" :message="form.errors.email" />
</div>
<div class="mt-4">
<InputLabel for="password" value="Password" />
<div>
<div class="flex justify-between items-center mb-1">
<InputLabel for="password" value="Mot de passe" class="!font-subtitle !text-xs !uppercase !tracking-widest !text-anthracite/60 !mb-0" />
<Link
v-if="canResetPassword"
:href="route('password.request')"
class="text-[10px] font-bold text-accent hover:text-accent/80 transition-colors uppercase tracking-wider"
>
Oublié ?
</Link>
</div>
<TextInput
id="password"
type="password"
class="mt-1 block w-full"
class="mt-1 block w-full !rounded-xl !border-anthracite/10 focus:!border-primary focus:!ring-primary/20 shadow-sm transition-colors text-sm"
v-model="form.password"
required
autocomplete="current-password"
placeholder="••••••••"
/>
<InputError class="mt-2" :message="form.errors.password" />
</div>
<div class="mt-4 block">
<label class="flex items-center">
<Checkbox name="remember" v-model:checked="form.remember" />
<span class="ms-2 text-sm text-gray-600"
>Remember me</span
>
<div class="block pt-2">
<label class="flex items-center group cursor-pointer w-max">
<Checkbox name="remember" v-model:checked="form.remember" class="!rounded !border-anthracite/20 text-primary focus:ring-primary shadow-sm group-hover:border-primary transition-colors" />
<span class="ms-2 text-sm text-anthracite/60 group-hover:text-anthracite transition-colors">Rester connecté</span>
</label>
</div>
<div class="mt-4 flex items-center justify-end">
<Link
v-if="canResetPassword"
:href="route('password.request')"
class="rounded-md text-sm text-gray-600 underline hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
>
Forgot your password?
</Link>
<PrimaryButton
class="ms-4"
:class="{ 'opacity-25': form.processing }"
<div class="pt-4">
<button
type="submit"
:class="{ 'opacity-50 cursor-not-allowed': form.processing }"
:disabled="form.processing"
class="w-full flex justify-center py-3.5 px-4 bg-highlight text-[#3a2800] rounded-xl font-subtitle font-bold shadow-md shadow-highlight/20 hover:brightness-110 hover:-translate-y-0.5 hover:shadow-lg hover:shadow-highlight/30 transition-all text-sm uppercase tracking-widest focus:outline-none focus:ring-2 focus:ring-highlight/50 focus:ring-offset-2"
>
Log in
</PrimaryButton>
Se connecter
</button>
</div>
</form>
</GuestLayout>

View File

@@ -10,7 +10,7 @@ const props = defineProps({
const currentQuestionIndex = ref(0);
const answers = ref({});
const timeLeft = ref(props.quiz.duration_minutes * 60);
const timeLeft = ref(props.quiz?.duration_minutes ? props.quiz.duration_minutes * 60 : 0);
let timer = null;
// Initialize answers from existing attempt answers if any
@@ -58,8 +58,8 @@ const formatTime = (seconds) => {
return `${mins}:${secs.toString().padStart(2, '0')}`;
};
const currentQuestion = computed(() => props.quiz.questions[currentQuestionIndex.value]);
const progress = computed(() => ((currentQuestionIndex.value + 1) / props.quiz.questions.length) * 100);
const currentQuestion = computed(() => props.quiz.questions?.[currentQuestionIndex.value] ?? null);
const progress = computed(() => props.quiz.questions?.length ? ((currentQuestionIndex.value + 1) / props.quiz.questions.length) * 100 : 0);
const saveAnswer = async () => {
const qid = currentQuestion.value.id;
@@ -150,8 +150,13 @@ const finishQuiz = () => {
<!-- Main Content -->
<main class="flex-1 flex flex-col items-center justify-center p-8">
<div class="w-full max-w-3xl">
<!-- Guard: only render if quiz has questions -->
<div v-if="!quiz.questions || !quiz.questions.length" class="text-center py-12">
<p class="text-slate-400 italic">Aucune question disponible pour ce test.</p>
</div>
<!-- Question Card -->
<div class="bg-slate-800/50 backdrop-blur-xl rounded-3xl p-8 sm:p-12 border border-slate-700 shadow-2xl relative overflow-hidden group">
<div v-else class="bg-slate-800/50 backdrop-blur-xl rounded-3xl p-8 sm:p-12 border border-slate-700 shadow-2xl relative overflow-hidden group">
<!-- Subtle background glow -->
<div class="absolute -top-24 -right-24 w-64 h-64 bg-indigo-600/10 blur-[100px] rounded-full group-hover:bg-indigo-600/20 transition-all duration-700"></div>
@@ -202,7 +207,8 @@ const finishQuiz = () => {
<textarea
class="w-full h-48 bg-slate-700/30 border border-slate-600 rounded-2xl p-6 focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 transition-all outline-none resize-none text-lg"
placeholder="Saisissez votre réponse ici..."
v-model="answers[currentQuestion.id].text_content"
:value="answers[currentQuestion.id]?.text_content ?? ''"
@input="updateOpenAnswer($event.target.value)"
@blur="saveAnswer"
></textarea>
</div>

View File

@@ -38,82 +38,115 @@ const getStatusColor = (status) => {
<span v-if="user.role === 'super_admin'" class="bg-gradient-to-r from-red-600 to-orange-500 text-white px-3 py-1 rounded-full text-[10px] font-black tracking-widest uppercase shadow-sm">
GOD MODE
</span>
<span v-else-if="user.tenant" class="bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-400 border border-indigo-200 dark:border-indigo-800 px-3 py-1 rounded-full text-[10px] font-black tracking-widest uppercase">
<span v-else-if="user.tenant" class="bg-indigo-600 text-white dark:bg-indigo-500/20 dark:text-indigo-300 px-3 py-1 rounded-full text-[10px] font-black tracking-widest uppercase border border-indigo-700 dark:border-indigo-400/30">
Structure : {{ user.tenant.name }}
</span>
</div>
</template>
<div v-if="isAdmin" class="p-8 space-y-8">
<div v-if="isAdmin" class="space-y-8 font-sans text-anthracite">
<!-- KPI Cards -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<div class="bg-white dark:bg-slate-800 p-6 rounded-3xl shadow-sm border border-slate-200 dark:border-slate-700 hover:shadow-xl transition-all duration-300">
<div class="text-slate-500 dark:text-slate-400 text-[10px] font-black uppercase tracking-widest">Total Candidats</div>
<div class="text-4xl font-black mt-2 text-indigo-600 dark:text-indigo-400">{{ stats.total_candidates }}</div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-6">
<!-- Total Candidats -->
<div class="bg-white p-6 rounded-3xl shadow-sm border border-anthracite/5 hover:-translate-y-1 hover:shadow-xl hover:shadow-primary/5 transition-all duration-300 relative overflow-hidden group">
<div class="text-[10px] font-subtitle font-black uppercase tracking-widest text-anthracite/40">Total Candidats</div>
<div class="text-4xl font-black mt-3 text-primary">{{ stats.total_candidates }}</div>
<div class="absolute bottom-0 right-0 w-24 h-24 bg-[radial-gradient(ellipse_at_bottom_right,_var(--tw-gradient-stops))] from-primary/10 to-transparent"></div>
</div>
<div class="bg-white dark:bg-slate-800 p-6 rounded-3xl shadow-sm border border-slate-200 dark:border-slate-700 hover:shadow-xl transition-all duration-300">
<div class="text-slate-500 dark:text-slate-400 text-[10px] font-black uppercase tracking-widest">Tests terminés</div>
<div class="text-4xl font-black mt-2 text-emerald-600 dark:text-emerald-400">{{ stats.finished_tests }}</div>
<!-- Candidats Retenus -->
<div class="bg-white p-6 rounded-3xl shadow-sm border border-anthracite/5 hover:-translate-y-1 hover:shadow-xl hover:shadow-highlight/20 transition-all duration-300 relative overflow-hidden group">
<div class="absolute inset-0 bg-gradient-to-br from-highlight/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"></div>
<div class="relative z-10">
<div class="text-highlight text-[10px] font-subtitle font-black uppercase tracking-widest flex items-center gap-1.5">
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" viewBox="0 0 20 20" fill="currentColor">
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" />
</svg>
Retenus
</div>
<div class="text-4xl font-black mt-3 text-highlight drop-shadow-sm">{{ stats.selected_candidates }}</div>
</div>
</div>
<div class="bg-white dark:bg-slate-800 p-6 rounded-3xl shadow-sm border border-slate-200 dark:border-slate-700 hover:shadow-xl transition-all duration-300">
<div class="text-slate-500 dark:text-slate-400 text-[10px] font-black uppercase tracking-widest">Moyenne Générale</div>
<div class="text-4xl font-black mt-2 text-blue-600 dark:text-blue-400">{{ stats.average_score }} / 20</div>
<!-- Tests terminés -->
<div class="bg-white p-6 rounded-3xl shadow-sm border border-anthracite/5 hover:-translate-y-1 hover:shadow-xl hover:shadow-emerald-500/10 transition-all duration-300 relative overflow-hidden group">
<div class="text-[10px] font-subtitle font-black uppercase tracking-widest text-anthracite/40">Tests terminés</div>
<div class="text-4xl font-black mt-3 text-emerald-500">{{ stats.finished_tests }}</div>
<div class="absolute bottom-0 right-0 w-24 h-24 bg-[radial-gradient(ellipse_at_bottom_right,_var(--tw-gradient-stops))] from-emerald-500/10 to-transparent"></div>
</div>
<div class="bg-white dark:bg-slate-800 p-6 rounded-3xl shadow-sm border border-slate-200 dark:border-slate-700 hover:shadow-xl transition-all duration-300">
<div class="text-slate-500 dark:text-slate-400 text-[10px] font-black uppercase tracking-widest">Meilleur Score</div>
<div class="text-4xl font-black mt-2 text-amber-600 dark:text-amber-400">{{ stats.best_score }} / 20</div>
<!-- Moyenne Générale -->
<div class="bg-white p-6 rounded-3xl shadow-sm border border-anthracite/5 hover:-translate-y-1 hover:shadow-xl hover:shadow-sky/10 transition-all duration-300 relative overflow-hidden group">
<div class="text-[10px] font-subtitle font-black uppercase tracking-widest text-anthracite/40">Moyenne Générale</div>
<div class="text-4xl font-black mt-3 text-sky">{{ stats.average_score }} <span class="text-lg opacity-50 font-bold">/ 20</span></div>
<div class="absolute bottom-0 right-0 w-24 h-24 bg-[radial-gradient(ellipse_at_bottom_right,_var(--tw-gradient-stops))] from-sky/10 to-transparent"></div>
</div>
<!-- Meilleur Score -->
<div class="bg-white p-6 rounded-3xl shadow-sm border border-anthracite/5 hover:-translate-y-1 hover:shadow-xl hover:shadow-accent/10 transition-all duration-300 relative overflow-hidden group">
<div class="text-[10px] font-subtitle font-black uppercase tracking-widest text-anthracite/40">Meilleur Score</div>
<div class="text-4xl font-black mt-3 text-accent">{{ stats.best_score }} <span class="text-lg opacity-50 font-bold">/ 20</span></div>
<div class="absolute bottom-0 right-0 w-24 h-24 bg-[radial-gradient(ellipse_at_bottom_right,_var(--tw-gradient-stops))] from-accent/10 to-transparent"></div>
</div>
</div>
<!-- Top Candidates Table -->
<div class="bg-white dark:bg-slate-800 shadow-sm border border-slate-200 dark:border-slate-700 rounded-3xl overflow-hidden">
<div class="px-8 py-6 border-b border-slate-100 dark:border-slate-700 flex justify-between items-center bg-slate-50/50 dark:bg-slate-900/50">
<h3 class="text-xl font-black uppercase tracking-tight">Top 10 Candidats</h3>
<Link :href="route('admin.candidates.index')" class="text-xs font-bold uppercase tracking-widest text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 transition-colors">
Voir tous les candidats
<div class="bg-white shadow-sm border border-anthracite/5 rounded-3xl overflow-hidden mt-8">
<div class="px-8 py-6 border-b border-anthracite/5 flex justify-between items-center bg-sand/30">
<h3 class="text-xl font-serif font-black text-primary capitalize tracking-tight flex items-center gap-3">
<div class="w-1.5 h-6 bg-highlight rounded-full hidden md:block"></div>
Top 10 Candidats
</h3>
<Link :href="route('admin.candidates.index')" class="text-xs font-subtitle font-bold uppercase tracking-widest text-primary hover:text-highlight transition-colors flex items-center gap-1">
Voir tous <span class="hidden sm:inline">les candidats</span> &rarr;
</Link>
</div>
<div class="overflow-x-auto">
<table class="w-full text-left border-collapse">
<thead>
<tr class="bg-slate-50/50 dark:bg-slate-900/30">
<th class="px-8 py-4 text-[10px] font-black uppercase tracking-[0.2em] text-slate-400">Candidat</th>
<th class="px-8 py-4 text-[10px] font-black uppercase tracking-[0.2em] text-slate-400">Score Pondéré</th>
<th class="px-8 py-4 text-[10px] font-black uppercase tracking-[0.2em] text-slate-400">Adéquation IA</th>
<th class="px-8 py-4 text-[10px] font-black uppercase tracking-[0.2em] text-slate-400">Statut</th>
<th class="px-8 py-4 text-[10px] font-black uppercase tracking-[0.2em] text-slate-400 text-right">Actions</th>
<tr class="bg-neutral/50">
<th class="px-8 py-4 text-[10px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40">Candidat</th>
<th class="px-8 py-4 text-[10px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40">Score Pondéré</th>
<th class="px-8 py-4 text-[10px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40">Adéquation IA</th>
<th class="px-8 py-4 text-[10px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40">Statut</th>
<th class="px-8 py-4 text-[10px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40 text-right">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-slate-100 dark:divide-slate-800">
<tr v-for="candidate in top_candidates" :key="candidate.id" class="hover:bg-slate-50 dark:hover:bg-slate-900/50 transition-colors group">
<tbody class="divide-y divide-anthracite/5">
<tr v-for="candidate in top_candidates" :key="candidate.id" class="hover:bg-sand/30 transition-colors group">
<td class="px-8 py-5">
<div class="font-bold text-slate-900 dark:text-slate-100 group-hover:text-indigo-600 transition-colors">{{ candidate.name }}</div>
<div class="text-xs text-slate-500 dark:text-slate-400">{{ candidate.email }}</div>
<div class="font-bold text-primary group-hover:text-highlight transition-colors block">{{ candidate.name }}</div>
<div class="text-xs text-anthracite/50 font-subtitle tracking-wide mt-0.5">{{ candidate.email }}</div>
</td>
<td class="px-8 py-5">
<div class="inline-flex items-center gap-2 px-4 py-1.5 bg-indigo-50 dark:bg-indigo-900/30 text-indigo-600 dark:text-indigo-400 rounded-full font-black text-sm border border-indigo-100 dark:border-indigo-800">
{{ candidate.weighted_score }} / 20
<div class="inline-flex items-center gap-2 px-4 py-1.5 bg-primary/5 text-primary rounded-xl font-black text-sm border border-primary/10 shadow-sm">
{{ candidate.weighted_score }} <span class="opacity-50 text-xs">/ 20</span>
</div>
</td>
<td class="px-8 py-5">
<div v-if="candidate.ai_analysis" class="flex items-center gap-2">
<div
class="px-2 py-0.5 rounded text-[10px] font-black"
class="px-3 py-1 rounded-lg text-xs font-black shadow-sm"
:class="[
candidate.ai_analysis.match_score >= 80 ? 'bg-emerald-100 text-emerald-700' :
candidate.ai_analysis.match_score >= 60 ? 'bg-amber-100 text-amber-700' :
'bg-red-100 text-red-700'
candidate.ai_analysis.match_score >= 80 ? 'bg-emerald-50 text-emerald-700 border border-emerald-200' :
candidate.ai_analysis.match_score >= 60 ? 'bg-highlight/10 text-[#3a2800] border border-highlight/30' :
'bg-accent/10 text-accent border border-accent/20'
]"
>
{{ candidate.ai_analysis.match_score }}%
</div>
</div>
<span v-else class="text-[10px] text-slate-300 italic font-medium">Non analysé</span>
<span v-else class="text-[10px] uppercase tracking-widest text-anthracite/30 italic font-bold">Non analysé</span>
</td>
<td class="px-8 py-5">
<span
class="px-3 py-1 text-[10px] font-black uppercase tracking-widest rounded-full"
:class="getStatusColor(candidate.status)"
class="px-3 py-1 text-[10px] font-black uppercase tracking-[0.15em] rounded-full"
:class="{
'bg-anthracite/5 text-anthracite/60 border border-anthracite/10': candidate.status === 'en_attente',
'bg-sky/10 text-sky border border-sky/20': candidate.status === 'en_cours',
'bg-emerald-50 text-emerald-700 border border-emerald-200': candidate.status === 'termine',
'bg-accent/10 text-accent border border-accent/20': candidate.status === 'refuse'
}"
>
{{ candidate.status }}
</span>
@@ -121,19 +154,20 @@ const getStatusColor = (status) => {
<td class="px-8 py-5 text-right">
<Link
:href="route('admin.candidates.show', candidate.id)"
class="inline-flex items-center justify-center p-2 text-slate-400 hover:text-indigo-600 hover:bg-indigo-50 dark:hover:bg-indigo-900/30 rounded-xl transition-all"
class="inline-flex items-center justify-center p-2 text-primary/40 hover:text-highlight hover:bg-highlight/10 rounded-xl transition-all"
title="Détails"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M14 5l7 7m0 0l-7 7m7-7H3" />
</svg>
</Link>
</td>
</tr>
<tr v-if="top_candidates.length === 0">
<td colspan="4" class="px-8 py-12 text-center text-slate-400 italic font-medium">
Aucun candidat pour le moment.
<td colspan="5" class="px-8 py-16 text-center">
<div class="text-anthracite/40 italic font-medium font-subtitle">
Aucun candidat pour le moment.
</div>
</td>
</tr>
</tbody>
@@ -142,41 +176,86 @@ const getStatusColor = (status) => {
</div>
</div>
<div v-else class="py-12">
<div class="mx-auto max-w-3xl sm:px-6 lg:px-8">
<div class="bg-white dark:bg-slate-800 p-12 rounded-3xl shadow-xl border border-slate-200 dark:border-slate-700 text-center">
<h3 class="text-3xl font-black mb-4">Bienvenue, {{ user.name }} !</h3>
<p class="text-slate-500 dark:text-slate-400 mb-12">
Veuillez sélectionner le test technique auquel vous avez été invité.
Prenez le temps de vous installer confortablement avant de commencer.
</p>
<!-- Candidate Dashboard: LIGHT ONLY, matched with new graphic charter -->
<div v-else class="flex flex-col items-center justify-center px-4 py-16 bg-neutral min-h-[calc(100vh-4rem)] font-sans text-anthracite selection:bg-highlight selection:text-anthracite">
<div class="w-full max-w-4xl">
<div v-if="quizzes.length > 0" class="space-y-4">
<div v-for="quiz in quizzes" :key="quiz.id" class="p-6 bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-700 rounded-2xl flex flex-col sm:flex-row items-center justify-between gap-6 group hover:border-indigo-500 transition-all duration-300">
<div class="text-left flex-1">
<h4 class="text-xl font-bold group-hover:text-indigo-600 transition-colors">{{ quiz.title }}</h4>
<p class="text-sm text-slate-500 mt-1">{{ quiz.duration_minutes }} minutes {{ quiz.description }}</p>
<!-- Welcome Section -->
<div class="mb-12 text-center">
<div class="inline-flex items-center gap-2 px-5 py-2 rounded-full text-xs font-subtitle font-bold uppercase tracking-widest mb-6 bg-primary/10 text-primary border border-primary/20">
Espace Candidat
</div>
<h3 class="text-4xl md:text-5xl font-serif font-black mb-5 tracking-tight text-primary leading-tight">
Bienvenue, <span class="text-accent">{{ user.name }}</span> !
</h3>
<p class="text-anthracite/70 text-lg max-w-2xl mx-auto leading-relaxed">
Voici les tests techniques préparés pour votre candidature. Installez-vous confortablement avant de commencer.
</p>
</div>
<!-- Quizzes Grid -->
<div v-if="quizzes && quizzes.length > 0" class="grid grid-cols-1 md:grid-cols-2 gap-8">
<div
v-for="quiz in quizzes"
:key="quiz.id"
class="group bg-white rounded-3xl p-8 shadow-sm border-b-4 border-transparent hover:border-highlight hover:-translate-y-2 hover:shadow-xl hover:shadow-highlight/10 transition-all duration-300 relative overflow-hidden"
>
<!-- Decorative blob -->
<div class="absolute -top-8 -right-8 w-32 h-32 bg-[radial-gradient(circle,_#1a4b8c20_0%,_transparent_70%)] rounded-full"></div>
<!-- Icon badge -->
<div class="inline-flex p-3 bg-sky/15 rounded-xl mb-6">
<svg xmlns="http://www.w3.org/2000/svg" class="w-7 h-7 text-primary" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4" />
</svg>
</div>
<h4 class="text-xl font-subtitle font-bold text-primary mb-3 leading-tight">{{ quiz.title }}</h4>
<p class="text-anthracite/70 text-sm leading-relaxed mb-8 line-clamp-2">
{{ quiz.description }}
</p>
<div class="pt-6 border-t border-anthracite/10 flex items-center justify-between gap-4 relative z-10">
<div>
<div class="text-[10px] font-black uppercase tracking-[0.1em] text-anthracite/40 mb-1">Durée</div>
<div class="text-base font-bold text-anthracite">{{ quiz.duration_minutes }} min</div>
</div>
<div v-if="quiz.has_finished_attempt" class="flex items-center gap-2 px-6 py-3 bg-emerald-50 dark:bg-emerald-900/20 border border-emerald-200 dark:border-emerald-800 rounded-xl text-emerald-600 dark:text-emerald-400 font-bold whitespace-nowrap">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
<div v-if="quiz.has_finished_attempt" class="flex items-center gap-2 bg-[#ecfdf5] text-[#059669] font-bold text-xs uppercase tracking-wider px-5 py-2.5 rounded-xl border-2 border-[#a7f3d0]">
<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="3">
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
</svg>
Test effectué
Terminé
</div>
<Link
<Link
v-else
:href="route('quizzes.take', quiz.id)"
class="bg-indigo-600 text-white px-8 py-3 rounded-xl font-bold hover:bg-slate-900 dark:hover:bg-white dark:hover:text-slate-900 transition-all duration-300 shadow-lg shadow-indigo-600/20 active:scale-95 whitespace-nowrap"
class="inline-flex items-center justify-center px-8 py-3 bg-highlight text-[#3a2800] rounded-xl font-subtitle font-bold text-sm shadow-md shadow-highlight/20 hover:brightness-110 hover:-translate-y-0.5 hover:shadow-lg hover:shadow-highlight/30 transition-all whitespace-nowrap"
>
Démarrer le test
Démarrer
</Link>
</div>
</div>
<div v-else class="py-12 text-slate-500 italic">
Aucun test ne vous est assigné pour le moment.
</div>
</div>
<!-- Empty State -->
<div v-else class="text-center p-20 bg-white rounded-3xl shadow-sm border border-anthracite/5">
<div class="inline-flex p-6 bg-accent/10 rounded-full mb-6">
<svg xmlns="http://www.w3.org/2000/svg" class="w-12 h-12 text-accent" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
</svg>
</div>
<h4 class="text-2xl font-serif font-black text-primary mb-3">Aucun test assigné</h4>
<p class="text-anthracite/70 max-w-lg mx-auto leading-relaxed text-sm">
Votre dossier est en cours de traitement. Un administrateur vous assignera bientôt vos tests techniques.
</p>
</div>
<!-- Footer -->
<div class="mt-12 text-center text-primary/50 text-[10px] font-subtitle font-bold uppercase tracking-widest">
&copy; {{ new Date().getFullYear() }} Communauté d'Agglomération Béziers Méditerranée
</div>
</div>
</div>
</component>

View File

@@ -2,184 +2,185 @@
import { Head, Link } from '@inertiajs/vue3';
defineProps({
canLogin: Boolean,
canRegister: Boolean,
canLogin: {
type: Boolean,
},
});
</script>
<template>
<Head title="Bienvenue sur RecruitQuizz" />
<Head title="Recru IT" />
<div class="min-h-screen bg-slate-50 dark:bg-slate-950 text-slate-900 dark:text-slate-100 selection:bg-indigo-500 selection:text-white font-sans overflow-x-hidden">
<div class="min-h-screen bg-neutral text-anthracite font-sans overflow-x-hidden selection:bg-highlight selection:text-anthracite">
<!-- Animated Background Blobs -->
<div class="fixed inset-0 pointer-events-none overflow-hidden">
<div class="absolute -top-[10%] -left-[10%] w-[40%] h-[40%] bg-indigo-500/10 dark:bg-indigo-500/5 rounded-full blur-[120px] animate-pulse"></div>
<div class="absolute top-[20%] -right-[10%] w-[35%] h-[35%] bg-purple-500/10 dark:bg-purple-500/5 rounded-full blur-[120px] animate-pulse" style="animation-delay: 2s;"></div>
<div class="absolute -bottom-[10%] left-[20%] w-[30%] h-[30%] bg-emerald-500/10 dark:bg-emerald-500/5 rounded-full blur-[120px] animate-pulse" style="animation-delay: 4s;"></div>
</div>
<!-- Navigation -->
<nav class="relative z-50 flex items-center justify-between px-6 py-8 md:px-12 max-w-7xl mx-auto">
<div class="flex items-center gap-2 group cursor-default">
<div class="w-10 h-10 bg-indigo-600 rounded-xl flex items-center justify-center shadow-lg shadow-indigo-600/20 group-hover:scale-110 transition-transform duration-300">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<div class="flex items-center gap-3 group cursor-default">
<div class="w-12 h-12 bg-primary rounded-lg flex items-center justify-center shadow-lg shadow-primary/30 group-hover:scale-105 transition-transform duration-300">
<svg xmlns="http://www.w3.org/2000/svg" class="h-7 w-7 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9l-.707.707M12 18v3m4.95-4.95l.707.707M12 3c-4.418 0-8 3.582-8 8 0 2.209.895 4.209 2.343 5.657L12 21l5.657-5.343A7.994 7.994 0 0020 11c0-4.418-3.582-8-8-8z" />
</svg>
</div>
<span class="text-2xl font-black tracking-tighter uppercase italic text-slate-900 dark:text-white">RECRU<span class="text-indigo-600">IT</span></span>
<span class="text-3xl font-serif font-bold text-primary">RECRU<span class="text-accent italic px-1">IT</span></span>
</div>
<div class="flex items-center gap-4">
<template v-if="$page.props.auth.user">
<Link :href="route('dashboard')" class="px-6 py-2.5 bg-slate-900 dark:bg-white text-white dark:text-slate-900 rounded-full font-bold text-sm hover:scale-105 transition-all shadow-xl shadow-slate-900/10 dark:shadow-none">
Aller au Dashboard
<Link :href="route('dashboard')" class="px-8 py-3 bg-highlight text-[#3a2800] rounded-lg font-subtitle font-bold text-sm hover:brightness-110 hover:shadow-xl hover:shadow-highlight/20 transition-all duration-300">
Accéder au Tableau de bord
</Link>
</template>
<template v-else>
<Link :href="route('login')" class="text-slate-600 dark:text-slate-400 font-bold text-sm hover:text-indigo-600 dark:hover:text-indigo-400 transition-colors hidden md:block px-4">
<Link :href="route('login')" class="px-8 py-3 bg-highlight text-[#3a2800] rounded-lg font-subtitle font-bold text-sm hover:brightness-110 hover:-translate-y-0.5 hover:shadow-xl hover:shadow-highlight/20 transition-all duration-300">
Connexion
</Link>
<Link
v-if="canRegister"
:href="route('register')"
class="px-8 py-3 bg-indigo-600 text-white rounded-full font-bold text-sm hover:bg-indigo-700 hover:scale-105 hover:shadow-2xl hover:shadow-indigo-600/30 transition-all duration-300"
>
Créer un compte
</Link>
</template>
</div>
</nav>
<!-- Hero Section -->
<main class="relative z-10 max-w-7xl mx-auto px-6 pt-20 pb-32 md:px-12 md:pt-32">
<div class="grid grid-cols-1 lg:grid-cols-12 gap-16 items-center">
<!-- Fond Institutionnel Hero Section -->
<main class="relative z-10 w-full mt-4">
<div class="max-w-[95%] mx-auto bg-primary rounded-[2.5rem] overflow-hidden shadow-2xl relative px-8 py-20 pb-32 md:px-16 md:py-32">
<!-- Hero Content -->
<div class="lg:col-span-7 space-y-10">
<div class="inline-flex items-center gap-2 px-4 py-2 bg-indigo-50 dark:bg-indigo-900/20 border border-indigo-100 dark:border-indigo-800 rounded-full text-indigo-600 dark:text-indigo-400 text-xs font-black uppercase tracking-widest animate-bounce">
<span class="relative flex h-2 w-2">
<span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-indigo-400 opacity-75"></span>
<span class="relative inline-flex rounded-full h-2 w-2 bg-indigo-500"></span>
</span>
Tests de recrutements
<!-- Graphic Elements -->
<div class="absolute top-0 right-0 w-[50%] h-full bg-gradient-to-l from-sky/40 to-transparent pointer-events-none"></div>
<div class="absolute -bottom-24 -left-24 w-96 h-96 bg-accent/20 rounded-full blur-[100px] pointer-events-none"></div>
<div class="relative z-10 grid grid-cols-1 lg:grid-cols-2 gap-16 items-center">
<!-- Hero Content -->
<div class="space-y-10 text-white">
<div class="inline-flex items-center gap-3 px-5 py-2.5 bg-white/10 backdrop-blur-md border border-white/20 rounded-full text-white text-sm font-subtitle font-bold uppercase tracking-widest shadow-inner">
<span class="relative flex h-3 w-3">
<span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-highlight opacity-75"></span>
<span class="relative inline-flex rounded-full h-3 w-3 bg-highlight"></span>
</span>
Évaluation des candidats
</div>
<h1 class="text-5xl md:text-7xl font-serif leading-[1.1] text-white">
Découvrez le potentiel de vos <span class="text-highlight">futures équipes</span>.
</h1>
<p class="text-lg md:text-xl text-sand font-sans font-light max-w-xl leading-relaxed">
Recru.IT simplifie le processus d'évaluation.
Générez des tests sur-mesure pour chaque poste et accédez à une analyse de compétences claire, précise et équitable.
</p>
<div class="flex flex-col sm:flex-row gap-4 pt-4">
<Link
v-if="!$page.props.auth.user"
:href="route('login')"
class="inline-flex items-center justify-center px-10 py-4 bg-highlight text-[#3a2800] rounded-xl font-subtitle font-bold uppercase tracking-wider text-sm hover:brightness-110 hover:-translate-y-1 hover:shadow-2xl hover:shadow-highlight/40 transition-all duration-300"
>
S'identifier
</Link>
</div>
</div>
<!-- Right illustration (abstract or UI mockup) -->
<div class="hidden lg:flex justify-end relative h-full">
<div class="w-full max-w-md bg-sand rounded-3xl p-8 shadow-2xl relative transform rotate-2 hover:rotate-0 transition-transform duration-500 border border-white/10">
<!-- Fake dashboard element -->
<div class="space-y-6">
<div class="flex justify-between items-center border-b border-anthracite/10 pb-4">
<div class="h-6 w-32 bg-primary/20 rounded"></div>
<div class="h-6 w-12 bg-accent/20 rounded-full"></div>
</div>
<div class="grid grid-cols-2 gap-4">
<div class="h-24 bg-white rounded-xl shadow-sm border border-anthracite/5 p-4 flex flex-col justify-between">
<div class="h-3 w-20 bg-neutral rounded"></div>
<div class="h-8 w-16 bg-primary/10 rounded"></div>
</div>
<div class="h-24 bg-white rounded-xl shadow-sm border border-anthracite/5 p-4 flex flex-col justify-between">
<div class="h-3 w-24 bg-neutral rounded"></div>
<div class="h-8 w-full bg-highlight/20 rounded"></div>
</div>
</div>
<div class="h-32 bg-white rounded-xl shadow-sm border border-anthracite/5 p-4 flex gap-4">
<div class="w-16 h-16 bg-sky/20 rounded-full shrink-0"></div>
<div class="flex-1 space-y-3 py-2">
<div class="h-3 w-[60%] bg-anthracite/20 rounded"></div>
<div class="h-2 w-[80%] bg-neutral rounded"></div>
<div class="h-2 w-[40%] bg-neutral rounded"></div>
</div>
</div>
</div>
<!-- Floating badge -->
<div class="absolute -left-12 bottom-12 bg-white p-5 rounded-2xl shadow-xl flex items-center gap-4 border border-sand/50 animate-bounce" style="animation-duration: 3s">
<div class="w-12 h-12 bg-accent rounded-full flex items-center justify-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
</svg>
</div>
<div>
<p class="text-xs text-anthracite/50 font-subtitle font-bold uppercase tracking-wider">Candidat</p>
<p class="text-anthracite font-bold">Approuvé</p>
</div>
</div>
</div>
</div>
<h1 class="text-6xl md:text-8xl font-black tracking-tight leading-[0.9] text-slate-900 dark:text-white">
Evualuation <br>
<span class="text-transparent bg-clip-text bg-gradient-to-r from-indigo-600 to-purple-600">des candidats.</span>
</h1>
<p class="text-xl text-slate-600 dark:text-slate-400 max-w-xl leading-relaxed">
Recru.IT transforme le processus de sélection technique. Testez les candidats avec des parcours personnalisés et des évaluations précises en quelques minutes.
</p>
<div class="flex flex-col sm:flex-row items-center gap-6">
<Link
:href="route('login')"
class="group relative w-full sm:w-auto px-10 py-5 bg-slate-900 dark:bg-white text-white dark:text-slate-900 rounded-3xl font-black uppercase tracking-widest text-sm text-center overflow-hidden hover:scale-105 transition-all duration-300"
>
<span class="relative z-10">Démarrer maintenant</span>
<div class="absolute inset-0 bg-gradient-to-r from-indigo-600 to-purple-600 opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
</Link>
<div class="flex -space-x-4">
<img class="w-12 h-12 rounded-full border-4 border-white dark:border-slate-950 shadow-xl" src="https://i.pravatar.cc/150?u=1" alt="User 1">
<img class="w-12 h-12 rounded-full border-4 border-white dark:border-slate-950 shadow-xl" src="https://i.pravatar.cc/150?u=2" alt="User 2">
<img class="w-12 h-12 rounded-full border-4 border-white dark:border-slate-950 shadow-xl" src="https://i.pravatar.cc/150?u=3" alt="User 3">
<div class="w-12 h-12 rounded-full border-4 border-white dark:border-slate-950 bg-indigo-600 flex items-center justify-center text-white text-xs font-bold shadow-xl">
:)
</div>
</div>
<p class="text-xs font-bold text-slate-400"></p>
</div>
</div>
<!-- Hero Illustration / Mockup -->
<div class="lg:col-span-5 relative hidden lg:block">
<div class="absolute -inset-4 bg-gradient-to-tr from-indigo-600 to-purple-600 rounded-[4rem] blur-3xl opacity-20 animate-pulse"></div>
<div class="relative bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-[3rem] shadow-2xl overflow-hidden aspect-[4/5] p-2">
<div class="bg-slate-50 dark:bg-slate-950 rounded-[2.5rem] h-full w-full p-8 border border-slate-100 dark:border-slate-800 flex flex-col justify-center gap-12 text-center">
<div class="w-24 h-24 bg-indigo-600/10 rounded-3xl mx-auto flex items-center justify-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-12 w-12 text-indigo-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
</div>
<div class="space-y-4">
<div class="text-3xl font-black uppercase tracking-tighter">Félicitations !</div>
<p class="text-slate-500 text-sm">Votre score est de 95%. <br> Vous êtes prêt pour la suite.</p>
</div>
<div class="flex flex-col gap-3">
<div class="h-4 w-full bg-slate-100 dark:bg-slate-800 rounded-full overflow-hidden">
<div class="h-full w-[95%] bg-indigo-600 rounded-full shadow-lg shadow-indigo-600/30"></div>
</div>
<div class="flex justify-between text-[10px] font-black uppercase text-slate-400">
<span>Rang S+</span>
<span>Recruté</span>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<!-- Features Grid -->
<section class="relative z-10 bg-white dark:bg-slate-900 border-y border-slate-200 dark:border-slate-800 px-6 py-24 md:px-12">
<!-- Features -->
<section class="relative z-10 bg-neutral px-6 py-24 md:px-12 -mt-16 pt-32">
<div class="max-w-7xl mx-auto">
<div class="text-center mb-20 space-y-4">
<h2 class="text-4xl font-black uppercase tracking-tight text-slate-900 dark:text-white">Conçu pour les recruteurs</h2>
<p class="text-slate-500 dark:text-slate-400 max-w-xl mx-auto">Une plateforme intuitive pour automatiser vos entretiens techniques et valoriser le potentiel de chaque candidat.</p>
<div class="text-center mb-16 space-y-4">
<h2 class="text-3xl md:text-5xl font-serif text-primary">Un processus optimisé</h2>
<p class="text-anthracite/70 font-sans max-w-2xl mx-auto text-lg pt-2">Pensé pour offrir la meilleure expérience d'évaluation technique aux communautés d'agglomération et leurs candidats.</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
<!-- Feature 1 -->
<div class="p-10 bg-slate-50 dark:bg-slate-950 rounded-[2.5rem] border border-slate-100 dark:border-slate-800 hover:border-indigo-500 transition-colors group">
<div class="w-14 h-14 bg-indigo-600/10 rounded-2xl flex items-center justify-center mb-8 group-hover:scale-110 transition-transform">
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8 text-indigo-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<div class="p-8 bg-white rounded-2xl shadow-md shadow-anthracite/5 border-b-4 border-primary hover:-translate-y-2 transition-transform duration-300">
<div class="w-14 h-14 bg-sky/10 rounded-xl flex items-center justify-center mb-6">
<svg xmlns="http://www.w3.org/2000/svg" class="h-7 w-7 text-primary" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z" />
</svg>
</div>
<h3 class="text-xl font-bold mb-4">Quiz Dynamiques</h3>
<p class="text-slate-500 dark:text-slate-400 text-sm leading-relaxed">Questions à choix multiples ou réponses ouvertes, adaptez vos tests au poste visé en quelques clics.</p>
<h3 class="text-xl font-subtitle font-bold text-primary mb-3">Quiz Dynamiques</h3>
<p class="text-anthracite/70 font-sans text-sm leading-relaxed">Une génération intelligente de questions basées sur l'Intelligence Artificielle pour cibler les attentes du poste.</p>
</div>
<!-- Feature 2 -->
<div class="p-10 bg-slate-50 dark:bg-slate-950 rounded-[2.5rem] border border-slate-100 dark:border-slate-800 hover:border-indigo-500 transition-colors group">
<div class="w-14 h-14 bg-emerald-600/10 rounded-2xl flex items-center justify-center mb-8 group-hover:scale-110 transition-transform">
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8 text-emerald-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<div class="p-8 bg-white rounded-2xl shadow-md shadow-anthracite/5 border-b-4 border-highlight hover:-translate-y-2 transition-transform duration-300">
<div class="w-14 h-14 bg-highlight/10 rounded-xl flex items-center justify-center mb-6">
<svg xmlns="http://www.w3.org/2000/svg" class="h-7 w-7 text-highlight" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" />
</svg>
</div>
<h3 class="text-xl font-bold mb-4">Audit & Sécurité</h3>
<p class="text-slate-500 dark:text-slate-400 text-sm leading-relaxed">Chaque action critique est journalisée pour une transparence totale sur vos recrutements.</p>
<h3 class="text-xl font-subtitle font-bold text-anthracite mb-3">Sécurisé & Traçable</h3>
<p class="text-anthracite/70 font-sans text-sm leading-relaxed">Respect de l'intégrité des compétences et de la RGPD, sans biais lors de l'analyse des profils.</p>
</div>
<!-- Feature 3 -->
<div class="p-10 bg-slate-50 dark:bg-slate-950 rounded-[2.5rem] border border-slate-100 dark:border-slate-800 hover:border-indigo-500 transition-colors group">
<div class="w-14 h-14 bg-purple-600/10 rounded-2xl flex items-center justify-center mb-8 group-hover:scale-110 transition-transform">
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8 text-purple-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<div class="p-8 bg-white rounded-2xl shadow-md shadow-anthracite/5 border-b-4 border-accent hover:-translate-y-2 transition-transform duration-300">
<div class="w-14 h-14 bg-accent/10 rounded-xl flex items-center justify-center mb-6">
<svg xmlns="http://www.w3.org/2000/svg" class="h-7 w-7 text-accent" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z" />
</svg>
</div>
<h3 class="text-xl font-bold mb-4">Mobile First</h3>
<p class="text-slate-500 dark:text-slate-400 text-sm leading-relaxed">Les candidats passent leurs tests sur mobile ou desktop avec un confort inégalé.</p>
<h3 class="text-xl font-subtitle font-bold text-accent mb-3">Expérience fluide</h3>
<p class="text-anthracite/70 font-sans text-sm leading-relaxed">Une interface candidate repensée pour valoriser la marque employeur et simplifier la passation d'examens.</p>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="relative z-10 px-6 py-20 text-center text-slate-400 text-xs font-black uppercase tracking-[0.2em]">
&copy; 2026 RecruitQuizz Advanced Recruitment Intelligence
<footer class="relative bg-sand px-6 py-12 text-center border-t border-anthracite/10">
<p class="text-primary font-subtitle font-bold text-xs uppercase tracking-[0.1em]">
&copy; {{ new Date().getFullYear() }} Communauté d'Agglomération Béziers Méditerranée — Tous droits réservés
</p>
</footer>
</div>
</template>
<style>
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700;900&display=swap');
.font-sans {
font-family: 'Outfit', sans-serif;
}
/* Import custom typographies */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,400;0,700;1,400;1,700&family=Nunito:ital,wght@0,400;0,600;0,700;1,400&display=swap');
</style>

View File

@@ -10,6 +10,9 @@
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.bunny.net">
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Merriweather:wght@700;900&family=Nunito:wght@400;600;700;800;900&display=swap" rel="stylesheet" />
<!-- Scripts -->
@routes

View File

@@ -0,0 +1,401 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Dossier Candidat - {{ $candidate->user->name }}</title>
<style>
@page {
margin: 0cm;
}
body {
font-family: 'Helvetica', 'Arial', sans-serif;
color: #2d3748;
line-height: 1.5;
margin: 0;
padding: 0;
background-color: #ffffff;
}
.header-stripe {
height: 15px;
background: linear-gradient(to right, #004f82, #e0b04c);
}
.container {
padding: 40px;
}
.page-break {
page-break-after: always;
}
/* Typography */
h1, h2, h3, h4 {
color: #004f82;
margin-bottom: 15px;
text-transform: uppercase;
letter-spacing: 1px;
}
h1 { font-size: 28px; border-bottom: 3px solid #e0b04c; padding-bottom: 10px; }
h2 { font-size: 20px; border-left: 5px solid #004f82; padding-left: 15px; margin-top: 30px; }
h3 { font-size: 16px; color: #4a5568; }
/* Candidate Details Card */
.card {
background-color: #f8f9fa;
border-radius: 15px;
padding: 20px;
margin-bottom: 30px;
border: 1px solid #e2e8f0;
}
.detail-row {
display: table;
width: 100%;
margin-bottom: 8px;
}
.detail-label {
display: table-cell;
width: 200px;
font-weight: bold;
color: #718096;
text-transform: uppercase;
font-size: 10px;
}
.detail-value {
display: table-cell;
font-weight: 500;
}
/* AI Section */
.ai-verdict {
display: inline-block;
padding: 8px 15px;
border-radius: 8px;
font-weight: bold;
font-size: 14px;
margin-bottom: 20px;
}
.verdict-positive { background-color: #def7ec; color: #03543f; }
.verdict-neutral { background-color: #fef3c7; color: #92400e; }
.verdict-negative { background-color: #fde8e8; color: #9b1c1c; }
.ai-box {
background-color: #f0f7ff;
border-left: 5px solid #004f82;
padding: 15px;
margin-bottom: 20px;
font-style: italic;
}
/* Tables & Lists */
table {
width: 100%;
border-collapse: collapse;
margin-bottom: 20px;
}
th {
background-color: #004f82;
color: white;
text-align: left;
padding: 10px;
font-size: 12px;
text-transform: uppercase;
}
td {
padding: 10px;
border-bottom: 1px solid #e2e8f0;
font-size: 12px;
}
.badge {
padding: 2px 8px;
border-radius: 4px;
font-size: 10px;
font-weight: bold;
}
/* Evaluation Grid */
.grid-cell {
height: 30px;
border: 1px solid #cbd5e0;
}
.notes-box {
height: 100px;
border: 1px solid #cbd5e0;
margin-top: 5px;
}
/* Footer */
.footer {
position: fixed;
bottom: 0px;
left: 0px;
right: 0px;
height: 50px;
text-align: center;
font-size: 10px;
color: #a0aec0;
border-top: 1px solid #e2e8f0;
padding-top: 10px;
}
</style>
</head>
<body>
<div class="header-stripe"></div>
<div class="container">
<!-- HEADER SECTION -->
<div style="text-align: center; margin-bottom: 40px;">
<div style="font-size: 12px; font-weight: bold; color: #e0b04c; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 2px;">CABM - Dossier de Synthèse</div>
<h1>{{ $candidate->user->name }}</h1>
<div style="font-size: 14px; color: #4a5568;">Candidature au poste de : <strong>{{ $candidate->jobPosition->title ?? 'Poste non défini' }}</strong></div>
</div>
<div class="card">
<div class="detail-row">
<div class="detail-label">Score Global Pondéré</div>
<div class="detail-value" style="font-size: 24px; color: #004f82; font-weight: 900;">{{ $candidate->weighted_score }}/20</div>
</div>
<div class="detail-row">
<div class="detail-label">Contact</div>
<div class="detail-value">{{ $candidate->user->email }} @if($candidate->phone) | {{ $candidate->phone }} @endif</div>
</div>
<div class="detail-row">
<div class="detail-label">Structure</div>
<div class="detail-value">{{ $candidate->tenant->name ?? 'N/A' }}</div>
</div>
@if($candidate->linkedin_url)
<div class="detail-row">
<div class="detail-label">LinkedIn</div>
<div class="detail-value">{{ $candidate->linkedin_url }}</div>
</div>
@endif
</div>
<!-- AI ANALYSIS -->
@if($candidate->ai_analysis)
<h2>Analyse Decisionnelle</h2>
<div class="ai-verdict {{ $candidate->ai_analysis['match_score'] >= 75 ? 'verdict-positive' : ($candidate->ai_analysis['match_score'] >= 50 ? 'verdict-neutral' : 'verdict-negative') }}">
Verdict : {{ $candidate->ai_analysis['verdict'] ?? 'N/A' }} ({{ $candidate->ai_analysis['match_score'] }}%)
</div>
<div class="ai-box">
{{ $candidate->ai_analysis['summary'] }}
</div>
<div style="display: table; width: 100%; margin-top: 20px;">
<div style="display: table-cell; width: 48%; padding-right: 2%;">
<h4 style="color: #057a55; font-size: 12px;">Points Forts</h4>
<ul style="font-size: 11px; padding-left: 20px; color: #03543f;">
@foreach($candidate->ai_analysis['strengths'] ?? [] as $s)
<li>{{ $s }}</li>
@endforeach
</ul>
</div>
<div style="display: table-cell; width: 48%;">
<h4 style="color: #9b1c1c; font-size: 12px;">Points de Vigilance</h4>
<ul style="font-size: 11px; padding-left: 20px; color: #9b1c1c;">
@foreach($candidate->ai_analysis['gaps'] ?? [] as $g)
<li>{{ $g }}</li>
@endforeach
</ul>
</div>
</div>
@if(!empty($candidate->ai_analysis['scores_detailles']))
<h4 style="margin-top: 20px; font-size: 12px; color: #004f82;">Détail des scores par dimension</h4>
<table style="margin-top: 10px;">
<thead style="background-color: #edf2f7;">
<tr>
<th style="color: #4a5568; background: #edf2f7; width: 30%;">Dimension</th>
<th style="color: #4a5568; background: #edf2f7; width: 15%; text-align: center;">Score</th>
<th style="color: #4a5568; background: #edf2f7; width: 55%;">Justification</th>
</tr>
</thead>
<tbody>
@foreach($candidate->ai_analysis['scores_detailles'] as $key => $details)
<tr>
<td style="font-weight: bold; text-transform: capitalize;">{{ str_replace('_', ' ', $key) }}</td>
<td style="text-align: center;">
<span style="font-weight: bold; color: #004f82;">{{ $details['score'] }}%</span>
</td>
<td style="font-size: 10px; color: #4a5568;">{{ $details['justification'] ?? '' }}</td>
</tr>
@endforeach
</tbody>
</table>
@endif
@if(!empty($candidate->ai_analysis['elements_bloquants']) && count($candidate->ai_analysis['elements_bloquants']) > 0 && $candidate->ai_analysis['elements_bloquants'][0] !== '')
<div style="margin-top: 20px; padding: 15px; background-color: #fff5f5; border: 1px dashed #feb2b2; border-radius: 10px;">
<h4 style="color: #c53030; font-size: 12px; margin-top: 0;">Signaux Critiques / Filtres Bloquants</h4>
<ul style="font-size: 11px; padding-left: 20px; color: #c53030; font-weight: bold;">
@foreach($candidate->ai_analysis['elements_bloquants'] as $item)
<li>{{ $item }}</li>
@endforeach
</ul>
</div>
@endif
@endif
<div class="page-break"></div>
<!-- TEST RESULTS -->
<h2>Résultats des Tests Techniques</h2>
@forelse($candidate->attempts as $attempt)
<div style="background-color: #f7fafc; padding: 15px; border-radius: 10px; margin-bottom: 25px;">
<h3 style="margin-top: 0;">{{ $attempt->quiz->title }} <span style="font-weight: normal; color: #a0aec0; font-size: 12px;">(Fait le {{ $attempt->finished_at->format('d/m/Y H:i') }})</span></h3>
<div style="font-size: 14px; font-weight: bold; margin-bottom: 15px;">Score : {{ $attempt->score }} / {{ $attempt->max_score }}</div>
<table style="background: white;">
<thead>
<tr>
<th style="width: 60%">Question</th>
<th style="width: 40%">Réponse / Score</th>
</tr>
</thead>
<tbody>
@php
$quizQuestions = $attempt->quiz->questions;
$answers = $attempt->answers->keyBy('question_id');
@endphp
@foreach($quizQuestions as $question)
@php $answer = $answers->get($question->id); @endphp
<tr>
<td>
<strong>{{ $question->label }}</strong>
@if($question->description)
<div style="font-size: 9px; color: #718096; margin-top: 4px;">{{ $question->description }}</div>
@endif
</td>
<td>
@if($answer)
@if($question->type === 'qcm')
<div style="color: {{ $answer->option?->is_correct ? '#057a55' : '#9b1c1c' }}; font-weight: bold;">
{{ $answer->option?->option_text ?? 'N/A' }}
({{ $answer->option?->is_correct ? 'Correct' : 'Incorrect' }})
</div>
@else
<div style="font-style: italic; color: #4a5568;">"{{ $answer->text_content }}"</div>
<div style="margin-top: 5px; font-weight: bold;">Note : {{ $answer->score }} / {{ $question->points }}</div>
@endif
@else
<span style="color: #a0aec0; font-style: italic;">Pas de réponse</span>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@empty
<p style="font-style: italic; color: #a0aec0;">Aucun test technique effectué.</p>
@endforelse
<div class="page-break"></div>
<!-- GRILLE D'EVALUATION PAPIER -->
<h2 style="background-color: #004f82; color: white; padding: 10px; border: none;">Grille d'Évaluation (Entretien)</h2>
<p style="font-size: 10px; color: #718096; margin-bottom: 20px;">Support pour prise de notes manuelle durant l'échange. Échelle de 0 à 10.</p>
<h3>1. Compétences Métier & Pré-requis</h3>
<table>
<thead>
<tr>
<th style="width: 40%">Critères</th>
@for($i=0; $i<=10; $i++) <th style="width: 4%; font-size: 8px; text-align: center;">{{ $i }}</th> @endfor
</tr>
</thead>
<tbody>
@php
$requirements = $candidate->jobPosition->requirements ?? ['Compétences techniques générales', 'Expérience domaine', 'Outils & Méthodes'];
@endphp
@foreach($requirements as $req)
<tr>
<td><strong>{{ $req }}</strong></td>
@for($i=0; $i<=10; $i++) <td style="border: 1px solid #e2e8f0; text-align: center;"></td> @endfor
</tr>
@endforeach
</tbody>
</table>
<div style="margin-bottom: 30px;">
<label style="font-size: 10px; font-weight: bold;">Commentaires Compétences :</label>
<div class="notes-box"></div>
</div>
<h3>2. Savoir être & Adaptabilité</h3>
<table>
<thead>
<tr>
<th style="width: 40%">Personnalité</th>
@for($i=0; $i<=10; $i++) <th style="width: 4%; font-size: 8px; text-align: center;">{{ $i }}</th> @endfor
</tr>
</thead>
<tbody>
@php
$softSkills = [
'Communication & Pédagogie',
'Esprit d\'équipe & Collaboration',
'Résolution de problèmes & Logique',
'Adaptabilité & Résilience',
'Autonomie & Proactivité'
];
@endphp
@foreach($softSkills as $skill)
<tr>
<td><strong>{{ $skill }}</strong></td>
@for($i=0; $i<=10; $i++) <td style="border: 1px solid #e2e8f0; text-align: center;"></td> @endfor
</tr>
@endforeach
</tbody>
</table>
<div style="margin-bottom: 30px;">
<label style="font-size: 10px; font-weight: bold;">Commentaires Savoir être :</label>
<div class="notes-box"></div>
</div>
<div class="page-break"></div>
<h3>3. Questions d'Entretien (Guide)</h3>
@if($candidate->ai_analysis && !empty($candidate->ai_analysis['questions_entretien_suggerees']))
@foreach($candidate->ai_analysis['questions_entretien_suggerees'] as $idx => $question)
<div style="margin-bottom: 20px;">
<div style="font-size: 12px; font-weight: bold; color: #004f82;">Q{{ $idx + 1 }}. {{ $question }}</div>
<div style="height: 60px; border-bottom: 1px dashed #cbd5e0; margin-top: 10px;"></div>
</div>
@endforeach
@else
<p style="font-style: italic; color: #a0aec0;">Aucune question suggérée. Utilisez vos questions standards.</p>
@for($i=1; $i<=5; $i++)
<div style="margin-bottom: 25px;">
<div style="height: 1px; background-color: #e2e8f0; margin-bottom: 5px;"></div>
<div style="height: 40px; border: 1px solid #f7fafc;"></div>
</div>
@endfor
@endif
<div style="margin-top: 40px; border: 2px solid #004f82; padding: 20px; border-radius: 15px;">
<div style="font-weight: bold; text-transform: uppercase; color: #004f82; margin-bottom: 10px; text-align: center;">Verdict Final & Avis Client</div>
<div style="display: table; width: 100%;">
<div style="display: table-cell; width: 33%; text-align: center; border-right: 1px solid #e2e8f0;">
<span style="display: inline-block; width: 15px; height: 15px; border: 2px solid #057a55;"></span>
<span style="font-size: 14px; font-weight: bold; color: #057a55; margin-left: 10px;">FAVORABLE</span>
</div>
<div style="display: table-cell; width: 33%; text-align: center; border-right: 1px solid #e2e8f0;">
<span style="display: inline-block; width: 15px; height: 15px; border: 2px solid #e0b04c;"></span>
<span style="font-size: 14px; font-weight: bold; color: #92400e; margin-left: 10px;">A REVOIR</span>
</div>
<div style="display: table-cell; width: 33%; text-align: center;">
<span style="display: inline-block; width: 15px; height: 15px; border: 2px solid #9b1c1c;"></span>
<span style="font-size: 14px; font-weight: bold; color: #9b1c1c; margin-left: 10px;">DEFAVORABLE</span>
</div>
</div>
<div style="margin-top: 20px;">
<label style="font-size: 10px; font-weight: bold;">Motivations du choix / Points à éclaircir :</label>
<div style="height: 150px;"></div>
</div>
</div>
</div>
<div class="footer">
Généré le {{ date('d/m/Y H:i') }} par CABM - Dossier Confidentiel
</div>
</body>
</html>

View File

@@ -12,10 +12,6 @@ use App\Http\Controllers\Auth\VerifyEmailController;
use Illuminate\Support\Facades\Route;
Route::middleware('guest')->group(function () {
Route::get('register', [RegisteredUserController::class, 'create'])
->name('register');
Route::post('register', [RegisteredUserController::class, 'store']);
Route::get('login', [AuthenticatedSessionController::class, 'create'])
->name('login');

View File

@@ -3,6 +3,10 @@
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Schedule;
Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote');
Schedule::command('app:cleanup-login-logs')->daily();

View File

@@ -8,9 +8,6 @@ use Inertia\Inertia;
Route::get('/', function () {
return Inertia::render('Welcome', [
'canLogin' => Route::has('login'),
'canRegister' => Route::has('register'),
'laravelVersion' => Application::VERSION,
'phpVersion' => PHP_VERSION,
]);
});
@@ -26,6 +23,7 @@ Route::get('/dashboard', function () {
$allCandidates = Candidate::with(['attempts'])->get();
$stats = [
'total_candidates' => Candidate::count(),
'selected_candidates' => Candidate::where('is_selected', true)->count(),
'finished_tests' => Attempt::whereNotNull('finished_at')->count(),
'average_score' => round($allCandidates->avg('weighted_score') ?? 0, 1),
'best_score' => round($allCandidates->max('weighted_score') ?? 0, 1),
@@ -49,7 +47,16 @@ Route::get('/dashboard', function () {
->all();
} else {
$candidate = auth()->user()->candidate;
$quizzes = \App\Models\Quiz::all()->map(function($quiz) use ($candidate) {
if ($candidate) {
$candidate->load('jobPosition.quizzes');
}
$quizzes = ($candidate && $candidate->jobPosition)
? $candidate->jobPosition->quizzes
: collect();
$quizzes = $quizzes->map(function($quiz) use ($candidate) {
$quiz->has_finished_attempt = $candidate
? $candidate->attempts()->where('quiz_id', $quiz->id)->whereNotNull('finished_at')->exists()
: false;
@@ -76,18 +83,24 @@ Route::middleware('auth')->group(function () {
Route::patch('/candidates/{candidate}/notes', [\App\Http\Controllers\CandidateController::class, 'updateNotes'])->name('candidates.update-notes');
Route::patch('/candidates/{candidate}/scores', [\App\Http\Controllers\CandidateController::class, 'updateScores'])->name('candidates.update-scores');
Route::patch('/candidates/{candidate}/position', [\App\Http\Controllers\CandidateController::class, 'updatePosition'])->name('candidates.update-position');
Route::patch('/candidates/{candidate}/tenant', [\App\Http\Controllers\CandidateController::class, 'updateTenant'])->name('candidates.update-tenant');
Route::patch('/candidates/{candidate}/toggle-selection', [\App\Http\Controllers\CandidateController::class, 'toggleSelection'])->name('candidates.toggle-selection');
Route::post('/candidates/{candidate}/analyze', [\App\Http\Controllers\AIAnalysisController::class, 'analyze'])->name('candidates.analyze');
Route::post('/candidates/{candidate}/reset-password', [\App\Http\Controllers\CandidateController::class, 'resetPassword'])->name('candidates.reset-password');
Route::get('/documents/{document}', [\App\Http\Controllers\DocumentController::class, 'show'])->name('documents.show');
Route::get('/candidates/{candidate}/export-dossier', [\App\Http\Controllers\Admin\CandidateExportController::class, 'exportDossier'])->name('candidates.export-dossier');
Route::get('/candidates/{candidate}/export-zip', [\App\Http\Controllers\Admin\CandidateExportController::class, 'exportZip'])->name('candidates.export-zip');
Route::resource('quizzes', \App\Http\Controllers\QuizController::class)->only(['index', 'store', 'show', 'update', 'destroy']);
Route::resource('job-positions', \App\Http\Controllers\JobPositionController::class)->only(['index', 'store', 'update', 'destroy']);
Route::resource('quizzes.questions', \App\Http\Controllers\QuestionController::class)->only(['store', 'update', 'destroy']);
Route::resource('tenants', \App\Http\Controllers\TenantController::class)->only(['index', 'store', 'update', 'destroy']);
Route::resource('users', \App\Http\Controllers\UserController::class)->except(['show', 'create', 'edit']);
Route::post('/users/{user}/reset-password', [\App\Http\Controllers\UserController::class, 'resetPassword'])->name('users.reset-password');
Route::get('/backup', [\App\Http\Controllers\BackupController::class, 'download'])->name('backup');
Route::delete('/attempts/{attempt}', [\App\Http\Controllers\AttemptController::class, 'destroy'])->name('attempts.destroy');
Route::patch('/answers/{answer}/score', [\App\Http\Controllers\AttemptController::class, 'updateAnswerScore'])->name('answers.update-score');
Route::get('/logs', [\App\Http\Controllers\Admin\LoginLogController::class, 'index'])->name('logs.index');
});
// Candidate Routes

View File

@@ -10,11 +10,151 @@ export default {
'./resources/views/**/*.blade.php',
'./resources/js/**/*.vue',
],
darkMode: 'class',
theme: {
extend: {
// ─── COULEURS ────────────────────────────────────────────────
colors: {
// Palette principale — CABM
primary: {
DEFAULT: '#1a4b8c', // Bleu Méditerranée
dark: '#122f5a', // Bleu nuit
light: '#3a7abf', // Bleu ciel (ex: sky)
},
accent: {
DEFAULT: '#c8102e', // Rouge Occitan
soft: 'rgba(200,16,46,0.10)',
},
highlight: {
DEFAULT: '#f5a800', // Or du Midi
soft: 'rgba(245,168,0,0.12)',
dark: '#3a2800', // Texte sur fond or
},
// Neutres chauds
sand: '#e8e0d0', // Sable garrigue (ex: sand)
neutral: '#f0ece4', // Fond neutre warm
surface: '#faf9f7', // Surface carte (ex: white)
// Texte
ink: {
DEFAULT: '#2d2d2d', // Anthracite
muted: 'rgba(45,45,45,0.50)',
faint: 'rgba(45,45,45,0.28)',
},
// Dark mode
dark: {
bg: '#0f1923',
surface: '#162130',
sidebar: '#0a111a',
border: 'rgba(255,255,255,0.06)',
},
// Sémantiques
success: '#10b981',
warning: '#f5a800',
danger: '#c8102e',
info: '#3a7abf',
// Compat rétro (garde les anciens noms fonctionnels)
anthracite: '#2d2d2d',
sky: '#3a7abf',
},
// ─── TYPOGRAPHIE ─────────────────────────────────────────────
fontFamily: {
sans: ['Figtree', ...defaultTheme.fontFamily.sans],
sans: ['Nunito', 'Helvetica Neue', 'Arial', 'sans-serif'],
serif: ['Merriweather', 'Georgia', 'serif'],
subtitle: ['Nunito', 'Gill Sans', 'sans-serif'],
mono: ['JetBrains Mono', 'Fira Code', 'monospace'],
},
fontSize: {
'2xs': ['0.625rem', { lineHeight: '1rem', letterSpacing: '0.12em' }], // 10px — labels caps
'xs': ['0.75rem', { lineHeight: '1.25rem' }], // 12px
'sm': ['0.8125rem',{ lineHeight: '1.375rem' }], // 13px
'base':['0.875rem', { lineHeight: '1.5rem' }], // 14px
'md': ['1rem', { lineHeight: '1.625rem' }], // 16px
'lg': ['1.0625rem',{ lineHeight: '1.75rem' }], // 17px
'xl': ['1.125rem', { lineHeight: '1.75rem' }], // 18px
'2xl': ['1.25rem', { lineHeight: '1.875rem' }], // 20px
'3xl': ['1.5rem', { lineHeight: '2rem' }], // 24px
'4xl': ['2rem', { lineHeight: '2.25rem', letterSpacing: '-0.02em'}], // 32px
},
// ─── ESPACEMENT ──────────────────────────────────────────────
// Garde l'échelle Tailwind standard + quelques tokens nommés
spacing: {
'sidebar': '220px',
'sidebar-sm': '64px',
'header': '60px',
'navbar': '40px',
},
// ─── BORDER RADIUS ───────────────────────────────────────────
borderRadius: {
'none': '0',
'sm': '6px',
'DEFAULT':'8px',
'md': '10px',
'lg': '12px',
'xl': '14px',
'2xl': '16px',
'3xl': '20px',
'4xl': '28px',
'full': '9999px',
// Tokens sémantiques
'card': '16px',
'btn': '10px',
'badge': '20px',
'input': '10px',
},
// ─── OMBRES ──────────────────────────────────────────────────
boxShadow: {
'xs': '0 1px 3px rgba(0,0,0,0.05)',
'sm': '0 1px 4px rgba(0,0,0,0.07)',
'DEFAULT':'0 2px 8px rgba(0,0,0,0.09)',
'md': '0 4px 16px rgba(0,0,0,0.10)',
'lg': '0 8px 28px rgba(0,0,0,0.12)',
'xl': '0 16px 48px rgba(0,0,0,0.14)',
// Sémantiques couleurs
'primary': '0 4px 16px rgba(26,75,140,0.20)',
'gold': '0 4px 16px rgba(245,168,0,0.30)',
'accent': '0 4px 16px rgba(200,16,46,0.18)',
// Dark mode
'dark-sm': '0 2px 12px rgba(0,0,0,0.30)',
'dark-md': '0 4px 24px rgba(0,0,0,0.40)',
'none': 'none',
},
// ─── TRANSITIONS ─────────────────────────────────────────────
transitionDuration: {
'fast': '120ms',
'DEFAULT': '180ms',
'slow': '300ms',
},
transitionTimingFunction: {
'smooth': 'cubic-bezier(0.4, 0, 0.2, 1)',
'spring': 'cubic-bezier(0.34, 1.56, 0.64, 1)',
},
// ─── ANIMATIONS ──────────────────────────────────────────────
keyframes: {
'fade-in': {
from: { opacity: '0', transform: 'translateY(6px)' },
to: { opacity: '1', transform: 'translateY(0)' },
},
'slide-in': {
from: { opacity: '0', transform: 'translateX(-8px)' },
to: { opacity: '1', transform: 'translateX(0)' },
},
'pulse-gold': {
'0%, 100%': { boxShadow: '0 0 0 0 rgba(245,168,0,0.3)' },
'50%': { boxShadow: '0 0 0 6px rgba(245,168,0,0)' },
},
},
animation: {
'fade-in': 'fade-in 0.2s ease-out',
'slide-in': 'slide-in 0.2s ease-out',
'pulse-gold':'pulse-gold 2s ease-in-out infinite',
},
},
},