Compare commits
43 Commits
7d94be7a8c
...
Module-RH
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9edf79e8ba | ||
|
|
97a8b9443d | ||
|
|
7c01803f46 | ||
|
|
fd4a39a703 | ||
|
|
29c274b23b | ||
|
|
d076fd7d7a | ||
|
|
6f00da6d10 | ||
|
|
174f229b5d | ||
|
|
2216de1a02 | ||
|
|
abfe01190b | ||
|
|
d924765b94 | ||
|
|
205c24182d | ||
|
|
f3d630d741 | ||
|
|
4017e3d9c5 | ||
|
|
b728686605 | ||
|
|
589e9956f9 | ||
|
|
d6e5b44e47 | ||
|
|
c4ab5c97b2 | ||
|
|
84a9c6bb14 | ||
|
|
957947cc0b | ||
|
|
6e4eb62553 | ||
|
|
c74d8e14ec | ||
|
|
e93a17f324 | ||
|
|
49ee91c601 | ||
|
|
479a7e35d1 | ||
|
|
de6938d2e6 | ||
|
|
91213cc371 | ||
|
|
af4502859b | ||
|
|
107e2d0a1d | ||
|
|
71672509b6 | ||
|
|
351bdda2a1 | ||
|
|
21d4aaee59 | ||
|
|
ec1fe91b35 | ||
|
|
8c577cfaa7 | ||
|
|
4a137fc511 | ||
|
|
e68108a2b1 | ||
|
|
4810ca9d9c | ||
|
|
7ece2036c1 | ||
|
|
d0ecfa3e96 | ||
|
|
38fe4a22d6 | ||
|
|
a3057aae6f | ||
|
|
2e423445f5 | ||
|
|
f53d5770df |
109
.claude/settings.local.json
Normal file
109
.claude/settings.local.json
Normal file
@@ -0,0 +1,109 @@
|
||||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(npm run *)",
|
||||
"Bash(npm --version)",
|
||||
"Bash(npx --version)",
|
||||
"Bash(npx --yes create-next-app@latest . --typescript --tailwind --app --src-dir --import-alias \"@/*\" --use-npm --eslint --no-turbopack --yes)",
|
||||
"Bash(npm install *)",
|
||||
"Bash(npx prisma *)",
|
||||
"Bash(curl -s -o /dev/null -w '%{http_code}' http://localhost:3000__TRACKED_VAR__)",
|
||||
"Bash(curl -s -X POST http://localhost:3000/api/readings -H \"Content-Type: application/json\" -d '{\"moment\":\"FASTING\",\"value\":1.05,\"notes\":\"Test smoke\"}')",
|
||||
"Bash(curl -s \"http://localhost:3000/api/stats\")",
|
||||
"Bash(curl -s -X DELETE http://localhost:3000/api/readings/91)",
|
||||
"Bash(curl -s -o /dev/null -w \"%{http_code}\\\\n\" http://localhost:3000/api/export)",
|
||||
"Bash(curl -s -o /dev/null -w \"%{http_code}\\\\n\" http://localhost:3000/profil)",
|
||||
"Bash(curl -s -o /dev/null -w \"%{http_code}\\\\n\" http://localhost:3000/api/patient)",
|
||||
"Bash(curl -s -X PUT http://localhost:3000/api/patient -H \"Content-Type: application/json\" -d '{\"firstName\":\"Jeremy\",\"lastName\":\"Bayse\",\"email\":\"jeremy.bayse@gmail.com\",\"birthDate\":\"1985-06-15\",\"heightCm\":180,\"weightKg\":78.5}')",
|
||||
"Bash(curl -s http://localhost:3000/api/patient)",
|
||||
"Bash(taskkill //PID 40172 //F)",
|
||||
"Bash(curl -s -o /dev/null -w \"GET /profil %{http_code}\\\\n\" http://localhost:3000/profil)",
|
||||
"Bash(curl -s -o /dev/null -w \"GET /api/patient %{http_code}\\\\n\" http://localhost:3000/api/patient)",
|
||||
"Bash(curl -s http://localhost:3000/)",
|
||||
"Bash(curl -s -X PUT http://localhost:3000/api/patient -H \"Content-Type: application/json\" -d '{\"firstName\":\"Jeremy\",\"lastName\":\"Bayse\",\"email\":\"jeremy.bayse@gmail.com\",\"birthDate\":\"1985-06-15\",\"heightCm\":180,\"weightKg\":78.5,\"sex\":\"M\",\"diabetesType\":\"TYPE_2\",\"treatment\":\"Metformine 1000 mg matin et soir\"}')",
|
||||
"Bash(curl -s -X PUT http://localhost:3000/api/patient -H \"Content-Type: application/json\" -d '{\"firstName\":\"Jeremy\",\"lastName\":\"Bayse\",\"sex\":\"INVALID\"}')",
|
||||
"Bash(curl -s http://localhost:3000/profil)",
|
||||
"Bash(curl -s -o /dev/null -w \"%{http_code}\\\\n\" http://localhost:3001/profil)",
|
||||
"Bash(curl -s -X PUT http://localhost:3001/api/patient -H \"Content-Type: application/json\" -d '{\"firstName\":\"Jeremy\",\"lastName\":\"Bayse\",\"email\":\"jeremy.bayse@gmail.com\",\"birthDate\":\"1985-06-15\",\"heightCm\":180,\"weightKg\":78.5,\"sex\":\"M\",\"diabetesType\":\"TYPE_2\",\"treatment\":\"Metformine 1000 mg matin et soir\"}')",
|
||||
"Bash(curl -s http://localhost:3001/api/patient)",
|
||||
"Bash(curl -s http://localhost:3001/)",
|
||||
"Bash(grep -oE \"Diab.{1,30}\")",
|
||||
"Bash(taskkill //PID 37932 //F)",
|
||||
"Bash(curl -s -X POST http://localhost:3001/api/chat -H \"Content-Type: application/json\" -d '{\"message\":\"Bonjour, comment se passe mon suivi cette semaine ?\",\"history\":[]}' --max-time 30)",
|
||||
"Bash(curl -s \"https://generativelanguage.googleapis.com/v1beta/models?key=AIzaSyD7ltywmUmEooMOBiMkfyhQygCEU06LbR4\")",
|
||||
"Bash(curl -s -X POST \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=AIzaSyD7ltywmUmEooMOBiMkfyhQygCEU06LbR4\" -H \"Content-Type: application/json\" -d '{\"contents\":[{\"parts\":[{\"text\":\"Dis bonjour en une phrase.\"}]}]}')",
|
||||
"Bash(curl -s -X POST \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=AIzaSyD7ltywmUmEooMOBiMkfyhQygCEU06LbR4\" -H \"Content-Type: application/json\" -d '{\"contents\":[{\"parts\":[{\"text\":\"Dis bonjour en une phrase.\"}]}]}')",
|
||||
"Bash(curl -s -X POST http://localhost:3001/api/chat -H \"Content-Type: application/json\" -d '{\"message\":\"Comment se passe mon suivi cette semaine ?\",\"history\":[]}' --max-time 30)",
|
||||
"Bash(curl -s http://localhost:3001/api/daily-analysis --max-time 30)",
|
||||
"Bash(taskkill //PID 42196 //F)",
|
||||
"Bash(curl -s http://localhost:3001/api/daily-analysis --max-time 35)",
|
||||
"Bash(curl -s http://localhost:3001/api/daily-analysis --max-time 10)",
|
||||
"Bash(python -c \"import sys,json; d=json.load\\(sys.stdin\\); print\\('fresh:', d.get\\('fresh'\\), '| generatedAt:', d.get\\('generatedAt'\\)\\)\")",
|
||||
"Bash(taskkill //PID 33804 //F)",
|
||||
"Bash(curl -s http://localhost:3000/mobile)",
|
||||
"Bash(curl -s http://localhost:3001/mobile)",
|
||||
"Bash(npx tsc *)",
|
||||
"Bash(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:3000/)",
|
||||
"Bash(curl -s http://localhost:3001/dashboard)",
|
||||
"Bash(curl -sv http://localhost:3001/dashboard)",
|
||||
"Bash(python3 -c \"import sys; data=sys.stdin.read\\(\\); print\\(data[data.find\\('Error'\\):data.find\\('Error'\\)+500] if 'Error' in data else data[:500]\\)\")",
|
||||
"Bash(node -e \"console.log\\(require\\('./node_modules/next/package.json'\\).version\\)\")",
|
||||
"Bash(rm -rf .next)",
|
||||
"Bash(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:3001/)",
|
||||
"Bash(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:3001/dashboard)",
|
||||
"Bash(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:3002/)",
|
||||
"Bash(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:3002/dashboard)",
|
||||
"Bash(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:3002/auth/login)",
|
||||
"Bash(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:3002/pricing)",
|
||||
"Bash(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:3002/auth/register)",
|
||||
"Bash(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:3002/auth/verify-pending)",
|
||||
"Bash(taskkill //F //IM node.exe)",
|
||||
"Bash(curl -s -X POST http://localhost:3000/api/auth/register -H 'Content-Type: application/json' -d '{\"name\":\"Test User\",\"email\":\"test@test.com\",\"password\":\"password123\"}')",
|
||||
"Bash(curl -s -X POST http://localhost:3000/api/auth/register -H 'Content-Type: application/json' -d '{\"name\":\"Jean Dupont\",\"email\":\"jean__CMDSUB_OUTPUT__@example.com\",\"password\":\"motdepasse123\"}')",
|
||||
"mcp__Claude_in_Chrome__tabs_context_mcp",
|
||||
"mcp__Claude_in_Chrome__browser_batch",
|
||||
"mcp__Claude_in_Chrome__switch_browser",
|
||||
"mcp__Claude_in_Chrome__list_connected_browsers",
|
||||
"mcp__Claude_in_Chrome__select_browser",
|
||||
"Bash(taskkill /F /IM node.exe)",
|
||||
"PowerShell(Stop-Process -Name node -Force -ErrorAction SilentlyContinue)",
|
||||
"Bash(curl -s http://localhost:3000/pricing)",
|
||||
"Bash(cat)",
|
||||
"Bash(chmod +x test-stripe.sh)",
|
||||
"Bash(./test-stripe.sh)",
|
||||
"Bash(curl -s http://localhost:3000/pricing -X POST -H \"Content-Type: application/json\")",
|
||||
"Bash(pkill -9 node)",
|
||||
"mcp__Claude_in_Chrome__navigate",
|
||||
"mcp__Claude_in_Chrome__computer",
|
||||
"mcp__Claude_in_Chrome__form_input",
|
||||
"Bash(sqlite3 prisma/dev.db \"SELECT id, email, plan FROM User LIMIT 5;\")",
|
||||
"Bash(node -e ' *)",
|
||||
"Bash(npm exec *)",
|
||||
"Bash(node test-cancel-subscription.mjs)",
|
||||
"Bash(pkill -f \"next dev\")",
|
||||
"mcp__Claude_in_Chrome__find",
|
||||
"Bash(curl -s http://localhost:3000)",
|
||||
"Bash(node add_readings.js)",
|
||||
"mcp__Claude_in_Chrome__read_network_requests",
|
||||
"mcp__Claude_in_Chrome__read_console_messages",
|
||||
"Bash(taskkill /PID 54104 /F)",
|
||||
"Bash(file ~/Downloads/rapport_glycemie*.pdf)",
|
||||
"Bash(pdftotext ~/Downloads/rapport_glycemie_2026-04*.pdf -)",
|
||||
"Bash(node /tmp/check_pdf.js)",
|
||||
"Bash(tasklist)",
|
||||
"Bash(curl -s http://localhost:3000/dashboard/rapports -c /tmp/cookies.txt)",
|
||||
"Bash(curl -s \"http://localhost:3000/api/reports/generate-pdf?month=2026-04-01\" -H \"Cookie: $\\(curl -s http://localhost:3000/dashboard/rapports -c /tmp/cookies.txt)",
|
||||
"Bash(grep -o '[^ ]*$')",
|
||||
"Bash(chmod +x /tmp/deploy-setup.sh)",
|
||||
"Bash(git remote *)",
|
||||
"Bash(git add *)",
|
||||
"Bash(git commit -m ' *)",
|
||||
"Bash(git push *)",
|
||||
"Bash(tar -czf diabetix-build.tar.gz .next/ node_modules/ package.json package-lock.json public/ prisma/ src/ .env.production next.config.js tsconfig.json)",
|
||||
"Bash(rm diabetix-build.tar.gz)",
|
||||
"Bash(tar -czf diabetix-build.tar.gz .next/ node_modules/ package.json package-lock.json public/ prisma/schema.prisma prisma/migrations/ src/ next.config.ts tsconfig.json)",
|
||||
"Bash(scp diabetix-build.tar.gz root@192.168.20.28:/tmp/)",
|
||||
"Bash(sshpass -p \"Lucas1978!\" scp -o StrictHostKeyChecking=no diabetix-build.tar.gz root@192.168.20.28:/tmp/)"
|
||||
]
|
||||
}
|
||||
}
|
||||
65
.env.example
65
.env.example
@@ -1,65 +0,0 @@
|
||||
APP_NAME=Laravel
|
||||
APP_ENV=local
|
||||
APP_KEY=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://localhost
|
||||
|
||||
APP_LOCALE=en
|
||||
APP_FALLBACK_LOCALE=en
|
||||
APP_FAKER_LOCALE=en_US
|
||||
|
||||
APP_MAINTENANCE_DRIVER=file
|
||||
# APP_MAINTENANCE_STORE=database
|
||||
|
||||
# PHP_CLI_SERVER_WORKERS=4
|
||||
|
||||
BCRYPT_ROUNDS=12
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
LOG_STACK=single
|
||||
LOG_DEPRECATIONS_CHANNEL=null
|
||||
LOG_LEVEL=debug
|
||||
|
||||
DB_CONNECTION=sqlite
|
||||
# DB_HOST=127.0.0.1
|
||||
# DB_PORT=3306
|
||||
# DB_DATABASE=laravel
|
||||
# DB_USERNAME=root
|
||||
# DB_PASSWORD=
|
||||
|
||||
SESSION_DRIVER=database
|
||||
SESSION_LIFETIME=120
|
||||
SESSION_ENCRYPT=false
|
||||
SESSION_PATH=/
|
||||
SESSION_DOMAIN=null
|
||||
|
||||
BROADCAST_CONNECTION=log
|
||||
FILESYSTEM_DISK=local
|
||||
QUEUE_CONNECTION=database
|
||||
|
||||
CACHE_STORE=database
|
||||
# CACHE_PREFIX=
|
||||
|
||||
MEMCACHED_HOST=127.0.0.1
|
||||
|
||||
REDIS_CLIENT=phpredis
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
MAIL_MAILER=log
|
||||
MAIL_SCHEME=null
|
||||
MAIL_HOST=127.0.0.1
|
||||
MAIL_PORT=2525
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_FROM_ADDRESS="hello@example.com"
|
||||
MAIL_FROM_NAME="${APP_NAME}"
|
||||
|
||||
AWS_ACCESS_KEY_ID=
|
||||
AWS_SECRET_ACCESS_KEY=
|
||||
AWS_DEFAULT_REGION=us-east-1
|
||||
AWS_BUCKET=
|
||||
AWS_USE_PATH_STYLE_ENDPOINT=false
|
||||
|
||||
VITE_APP_NAME="${APP_NAME}"
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -22,3 +22,8 @@
|
||||
Homestead.json
|
||||
Homestead.yaml
|
||||
Thumbs.db
|
||||
|
||||
# Debug & temporary scripts (never commit these)
|
||||
fix_*.php
|
||||
test-*.php
|
||||
scratch/
|
||||
|
||||
99
README.md
99
README.md
@@ -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
|
||||
|
||||
### Prerequisites
|
||||
* PHP 8.3+
|
||||
* Composer
|
||||
* Node.js & NPM
|
||||
|
||||
### Installation
|
||||
|
||||
1. **Clone the repository**
|
||||
```bash
|
||||
composer require laravel/boost --dev
|
||||
|
||||
php artisan boost:install
|
||||
git clone <repository-url>
|
||||
cd QuizzCabm
|
||||
```
|
||||
|
||||
Boost provides your agent 15+ tools and skills that help agents build Laravel applications while following best practices.
|
||||
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.*
|
||||
|
||||
## Contributing
|
||||
3. **Environment Configuration**
|
||||
Edit your `.env` file to configure your database and other service providers.
|
||||
|
||||
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
|
||||
4. **Start the Development Server**
|
||||
```bash
|
||||
composer run dev
|
||||
```
|
||||
*This starts the Laravel server, Vite dev server, and the queue listener concurrently.*
|
||||
|
||||
## Code of Conduct
|
||||
## 📜 License
|
||||
|
||||
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).
|
||||
|
||||
## 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.
|
||||
|
||||
23
app/Console/Commands/CleanupLoginLogs.php
Normal file
23
app/Console/Commands/CleanupLoginLogs.php
Normal 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.");
|
||||
}
|
||||
}
|
||||
@@ -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([
|
||||
|
||||
131
app/Http/Controllers/Admin/CandidateExportController.php
Normal file
131
app/Http/Controllers/Admin/CandidateExportController.php
Normal 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);
|
||||
}
|
||||
}
|
||||
78
app/Http/Controllers/Admin/JobPositionAiHelperController.php
Normal file
78
app/Http/Controllers/Admin/JobPositionAiHelperController.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class JobPositionAiHelperController extends Controller
|
||||
{
|
||||
public function generate(Request $request)
|
||||
{
|
||||
if (!auth()->user()->isAdmin()) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
$request->validate([
|
||||
'title' => 'required|string',
|
||||
'description' => 'required|string',
|
||||
]);
|
||||
|
||||
$prompt = "Tu es un expert en ingénierie logicielle spécialisé dans la Fonction Publique Territoriale (FPT) et le Code Général de la Fonction Publique (CGFP).
|
||||
Mon application permet de créer des offres d'emploi. Je n'ai pas encore de backend RH métier. Ton rôle est de transformer une saisie utilisateur (souvent incomplète) en un objet JSON structuré respectant strictement les obligations réglementaires françaises (DVE, publicité légale).
|
||||
|
||||
### INPUT UTILISATEUR :
|
||||
Titre : {$request->title}
|
||||
Description : {$request->description}
|
||||
|
||||
### TES MISSIONS :
|
||||
1. ANALYSE STATUTAIRE : Identifie automatiquement la catégorie (A, B, C), le cadre d'emplois et les grades possibles selon l'intitulé du poste.
|
||||
2. COMPLÉTION RÉGLEMENTAIRE : Génère les mentions obligatoires manquantes (fondements juridiques pour les contractuels, références au CGFP).
|
||||
3. STRUCTURATION DES DONNÉES : Retourne uniquement un objet JSON contenant :
|
||||
- \"infos_poste\" : {intitule, categorie, cadre_emplois, grade_mini, grade_maxi}
|
||||
- \"conformite\" : {fondement_juridique_recrutement, mentions_legales_obligatoires: []}
|
||||
- \"publication\" : {support_obligatoire: \"Choisir le service public / Emploi Territorial\", delai_affichage_minimal: \"30 jours\"}
|
||||
- \"fiche_synthese\" : Un texte complet de l'annonce, richement formaté en Markdown (avec des titres ###, des puces -, et du texte en **gras** pour optimiser l'attractivité et le SEO), tout en restant conforme au droit.
|
||||
|
||||
### CONTRAINTES :
|
||||
- Ne propose que des cadres d'emplois existants dans la FPT (ex: Adjoint technique, Rédacteur, Attaché).
|
||||
- Si le poste semble ouvert aux contractuels, précise l'article L332-8 ou L332-14 du CGFP approprié.
|
||||
- L'ensemble de ta réponse doit être un objet JSON brut. Ne mets PAS de blocs de code markdown (comme ```json) autour de la réponse, retourne juste le JSON. Le contenu de la clé `fiche_synthese` DOIT cependant contenir du formatage Markdown interne.";
|
||||
|
||||
$apiKey = env('GEMINI_API_KEY');
|
||||
if (!$apiKey) {
|
||||
return response()->json(['error' => 'API Key non configurée'], 500);
|
||||
}
|
||||
|
||||
try {
|
||||
$response = Http::timeout(60)->post("https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent?key={$apiKey}", [
|
||||
'generationConfig' => [
|
||||
'temperature' => 0.2,
|
||||
'responseMimeType' => 'application/json'
|
||||
],
|
||||
'contents' => [
|
||||
['role' => 'user', 'parts' => [['text' => $prompt]]]
|
||||
]
|
||||
]);
|
||||
|
||||
if ($response->successful()) {
|
||||
$text = $response->json('candidates.0.content.parts.0.text');
|
||||
// Extract JSON if it contains markdown formatting
|
||||
preg_match('/\{.*\}/s', $text, $matches);
|
||||
$json = $matches[0] ?? $text;
|
||||
|
||||
return response()->json(json_decode($json, true));
|
||||
}
|
||||
|
||||
Log::error("Gemini API Error: " . $response->body());
|
||||
return response()->json(['error' => 'Erreur de génération IA'], 500);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
Log::error("Gemini Connection Failed: " . $e->getMessage());
|
||||
return response()->json(['error' => 'Erreur de connexion à l\'IA'], 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
27
app/Http/Controllers/Admin/LoginLogController.php
Normal file
27
app/Http/Controllers/Admin/LoginLogController.php
Normal 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
|
||||
]);
|
||||
}
|
||||
}
|
||||
55
app/Http/Controllers/Api/CandidateHoneypotController.php
Normal file
55
app/Http/Controllers/Api/CandidateHoneypotController.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CandidateHoneypotController extends Controller
|
||||
{
|
||||
public function logDirectoryTraversal(Request $request)
|
||||
{
|
||||
$this->logSecurityAlert('directory_traversal', $request);
|
||||
|
||||
// Fausse réponse pour faire croire que le serveur est vulnérable
|
||||
return response(
|
||||
"<html><body><h1>Index of /documents/private</h1><ul><li><a href='../'>../</a></li><li><a href='reponses_tests_2026.pdf'>reponses_tests_2026.pdf</a></li><li><a href='backup_db.sql'>backup_db.sql</a></li></ul></body></html>",
|
||||
200
|
||||
)->header('Content-Type', 'text/html');
|
||||
}
|
||||
|
||||
public function logMassAssignment(Request $request)
|
||||
{
|
||||
$this->logSecurityAlert('mass_assignment', $request);
|
||||
|
||||
// Faire croire que l'opération a réussi mais renvoyer une erreur 403 discrètement
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'message' => 'Profil mis à jour.',
|
||||
'debug' => 'Attempt logged.'
|
||||
], 403);
|
||||
}
|
||||
|
||||
public function downloadFakeFile(Request $request, $filename)
|
||||
{
|
||||
$this->logSecurityAlert('file_exfiltration', $request, ['filename' => $filename]);
|
||||
|
||||
// Faux contenu
|
||||
$content = "Ceci est un honeypot de sécurité. Votre action a été journalisée.";
|
||||
return response($content, 200)
|
||||
->header('Content-Type', 'text/plain')
|
||||
->header('Content-Disposition', 'attachment; filename="' . $filename . '"');
|
||||
}
|
||||
|
||||
private function logSecurityAlert(string $type, Request $request, array $extraPayload = [])
|
||||
{
|
||||
\App\Models\SecurityAlert::create([
|
||||
'user_id' => auth()->id(),
|
||||
'type' => $type,
|
||||
'endpoint' => $request->path(),
|
||||
'payload' => array_merge($request->all(), $extraPayload),
|
||||
'ip_address' => $request->ip(),
|
||||
'user_agent' => $request->userAgent(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -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]);
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -15,10 +15,14 @@ class CandidateController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$candidates = Candidate::with(['user', 'documents', 'attempts'])->latest()->get();
|
||||
$candidates = Candidate::with(['user', 'documents', 'attempts', 'tenant', 'jobPosition'])->latest()->get();
|
||||
$jobPositions = \App\Models\JobPosition::orderBy('title')->get();
|
||||
$tenants = \App\Models\Tenant::orderBy('name')->get();
|
||||
|
||||
return \Inertia\Inertia::render('Admin/Candidates/Index', [
|
||||
'candidates' => $candidates
|
||||
'candidates' => $candidates,
|
||||
'jobPositions' => $jobPositions,
|
||||
'tenants' => $tenants
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -35,31 +39,111 @@ class CandidateController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function selectedCandidates()
|
||||
{
|
||||
$candidates = Candidate::with(['user', 'jobPosition', 'attempts.quiz', 'documents'])
|
||||
->where('is_selected', true)
|
||||
->orderBy('sort_order')
|
||||
->get()
|
||||
->map(function($candidate) {
|
||||
$candidate->weighted_score = $candidate->weighted_score;
|
||||
return $candidate;
|
||||
});
|
||||
|
||||
return \Inertia\Inertia::render('Admin/Candidates/Selected', [
|
||||
'candidates' => $candidates
|
||||
]);
|
||||
}
|
||||
|
||||
public function map()
|
||||
{
|
||||
$candidates = Candidate::with(['user', 'jobPosition'])
|
||||
->whereNotNull('city')
|
||||
->where('city', '!=', '')
|
||||
->get()
|
||||
->map(function($c) {
|
||||
return [
|
||||
'id' => $c->id,
|
||||
'name' => $c->user->name,
|
||||
'city' => $c->city,
|
||||
'job' => $c->jobPosition?->title,
|
||||
'score' => $c->weighted_score
|
||||
];
|
||||
});
|
||||
|
||||
return \Inertia\Inertia::render('Admin/Candidates/Map', [
|
||||
'candidates' => $candidates
|
||||
]);
|
||||
}
|
||||
|
||||
public function updateOrder(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'ids' => 'required|array',
|
||||
'ids.*' => 'exists:candidates,id',
|
||||
]);
|
||||
|
||||
foreach ($request->ids as $index => $id) {
|
||||
Candidate::where('id', $id)->update(['sort_order' => $index]);
|
||||
}
|
||||
|
||||
return back()->with('success', 'Classement enregistré.');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required|string|max:255',
|
||||
'birth_name' => 'nullable|string|max:255',
|
||||
'usage_name' => 'nullable|string|max:255',
|
||||
'first_name' => 'nullable|string|max:255',
|
||||
'address' => 'nullable|string|max:255',
|
||||
'zip_code' => 'nullable|string|max:10',
|
||||
'email' => 'required|string|email|max:255|unique:users',
|
||||
'phone' => 'nullable|string|max:20',
|
||||
'linkedin_url' => 'nullable|url|max:255',
|
||||
'cv' => 'nullable|file|mimes:pdf|max:5120',
|
||||
'cover_letter' => 'nullable|file|mimes:pdf|max:5120',
|
||||
'city' => 'nullable|string|max:255',
|
||||
'birth_date' => 'nullable|date',
|
||||
'birth_place' => 'nullable|string|max:255',
|
||||
'nationality' => 'nullable|string|max:255',
|
||||
'current_situation' => 'nullable|string|max:255',
|
||||
'education_level' => 'nullable|string|max:255',
|
||||
'has_driving_license' => 'nullable|boolean',
|
||||
'cv' => 'nullable|mimes:pdf|max:5120',
|
||||
'cover_letter' => 'nullable|mimes:pdf|max:5120',
|
||||
'tenant_id' => 'nullable|exists:tenants,id',
|
||||
'job_position_id' => 'nullable|exists:job_positions,id',
|
||||
]);
|
||||
|
||||
$password = Str::random(10);
|
||||
|
||||
$name = $request->first_name
|
||||
? ($request->first_name . ' ' . ($request->usage_name ?? ''))
|
||||
: $request->name;
|
||||
|
||||
$user = User::create([
|
||||
'name' => $request->name,
|
||||
'name' => $name,
|
||||
'email' => $request->email,
|
||||
'password' => Hash::make($password),
|
||||
'role' => 'candidate',
|
||||
'tenant_id' => (auth()->user()->isSuperAdmin() || auth()->user()->isGestionnaireRH()) ? $request->tenant_id : auth()->user()->tenant_id,
|
||||
]);
|
||||
|
||||
$candidate = Candidate::create([
|
||||
'user_id' => $user->id,
|
||||
$candidate = $user->candidate()->create([
|
||||
'birth_name' => $request->birth_name,
|
||||
'usage_name' => $request->usage_name,
|
||||
'first_name' => $request->first_name,
|
||||
'address' => $request->address,
|
||||
'zip_code' => $request->zip_code,
|
||||
'phone' => $request->phone,
|
||||
'linkedin_url' => $request->linkedin_url,
|
||||
'city' => $request->city,
|
||||
'birth_date' => $request->birth_date,
|
||||
'birth_place' => $request->birth_place,
|
||||
'nationality' => $request->nationality,
|
||||
'current_situation' => $request->current_situation,
|
||||
'education_level' => $request->education_level,
|
||||
'has_driving_license' => $request->has_driving_license ?? false,
|
||||
'status' => 'en_attente',
|
||||
'tenant_id' => (auth()->user()->isSuperAdmin() || auth()->user()->isGestionnaireRH()) ? $request->tenant_id : auth()->user()->tenant_id,
|
||||
'job_position_id' => $request->job_position_id,
|
||||
]);
|
||||
|
||||
$this->storeDocument($candidate, $request->file('cv'), 'cv');
|
||||
@@ -71,27 +155,44 @@ class CandidateController extends Controller
|
||||
public function show(Candidate $candidate)
|
||||
{
|
||||
$candidate->load([
|
||||
'user',
|
||||
'user.securityAlerts',
|
||||
'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() || auth()->user()->isGestionnaireRH()) {
|
||||
$data['tenants'] = \App\Models\Tenant::orderBy('name')->get();
|
||||
}
|
||||
|
||||
return \Inertia\Inertia::render('Admin/Candidates/Show', $data);
|
||||
}
|
||||
|
||||
public function destroy(Candidate $candidate)
|
||||
@@ -112,10 +213,43 @@ class CandidateController extends Controller
|
||||
public function update(Request $request, Candidate $candidate)
|
||||
{
|
||||
$request->validate([
|
||||
'birth_name' => 'nullable|string|max:255',
|
||||
'usage_name' => 'nullable|string|max:255',
|
||||
'first_name' => 'nullable|string|max:255',
|
||||
'address' => 'nullable|string|max:255',
|
||||
'zip_code' => 'nullable|string|max:10',
|
||||
'phone' => 'nullable|string|max:255',
|
||||
'city' => 'nullable|string|max:255',
|
||||
'birth_date' => 'nullable|date',
|
||||
'birth_place' => 'nullable|string|max:255',
|
||||
'nationality' => 'nullable|string|max:255',
|
||||
'current_situation' => 'nullable|string|max:255',
|
||||
'education_level' => 'nullable|string|max:255',
|
||||
'has_driving_license' => 'nullable|boolean',
|
||||
'email' => 'nullable|string|email|max:255|unique:users,email,' . $candidate->user_id,
|
||||
'linkedin_url' => 'nullable|url|max:255',
|
||||
'cv' => 'nullable|file|mimes:pdf|max:5120',
|
||||
'cover_letter' => 'nullable|file|mimes:pdf|max:5120',
|
||||
]);
|
||||
|
||||
// Update User info if name or email present
|
||||
if ($request->has('email')) {
|
||||
$candidate->user->update(['email' => $request->email]);
|
||||
}
|
||||
|
||||
if ($request->has('first_name') || $request->has('usage_name')) {
|
||||
$firstName = $request->first_name ?? $candidate->first_name;
|
||||
$usageName = $request->usage_name ?? $candidate->usage_name;
|
||||
$candidate->user->update(['name' => $firstName . ' ' . $usageName]);
|
||||
}
|
||||
|
||||
// Update Candidate info
|
||||
$candidate->update($request->only([
|
||||
'birth_name', 'usage_name', 'first_name', 'address', 'zip_code',
|
||||
'phone', 'linkedin_url', 'city', 'birth_date', 'birth_place',
|
||||
'nationality', 'current_situation', 'education_level', 'has_driving_license'
|
||||
]));
|
||||
|
||||
if ($request->hasFile('cv')) {
|
||||
$this->replaceDocument($candidate, $request->file('cv'), 'cv');
|
||||
}
|
||||
@@ -124,20 +258,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:25',
|
||||
]);
|
||||
|
||||
$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)
|
||||
@@ -145,7 +283,7 @@ class CandidateController extends Controller
|
||||
$request->validate([
|
||||
'cv_score' => 'nullable|numeric|min:0|max:20',
|
||||
'motivation_score' => 'nullable|numeric|min:0|max:10',
|
||||
'interview_score' => 'nullable|numeric|min:0|max:30',
|
||||
'interview_score' => 'nullable|numeric|min:0|max:25',
|
||||
]);
|
||||
|
||||
$candidate->update($request->only(['cv_score', 'motivation_score', 'interview_score']));
|
||||
@@ -166,6 +304,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() && !auth()->user()->isGestionnaireRH()) {
|
||||
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);
|
||||
@@ -188,6 +350,17 @@ 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) {
|
||||
|
||||
@@ -13,7 +13,9 @@ class JobPositionController extends Controller
|
||||
$this->authorizeAdmin();
|
||||
|
||||
return Inertia::render('Admin/JobPositions/Index', [
|
||||
'jobPositions' => JobPosition::all()
|
||||
'jobPositions' => JobPosition::with(['tenant', 'quizzes'])->withCount('candidates')->get(),
|
||||
'tenants' => \App\Models\Tenant::orderBy('name')->get(),
|
||||
'quizzes' => \App\Models\Quiz::all()
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -26,15 +28,27 @@ class JobPositionController extends Controller
|
||||
'description' => 'required|string',
|
||||
'requirements' => 'nullable|array',
|
||||
'ai_prompt' => 'nullable|string',
|
||||
'ai_bypass_base_prompt' => 'boolean',
|
||||
'fpt_metadata' => 'nullable|array',
|
||||
'tenant_id' => 'nullable|exists:tenants,id',
|
||||
'quiz_ids' => 'nullable|array',
|
||||
'quiz_ids.*' => 'exists:quizzes,id',
|
||||
'expires_at' => 'nullable|date',
|
||||
]);
|
||||
|
||||
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'),
|
||||
'fpt_metadata' => $request->fpt_metadata,
|
||||
'tenant_id' => (auth()->user()->isSuperAdmin() || auth()->user()->isGestionnaireRH()) ? $request->tenant_id : auth()->user()->tenant_id,
|
||||
'expires_at' => $request->expires_at,
|
||||
]);
|
||||
|
||||
$jobPosition->quizzes()->sync($request->input('quiz_ids', []));
|
||||
|
||||
return back()->with('success', 'Fiche de poste créée avec succès.');
|
||||
}
|
||||
|
||||
@@ -47,6 +61,12 @@ class JobPositionController extends Controller
|
||||
'description' => 'required|string',
|
||||
'requirements' => 'nullable|array',
|
||||
'ai_prompt' => 'nullable|string',
|
||||
'ai_bypass_base_prompt' => 'boolean',
|
||||
'fpt_metadata' => 'nullable|array',
|
||||
'tenant_id' => 'nullable|exists:tenants,id',
|
||||
'quiz_ids' => 'nullable|array',
|
||||
'quiz_ids.*' => 'exists:quizzes,id',
|
||||
'expires_at' => 'nullable|date',
|
||||
]);
|
||||
|
||||
$jobPosition->update([
|
||||
@@ -54,8 +74,14 @@ 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'),
|
||||
'fpt_metadata' => $request->fpt_metadata,
|
||||
'tenant_id' => (auth()->user()->isSuperAdmin() || auth()->user()->isGestionnaireRH()) ? $request->tenant_id : auth()->user()->tenant_id,
|
||||
'expires_at' => $request->expires_at,
|
||||
]);
|
||||
|
||||
$jobPosition->quizzes()->sync($request->input('quiz_ids', []));
|
||||
|
||||
return back()->with('success', 'Fiche de poste mise à jour.');
|
||||
}
|
||||
|
||||
|
||||
133
app/Http/Controllers/PublicJobApplicationController.php
Normal file
133
app/Http/Controllers/PublicJobApplicationController.php
Normal file
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\JobPosition;
|
||||
use App\Models\Candidate;
|
||||
use App\Models\User;
|
||||
use App\Models\Document;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
use Inertia\Inertia;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class PublicJobApplicationController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$jobs = JobPosition::with('tenant')
|
||||
->where(function($q) {
|
||||
$q->whereNull('expires_at')
|
||||
->orWhere('expires_at', '>=', now());
|
||||
})
|
||||
->orderBy('created_at', 'desc')
|
||||
->get()
|
||||
->map(function($job) {
|
||||
$job->description = strip_tags(\Illuminate\Support\Str::markdown($job->description));
|
||||
return $job;
|
||||
});
|
||||
|
||||
return Inertia::render('Public/Jobs/Index', [
|
||||
'jobs' => $jobs
|
||||
]);
|
||||
}
|
||||
|
||||
public function show(JobPosition $jobPosition)
|
||||
{
|
||||
if ($jobPosition->expires_at && $jobPosition->expires_at->isPast()) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
$data = $jobPosition->toArray();
|
||||
$data['description_html'] = \Illuminate\Support\Str::markdown($jobPosition->description);
|
||||
|
||||
return Inertia::render('Public/Jobs/Show', [
|
||||
'jobPosition' => $data
|
||||
]);
|
||||
}
|
||||
|
||||
public function store(Request $request, JobPosition $jobPosition)
|
||||
{
|
||||
if ($jobPosition->expires_at && $jobPosition->expires_at->isPast()) {
|
||||
return back()->withErrors(['error' => 'Cette offre a expiré.']);
|
||||
}
|
||||
|
||||
$request->validate([
|
||||
'birth_name' => 'required|string|max:255',
|
||||
'usage_name' => 'required|string|max:255',
|
||||
'first_name' => 'required|string|max:255',
|
||||
'address' => 'required|string|max:255',
|
||||
'zip_code' => 'required|string|max:10',
|
||||
'city' => 'required|string|max:255',
|
||||
'phone' => 'required|string|max:20',
|
||||
'email' => 'required|string|email|max:255|unique:users|confirmed',
|
||||
'birth_date' => 'required|date',
|
||||
'birth_place' => 'required|string|max:255',
|
||||
'nationality' => 'required|string|max:255',
|
||||
'current_situation' => 'required|string|max:255',
|
||||
'education_level' => 'required|string|max:255',
|
||||
'has_driving_license' => 'required|boolean',
|
||||
'privacy_policy' => 'accepted',
|
||||
'cv' => 'nullable|mimes:pdf|max:5120',
|
||||
'cover_letter' => 'nullable|mimes:pdf|max:5120',
|
||||
]);
|
||||
|
||||
$password = Str::random(10);
|
||||
|
||||
$user = User::create([
|
||||
'name' => $request->first_name . ' ' . $request->usage_name,
|
||||
'email' => $request->email,
|
||||
'password' => Hash::make($password),
|
||||
'role' => 'candidate',
|
||||
'tenant_id' => $jobPosition->tenant_id,
|
||||
]);
|
||||
|
||||
$candidate = $user->candidate()->create([
|
||||
'birth_name' => $request->birth_name,
|
||||
'usage_name' => $request->usage_name,
|
||||
'first_name' => $request->first_name,
|
||||
'address' => $request->address,
|
||||
'zip_code' => $request->zip_code,
|
||||
'city' => $request->city,
|
||||
'phone' => $request->phone,
|
||||
'birth_date' => $request->birth_date,
|
||||
'birth_place' => $request->birth_place,
|
||||
'nationality' => $request->nationality,
|
||||
'current_situation' => $request->current_situation,
|
||||
'education_level' => $request->education_level,
|
||||
'has_driving_license' => $request->has_driving_license,
|
||||
'status' => 'en_attente',
|
||||
'tenant_id' => $jobPosition->tenant_id,
|
||||
'job_position_id' => $jobPosition->id,
|
||||
]);
|
||||
|
||||
if ($request->hasFile('cv')) {
|
||||
$this->storeDocument($candidate, $request->file('cv'), 'cv');
|
||||
}
|
||||
if ($request->hasFile('cover_letter')) {
|
||||
$this->storeDocument($candidate, $request->file('cover_letter'), 'cover_letter');
|
||||
}
|
||||
|
||||
// Auto-login
|
||||
Auth::login($user);
|
||||
|
||||
return redirect()->route('dashboard')->with('success', 'Votre candidature a bien été enregistrée. Voici votre mot de passe temporaire pour vous reconnecter : ' . $password);
|
||||
}
|
||||
|
||||
private function storeDocument(Candidate $candidate, $file, string $type)
|
||||
{
|
||||
if (!$file) {
|
||||
return;
|
||||
}
|
||||
|
||||
$path = $file->store('private/documents/' . $candidate->id, 'local');
|
||||
|
||||
Document::create([
|
||||
'candidate_id' => $candidate->id,
|
||||
'type' => $type,
|
||||
'file_path' => $path,
|
||||
'original_name' => $file->getClientOriginalName(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
64
app/Http/Controllers/TenantController.php
Normal file
64
app/Http/Controllers/TenantController.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Tenant;
|
||||
use Illuminate\Http\Request;
|
||||
use Inertia\Inertia;
|
||||
|
||||
class TenantController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
if (!auth()->user()->isSuperAdmin() && !auth()->user()->isGestionnaireRH()) {
|
||||
abort(403, 'Unauthorized action.');
|
||||
}
|
||||
|
||||
$tenants = Tenant::orderBy('name')->get();
|
||||
|
||||
return Inertia::render('Admin/Tenants/Index', [
|
||||
'tenants' => $tenants
|
||||
]);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
if (!auth()->user()->isSuperAdmin() && !auth()->user()->isGestionnaireRH()) {
|
||||
abort(403, 'Unauthorized action.');
|
||||
}
|
||||
|
||||
$request->validate([
|
||||
'name' => 'required|string|max:255|unique:tenants,name',
|
||||
]);
|
||||
|
||||
Tenant::create($request->only('name'));
|
||||
|
||||
return back()->with('success', 'Structure créée avec succès.');
|
||||
}
|
||||
|
||||
public function update(Request $request, Tenant $tenant)
|
||||
{
|
||||
if (!auth()->user()->isSuperAdmin() && !auth()->user()->isGestionnaireRH()) {
|
||||
abort(403, 'Unauthorized action.');
|
||||
}
|
||||
|
||||
$request->validate([
|
||||
'name' => 'required|string|max:255|unique:tenants,name,' . $tenant->id,
|
||||
]);
|
||||
|
||||
$tenant->update($request->only('name'));
|
||||
|
||||
return back()->with('success', 'Structure mise à jour.');
|
||||
}
|
||||
|
||||
public function destroy(Tenant $tenant)
|
||||
{
|
||||
if (!auth()->user()->isSuperAdmin() && !auth()->user()->isGestionnaireRH()) {
|
||||
abort(403, 'Unauthorized action.');
|
||||
}
|
||||
|
||||
$tenant->delete();
|
||||
|
||||
return back()->with('success', 'Structure supprimée.');
|
||||
}
|
||||
}
|
||||
111
app/Http/Controllers/UserController.php
Normal file
111
app/Http/Controllers/UserController.php
Normal file
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Models\Tenant;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
use Inertia\Inertia;
|
||||
|
||||
class UserController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
if (!auth()->user()->isSuperAdmin()) {
|
||||
abort(403, 'Unauthorized action.');
|
||||
}
|
||||
|
||||
$users = User::whereIn('role', ['admin', 'super_admin', 'gestionnaire_rh'])
|
||||
->with('tenant')
|
||||
->orderBy('name')
|
||||
->get();
|
||||
|
||||
$tenants = Tenant::orderBy('name')->get();
|
||||
|
||||
return Inertia::render('Admin/Users/Index', [
|
||||
'users' => $users,
|
||||
'tenants' => $tenants
|
||||
]);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
if (!auth()->user()->isSuperAdmin()) {
|
||||
abort(403, 'Unauthorized action.');
|
||||
}
|
||||
|
||||
$request->validate([
|
||||
'name' => 'required|string|max:255',
|
||||
'email' => 'required|string|email|max:255|unique:users',
|
||||
'role' => ['required', Rule::in(['admin', 'super_admin', 'gestionnaire_rh'])],
|
||||
'tenant_id' => 'nullable|exists:tenants,id',
|
||||
]);
|
||||
|
||||
$password = Str::random(10);
|
||||
|
||||
User::create([
|
||||
'name' => $request->name,
|
||||
'email' => $request->email,
|
||||
'password' => Hash::make($password),
|
||||
'role' => $request->role,
|
||||
'tenant_id' => ($request->role === 'super_admin' || $request->role === 'gestionnaire_rh') ? null : $request->tenant_id,
|
||||
]);
|
||||
|
||||
return back()->with('success', 'Administrateur créé avec succès. Mot de passe généré : ' . $password);
|
||||
}
|
||||
|
||||
public function update(Request $request, User $user)
|
||||
{
|
||||
if (!auth()->user()->isSuperAdmin()) {
|
||||
abort(403, 'Unauthorized action.');
|
||||
}
|
||||
|
||||
$request->validate([
|
||||
'name' => 'required|string|max:255',
|
||||
'email' => 'required|string|email|max:255|unique:users,email,' . $user->id,
|
||||
'role' => ['required', Rule::in(['admin', 'super_admin', 'gestionnaire_rh'])],
|
||||
'tenant_id' => 'nullable|exists:tenants,id',
|
||||
]);
|
||||
|
||||
$user->update([
|
||||
'name' => $request->name,
|
||||
'email' => $request->email,
|
||||
'role' => $request->role,
|
||||
'tenant_id' => ($request->role === 'super_admin' || $request->role === 'gestionnaire_rh') ? null : $request->tenant_id,
|
||||
]);
|
||||
|
||||
return back()->with('success', 'Administrateur mis à jour.');
|
||||
}
|
||||
|
||||
public function destroy(User $user)
|
||||
{
|
||||
if (!auth()->user()->isSuperAdmin()) {
|
||||
abort(403, 'Unauthorized action.');
|
||||
}
|
||||
|
||||
if ($user->id === auth()->id()) {
|
||||
return back()->with('error', 'Vous ne pouvez pas supprimer votre propre compte.');
|
||||
}
|
||||
|
||||
$user->delete();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -32,12 +32,14 @@ class HandleInertiaRequests extends Middleware
|
||||
return [
|
||||
...parent::share($request),
|
||||
'auth' => [
|
||||
'user' => $request->user(),
|
||||
'user' => $request->user() ? clone $request->user()->load('tenant') : null,
|
||||
],
|
||||
'flash' => [
|
||||
'success' => $request->session()->get('success'),
|
||||
'error' => $request->session()->get('error'),
|
||||
],
|
||||
'app_env' => config('app.env'),
|
||||
'app_version' => config('app.version'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
24
app/Http/Middleware/RestrictHrManager.php
Normal file
24
app/Http/Middleware/RestrictHrManager.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class RestrictHrManager
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param Closure(Request): (Response) $next
|
||||
*/
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
if (auth()->check() && auth()->user()->isGestionnaireRH()) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
30
app/Listeners/LogSuccessfulLogin.php
Normal file
30
app/Listeners/LogSuccessfulLogin.php
Normal 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(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -9,13 +9,30 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
#[Fillable(['user_id', 'job_position_id', 'phone', 'linkedin_url', 'status', 'notes', 'cv_score', 'motivation_score', 'interview_score', 'ai_analysis'])]
|
||||
use App\Traits\BelongsToTenant;
|
||||
|
||||
#[Fillable(['user_id', 'job_position_id', 'birth_name', 'usage_name', 'first_name', 'address', 'zip_code', 'phone', 'linkedin_url', 'city', 'birth_date', 'birth_place', 'nationality', 'current_situation', 'education_level', 'has_driving_license', 'status', 'is_selected', 'sort_order', 'notes', 'cv_score', 'motivation_score', 'interview_score', 'interview_details', 'ai_analysis', 'tenant_id'])]
|
||||
class Candidate extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
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',
|
||||
'has_driving_license' => 'boolean',
|
||||
'interview_details' => 'array',
|
||||
];
|
||||
|
||||
public function jobPosition(): BelongsTo
|
||||
@@ -37,7 +54,7 @@ class Candidate extends Model
|
||||
})->max() ?? 0;
|
||||
|
||||
$totalPoints = $cv + $motivation + $interview + $bestAttempt;
|
||||
$maxPoints = 20 + 10 + 30 + 20; // Total potentiel = 80
|
||||
$maxPoints = 20 + 10 + 25 + 20; // Total potentiel = 75
|
||||
|
||||
return round(($totalPoints / $maxPoints) * 20, 2);
|
||||
}
|
||||
|
||||
@@ -7,17 +7,28 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
#[Fillable(['title', 'description', 'requirements', 'ai_prompt'])]
|
||||
use App\Traits\BelongsToTenant;
|
||||
|
||||
#[Fillable(['title', 'description', 'requirements', 'ai_prompt', 'ai_bypass_base_prompt', 'gemini_cache_id', 'gemini_cache_expires_at', 'tenant_id', 'fpt_metadata', 'expires_at'])]
|
||||
class JobPosition extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasFactory, BelongsToTenant;
|
||||
|
||||
protected $casts = [
|
||||
'requirements' => 'array',
|
||||
'ai_bypass_base_prompt' => 'boolean',
|
||||
'gemini_cache_expires_at' => 'datetime',
|
||||
'fpt_metadata' => 'array',
|
||||
'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
16
app/Models/LoginLog.php
Normal 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);
|
||||
}
|
||||
}
|
||||
@@ -8,13 +8,20 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
#[Fillable(['title', 'description', 'duration_minutes'])]
|
||||
use App\Traits\BelongsToTenant;
|
||||
|
||||
#[Fillable(['title', 'description', 'duration_minutes', 'tenant_id'])]
|
||||
class Quiz extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasFactory, BelongsToTenant;
|
||||
|
||||
public function questions(): HasMany
|
||||
{
|
||||
return $this->hasMany(Question::class);
|
||||
}
|
||||
|
||||
public function jobPositions()
|
||||
{
|
||||
return $this->belongsToMany(JobPosition::class);
|
||||
}
|
||||
}
|
||||
|
||||
26
app/Models/SecurityAlert.php
Normal file
26
app/Models/SecurityAlert.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SecurityAlert extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'type',
|
||||
'endpoint',
|
||||
'payload',
|
||||
'ip_address',
|
||||
'user_agent',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'payload' => 'array',
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
31
app/Models/Tenant.php
Normal file
31
app/Models/Tenant.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
|
||||
#[Fillable(['name'])]
|
||||
class Tenant extends Model
|
||||
{
|
||||
public function users()
|
||||
{
|
||||
return $this->hasMany(User::class);
|
||||
}
|
||||
|
||||
public function candidates()
|
||||
{
|
||||
return $this->hasMany(Candidate::class);
|
||||
}
|
||||
|
||||
public function quizzes()
|
||||
{
|
||||
return $this->hasMany(Quiz::class);
|
||||
}
|
||||
|
||||
public function jobPositions()
|
||||
{
|
||||
return $this->hasMany(JobPosition::class);
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
|
||||
#[Fillable(['name', 'email', 'password', 'role'])]
|
||||
#[Fillable(['name', 'email', 'password', 'role', 'tenant_id'])]
|
||||
#[Hidden(['password', 'remember_token'])]
|
||||
class User extends Authenticatable
|
||||
{
|
||||
@@ -19,7 +19,17 @@ class User extends Authenticatable
|
||||
|
||||
public function isAdmin(): bool
|
||||
{
|
||||
return $this->role === 'admin';
|
||||
return in_array($this->role, ['admin', 'super_admin', 'gestionnaire_rh']);
|
||||
}
|
||||
|
||||
public function isSuperAdmin(): bool
|
||||
{
|
||||
return $this->role === 'super_admin';
|
||||
}
|
||||
|
||||
public function isGestionnaireRH(): bool
|
||||
{
|
||||
return $this->role === 'gestionnaire_rh';
|
||||
}
|
||||
|
||||
public function isCandidate(): bool
|
||||
@@ -32,6 +42,16 @@ class User extends Authenticatable
|
||||
return $this->hasOne(Candidate::class);
|
||||
}
|
||||
|
||||
public function tenant()
|
||||
{
|
||||
return $this->belongsTo(Tenant::class);
|
||||
}
|
||||
|
||||
public function securityAlerts()
|
||||
{
|
||||
return $this->hasMany(SecurityAlert::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the attributes that should be cast.
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
|
||||
$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.
|
||||
// --- 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');
|
||||
|
||||
DESCRIPTION DU POSTE:
|
||||
{$jobDesc}
|
||||
$staticPrompt = "{$baseInstruction} Ton rôle est d'analyser le profil d'un candidat pour le poste de '{$job->title}'.\n\n";
|
||||
|
||||
COMPÉTENCES REQUISES:
|
||||
{$requirements}
|
||||
$staticPrompt .= "DESCRIPTION DU POSTE:\n{$job->description}\n\n";
|
||||
|
||||
CONTENU DU CV:
|
||||
{$cvText}
|
||||
CONTENU DE LA LETTRE DE MOTIVATION:
|
||||
" . ($letterText ?? "Non fournie") . "
|
||||
if (!empty($job->requirements)) {
|
||||
$staticPrompt .= "COMPÉTENCES REQUISES:\n" . implode(", ", $job->requirements) . "\n\n";
|
||||
}
|
||||
|
||||
CONTEXTE ADDITIONNEL & INSTRUCTIONS PARTICULIÈRES:
|
||||
" . ($candidate->jobPosition->ai_prompt ?? "Aucune instruction spécifique.") . "
|
||||
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";
|
||||
}
|
||||
|
||||
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)
|
||||
$staticPrompt .= "FORMAT DE RÉPONSE ATTENDU:\n{$jsonFormat}\n";
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
// 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'
|
||||
];
|
||||
|
||||
foreach ($models as $model) {
|
||||
try {
|
||||
$response = Http::timeout(60)->post("https://generativelanguage.googleapis.com/v1/models/gemini-2.5-flash:generateContent?key=" . $apiKey, [
|
||||
'contents' => [['parts' => [['text' => $prompt]]]]
|
||||
]);
|
||||
$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()) {
|
||||
$text = $response->json('candidates.0.content.parts.0.text');
|
||||
return json_decode($this->extractJson($text), true);
|
||||
$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: " . $response->status() . " - " . $response->body());
|
||||
Log::error("Gemini API Error ($model): " . $response->status() . " - " . $response->body());
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
Log::error("Gemini Connection Failed: " . $e->getMessage());
|
||||
Log::error("Gemini Connection Failed ($model): " . $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"
|
||||
|
||||
44
app/Traits/BelongsToTenant.php
Normal file
44
app/Traits/BelongsToTenant.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Traits;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
trait BelongsToTenant
|
||||
{
|
||||
protected static function bootBelongsToTenant()
|
||||
{
|
||||
static::addGlobalScope('tenant', function (Builder $builder) {
|
||||
if (Auth::check()) {
|
||||
$user = Auth::user();
|
||||
|
||||
// Super admins see everything
|
||||
if ($user->role === 'super_admin') {
|
||||
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(function ($query) use ($user) {
|
||||
$query->where('tenant_id', $user->tenant_id)
|
||||
->orWhereNull('tenant_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
static::creating(function ($model) {
|
||||
if (Auth::check() && Auth::user()->tenant_id && Auth::user()->role !== 'super_admin') {
|
||||
$model->tenant_id = Auth::user()->tenant_id;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function tenant()
|
||||
{
|
||||
return $this->belongsTo(\App\Models\Tenant::class);
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
|
||||
$middleware->alias([
|
||||
'admin' => \App\Http\Middleware\AdminMiddleware::class,
|
||||
'restrict_hr' => \App\Http\Middleware\RestrictHrManager::class,
|
||||
]);
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions): void {
|
||||
|
||||
@@ -7,15 +7,20 @@
|
||||
"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": {
|
||||
"fakerphp/faker": "^1.23",
|
||||
"laravel-lang/common": "^6.8",
|
||||
"laravel/breeze": "^2.4",
|
||||
"laravel/pail": "^1.2.5",
|
||||
"laravel/pint": "^1.27",
|
||||
|
||||
2657
composer.lock
generated
2657
composer.lock
generated
File diff suppressed because it is too large
Load Diff
37
config/ai.php
Normal file
37
config/ai.php
Normal 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'),
|
||||
],
|
||||
// ...
|
||||
]
|
||||
];
|
||||
@@ -78,7 +78,7 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'locale' => env('APP_LOCALE', 'en'),
|
||||
'locale' => 'fr',
|
||||
|
||||
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
|
||||
|
||||
@@ -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'),
|
||||
|
||||
];
|
||||
|
||||
@@ -32,7 +32,7 @@ return [
|
||||
|
||||
'local' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app/private'),
|
||||
'root' => storage_path('app'),
|
||||
'serve' => true,
|
||||
'throw' => false,
|
||||
'report' => false,
|
||||
|
||||
@@ -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::create('tenants', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('tenants');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,56 @@
|
||||
<?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->foreignId('tenant_id')->nullable()->constrained()->nullOnDelete();
|
||||
});
|
||||
|
||||
Schema::table('candidates', function (Blueprint $table) {
|
||||
$table->foreignId('tenant_id')->nullable()->constrained()->nullOnDelete();
|
||||
});
|
||||
|
||||
Schema::table('quizzes', function (Blueprint $table) {
|
||||
$table->foreignId('tenant_id')->nullable()->constrained()->nullOnDelete();
|
||||
});
|
||||
|
||||
Schema::table('job_positions', function (Blueprint $table) {
|
||||
$table->foreignId('tenant_id')->nullable()->constrained()->nullOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropForeign(['tenant_id']);
|
||||
$table->dropColumn('tenant_id');
|
||||
});
|
||||
|
||||
Schema::table('candidates', function (Blueprint $table) {
|
||||
$table->dropForeign(['tenant_id']);
|
||||
$table->dropColumn('tenant_id');
|
||||
});
|
||||
|
||||
Schema::table('quizzes', function (Blueprint $table) {
|
||||
$table->dropForeign(['tenant_id']);
|
||||
$table->dropColumn('tenant_id');
|
||||
});
|
||||
|
||||
Schema::table('job_positions', function (Blueprint $table) {
|
||||
$table->dropForeign(['tenant_id']);
|
||||
$table->dropColumn('tenant_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -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();
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -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');
|
||||
}
|
||||
};
|
||||
@@ -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');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -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']);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -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');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -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');
|
||||
}
|
||||
};
|
||||
@@ -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');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -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->integer('sort_order')->default(0)->after('is_selected');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('candidates', function (Blueprint $table) {
|
||||
$table->dropColumn('sort_order');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -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->string('city')->nullable()->after('linkedin_url');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('candidates', function (Blueprint $table) {
|
||||
$table->dropColumn('city');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
<?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('security_alerts', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->nullable()->constrained()->onDelete('set null');
|
||||
$table->string('type'); // 'mass_assignment', 'directory_traversal', etc.
|
||||
$table->string('endpoint')->nullable();
|
||||
$table->json('payload')->nullable();
|
||||
$table->string('ip_address')->nullable();
|
||||
$table->text('user_agent')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('security_alerts');
|
||||
}
|
||||
};
|
||||
@@ -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->json('fpt_metadata')->nullable()->after('ai_bypass_base_prompt');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('job_positions', function (Blueprint $table) {
|
||||
$table->dropColumn('fpt_metadata');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -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->timestamp('expires_at')->nullable()->after('description');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('job_positions', function (Blueprint $table) {
|
||||
$table->dropColumn('expires_at');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,50 @@
|
||||
<?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->string('birth_name')->nullable()->after('user_id');
|
||||
$table->string('usage_name')->nullable()->after('birth_name');
|
||||
$table->string('first_name')->nullable()->after('usage_name');
|
||||
$table->string('address')->nullable()->after('first_name');
|
||||
$table->string('zip_code')->nullable()->after('address');
|
||||
$table->date('birth_date')->nullable()->after('city');
|
||||
$table->string('birth_place')->nullable()->after('birth_date');
|
||||
$table->string('nationality')->nullable()->after('birth_place');
|
||||
$table->string('current_situation')->nullable()->after('nationality');
|
||||
$table->string('education_level')->nullable()->after('current_situation');
|
||||
$table->boolean('has_driving_license')->default(false)->after('education_level');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('candidates', function (Blueprint $table) {
|
||||
$table->dropColumn([
|
||||
'birth_name',
|
||||
'usage_name',
|
||||
'first_name',
|
||||
'address',
|
||||
'zip_code',
|
||||
'birth_date',
|
||||
'birth_place',
|
||||
'nationality',
|
||||
'current_situation',
|
||||
'education_level',
|
||||
'has_driving_license'
|
||||
]);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
264
lang/en.json
Normal file
264
lang/en.json
Normal file
@@ -0,0 +1,264 @@
|
||||
{
|
||||
"(and :count more error)": "(and :count more error)",
|
||||
"(and :count more errors)": "(and :count more error)|(and :count more errors)|(and :count more errors)",
|
||||
"A decryption key is required.": "A decryption key is required.",
|
||||
"A new verification link has been sent to the email address you provided during registration.": "A new verification link has been sent to the email address you provided during registration.",
|
||||
"A new verification link has been sent to your email address.": "A new verification link has been sent to your email address.",
|
||||
"A Timeout Occurred": "A Timeout Occurred",
|
||||
"Accept": "Accept",
|
||||
"Accepted": "Accepted",
|
||||
"Action": "Action",
|
||||
"Actions": "Actions",
|
||||
"Add": "Add",
|
||||
"Add :name": "Add :name",
|
||||
"Admin": "Admin",
|
||||
"Agree": "Agree",
|
||||
"All rights reserved.": "All rights reserved.",
|
||||
"Already registered?": "Already registered?",
|
||||
"Already Reported": "Already Reported",
|
||||
"Archive": "Archive",
|
||||
"Are you sure you want to delete your account?": "Are you sure you want to delete your account?",
|
||||
"Assign": "Assign",
|
||||
"Associate": "Associate",
|
||||
"Attach": "Attach",
|
||||
"Bad Gateway": "Bad Gateway",
|
||||
"Bad Request": "Bad Request",
|
||||
"Bandwidth Limit Exceeded": "Bandwidth Limit Exceeded",
|
||||
"Browse": "Browse",
|
||||
"Cancel": "Cancel",
|
||||
"Choose": "Choose",
|
||||
"Choose :name": "Choose :name",
|
||||
"Choose File": "Choose File",
|
||||
"Choose Image": "Choose Image",
|
||||
"Click here to re-send the verification email.": "Click here to re-send the verification email.",
|
||||
"Click to copy": "Click to copy",
|
||||
"Client Closed Request": "Client Closed Request",
|
||||
"Close": "Close",
|
||||
"Collapse": "Collapse",
|
||||
"Collapse All": "Collapse All",
|
||||
"Comment": "Comment",
|
||||
"Confirm": "Confirm",
|
||||
"Confirm Password": "Confirm Password",
|
||||
"Conflict": "Conflict",
|
||||
"Connect": "Connect",
|
||||
"Connection Closed Without Response": "Connection Closed Without Response",
|
||||
"Connection Timed Out": "Connection Timed Out",
|
||||
"Continue": "Continue",
|
||||
"Create": "Create",
|
||||
"Create :name": "Create :name",
|
||||
"Created": "Created",
|
||||
"Current Password": "Current Password",
|
||||
"Dashboard": "Dashboard",
|
||||
"Delete": "Delete",
|
||||
"Delete :name": "Delete :name",
|
||||
"Delete Account": "Delete Account",
|
||||
"Detach": "Detach",
|
||||
"Details": "Details",
|
||||
"Disable": "Disable",
|
||||
"Discard": "Discard",
|
||||
"Done": "Done",
|
||||
"Down": "Down",
|
||||
"Duplicate": "Duplicate",
|
||||
"Duplicate :name": "Duplicate :name",
|
||||
"Edit": "Edit",
|
||||
"Edit :name": "Edit :name",
|
||||
"Email": "Email",
|
||||
"email": "The :attribute field must be a valid email address.",
|
||||
"Email Password Reset Link": "Email Password Reset Link",
|
||||
"Enable": "Enable",
|
||||
"Encrypted environment file already exists.": "Encrypted environment file already exists.",
|
||||
"Encrypted environment file not found.": "Encrypted environment file not found.",
|
||||
"Ensure your account is using a long, random password to stay secure.": "Ensure your account is using a long, random password to stay secure.",
|
||||
"Environment file already exists.": "Environment file already exists.",
|
||||
"Environment file not found.": "Environment file not found.",
|
||||
"errors": "errors",
|
||||
"Expand": "Expand",
|
||||
"Expand All": "Expand All",
|
||||
"Expectation Failed": "Expectation Failed",
|
||||
"Explanation": "Explanation",
|
||||
"Export": "Export",
|
||||
"Export :name": "Export :name",
|
||||
"Failed Dependency": "Failed Dependency",
|
||||
"File": "File",
|
||||
"Files": "Files",
|
||||
"Forbidden": "Forbidden",
|
||||
"Forgot your password?": "Forgot your password?",
|
||||
"Forgot your password? No problem. Just let us know your email address and we will email you a password reset link that will allow you to choose a new one.": "Forgot your password? No problem. Just let us know your email address and we will email you a password reset link that will allow you to choose a new one.",
|
||||
"Found": "Found",
|
||||
"Gateway Timeout": "Gateway Timeout",
|
||||
"Go Home": "Go Home",
|
||||
"Go to page :page": "Go to page :page",
|
||||
"Gone": "Gone",
|
||||
"Hello!": "Hello!",
|
||||
"Hide": "Hide",
|
||||
"Hide :name": "Hide :name",
|
||||
"Home": "Home",
|
||||
"HTTP Version Not Supported": "HTTP Version Not Supported",
|
||||
"I'm a teapot": "I'm a teapot",
|
||||
"If you did not create an account, no further action is required.": "If you did not create an account, no further action is required.",
|
||||
"If you did not request a password reset, no further action is required.": "If you did not request a password reset, no further action is required.",
|
||||
"If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:": "If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:",
|
||||
"IM Used": "IM Used",
|
||||
"Image": "Image",
|
||||
"Impersonate": "Impersonate",
|
||||
"Impersonation": "Impersonation",
|
||||
"Import": "Import",
|
||||
"Import :name": "Import :name",
|
||||
"Insufficient Storage": "Insufficient Storage",
|
||||
"Internal Server Error": "Internal Server Error",
|
||||
"Introduction": "Introduction",
|
||||
"Invalid filename.": "Invalid filename.",
|
||||
"Invalid JSON was returned from the route.": "Invalid JSON was returned from the route.",
|
||||
"Invalid SSL Certificate": "Invalid SSL Certificate",
|
||||
"length": "length",
|
||||
"Length Required": "Length Required",
|
||||
"Like": "Like",
|
||||
"Load": "Load",
|
||||
"Localize": "Localize",
|
||||
"Location": "Location",
|
||||
"Locked": "Locked",
|
||||
"Log In": "Log In",
|
||||
"Log in": "Log in",
|
||||
"Log Out": "Log Out",
|
||||
"Login": "Login",
|
||||
"Logout": "Logout",
|
||||
"Loop Detected": "Loop Detected",
|
||||
"Maintenance Mode": "Maintenance Mode",
|
||||
"Method Not Allowed": "Method Not Allowed",
|
||||
"Misdirected Request": "Misdirected Request",
|
||||
"Moved Permanently": "Moved Permanently",
|
||||
"Multi-Status": "Multi-Status",
|
||||
"Multiple Choices": "Multiple Choices",
|
||||
"Name": "Name",
|
||||
"name": "name",
|
||||
"Network Authentication Required": "Network Authentication Required",
|
||||
"Network Connect Timeout Error": "Network Connect Timeout Error",
|
||||
"Network Read Timeout Error": "Network Read Timeout Error",
|
||||
"New": "New",
|
||||
"New :name": "New :name",
|
||||
"New Password": "New Password",
|
||||
"No": "No",
|
||||
"No Content": "No Content",
|
||||
"Non-Authoritative Information": "Non-Authoritative Information",
|
||||
"Not Acceptable": "Not Acceptable",
|
||||
"Not Extended": "Not Extended",
|
||||
"Not Found": "Not Found",
|
||||
"Not Implemented": "Not Implemented",
|
||||
"Not Modified": "Not Modified",
|
||||
"of": "of",
|
||||
"OK": "OK",
|
||||
"Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.": "Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.",
|
||||
"Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.": "Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.",
|
||||
"Open": "Open",
|
||||
"Open in a current window": "Open in a current window",
|
||||
"Open in a new window": "Open in a new window",
|
||||
"Open in a parent frame": "Open in a parent frame",
|
||||
"Open in the topmost frame": "Open in the topmost frame",
|
||||
"Open on the website": "Open on the website",
|
||||
"Origin Is Unreachable": "Origin Is Unreachable",
|
||||
"Page Expired": "Page Expired",
|
||||
"Pagination Navigation": "Pagination Navigation",
|
||||
"Partial Content": "Partial Content",
|
||||
"Password": "Password",
|
||||
"password": "The provided password is incorrect.",
|
||||
"Payload Too Large": "Payload Too Large",
|
||||
"Payment Required": "Payment Required",
|
||||
"Permanent Redirect": "Permanent Redirect",
|
||||
"Please click the button below to verify your email address.": "Please click the button below to verify your email address.",
|
||||
"Precondition Failed": "Precondition Failed",
|
||||
"Precondition Required": "Precondition Required",
|
||||
"Preview": "Preview",
|
||||
"Price": "Price",
|
||||
"Processing": "Processing",
|
||||
"Profile": "Profile",
|
||||
"Profile Information": "Profile Information",
|
||||
"Proxy Authentication Required": "Proxy Authentication Required",
|
||||
"Railgun Error": "Railgun Error",
|
||||
"Range Not Satisfiable": "Range Not Satisfiable",
|
||||
"Record": "Record",
|
||||
"Regards,": "Regards,",
|
||||
"Register": "Register",
|
||||
"Remember me": "Remember me",
|
||||
"Request Header Fields Too Large": "Request Header Fields Too Large",
|
||||
"Request Timeout": "Request Timeout",
|
||||
"Resend Verification Email": "Resend Verification Email",
|
||||
"Reset Content": "Reset Content",
|
||||
"Reset Password": "Reset Password",
|
||||
"Reset your password": "Reset your password",
|
||||
"Restore": "Restore",
|
||||
"Restore :name": "Restore :name",
|
||||
"results": "results",
|
||||
"Retry With": "Retry With",
|
||||
"Save": "Save",
|
||||
"Save & Close": "Save & Close",
|
||||
"Save & Return": "Save & Return",
|
||||
"Save :name": "Save :name",
|
||||
"Saved.": "Saved.",
|
||||
"Search": "Search",
|
||||
"Search :name": "Search :name",
|
||||
"See Other": "See Other",
|
||||
"Select": "Select",
|
||||
"Select All": "Select All",
|
||||
"Send": "Send",
|
||||
"Server Error": "Server Error",
|
||||
"Service Unavailable": "Service Unavailable",
|
||||
"Session Has Expired": "Session Has Expired",
|
||||
"Settings": "Settings",
|
||||
"Show": "Show",
|
||||
"Show :name": "Show :name",
|
||||
"Show All": "Show All",
|
||||
"Showing": "Showing",
|
||||
"Sign In": "Sign In",
|
||||
"Solve": "Solve",
|
||||
"SSL Handshake Failed": "SSL Handshake Failed",
|
||||
"Start": "Start",
|
||||
"Stop": "Stop",
|
||||
"Submit": "Submit",
|
||||
"Subscribe": "Subscribe",
|
||||
"Switch": "Switch",
|
||||
"Switch To Role": "Switch To Role",
|
||||
"Switching Protocols": "Switching Protocols",
|
||||
"Tag": "Tag",
|
||||
"Tags": "Tags",
|
||||
"Temporary Redirect": "Temporary Redirect",
|
||||
"Thanks for signing up! Before getting started, could you verify your email address by clicking on the link we just emailed to you? If you didn't receive the email, we will gladly send you another.": "Thanks for signing up! Before getting started, could you verify your email address by clicking on the link we just emailed to you? If you didn't receive the email, we will gladly send you another.",
|
||||
"The given data was invalid.": "The given data was invalid.",
|
||||
"The response is not a streamed response.": "The response is not a streamed response.",
|
||||
"The response is not a view.": "The response is not a view.",
|
||||
"This action is unauthorized.": "This action is unauthorized.",
|
||||
"This is a secure area of the application. Please confirm your password before continuing.": "This is a secure area of the application. Please confirm your password before continuing.",
|
||||
"This password reset link will expire in :count minutes.": "This password reset link will expire in :count minutes.",
|
||||
"to": "to",
|
||||
"Toggle navigation": "Toggle navigation",
|
||||
"Too Early": "Too Early",
|
||||
"Too Many Requests": "Too Many Requests",
|
||||
"Translate": "Translate",
|
||||
"Translate It": "Translate It",
|
||||
"Unauthorized": "Unauthorized",
|
||||
"Unavailable For Legal Reasons": "Unavailable For Legal Reasons",
|
||||
"Unknown Error": "Unknown Error",
|
||||
"Unpack": "Unpack",
|
||||
"Unprocessable Entity": "Unprocessable Entity",
|
||||
"Unsubscribe": "Unsubscribe",
|
||||
"Unsupported Media Type": "Unsupported Media Type",
|
||||
"Up": "Up",
|
||||
"Update": "Update",
|
||||
"Update :name": "Update :name",
|
||||
"Update Password": "Update Password",
|
||||
"Update your account's profile information and email address.": "Update your account's profile information and email address.",
|
||||
"Upgrade Required": "Upgrade Required",
|
||||
"URI Too Long": "URI Too Long",
|
||||
"Use Proxy": "Use Proxy",
|
||||
"User": "User",
|
||||
"Variant Also Negotiates": "Variant Also Negotiates",
|
||||
"Verify Email Address": "Verify Email Address",
|
||||
"Verify your email address": "Verify your email address",
|
||||
"View": "View",
|
||||
"View :name": "View :name",
|
||||
"Web Server is Down": "Web Server is Down",
|
||||
"Whoops!": "Whoops!",
|
||||
"Yes": "Yes",
|
||||
"You are receiving this email because we received a password reset request for your account.": "You are receiving this email because we received a password reset request for your account.",
|
||||
"You're logged in!": "You're logged in!",
|
||||
"Your email address is unverified.": "Your email address is unverified."
|
||||
}
|
||||
119
lang/en/actions.php
Normal file
119
lang/en/actions.php
Normal file
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'accept' => 'Accept',
|
||||
'action' => 'Action',
|
||||
'actions' => 'Actions',
|
||||
'add' => 'Add',
|
||||
'admin' => 'Admin',
|
||||
'agree' => 'Agree',
|
||||
'archive' => 'Archive',
|
||||
'assign' => 'Assign',
|
||||
'associate' => 'Associate',
|
||||
'attach' => 'Attach',
|
||||
'browse' => 'Browse',
|
||||
'cancel' => 'Cancel',
|
||||
'choose' => 'Choose',
|
||||
'choose_file' => 'Choose File',
|
||||
'choose_image' => 'Choose Image',
|
||||
'click_to_copy' => 'Click to copy',
|
||||
'close' => 'Close',
|
||||
'collapse' => 'Collapse',
|
||||
'collapse_all' => 'Collapse All',
|
||||
'comment' => 'Comment',
|
||||
'confirm' => 'Confirm',
|
||||
'connect' => 'Connect',
|
||||
'create' => 'Create',
|
||||
'delete' => 'Delete',
|
||||
'detach' => 'Detach',
|
||||
'details' => 'Details',
|
||||
'disable' => 'Disable',
|
||||
'discard' => 'Discard',
|
||||
'done' => 'Done',
|
||||
'down' => 'Down',
|
||||
'duplicate' => 'Duplicate',
|
||||
'edit' => 'Edit',
|
||||
'enable' => 'Enable',
|
||||
'expand' => 'Expand',
|
||||
'expand_all' => 'Expand All',
|
||||
'explanation' => 'Explanation',
|
||||
'export' => 'Export',
|
||||
'file' => 'File',
|
||||
'files' => 'Files',
|
||||
'go_home' => 'Go Home',
|
||||
'hide' => 'Hide',
|
||||
'home' => 'Home',
|
||||
'image' => 'Image',
|
||||
'impersonate' => 'Impersonate',
|
||||
'impersonation' => 'Impersonation',
|
||||
'import' => 'Import',
|
||||
'introduction' => 'Introduction',
|
||||
'like' => 'Like',
|
||||
'load' => 'Load',
|
||||
'localize' => 'Localize',
|
||||
'log_in' => 'Log In',
|
||||
'log_out' => 'Log Out',
|
||||
'named' => [
|
||||
'add' => 'Add :name',
|
||||
'choose' => 'Choose :name',
|
||||
'create' => 'Create :name',
|
||||
'delete' => 'Delete :name',
|
||||
'duplicate' => 'Duplicate :name',
|
||||
'edit' => 'Edit :name',
|
||||
'export' => 'Export :name',
|
||||
'hide' => 'Hide :name',
|
||||
'import' => 'Import :name',
|
||||
'new' => 'New :name',
|
||||
'restore' => 'Restore :name',
|
||||
'save' => 'Save :name',
|
||||
'search' => 'Search :name',
|
||||
'show' => 'Show :name',
|
||||
'update' => 'Update :name',
|
||||
'view' => 'View :name',
|
||||
],
|
||||
'new' => 'New',
|
||||
'no' => 'No',
|
||||
'open' => 'Open',
|
||||
'open_website' => 'Open on the website',
|
||||
'preview' => 'Preview',
|
||||
'price' => 'Price',
|
||||
'record' => 'Record',
|
||||
'restore' => 'Restore',
|
||||
'save' => 'Save',
|
||||
'save_and_close' => 'Save & Close',
|
||||
'save_and_return' => 'Save & Return',
|
||||
'search' => 'Search',
|
||||
'select' => 'Select',
|
||||
'select_all' => 'Select All',
|
||||
'send' => 'Send',
|
||||
'settings' => 'Settings',
|
||||
'show' => 'Show',
|
||||
'show_all' => 'Show All',
|
||||
'sign_in' => 'Sign In',
|
||||
'solve' => 'Solve',
|
||||
'start' => 'Start',
|
||||
'stop' => 'Stop',
|
||||
'submit' => 'Submit',
|
||||
'subscribe' => 'Subscribe',
|
||||
'switch' => 'Switch',
|
||||
'switch_to_role' => 'Switch To Role',
|
||||
'tag' => 'Tag',
|
||||
'tags' => 'Tags',
|
||||
'target_link' => [
|
||||
'blank' => 'Open in a new window',
|
||||
'parent' => 'Open in a parent frame',
|
||||
'self' => 'Open in a current window',
|
||||
'top' => 'Open in the topmost frame',
|
||||
],
|
||||
'translate' => 'Translate',
|
||||
'translate_it' => 'Translate It',
|
||||
'unpack' => 'Unpack',
|
||||
'unsubscribe' => 'Unsubscribe',
|
||||
'up' => 'Up',
|
||||
'update' => 'Update',
|
||||
'user' => 'User',
|
||||
'view' => 'View',
|
||||
'yes' => 'Yes',
|
||||
];
|
||||
9
lang/en/auth.php
Normal file
9
lang/en/auth.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'failed' => 'These credentials do not match our records.',
|
||||
'password' => 'The provided password is incorrect.',
|
||||
'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
|
||||
];
|
||||
84
lang/en/http-statuses.php
Normal file
84
lang/en/http-statuses.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'0' => 'Unknown Error',
|
||||
'100' => 'Continue',
|
||||
'101' => 'Switching Protocols',
|
||||
'102' => 'Processing',
|
||||
'200' => 'OK',
|
||||
'201' => 'Created',
|
||||
'202' => 'Accepted',
|
||||
'203' => 'Non-Authoritative Information',
|
||||
'204' => 'No Content',
|
||||
'205' => 'Reset Content',
|
||||
'206' => 'Partial Content',
|
||||
'207' => 'Multi-Status',
|
||||
'208' => 'Already Reported',
|
||||
'226' => 'IM Used',
|
||||
'300' => 'Multiple Choices',
|
||||
'301' => 'Moved Permanently',
|
||||
'302' => 'Found',
|
||||
'303' => 'See Other',
|
||||
'304' => 'Not Modified',
|
||||
'305' => 'Use Proxy',
|
||||
'307' => 'Temporary Redirect',
|
||||
'308' => 'Permanent Redirect',
|
||||
'400' => 'Bad Request',
|
||||
'401' => 'Unauthorized',
|
||||
'402' => 'Payment Required',
|
||||
'403' => 'Forbidden',
|
||||
'404' => 'Not Found',
|
||||
'405' => 'Method Not Allowed',
|
||||
'406' => 'Not Acceptable',
|
||||
'407' => 'Proxy Authentication Required',
|
||||
'408' => 'Request Timeout',
|
||||
'409' => 'Conflict',
|
||||
'410' => 'Gone',
|
||||
'411' => 'Length Required',
|
||||
'412' => 'Precondition Failed',
|
||||
'413' => 'Payload Too Large',
|
||||
'414' => 'URI Too Long',
|
||||
'415' => 'Unsupported Media Type',
|
||||
'416' => 'Range Not Satisfiable',
|
||||
'417' => 'Expectation Failed',
|
||||
'418' => 'I\'m a teapot',
|
||||
'419' => 'Session Has Expired',
|
||||
'421' => 'Misdirected Request',
|
||||
'422' => 'Unprocessable Entity',
|
||||
'423' => 'Locked',
|
||||
'424' => 'Failed Dependency',
|
||||
'425' => 'Too Early',
|
||||
'426' => 'Upgrade Required',
|
||||
'428' => 'Precondition Required',
|
||||
'429' => 'Too Many Requests',
|
||||
'431' => 'Request Header Fields Too Large',
|
||||
'444' => 'Connection Closed Without Response',
|
||||
'449' => 'Retry With',
|
||||
'451' => 'Unavailable For Legal Reasons',
|
||||
'499' => 'Client Closed Request',
|
||||
'500' => 'Internal Server Error',
|
||||
'501' => 'Not Implemented',
|
||||
'502' => 'Bad Gateway',
|
||||
'503' => 'Maintenance Mode',
|
||||
'504' => 'Gateway Timeout',
|
||||
'505' => 'HTTP Version Not Supported',
|
||||
'506' => 'Variant Also Negotiates',
|
||||
'507' => 'Insufficient Storage',
|
||||
'508' => 'Loop Detected',
|
||||
'509' => 'Bandwidth Limit Exceeded',
|
||||
'510' => 'Not Extended',
|
||||
'511' => 'Network Authentication Required',
|
||||
'520' => 'Unknown Error',
|
||||
'521' => 'Web Server is Down',
|
||||
'522' => 'Connection Timed Out',
|
||||
'523' => 'Origin Is Unreachable',
|
||||
'524' => 'A Timeout Occurred',
|
||||
'525' => 'SSL Handshake Failed',
|
||||
'526' => 'Invalid SSL Certificate',
|
||||
'527' => 'Railgun Error',
|
||||
'598' => 'Network Read Timeout Error',
|
||||
'599' => 'Network Connect Timeout Error',
|
||||
'unknownError' => 'Unknown Error',
|
||||
];
|
||||
8
lang/en/pagination.php
Normal file
8
lang/en/pagination.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'next' => 'Next »',
|
||||
'previous' => '« Previous',
|
||||
];
|
||||
11
lang/en/passwords.php
Normal file
11
lang/en/passwords.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'reset' => 'Your password has been reset.',
|
||||
'sent' => 'We have emailed your password reset link.',
|
||||
'throttled' => 'Please wait before retrying.',
|
||||
'token' => 'This password reset token is invalid.',
|
||||
'user' => 'We can\'t find a user with that email address.',
|
||||
];
|
||||
288
lang/en/validation.php
Normal file
288
lang/en/validation.php
Normal file
@@ -0,0 +1,288 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'accepted' => 'The :attribute field must be accepted.',
|
||||
'accepted_if' => 'The :attribute field must be accepted when :other is :value.',
|
||||
'active_url' => 'The :attribute field must be a valid URL.',
|
||||
'after' => 'The :attribute field must be a date after :date.',
|
||||
'after_or_equal' => 'The :attribute field must be a date after or equal to :date.',
|
||||
'alpha' => 'The :attribute field must only contain letters.',
|
||||
'alpha_dash' => 'The :attribute field must only contain letters, numbers, dashes, and underscores.',
|
||||
'alpha_num' => 'The :attribute field must only contain letters and numbers.',
|
||||
'any_of' => 'The :attribute field is invalid.',
|
||||
'array' => 'The :attribute field must be an array.',
|
||||
'ascii' => 'The :attribute field must only contain single-byte alphanumeric characters and symbols.',
|
||||
'before' => 'The :attribute field must be a date before :date.',
|
||||
'before_or_equal' => 'The :attribute field must be a date before or equal to :date.',
|
||||
'between' => [
|
||||
'array' => 'The :attribute field must have between :min and :max items.',
|
||||
'file' => 'The :attribute field must be between :min and :max kilobytes.',
|
||||
'numeric' => 'The :attribute field must be between :min and :max.',
|
||||
'string' => 'The :attribute field must be between :min and :max characters.',
|
||||
],
|
||||
'boolean' => 'The :attribute field must be true or false.',
|
||||
'can' => 'The :attribute field contains an unauthorized value.',
|
||||
'confirmed' => 'The :attribute field confirmation does not match.',
|
||||
'contains' => 'The :attribute field is missing a required value.',
|
||||
'current_password' => 'The password is incorrect.',
|
||||
'date' => 'The :attribute field must be a valid date.',
|
||||
'date_equals' => 'The :attribute field must be a date equal to :date.',
|
||||
'date_format' => 'The :attribute field must match the format :format.',
|
||||
'decimal' => 'The :attribute field must have :decimal decimal places.',
|
||||
'declined' => 'The :attribute field must be declined.',
|
||||
'declined_if' => 'The :attribute field must be declined when :other is :value.',
|
||||
'different' => 'The :attribute field and :other must be different.',
|
||||
'digits' => 'The :attribute field must be :digits digits.',
|
||||
'digits_between' => 'The :attribute field must be between :min and :max digits.',
|
||||
'dimensions' => 'The :attribute field has invalid image dimensions.',
|
||||
'distinct' => 'The :attribute field has a duplicate value.',
|
||||
'doesnt_contain' => 'The :attribute field must not contain any of the following: :values.',
|
||||
'doesnt_end_with' => 'The :attribute field must not end with one of the following: :values.',
|
||||
'doesnt_start_with' => 'The :attribute field must not start with one of the following: :values.',
|
||||
'email' => 'The :attribute field must be a valid email address.',
|
||||
'encoding' => 'The :attribute field must be encoded in :encoding.',
|
||||
'ends_with' => 'The :attribute field must end with one of the following: :values.',
|
||||
'enum' => 'The selected :attribute is invalid.',
|
||||
'exists' => 'The selected :attribute is invalid.',
|
||||
'extensions' => 'The :attribute field must have one of the following extensions: :values.',
|
||||
'file' => 'The :attribute field must be a file.',
|
||||
'filled' => 'The :attribute field must have a value.',
|
||||
'gt' => [
|
||||
'array' => 'The :attribute field must have more than :value items.',
|
||||
'file' => 'The :attribute field must be greater than :value kilobytes.',
|
||||
'numeric' => 'The :attribute field must be greater than :value.',
|
||||
'string' => 'The :attribute field must be greater than :value characters.',
|
||||
],
|
||||
'gte' => [
|
||||
'array' => 'The :attribute field must have :value items or more.',
|
||||
'file' => 'The :attribute field must be greater than or equal to :value kilobytes.',
|
||||
'numeric' => 'The :attribute field must be greater than or equal to :value.',
|
||||
'string' => 'The :attribute field must be greater than or equal to :value characters.',
|
||||
],
|
||||
'hex_color' => 'The :attribute field must be a valid hexadecimal color.',
|
||||
'image' => 'The :attribute field must be an image.',
|
||||
'in' => 'The selected :attribute is invalid.',
|
||||
'in_array' => 'The :attribute field must exist in :other.',
|
||||
'in_array_keys' => 'The :attribute field must contain at least one of the following keys: :values.',
|
||||
'integer' => 'The :attribute field must be an integer.',
|
||||
'ip' => 'The :attribute field must be a valid IP address.',
|
||||
'ipv4' => 'The :attribute field must be a valid IPv4 address.',
|
||||
'ipv6' => 'The :attribute field must be a valid IPv6 address.',
|
||||
'json' => 'The :attribute field must be a valid JSON string.',
|
||||
'list' => 'The :attribute field must be a list.',
|
||||
'lowercase' => 'The :attribute field must be lowercase.',
|
||||
'lt' => [
|
||||
'array' => 'The :attribute field must have less than :value items.',
|
||||
'file' => 'The :attribute field must be less than :value kilobytes.',
|
||||
'numeric' => 'The :attribute field must be less than :value.',
|
||||
'string' => 'The :attribute field must be less than :value characters.',
|
||||
],
|
||||
'lte' => [
|
||||
'array' => 'The :attribute field must not have more than :value items.',
|
||||
'file' => 'The :attribute field must be less than or equal to :value kilobytes.',
|
||||
'numeric' => 'The :attribute field must be less than or equal to :value.',
|
||||
'string' => 'The :attribute field must be less than or equal to :value characters.',
|
||||
],
|
||||
'mac_address' => 'The :attribute field must be a valid MAC address.',
|
||||
'max' => [
|
||||
'array' => 'The :attribute field must not have more than :max items.',
|
||||
'file' => 'The :attribute field must not be greater than :max kilobytes.',
|
||||
'numeric' => 'The :attribute field must not be greater than :max.',
|
||||
'string' => 'The :attribute field must not be greater than :max characters.',
|
||||
],
|
||||
'max_digits' => 'The :attribute field must not have more than :max digits.',
|
||||
'mimes' => 'The :attribute field must be a file of type: :values.',
|
||||
'mimetypes' => 'The :attribute field must be a file of type: :values.',
|
||||
'min' => [
|
||||
'array' => 'The :attribute field must have at least :min items.',
|
||||
'file' => 'The :attribute field must be at least :min kilobytes.',
|
||||
'numeric' => 'The :attribute field must be at least :min.',
|
||||
'string' => 'The :attribute field must be at least :min characters.',
|
||||
],
|
||||
'min_digits' => 'The :attribute field must have at least :min digits.',
|
||||
'missing' => 'The :attribute field must be missing.',
|
||||
'missing_if' => 'The :attribute field must be missing when :other is :value.',
|
||||
'missing_unless' => 'The :attribute field must be missing unless :other is :value.',
|
||||
'missing_with' => 'The :attribute field must be missing when :values is present.',
|
||||
'missing_with_all' => 'The :attribute field must be missing when :values are present.',
|
||||
'multiple_of' => 'The :attribute field must be a multiple of :value.',
|
||||
'not_in' => 'The selected :attribute is invalid.',
|
||||
'not_regex' => 'The :attribute field format is invalid.',
|
||||
'numeric' => 'The :attribute field must be a number.',
|
||||
'password' => [
|
||||
'letters' => 'The :attribute field must contain at least one letter.',
|
||||
'mixed' => 'The :attribute field must contain at least one uppercase and one lowercase letter.',
|
||||
'numbers' => 'The :attribute field must contain at least one number.',
|
||||
'symbols' => 'The :attribute field must contain at least one symbol.',
|
||||
'uncompromised' => 'The given :attribute has appeared in a data leak. Please choose a different :attribute.',
|
||||
],
|
||||
'present' => 'The :attribute field must be present.',
|
||||
'present_if' => 'The :attribute field must be present when :other is :value.',
|
||||
'present_unless' => 'The :attribute field must be present unless :other is :value.',
|
||||
'present_with' => 'The :attribute field must be present when :values is present.',
|
||||
'present_with_all' => 'The :attribute field must be present when :values are present.',
|
||||
'prohibited' => 'The :attribute field is prohibited.',
|
||||
'prohibited_if' => 'The :attribute field is prohibited when :other is :value.',
|
||||
'prohibited_if_accepted' => 'The :attribute field is prohibited when :other is accepted.',
|
||||
'prohibited_if_declined' => 'The :attribute field is prohibited when :other is declined.',
|
||||
'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.',
|
||||
'prohibits' => 'The :attribute field prohibits :other from being present.',
|
||||
'regex' => 'The :attribute field format is invalid.',
|
||||
'required' => 'The :attribute field is required.',
|
||||
'required_array_keys' => 'The :attribute field must contain entries for: :values.',
|
||||
'required_if' => 'The :attribute field is required when :other is :value.',
|
||||
'required_if_accepted' => 'The :attribute field is required when :other is accepted.',
|
||||
'required_if_declined' => 'The :attribute field is required when :other is declined.',
|
||||
'required_unless' => 'The :attribute field is required unless :other is in :values.',
|
||||
'required_with' => 'The :attribute field is required when :values is present.',
|
||||
'required_with_all' => 'The :attribute field is required when :values are present.',
|
||||
'required_without' => 'The :attribute field is required when :values is not present.',
|
||||
'required_without_all' => 'The :attribute field is required when none of :values are present.',
|
||||
'same' => 'The :attribute field must match :other.',
|
||||
'size' => [
|
||||
'array' => 'The :attribute field must contain :size items.',
|
||||
'file' => 'The :attribute field must be :size kilobytes.',
|
||||
'numeric' => 'The :attribute field must be :size.',
|
||||
'string' => 'The :attribute field must be :size characters.',
|
||||
],
|
||||
'starts_with' => 'The :attribute field must start with one of the following: :values.',
|
||||
'string' => 'The :attribute field must be a string.',
|
||||
'timezone' => 'The :attribute field must be a valid timezone.',
|
||||
'ulid' => 'The :attribute field must be a valid ULID.',
|
||||
'unique' => 'The :attribute has already been taken.',
|
||||
'uploaded' => 'The :attribute failed to upload.',
|
||||
'uppercase' => 'The :attribute field must be uppercase.',
|
||||
'url' => 'The :attribute field must be a valid URL.',
|
||||
'uuid' => 'The :attribute field must be a valid UUID.',
|
||||
'attributes' => [
|
||||
'address' => 'address',
|
||||
'affiliate_url' => 'affiliate URL',
|
||||
'age' => 'age',
|
||||
'amount' => 'amount',
|
||||
'announcement' => 'announcement',
|
||||
'area' => 'area',
|
||||
'audience_prize' => 'audience prize',
|
||||
'audience_winner' => 'audience winner',
|
||||
'available' => 'available',
|
||||
'birthday' => 'birthday',
|
||||
'body' => 'body',
|
||||
'city' => 'city',
|
||||
'color' => 'color',
|
||||
'company' => 'company',
|
||||
'compilation' => 'compilation',
|
||||
'concept' => 'concept',
|
||||
'conditions' => 'conditions',
|
||||
'content' => 'content',
|
||||
'contest' => 'contest',
|
||||
'country' => 'country',
|
||||
'cover' => 'cover',
|
||||
'created_at' => 'created at',
|
||||
'creator' => 'creator',
|
||||
'currency' => 'currency',
|
||||
'current_password' => 'current password',
|
||||
'customer' => 'customer',
|
||||
'date' => 'date',
|
||||
'date_of_birth' => 'date of birth',
|
||||
'dates' => 'dates',
|
||||
'day' => 'day',
|
||||
'deleted_at' => 'deleted at',
|
||||
'description' => 'description',
|
||||
'display_type' => 'display type',
|
||||
'district' => 'district',
|
||||
'duration' => 'duration',
|
||||
'email' => 'email',
|
||||
'excerpt' => 'excerpt',
|
||||
'filter' => 'filter',
|
||||
'finished_at' => 'finished at',
|
||||
'first_name' => 'first name',
|
||||
'gender' => 'gender',
|
||||
'grand_prize' => 'grand prize',
|
||||
'group' => 'group',
|
||||
'hour' => 'hour',
|
||||
'image' => 'image',
|
||||
'image_desktop' => 'desktop image',
|
||||
'image_main' => 'main image',
|
||||
'image_mobile' => 'mobile image',
|
||||
'images' => 'images',
|
||||
'is_audience_winner' => 'is audience winner',
|
||||
'is_hidden' => 'is hidden',
|
||||
'is_subscribed' => 'is subscribed',
|
||||
'is_visible' => 'is visible',
|
||||
'is_winner' => 'is winner',
|
||||
'items' => 'items',
|
||||
'key' => 'key',
|
||||
'last_name' => 'last name',
|
||||
'lesson' => 'lesson',
|
||||
'line_address_1' => 'line address 1',
|
||||
'line_address_2' => 'line address 2',
|
||||
'login' => 'login',
|
||||
'message' => 'message',
|
||||
'middle_name' => 'middle name',
|
||||
'minute' => 'minute',
|
||||
'mobile' => 'mobile',
|
||||
'month' => 'month',
|
||||
'name' => 'name',
|
||||
'national_code' => 'national code',
|
||||
'number' => 'number',
|
||||
'password' => 'password',
|
||||
'password_confirmation' => 'password confirmation',
|
||||
'phone' => 'phone',
|
||||
'photo' => 'photo',
|
||||
'portfolio' => 'portfolio',
|
||||
'postal_code' => 'postal code',
|
||||
'preview' => 'preview',
|
||||
'price' => 'price',
|
||||
'product_id' => 'product ID',
|
||||
'product_uid' => 'product UID',
|
||||
'product_uuid' => 'product UUID',
|
||||
'promo_code' => 'promo code',
|
||||
'province' => 'province',
|
||||
'quantity' => 'quantity',
|
||||
'reason' => 'reason',
|
||||
'recaptcha_response_field' => 'recaptcha response field',
|
||||
'referee' => 'referee',
|
||||
'referees' => 'referees',
|
||||
'region' => 'region',
|
||||
'reject_reason' => 'reject reason',
|
||||
'remember' => 'remember',
|
||||
'restored_at' => 'restored at',
|
||||
'result_text_under_image' => 'result text under image',
|
||||
'role' => 'role',
|
||||
'rule' => 'rule',
|
||||
'rules' => 'rules',
|
||||
'second' => 'second',
|
||||
'sex' => 'sex',
|
||||
'shipment' => 'shipment',
|
||||
'short_text' => 'short text',
|
||||
'size' => 'size',
|
||||
'skills' => 'skills',
|
||||
'slug' => 'slug',
|
||||
'specialization' => 'specialization',
|
||||
'started_at' => 'started at',
|
||||
'state' => 'state',
|
||||
'status' => 'status',
|
||||
'street' => 'street',
|
||||
'student' => 'student',
|
||||
'subject' => 'subject',
|
||||
'tag' => 'tag',
|
||||
'tags' => 'tags',
|
||||
'teacher' => 'teacher',
|
||||
'terms' => 'terms',
|
||||
'test_description' => 'test description',
|
||||
'test_locale' => 'test locale',
|
||||
'test_name' => 'test name',
|
||||
'text' => 'text',
|
||||
'time' => 'time',
|
||||
'title' => 'title',
|
||||
'type' => 'type',
|
||||
'updated_at' => 'updated at',
|
||||
'user' => 'user',
|
||||
'username' => 'username',
|
||||
'value' => 'value',
|
||||
'winner' => 'winner',
|
||||
'work' => 'work',
|
||||
'year' => 'year',
|
||||
],
|
||||
];
|
||||
264
lang/fr.json
Normal file
264
lang/fr.json
Normal file
@@ -0,0 +1,264 @@
|
||||
{
|
||||
"(and :count more error)": "(et :count erreur en plus)",
|
||||
"(and :count more errors)": "(et :count erreur en plus)|(et :count erreurs en plus)|(et :count erreurs en plus)",
|
||||
"A decryption key is required.": "Une clé de déchiffrement est requise.",
|
||||
"A new verification link has been sent to the email address you provided during registration.": "Un nouveau lien de vérification a été envoyé à l'adresse e-mail que vous avez indiquée lors de votre inscription.",
|
||||
"A new verification link has been sent to your email address.": "Un nouveau lien de vérification a été envoyé à votre adresse e-mail.",
|
||||
"A Timeout Occurred": "Temps d'attente dépassé",
|
||||
"Accept": "Accepter",
|
||||
"Accepted": "Accepté",
|
||||
"Action": "Action",
|
||||
"Actions": "Actions",
|
||||
"Add": "Ajouter",
|
||||
"Add :name": "Ajouter :name",
|
||||
"Admin": "Administrateur",
|
||||
"Agree": "Accepter",
|
||||
"All rights reserved.": "Tous droits réservés.",
|
||||
"Already registered?": "Déjà inscrit ?",
|
||||
"Already Reported": "Déjà rapporté",
|
||||
"Archive": "Archive",
|
||||
"Are you sure you want to delete your account?": "Êtes-vous sûr de vouloir supprimer votre compte ?",
|
||||
"Assign": "Attribuer",
|
||||
"Associate": "Associé",
|
||||
"Attach": "Attacher",
|
||||
"Bad Gateway": "Passerelle invalide",
|
||||
"Bad Request": "Requête erronée",
|
||||
"Bandwidth Limit Exceeded": "Limite de bande passante dépassée",
|
||||
"Browse": "Parcourir",
|
||||
"Cancel": "Annuler",
|
||||
"Choose": "Choisir",
|
||||
"Choose :name": "Choisir :name",
|
||||
"Choose File": "Choisir le fichier",
|
||||
"Choose Image": "Choisir une image",
|
||||
"Click here to re-send the verification email.": "Cliquez ici pour renvoyer l'e-mail de vérification.",
|
||||
"Click to copy": "Cliquer pour copier",
|
||||
"Client Closed Request": "Demande fermée par le client",
|
||||
"Close": "Fermer",
|
||||
"Collapse": "Réduire",
|
||||
"Collapse All": "Réduire tout",
|
||||
"Comment": "Commentaire",
|
||||
"Confirm": "Confirmer",
|
||||
"Confirm Password": "Confirmer le mot de passe",
|
||||
"Conflict": "Conflit",
|
||||
"Connect": "Connecter",
|
||||
"Connection Closed Without Response": "Connexion fermée sans réponse",
|
||||
"Connection Timed Out": "La connexion a expiré",
|
||||
"Continue": "Continuer",
|
||||
"Create": "Créer",
|
||||
"Create :name": "Créer :name",
|
||||
"Created": "Créé",
|
||||
"Current Password": "Mot de passe actuel",
|
||||
"Dashboard": "Tableau de bord",
|
||||
"Delete": "Supprimer",
|
||||
"Delete :name": "Supprimer :name",
|
||||
"Delete Account": "Supprimer le compte",
|
||||
"Detach": "Détacher",
|
||||
"Details": "Détails",
|
||||
"Disable": "Désactiver",
|
||||
"Discard": "Jeter",
|
||||
"Done": "Fait",
|
||||
"Down": "Descendre",
|
||||
"Duplicate": "Dupliquer",
|
||||
"Duplicate :name": "Dupliquer :name",
|
||||
"Edit": "Éditer",
|
||||
"Edit :name": "Modifier :name",
|
||||
"Email": "E-mail",
|
||||
"email": "Le champ :attribute doit être une adresse e-mail valide.",
|
||||
"Email Password Reset Link": "Lien de réinitialisation du mot de passe",
|
||||
"Enable": "Activer",
|
||||
"Encrypted environment file already exists.": "Le fichier d'environnement chiffré existe déjà.",
|
||||
"Encrypted environment file not found.": "Fichier d'environnement chiffré introuvable.",
|
||||
"Ensure your account is using a long, random password to stay secure.": "Assurez-vous d'utiliser un mot de passe long et aléatoire pour sécuriser votre compte.",
|
||||
"Environment file already exists.": "Le fichier d'environnement existe déjà.",
|
||||
"Environment file not found.": "Fichier d'environnement introuvable.",
|
||||
"errors": "les erreurs",
|
||||
"Expand": "Développer",
|
||||
"Expand All": "Développer tout",
|
||||
"Expectation Failed": "Comportement attendu insatisfaisant",
|
||||
"Explanation": "Explication",
|
||||
"Export": "Exporter",
|
||||
"Export :name": "Exporter :name",
|
||||
"Failed Dependency": "Dépendance échouée",
|
||||
"File": "Déposer",
|
||||
"Files": "Des dossiers",
|
||||
"Forbidden": "Interdit",
|
||||
"Forgot your password?": "Mot de passe oublié ?",
|
||||
"Forgot your password? No problem. Just let us know your email address and we will email you a password reset link that will allow you to choose a new one.": "Mot de passe oublié ? Pas de soucis. Veuillez nous indiquer votre adresse e-mail et nous vous enverrons un lien de réinitialisation du mot de passe.",
|
||||
"Found": "Trouvé",
|
||||
"Gateway Timeout": "Temps d'attente de la passerelle dépassé",
|
||||
"Go Home": "Aller à l'accueil",
|
||||
"Go to page :page": "Aller à la page :page",
|
||||
"Gone": "Disparu",
|
||||
"Hello!": "Bonjour !",
|
||||
"Hide": "Cacher",
|
||||
"Hide :name": "Cacher :name",
|
||||
"Home": "Accueil",
|
||||
"HTTP Version Not Supported": "Version HTTP non prise en charge",
|
||||
"I'm a teapot": "Je suis une théière",
|
||||
"If you did not create an account, no further action is required.": "Si vous n'avez pas créé de compte, vous pouvez ignorer ce message.",
|
||||
"If you did not request a password reset, no further action is required.": "Si vous n'avez pas demandé de réinitialisation de mot de passe, vous pouvez ignorer ce message.",
|
||||
"If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:": "Si vous avez des difficultés à cliquer sur le bouton \":actionText\", copiez et collez l'URL ci-dessous\ndans votre navigateur Web :",
|
||||
"IM Used": "IM utilisé",
|
||||
"Image": "Image",
|
||||
"Impersonate": "Utiliser un autre compte",
|
||||
"Impersonation": "Imitation",
|
||||
"Import": "Importer",
|
||||
"Import :name": "Importer :name",
|
||||
"Insufficient Storage": "Espace insuffisant",
|
||||
"Internal Server Error": "Erreur interne du serveur",
|
||||
"Introduction": "Introduction",
|
||||
"Invalid filename.": "Nom de fichier incorrect.",
|
||||
"Invalid JSON was returned from the route.": "Un JSON non valide a été renvoyé par la route.",
|
||||
"Invalid SSL Certificate": "Certificat SSL invalide",
|
||||
"length": "longueur",
|
||||
"Length Required": "Longueur requise",
|
||||
"Like": "Aimer",
|
||||
"Load": "Charger",
|
||||
"Localize": "Localiser",
|
||||
"Location": "Emplacement",
|
||||
"Locked": "Verrouillé",
|
||||
"Log In": "Se connecter",
|
||||
"Log in": "Se connecter",
|
||||
"Log Out": "Se déconnecter",
|
||||
"Login": "Connexion",
|
||||
"Logout": "Déconnexion",
|
||||
"Loop Detected": "Boucle détectée",
|
||||
"Maintenance Mode": "Mode de maintenance",
|
||||
"Method Not Allowed": "Méthode non autorisée",
|
||||
"Misdirected Request": "Demande mal dirigée",
|
||||
"Moved Permanently": "Déplacé de façon permanente",
|
||||
"Multi-Status": "Statut multiple",
|
||||
"Multiple Choices": "Choix multiples",
|
||||
"Name": "Nom",
|
||||
"name": "nom",
|
||||
"Network Authentication Required": "Authentification réseau requise",
|
||||
"Network Connect Timeout Error": "Temps d'attente de la connexion réseau dépassé",
|
||||
"Network Read Timeout Error": "Temps d'attente de la lecture réseau dépassé",
|
||||
"New": "Nouveau",
|
||||
"New :name": "Nouveau :name",
|
||||
"New Password": "Nouveau mot de passe",
|
||||
"No": "Non",
|
||||
"No Content": "Pas de contenu",
|
||||
"Non-Authoritative Information": "Informations non certifiées",
|
||||
"Not Acceptable": "Pas acceptable",
|
||||
"Not Extended": "Non prolongé",
|
||||
"Not Found": "Non trouvé",
|
||||
"Not Implemented": "Non implémenté",
|
||||
"Not Modified": "Non modifié",
|
||||
"of": "de",
|
||||
"OK": "OK",
|
||||
"Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.": "Une fois que votre compte est supprimé, toutes vos données sont supprimées définitivement. Avant de supprimer votre compte, veuillez télécharger vos données.",
|
||||
"Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.": "Une fois que votre compte est supprimé, toutes les données associées seront supprimées définitivement. Pour confirmer que vous voulez supprimer définitivement votre compte, renseignez votre mot de passe.",
|
||||
"Open": "Ouvrir",
|
||||
"Open in a current window": "Ouvrir dans une fenêtre actuelle",
|
||||
"Open in a new window": "Ouvrir dans une nouvelle fenêtre",
|
||||
"Open in a parent frame": "Ouvrir dans un cadre parent",
|
||||
"Open in the topmost frame": "Ouvrir dans le cadre le plus haut",
|
||||
"Open on the website": "Ouvrir sur le site",
|
||||
"Origin Is Unreachable": "L'origine est inaccessible",
|
||||
"Page Expired": "Page expirée",
|
||||
"Pagination Navigation": "Pagination",
|
||||
"Partial Content": "Contenu partiel",
|
||||
"Password": "Mot de passe",
|
||||
"password": "Le mot de passe est incorrect",
|
||||
"Payload Too Large": "Charge utile trop grande",
|
||||
"Payment Required": "Paiement requis",
|
||||
"Permanent Redirect": "Redirection permanente",
|
||||
"Please click the button below to verify your email address.": "Veuillez cliquer sur le bouton ci-dessous pour vérifier votre adresse e-mail :",
|
||||
"Precondition Failed": "La précondition a échoué",
|
||||
"Precondition Required": "Condition préalable requise",
|
||||
"Preview": "Aperçu",
|
||||
"Price": "Prix",
|
||||
"Processing": "En traitement",
|
||||
"Profile": "Profil",
|
||||
"Profile Information": "Informations du profil",
|
||||
"Proxy Authentication Required": "Authentification proxy requise",
|
||||
"Railgun Error": "Erreur de Railgun",
|
||||
"Range Not Satisfiable": "Plage non satisfaisante",
|
||||
"Record": "Enregistrer",
|
||||
"Regards,": "Cordialement,",
|
||||
"Register": "Inscription",
|
||||
"Remember me": "Se souvenir de moi",
|
||||
"Request Header Fields Too Large": "Champs d'en-tête de requête trop grands",
|
||||
"Request Timeout": "Temps d'attente de la requête dépassé",
|
||||
"Resend Verification Email": "Renvoyer l'e-mail de vérification",
|
||||
"Reset Content": "Réinitialiser le contenu",
|
||||
"Reset Password": "Réinitialisation du mot de passe",
|
||||
"Reset your password": "Reset your password",
|
||||
"Restore": "Restaurer",
|
||||
"Restore :name": "Restaurer :name",
|
||||
"results": "résultats",
|
||||
"Retry With": "Réessayer avec",
|
||||
"Save": "Sauvegarder",
|
||||
"Save & Close": "Sauvegarder et fermer",
|
||||
"Save & Return": "Sauvegarder et retourner",
|
||||
"Save :name": "Sauvegarder :name",
|
||||
"Saved.": "Sauvegardé.",
|
||||
"Search": "Rechercher",
|
||||
"Search :name": "Chercher :name",
|
||||
"See Other": "Voir autre",
|
||||
"Select": "Sélectionner",
|
||||
"Select All": "Tout sélectionner",
|
||||
"Send": "Envoyer",
|
||||
"Server Error": "Erreur serveur",
|
||||
"Service Unavailable": "Service indisponible",
|
||||
"Session Has Expired": "La session a expiré",
|
||||
"Settings": "Paramètres",
|
||||
"Show": "Afficher",
|
||||
"Show :name": "Afficher :name",
|
||||
"Show All": "Afficher tout",
|
||||
"Showing": "Montrant",
|
||||
"Sign In": "Se connecter",
|
||||
"Solve": "Résoudre",
|
||||
"SSL Handshake Failed": "Échec de la prise de contact SSL",
|
||||
"Start": "Commencer",
|
||||
"Stop": "Arrêter",
|
||||
"Submit": "Soumettre",
|
||||
"Subscribe": "S'abonner",
|
||||
"Switch": "Changer",
|
||||
"Switch To Role": "Passer au rôle",
|
||||
"Switching Protocols": "Protocoles de commutation",
|
||||
"Tag": "Mot clé",
|
||||
"Tags": "Mots clés",
|
||||
"Temporary Redirect": "Redirection temporaire",
|
||||
"Thanks for signing up! Before getting started, could you verify your email address by clicking on the link we just emailed to you? If you didn't receive the email, we will gladly send you another.": "Merci de vous être inscrit(e) ! Avant de commencer, veuillez vérifier votre adresse e-mail en cliquant sur le lien que nous venons de vous envoyer. Si vous n'avez pas reçu cet e-mail, nous vous en enverrons un nouveau avec plaisir.",
|
||||
"The given data was invalid.": "La donnée renseignée est incorrecte.",
|
||||
"The response is not a streamed response.": "La réponse n'est pas une réponse diffusée.",
|
||||
"The response is not a view.": "La réponse n'est pas une vue.",
|
||||
"This action is unauthorized.": "Cette action n'est pas autorisée.",
|
||||
"This is a secure area of the application. Please confirm your password before continuing.": "Ceci est une zone sécurisée de l'application. Veuillez confirmer votre mot de passe avant de continuer.",
|
||||
"This password reset link will expire in :count minutes.": "Ce lien de réinitialisation du mot de passe expirera dans :count minutes.",
|
||||
"to": "à",
|
||||
"Toggle navigation": "Afficher / masquer le menu de navigation",
|
||||
"Too Early": "Trop tôt",
|
||||
"Too Many Requests": "Trop de requêtes",
|
||||
"Translate": "Traduire",
|
||||
"Translate It": "Traduis le",
|
||||
"Unauthorized": "Non autorisé",
|
||||
"Unavailable For Legal Reasons": "Indisponible pour des raisons légales",
|
||||
"Unknown Error": "Erreur inconnue",
|
||||
"Unpack": "Déballer",
|
||||
"Unprocessable Entity": "Entité non traitable",
|
||||
"Unsubscribe": "Se désabonner",
|
||||
"Unsupported Media Type": "Type de média non supporté",
|
||||
"Up": "Monter",
|
||||
"Update": "Mettre à jour",
|
||||
"Update :name": "Mettre à jour :name",
|
||||
"Update Password": "Mettre à jour le mot de passe",
|
||||
"Update your account's profile information and email address.": "Modifier le profil associé à votre compte ainsi que votre adresse e-mail.",
|
||||
"Upgrade Required": "Mise à niveau requise",
|
||||
"URI Too Long": "URI trop long",
|
||||
"Use Proxy": "Utiliser un proxy",
|
||||
"User": "Utilisateur",
|
||||
"Variant Also Negotiates": "La variante négocie également",
|
||||
"Verify Email Address": "Vérifier l'adresse e-mail",
|
||||
"Verify your email address": "Verify your email address",
|
||||
"View": "Vue",
|
||||
"View :name": "Voir :name",
|
||||
"Web Server is Down": "Le serveur Web est en panne",
|
||||
"Whoops!": "Oups !",
|
||||
"Yes": "Oui",
|
||||
"You are receiving this email because we received a password reset request for your account.": "Vous recevez cet e-mail car nous avons reçu une demande de réinitialisation de mot de passe pour votre compte.",
|
||||
"You're logged in!": "Vous êtes connecté !",
|
||||
"Your email address is unverified.": "Votre adresse e-mail n'est pas vérifiée."
|
||||
}
|
||||
119
lang/fr/actions.php
Normal file
119
lang/fr/actions.php
Normal file
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'accept' => 'Accepter',
|
||||
'action' => 'Action',
|
||||
'actions' => 'Actions',
|
||||
'add' => 'Ajouter',
|
||||
'admin' => 'Administrateur',
|
||||
'agree' => 'Approuver',
|
||||
'archive' => 'Archiver',
|
||||
'assign' => 'Attribuer',
|
||||
'associate' => 'Associer',
|
||||
'attach' => 'Attacher',
|
||||
'browse' => 'Parcourir',
|
||||
'cancel' => 'Annuler',
|
||||
'choose' => 'Choisir',
|
||||
'choose_file' => 'Choisir le fichier',
|
||||
'choose_image' => 'Choisir une image',
|
||||
'click_to_copy' => 'Cliquer pour copier',
|
||||
'close' => 'Fermer',
|
||||
'collapse' => 'Réduire',
|
||||
'collapse_all' => 'Réduire tout',
|
||||
'comment' => 'Commentaire',
|
||||
'confirm' => 'Confirmer',
|
||||
'connect' => 'Connecter',
|
||||
'create' => 'Créer',
|
||||
'delete' => 'Supprimer',
|
||||
'detach' => 'Détacher',
|
||||
'details' => 'Détails',
|
||||
'disable' => 'Désactiver',
|
||||
'discard' => 'Jeter',
|
||||
'done' => 'Fait',
|
||||
'down' => 'Descendre',
|
||||
'duplicate' => 'Dupliquer',
|
||||
'edit' => 'Editer',
|
||||
'enable' => 'Activer',
|
||||
'expand' => 'Développer',
|
||||
'expand_all' => 'Développer tout',
|
||||
'explanation' => 'Explication',
|
||||
'export' => 'Exporter',
|
||||
'file' => 'Déposer',
|
||||
'files' => 'Fichiers',
|
||||
'go_home' => 'Aller à l\'accueil',
|
||||
'hide' => 'Cacher',
|
||||
'home' => 'Accueil',
|
||||
'image' => 'Image',
|
||||
'impersonate' => 'Imiter',
|
||||
'impersonation' => 'Imitation',
|
||||
'import' => 'Importer',
|
||||
'introduction' => 'Introduction',
|
||||
'like' => 'Aimer',
|
||||
'load' => 'Charger',
|
||||
'localize' => 'Localiser',
|
||||
'log_in' => 'Se connecter',
|
||||
'log_out' => 'Se déconnecter',
|
||||
'named' => [
|
||||
'add' => 'Ajouter :name',
|
||||
'choose' => 'Choisir :name',
|
||||
'create' => 'Créer :name',
|
||||
'delete' => 'Supprimer :name',
|
||||
'duplicate' => 'Dupliquer :name',
|
||||
'edit' => 'Editer :name',
|
||||
'export' => 'Exporter :name',
|
||||
'hide' => 'Cacher :name',
|
||||
'import' => 'Importer :name',
|
||||
'new' => 'Nouveau :name',
|
||||
'restore' => 'Restaurer :name',
|
||||
'save' => 'Sauvegarder :name',
|
||||
'search' => 'Chercher :name',
|
||||
'show' => 'Afficher :name',
|
||||
'update' => 'Mettre à jour :name',
|
||||
'view' => 'Voir :name',
|
||||
],
|
||||
'new' => 'Nouveau',
|
||||
'no' => 'Non',
|
||||
'open' => 'Ouvrir',
|
||||
'open_website' => 'Ouvrir sur le site',
|
||||
'preview' => 'Aperçu',
|
||||
'price' => 'Prix',
|
||||
'record' => 'Enregistrer',
|
||||
'restore' => 'Restaurer',
|
||||
'save' => 'Sauvegarder',
|
||||
'save_and_close' => 'Sauvegarder et fermer',
|
||||
'save_and_return' => 'Sauvegarder et retourner',
|
||||
'search' => 'Chercher',
|
||||
'select' => 'Sélectionner',
|
||||
'select_all' => 'Tout sélectionner',
|
||||
'send' => 'Envoyer',
|
||||
'settings' => 'Paramètres',
|
||||
'show' => 'Montrer',
|
||||
'show_all' => 'Afficher tout',
|
||||
'sign_in' => 'Se connecter',
|
||||
'solve' => 'Résoudre',
|
||||
'start' => 'Commencer',
|
||||
'stop' => 'Arrêter',
|
||||
'submit' => 'Soumettre',
|
||||
'subscribe' => 'S\'abonner',
|
||||
'switch' => 'Changer',
|
||||
'switch_to_role' => 'Passer au rôle',
|
||||
'tag' => 'Mot clé',
|
||||
'tags' => 'Mots clés',
|
||||
'target_link' => [
|
||||
'blank' => 'Ouvrir dans une nouvelle fenêtre',
|
||||
'parent' => 'Ouvrir dans la fenêtre parente',
|
||||
'self' => 'Ouvrir dans la fenêtre actuelle',
|
||||
'top' => 'Ouvrir dans le cadre le plus haut',
|
||||
],
|
||||
'translate' => 'Traduire',
|
||||
'translate_it' => 'Traduis le',
|
||||
'unpack' => 'Déballer',
|
||||
'unsubscribe' => 'Se désabonner',
|
||||
'up' => 'Monter',
|
||||
'update' => 'Mettre à jour',
|
||||
'user' => 'Utilisateur',
|
||||
'view' => 'Voir',
|
||||
'yes' => 'Oui',
|
||||
];
|
||||
9
lang/fr/auth.php
Normal file
9
lang/fr/auth.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'failed' => 'Ces identifiants ne correspondent pas à nos enregistrements.',
|
||||
'password' => 'Le mot de passe est incorrect',
|
||||
'throttle' => 'Tentatives de connexion trop nombreuses. Veuillez essayer de nouveau dans :seconds secondes.',
|
||||
];
|
||||
84
lang/fr/http-statuses.php
Normal file
84
lang/fr/http-statuses.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'0' => 'Erreur inconnue',
|
||||
'100' => 'Continuer',
|
||||
'101' => 'Protocoles de commutation',
|
||||
'102' => 'En traitement',
|
||||
'200' => 'OK',
|
||||
'201' => 'Créé',
|
||||
'202' => 'Accepté',
|
||||
'203' => 'Informations non certifiées',
|
||||
'204' => 'Pas de contenu',
|
||||
'205' => 'Réinitialiser le contenu',
|
||||
'206' => 'Contenu partiel',
|
||||
'207' => 'Statut multiple',
|
||||
'208' => 'Déjà rapporté',
|
||||
'226' => 'IM utilisé',
|
||||
'300' => 'Choix multiples',
|
||||
'301' => 'Déplacé de façon permanente',
|
||||
'302' => 'A trouvé',
|
||||
'303' => 'Voir autre',
|
||||
'304' => 'Non modifié',
|
||||
'305' => 'Utiliser un proxy',
|
||||
'307' => 'Redirection temporaire',
|
||||
'308' => 'Redirection permanente',
|
||||
'400' => 'Requête invalide',
|
||||
'401' => 'Non authentifié',
|
||||
'402' => 'Paiement requis',
|
||||
'403' => 'Interdit',
|
||||
'404' => 'Page non trouvée',
|
||||
'405' => 'Méthode non autorisée',
|
||||
'406' => 'Non acceptable',
|
||||
'407' => 'Authentification proxy requise',
|
||||
'408' => 'Requête expirée',
|
||||
'409' => 'Conflit',
|
||||
'410' => 'Disparu',
|
||||
'411' => 'Longueur requise',
|
||||
'412' => 'La précondition a échoué',
|
||||
'413' => 'Charge utile trop grande',
|
||||
'414' => 'URI trop long',
|
||||
'415' => 'Type de média non supporté',
|
||||
'416' => 'Plage non satisfaisante',
|
||||
'417' => 'Comportement attendu insatisfaisant',
|
||||
'418' => 'Je suis une théière',
|
||||
'419' => 'La session a expiré',
|
||||
'421' => 'Demande mal dirigée',
|
||||
'422' => 'Contenu non traitable',
|
||||
'423' => 'Verrouillé',
|
||||
'424' => 'Dépendance échouée',
|
||||
'425' => 'Trop tôt',
|
||||
'426' => 'Mise à niveau requise',
|
||||
'428' => 'Condition préalable requise',
|
||||
'429' => 'Trop de demandes',
|
||||
'431' => 'Champs d\'en-tête de requête trop grands',
|
||||
'444' => 'Connexion fermée sans réponse',
|
||||
'449' => 'Réessayer avec',
|
||||
'451' => 'Indisponible pour des raisons légales',
|
||||
'499' => 'Demande fermée par le client',
|
||||
'500' => 'Erreur interne du serveur',
|
||||
'501' => 'Non implémenté',
|
||||
'502' => 'Mauvaise passerelle',
|
||||
'503' => 'Service non disponible',
|
||||
'504' => 'Temps d\'attente de la passerelle dépassé',
|
||||
'505' => 'Version HTTP non prise en charge',
|
||||
'506' => 'La variante négocie également',
|
||||
'507' => 'Espace insuffisant',
|
||||
'508' => 'Boucle détectée',
|
||||
'509' => 'Limite de bande passante dépassée',
|
||||
'510' => 'Non prolongé',
|
||||
'511' => 'Authentification réseau requise',
|
||||
'520' => 'Erreur inconnue',
|
||||
'521' => 'Le serveur Web est en panne',
|
||||
'522' => 'La connexion a expiré',
|
||||
'523' => 'L\'origine est inaccessible',
|
||||
'524' => 'Un dépassement de délai s\'est produit',
|
||||
'525' => 'Échec de la prise de contact SSL',
|
||||
'526' => 'Certificat SSL invalide',
|
||||
'527' => 'Erreur de Railgun',
|
||||
'598' => 'Temps d\'attente de la lecture réseau dépassé',
|
||||
'599' => 'Temps d\'attente de la connexion réseau dépassé',
|
||||
'unknownError' => 'Erreur inconnue',
|
||||
];
|
||||
8
lang/fr/pagination.php
Normal file
8
lang/fr/pagination.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'next' => 'Suivant »',
|
||||
'previous' => '« Précédent',
|
||||
];
|
||||
11
lang/fr/passwords.php
Normal file
11
lang/fr/passwords.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'reset' => 'Votre mot de passe a été réinitialisé !',
|
||||
'sent' => 'Nous vous avons envoyé par email le lien de réinitialisation du mot de passe !',
|
||||
'throttled' => 'Veuillez patienter avant de réessayer.',
|
||||
'token' => 'Ce jeton de réinitialisation du mot de passe n\'est pas valide.',
|
||||
'user' => 'Aucun utilisateur n\'a été trouvé avec cette adresse email.',
|
||||
];
|
||||
288
lang/fr/validation.php
Normal file
288
lang/fr/validation.php
Normal file
@@ -0,0 +1,288 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'accepted' => 'Le champ :attribute doit être accepté.',
|
||||
'accepted_if' => 'Le champ :attribute doit être accepté quand :other a la valeur :value.',
|
||||
'active_url' => 'Le champ :attribute n\'est pas une URL valide.',
|
||||
'after' => 'Le champ :attribute doit être une date postérieure au :date.',
|
||||
'after_or_equal' => 'Le champ :attribute doit être une date postérieure ou égale au :date.',
|
||||
'alpha' => 'Le champ :attribute doit contenir uniquement des lettres.',
|
||||
'alpha_dash' => 'Le champ :attribute doit contenir uniquement des lettres, des chiffres et des tirets.',
|
||||
'alpha_num' => 'Le champ :attribute doit contenir uniquement des chiffres et des lettres.',
|
||||
'any_of' => 'Le champ :attribute est invalide.',
|
||||
'array' => 'Le champ :attribute doit être un tableau.',
|
||||
'ascii' => 'Le champ :attribute ne doit contenir que des caractères alphanumériques et des symboles codés sur un octet.',
|
||||
'before' => 'Le champ :attribute doit être une date antérieure au :date.',
|
||||
'before_or_equal' => 'Le champ :attribute doit être une date antérieure ou égale au :date.',
|
||||
'between' => [
|
||||
'array' => 'Le tableau :attribute doit contenir entre :min et :max éléments.',
|
||||
'file' => 'La taille du fichier de :attribute doit être comprise entre :min et :max kilo-octets.',
|
||||
'numeric' => 'La valeur de :attribute doit être comprise entre :min et :max.',
|
||||
'string' => 'Le texte :attribute doit contenir entre :min et :max caractères.',
|
||||
],
|
||||
'boolean' => 'Le champ :attribute doit être vrai ou faux.',
|
||||
'can' => 'Le champ :attribute contient une valeur non autorisée.',
|
||||
'confirmed' => 'Le champ de confirmation :attribute ne correspond pas.',
|
||||
'contains' => 'Le champ :attribute manque une valeur requise.',
|
||||
'current_password' => 'Le mot de passe est incorrect.',
|
||||
'date' => 'Le champ :attribute n\'est pas une date valide.',
|
||||
'date_equals' => 'Le champ :attribute doit être une date égale à :date.',
|
||||
'date_format' => 'Le champ :attribute ne correspond pas au format :format.',
|
||||
'decimal' => 'Le champ :attribute doit comporter :decimal décimales.',
|
||||
'declined' => 'Le champ :attribute doit être décliné.',
|
||||
'declined_if' => 'Le champ :attribute doit être décliné quand :other a la valeur :value.',
|
||||
'different' => 'Les champs :attribute et :other doivent être différents.',
|
||||
'digits' => 'Le champ :attribute doit contenir :digits chiffres.',
|
||||
'digits_between' => 'Le champ :attribute doit contenir entre :min et :max chiffres.',
|
||||
'dimensions' => 'La taille de l\'image :attribute n\'est pas conforme.',
|
||||
'distinct' => 'Le champ :attribute a une valeur en double.',
|
||||
'doesnt_contain' => 'Le champ :attribute ne doit contenir aucun des éléments suivants : :values.',
|
||||
'doesnt_end_with' => 'Le champ :attribute ne doit pas finir avec une des valeurs suivantes : :values.',
|
||||
'doesnt_start_with' => 'Le champ :attribute ne doit pas commencer avec une des valeurs suivantes : :values.',
|
||||
'email' => 'Le champ :attribute doit être une adresse e-mail valide.',
|
||||
'encoding' => 'The :attribute field must be encoded in :encoding.',
|
||||
'ends_with' => 'Le champ :attribute doit se terminer par une des valeurs suivantes : :values',
|
||||
'enum' => 'Le champ :attribute sélectionné est invalide.',
|
||||
'exists' => 'Le champ :attribute sélectionné est invalide.',
|
||||
'extensions' => 'Le champ :attribute doit avoir l\'une des extensions suivantes : :values.',
|
||||
'file' => 'Le champ :attribute doit être un fichier.',
|
||||
'filled' => 'Le champ :attribute doit avoir une valeur.',
|
||||
'gt' => [
|
||||
'array' => 'Le tableau :attribute doit contenir plus de :value éléments.',
|
||||
'file' => 'La taille du fichier de :attribute doit être supérieure à :value kilo-octets.',
|
||||
'numeric' => 'La valeur de :attribute doit être supérieure à :value.',
|
||||
'string' => 'Le texte :attribute doit contenir plus de :value caractères.',
|
||||
],
|
||||
'gte' => [
|
||||
'array' => 'Le tableau :attribute doit contenir au moins :value éléments.',
|
||||
'file' => 'La taille du fichier de :attribute doit être supérieure ou égale à :value kilo-octets.',
|
||||
'numeric' => 'La valeur de :attribute doit être supérieure ou égale à :value.',
|
||||
'string' => 'Le texte :attribute doit contenir au moins :value caractères.',
|
||||
],
|
||||
'hex_color' => 'Le champ :attribute doit être une couleur hexadécimale valide.',
|
||||
'image' => 'Le champ :attribute doit être une image.',
|
||||
'in' => 'Le champ :attribute est invalide.',
|
||||
'in_array' => 'Le champ :attribute n\'existe pas dans :other.',
|
||||
'in_array_keys' => 'Le champ :attribute doit contenir au moins l\'une des clés suivantes : :values.',
|
||||
'integer' => 'Le champ :attribute doit être un entier.',
|
||||
'ip' => 'Le champ :attribute doit être une adresse IP valide.',
|
||||
'ipv4' => 'Le champ :attribute doit être une adresse IPv4 valide.',
|
||||
'ipv6' => 'Le champ :attribute doit être une adresse IPv6 valide.',
|
||||
'json' => 'Le champ :attribute doit être un document JSON valide.',
|
||||
'list' => 'Le champ :attribute doit être une liste.',
|
||||
'lowercase' => 'Le champ :attribute doit être en minuscules.',
|
||||
'lt' => [
|
||||
'array' => 'Le tableau :attribute doit contenir moins de :value éléments.',
|
||||
'file' => 'La taille du fichier de :attribute doit être inférieure à :value kilo-octets.',
|
||||
'numeric' => 'La valeur de :attribute doit être inférieure à :value.',
|
||||
'string' => 'Le texte :attribute doit contenir moins de :value caractères.',
|
||||
],
|
||||
'lte' => [
|
||||
'array' => 'Le tableau :attribute doit contenir au plus :value éléments.',
|
||||
'file' => 'La taille du fichier de :attribute doit être inférieure ou égale à :value kilo-octets.',
|
||||
'numeric' => 'La valeur de :attribute doit être inférieure ou égale à :value.',
|
||||
'string' => 'Le texte :attribute doit contenir au plus :value caractères.',
|
||||
],
|
||||
'mac_address' => 'Le champ :attribute doit être une adresse MAC valide.',
|
||||
'max' => [
|
||||
'array' => 'Le tableau :attribute ne peut pas contenir plus que :max éléments.',
|
||||
'file' => 'La taille du fichier de :attribute ne peut pas dépasser :max kilo-octets.',
|
||||
'numeric' => 'La valeur de :attribute ne peut pas être supérieure à :max.',
|
||||
'string' => 'Le texte de :attribute ne peut pas contenir plus de :max caractères.',
|
||||
],
|
||||
'max_digits' => 'Le champ :attribute ne doit pas avoir plus de :max chiffres.',
|
||||
'mimes' => 'Le champ :attribute doit être un fichier de type : :values.',
|
||||
'mimetypes' => 'Le champ :attribute doit être un fichier de type : :values.',
|
||||
'min' => [
|
||||
'array' => 'Le tableau :attribute doit contenir au moins :min éléments.',
|
||||
'file' => 'La taille du fichier de :attribute doit être supérieure ou égale à :min kilo-octets.',
|
||||
'numeric' => 'La valeur de :attribute doit être supérieure ou égale à :min.',
|
||||
'string' => 'Le texte de :attribute doit contenir au moins :min caractères.',
|
||||
],
|
||||
'min_digits' => 'Le champ :attribute doit avoir au moins :min chiffres.',
|
||||
'missing' => 'Le champ :attribute doit être manquant.',
|
||||
'missing_if' => 'Le champ :attribute doit être manquant quand :other a la valeur :value.',
|
||||
'missing_unless' => 'Le champ :attribute doit être manquant sauf si :other a la valeur :value.',
|
||||
'missing_with' => 'Le champ :attribute doit être manquant quand :values est présent.',
|
||||
'missing_with_all' => 'Le champ :attribute doit être manquant quand :values sont présents.',
|
||||
'multiple_of' => 'La valeur de :attribute doit être un multiple de :value',
|
||||
'not_in' => 'Le champ :attribute sélectionné n\'est pas valide.',
|
||||
'not_regex' => 'Le format du champ :attribute n\'est pas valide.',
|
||||
'numeric' => 'Le champ :attribute doit contenir un nombre.',
|
||||
'password' => [
|
||||
'letters' => 'Le champ :attribute doit contenir au moins une lettre.',
|
||||
'mixed' => 'Le champ :attribute doit contenir au moins une majuscule et une minuscule.',
|
||||
'numbers' => 'Le champ :attribute doit contenir au moins un chiffre.',
|
||||
'symbols' => 'Le champ :attribute doit contenir au moins un symbole.',
|
||||
'uncompromised' => 'La valeur du champ :attribute est apparue dans une fuite de données. Veuillez choisir une valeur différente.',
|
||||
],
|
||||
'present' => 'Le champ :attribute doit être présent.',
|
||||
'present_if' => 'Le champ :attribute doit être présent lorsque :other est :value.',
|
||||
'present_unless' => 'Le champ :attribute doit être présent sauf si :other vaut :value.',
|
||||
'present_with' => 'Le champ :attribute doit être présent lorsque :values est présent.',
|
||||
'present_with_all' => 'Le champ :attribute doit être présent lorsque :values sont présents.',
|
||||
'prohibited' => 'Le champ :attribute est interdit.',
|
||||
'prohibited_if' => 'Le champ :attribute est interdit quand :other a la valeur :value.',
|
||||
'prohibited_if_accepted' => 'Le champ :attribute est interdit quand :other a été accepté.',
|
||||
'prohibited_if_declined' => 'Le champ :attribute est interdit quand :other a été refusé.',
|
||||
'prohibited_unless' => 'Le champ :attribute est interdit à moins que :other est l\'une des valeurs :values.',
|
||||
'prohibits' => 'Le champ :attribute interdit :other d\'être présent.',
|
||||
'regex' => 'Le format du champ :attribute est invalide.',
|
||||
'required' => 'Le champ :attribute est obligatoire.',
|
||||
'required_array_keys' => 'Le champ :attribute doit contenir des entrées pour : :values.',
|
||||
'required_if' => 'Le champ :attribute est obligatoire quand la valeur de :other est :value.',
|
||||
'required_if_accepted' => 'Le champ :attribute est obligatoire quand le champ :other a été accepté.',
|
||||
'required_if_declined' => 'Le champ :attribute est obligatoire quand le champ :other a été refusé.',
|
||||
'required_unless' => 'Le champ :attribute est obligatoire sauf si :other est :values.',
|
||||
'required_with' => 'Le champ :attribute est obligatoire quand :values est présent.',
|
||||
'required_with_all' => 'Le champ :attribute est obligatoire quand :values sont présents.',
|
||||
'required_without' => 'Le champ :attribute est obligatoire quand :values n\'est pas présent.',
|
||||
'required_without_all' => 'Le champ :attribute est requis quand aucun de :values n\'est présent.',
|
||||
'same' => 'Les champs :attribute et :other doivent être identiques.',
|
||||
'size' => [
|
||||
'array' => 'Le tableau :attribute doit contenir :size éléments.',
|
||||
'file' => 'La taille du fichier de :attribute doit être de :size kilo-octets.',
|
||||
'numeric' => 'La valeur de :attribute doit être :size.',
|
||||
'string' => 'Le texte de :attribute doit contenir :size caractères.',
|
||||
],
|
||||
'starts_with' => 'Le champ :attribute doit commencer avec une des valeurs suivantes : :values',
|
||||
'string' => 'Le champ :attribute doit être une chaîne de caractères.',
|
||||
'timezone' => 'Le champ :attribute doit être un fuseau horaire valide.',
|
||||
'ulid' => 'Le champ :attribute doit être un ULID valide.',
|
||||
'unique' => 'La valeur du champ :attribute est déjà utilisée.',
|
||||
'uploaded' => 'Le fichier du champ :attribute n\'a pu être téléversé.',
|
||||
'uppercase' => 'Le champ :attribute doit être en majuscules.',
|
||||
'url' => 'Le format de l\'URL de :attribute n\'est pas valide.',
|
||||
'uuid' => 'Le champ :attribute doit être un UUID valide',
|
||||
'attributes' => [
|
||||
'address' => 'adresse',
|
||||
'affiliate_url' => 'URL d\'affiliation',
|
||||
'age' => 'âge',
|
||||
'amount' => 'montant',
|
||||
'announcement' => 'annonce',
|
||||
'area' => 'zone',
|
||||
'audience_prize' => 'prix du public',
|
||||
'audience_winner' => 'gagnant du public',
|
||||
'available' => 'disponible',
|
||||
'birthday' => 'anniversaire',
|
||||
'body' => 'corps',
|
||||
'city' => 'ville',
|
||||
'color' => 'color',
|
||||
'company' => 'entreprise',
|
||||
'compilation' => 'compilation',
|
||||
'concept' => 'concept',
|
||||
'conditions' => 'conditions',
|
||||
'content' => 'contenu',
|
||||
'contest' => 'contest',
|
||||
'country' => 'pays',
|
||||
'cover' => 'couverture',
|
||||
'created_at' => 'date de création',
|
||||
'creator' => 'créateur',
|
||||
'currency' => 'devise',
|
||||
'current_password' => 'mot de passe actuel',
|
||||
'customer' => 'client',
|
||||
'date' => 'date',
|
||||
'date_of_birth' => 'date de naissance',
|
||||
'dates' => 'rendez-vous',
|
||||
'day' => 'jour',
|
||||
'deleted_at' => 'date de suppression',
|
||||
'description' => 'description',
|
||||
'display_type' => 'type d\'affichage',
|
||||
'district' => 'quartier',
|
||||
'duration' => 'durée',
|
||||
'email' => 'adresse e-mail',
|
||||
'excerpt' => 'extrait',
|
||||
'filter' => 'filtre',
|
||||
'finished_at' => 'date de fin',
|
||||
'first_name' => 'prénom',
|
||||
'gender' => 'genre',
|
||||
'grand_prize' => 'grand prix',
|
||||
'group' => 'groupe',
|
||||
'hour' => 'heure',
|
||||
'image' => 'image',
|
||||
'image_desktop' => 'image de bureau',
|
||||
'image_main' => 'image principale',
|
||||
'image_mobile' => 'image mobile',
|
||||
'images' => 'images',
|
||||
'is_audience_winner' => 'est le gagnant du public',
|
||||
'is_hidden' => 'est caché',
|
||||
'is_subscribed' => 'est abonné',
|
||||
'is_visible' => 'est visible',
|
||||
'is_winner' => 'est gagnant',
|
||||
'items' => 'articles',
|
||||
'key' => 'clé',
|
||||
'last_name' => 'nom de famille',
|
||||
'lesson' => 'leçon',
|
||||
'line_address_1' => 'ligne d\'adresse 1',
|
||||
'line_address_2' => 'ligne d\'adresse 2',
|
||||
'login' => 'identifiant',
|
||||
'message' => 'message',
|
||||
'middle_name' => 'deuxième prénom',
|
||||
'minute' => 'minute',
|
||||
'mobile' => 'portable',
|
||||
'month' => 'mois',
|
||||
'name' => 'nom',
|
||||
'national_code' => 'code national',
|
||||
'number' => 'numéro',
|
||||
'password' => 'mot de passe',
|
||||
'password_confirmation' => 'confirmation du mot de passe',
|
||||
'phone' => 'téléphone',
|
||||
'photo' => 'photo',
|
||||
'portfolio' => 'portefeuille',
|
||||
'postal_code' => 'code postal',
|
||||
'preview' => 'aperçu',
|
||||
'price' => 'prix',
|
||||
'product_id' => 'identifiant du produit',
|
||||
'product_uid' => 'UID du produit',
|
||||
'product_uuid' => 'UUID du produit',
|
||||
'promo_code' => 'code promo',
|
||||
'province' => 'région',
|
||||
'quantity' => 'quantité',
|
||||
'reason' => 'raison',
|
||||
'recaptcha_response_field' => 'champ de réponse reCAPTCHA',
|
||||
'referee' => 'arbitre',
|
||||
'referees' => 'arbitres',
|
||||
'region' => 'region',
|
||||
'reject_reason' => 'motif de rejet',
|
||||
'remember' => 'se souvenir',
|
||||
'restored_at' => 'date de restauration',
|
||||
'result_text_under_image' => 'texte de résultat sous l\'image',
|
||||
'role' => 'rôle',
|
||||
'rule' => 'règle',
|
||||
'rules' => 'règles',
|
||||
'second' => 'seconde',
|
||||
'sex' => 'sexe',
|
||||
'shipment' => 'expédition',
|
||||
'short_text' => 'texte court',
|
||||
'size' => 'taille',
|
||||
'skills' => 'compétences',
|
||||
'slug' => 'slug',
|
||||
'specialization' => 'spécialisation',
|
||||
'started_at' => 'date de début',
|
||||
'state' => 'état',
|
||||
'status' => 'statut',
|
||||
'street' => 'rue',
|
||||
'student' => 'étudiant',
|
||||
'subject' => 'sujet',
|
||||
'tag' => 'mot clé',
|
||||
'tags' => 'mots clés',
|
||||
'teacher' => 'professeur',
|
||||
'terms' => 'conditions',
|
||||
'test_description' => 'description du test',
|
||||
'test_locale' => 'localisation du test',
|
||||
'test_name' => 'nom du test',
|
||||
'text' => 'texte',
|
||||
'time' => 'heure',
|
||||
'title' => 'titre',
|
||||
'type' => 'type',
|
||||
'updated_at' => 'date de mise à jour',
|
||||
'user' => 'utilisateur',
|
||||
'username' => 'nom d\'utilisateur',
|
||||
'value' => 'valeur',
|
||||
'winner' => 'gagnant',
|
||||
'work' => 'travail',
|
||||
'year' => 'année',
|
||||
],
|
||||
];
|
||||
78
package-lock.json
generated
78
package-lock.json
generated
@@ -1,12 +1,16 @@
|
||||
{
|
||||
"name": "QuizzCabm",
|
||||
"name": "RECRU_IT_V2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"@tailwindcss/typography": "^0.5.19",
|
||||
"marked": "^17.0.4"
|
||||
"chart.js": "^4.5.1",
|
||||
"date-fns": "^4.1.0",
|
||||
"leaflet": "^1.9.4",
|
||||
"marked": "^17.0.4",
|
||||
"vuedraggable": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@inertiajs/vue3": "^2.0.0",
|
||||
@@ -39,7 +43,6 @@
|
||||
"version": "7.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz",
|
||||
"integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
@@ -49,7 +52,6 @@
|
||||
"version": "7.28.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz",
|
||||
"integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
@@ -59,7 +61,6 @@
|
||||
"version": "7.29.2",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.2.tgz",
|
||||
"integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.29.0"
|
||||
@@ -75,7 +76,6 @@
|
||||
"version": "7.29.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz",
|
||||
"integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/helper-string-parser": "^7.27.1",
|
||||
@@ -195,6 +195,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",
|
||||
@@ -892,7 +898,6 @@
|
||||
"version": "3.5.30",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.30.tgz",
|
||||
"integrity": "sha512-s3DfdZkcu/qExZ+td75015ljzHc6vE+30cFMGRPROYjqkroYI5NV2X1yAMX9UeyBNWB9MxCfPcsjpLS11nzkkw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.29.0",
|
||||
@@ -906,7 +911,6 @@
|
||||
"version": "3.5.30",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.30.tgz",
|
||||
"integrity": "sha512-eCFYESUEVYHhiMuK4SQTldO3RYxyMR/UQL4KdGD1Yrkfdx4m/HYuZ9jSfPdA+nWJY34VWndiYdW/wZXyiPEB9g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vue/compiler-core": "3.5.30",
|
||||
@@ -917,7 +921,6 @@
|
||||
"version": "3.5.30",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.30.tgz",
|
||||
"integrity": "sha512-LqmFPDn89dtU9vI3wHJnwaV6GfTRD87AjWpTWpyrdVOObVtjIuSeZr181z5C4PmVx/V3j2p+0f7edFKGRMpQ5A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.29.0",
|
||||
@@ -935,7 +938,6 @@
|
||||
"version": "3.5.30",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.30.tgz",
|
||||
"integrity": "sha512-NsYK6OMTnx109PSL2IAyf62JP6EUdk4Dmj6AkWcJGBvN0dQoMYtVekAmdqgTtWQgEJo+Okstbf/1p7qZr5H+bA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vue/compiler-dom": "3.5.30",
|
||||
@@ -946,7 +948,6 @@
|
||||
"version": "3.5.30",
|
||||
"resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.30.tgz",
|
||||
"integrity": "sha512-179YNgKATuwj9gB+66snskRDOitDiuOZqkYia7mHKJaidOMo/WJxHKF8DuGc4V4XbYTJANlfEKb0yxTQotnx4Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.5.30"
|
||||
@@ -956,7 +957,6 @@
|
||||
"version": "3.5.30",
|
||||
"resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.5.30.tgz",
|
||||
"integrity": "sha512-e0Z+8PQsUTdwV8TtEsLzUM7SzC7lQwYKePydb7K2ZnmS6jjND+WJXkmmfh/swYzRyfP1EY3fpdesyYoymCzYfg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vue/reactivity": "3.5.30",
|
||||
@@ -967,7 +967,6 @@
|
||||
"version": "3.5.30",
|
||||
"resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.5.30.tgz",
|
||||
"integrity": "sha512-2UIGakjU4WSQ0T4iwDEW0W7vQj6n7AFn7taqZ9Cvm0Q/RA2FFOziLESrDL4GmtI1wV3jXg5nMoJSYO66egDUBw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vue/reactivity": "3.5.30",
|
||||
@@ -980,7 +979,6 @@
|
||||
"version": "3.5.30",
|
||||
"resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.5.30.tgz",
|
||||
"integrity": "sha512-v+R34icapydRwbZRD0sXwtHqrQJv38JuMB4JxbOxd8NEpGLny7cncMp53W9UH/zo4j8eDHjQ1dEJXwzFQknjtQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vue/compiler-ssr": "3.5.30",
|
||||
@@ -994,7 +992,6 @@
|
||||
"version": "3.5.30",
|
||||
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.30.tgz",
|
||||
"integrity": "sha512-YXgQ7JjaO18NeK2K9VTbDHaFy62WrObMa6XERNfNOkAhD1F1oDSf3ZJ7K6GqabZ0BvSDHajp8qfS5Sa2I9n8uQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/ansi-regex": {
|
||||
@@ -1266,6 +1263,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",
|
||||
@@ -1400,9 +1409,18 @@
|
||||
"version": "3.2.3",
|
||||
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
|
||||
"integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
|
||||
"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",
|
||||
@@ -1482,7 +1500,6 @@
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz",
|
||||
"integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==",
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause",
|
||||
"engines": {
|
||||
"node": ">=0.12"
|
||||
@@ -1554,7 +1571,6 @@
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
|
||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fast-glob": {
|
||||
@@ -1922,6 +1938,12 @@
|
||||
"vite": "^8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/leaflet": {
|
||||
"version": "1.9.4",
|
||||
"resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.4.tgz",
|
||||
"integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==",
|
||||
"license": "BSD-2-Clause"
|
||||
},
|
||||
"node_modules/lightningcss": {
|
||||
"version": "1.32.0",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz",
|
||||
@@ -2212,7 +2234,6 @@
|
||||
"version": "0.30.21",
|
||||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz",
|
||||
"integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jridgewell/sourcemap-codec": "^1.5.5"
|
||||
@@ -2836,6 +2857,12 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/sortablejs": {
|
||||
"version": "1.14.0",
|
||||
"resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.14.0.tgz",
|
||||
"integrity": "sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/source-map-js": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
|
||||
@@ -3227,7 +3254,6 @@
|
||||
"version": "3.5.30",
|
||||
"resolved": "https://registry.npmjs.org/vue/-/vue-3.5.30.tgz",
|
||||
"integrity": "sha512-hTHLc6VNZyzzEH/l7PFGjpcTvUgiaPK5mdLkbjrTeWSRcEfxFrv56g/XckIYlE9ckuobsdwqd5mk2g1sBkMewg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vue/compiler-dom": "3.5.30",
|
||||
@@ -3245,6 +3271,18 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/vuedraggable": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/vuedraggable/-/vuedraggable-4.1.0.tgz",
|
||||
"integrity": "sha512-FU5HCWBmsf20GpP3eudURW3WdWTKIbEIQxh9/8GE806hydR9qZqRRxRE3RjqX7PkuLuMQG/A7n3cfj9rCEchww==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"sortablejs": "1.14.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/wrap-ansi": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
||||
|
||||
@@ -22,6 +22,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@tailwindcss/typography": "^0.5.19",
|
||||
"marked": "^17.0.4"
|
||||
"chart.js": "^4.5.1",
|
||||
"date-fns": "^4.1.0",
|
||||
"leaflet": "^1.9.4",
|
||||
"marked": "^17.0.4",
|
||||
"vuedraggable": "^4.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 0 B After Width: | Height: | Size: 15 KiB |
BIN
public/images/logo.png
Normal file
BIN
public/images/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -1,3 +1,4 @@
|
||||
@import './tokens.css';
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
271
resources/css/tokens.css
Normal file
271
resources/css/tokens.css
Normal 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; }
|
||||
@@ -36,6 +36,8 @@ const alignmentClasses = computed(() => {
|
||||
return 'ltr:origin-top-left rtl:origin-top-right start-0';
|
||||
} else if (props.align === 'right') {
|
||||
return 'ltr:origin-top-right rtl:origin-top-left end-0';
|
||||
} else if (props.align === 'top-right') {
|
||||
return 'origin-bottom-right bottom-full mb-2 end-0 !mt-0';
|
||||
} else {
|
||||
return 'origin-top';
|
||||
}
|
||||
@@ -67,13 +69,13 @@ const open = ref(false);
|
||||
>
|
||||
<div
|
||||
v-show="open"
|
||||
class="absolute z-50 mt-2 rounded-md shadow-lg"
|
||||
class="absolute z-50 mt-2 rounded-xl shadow-md border border-anthracite/5"
|
||||
:class="[widthClass, alignmentClasses]"
|
||||
style="display: none"
|
||||
@click="open = false"
|
||||
>
|
||||
<div
|
||||
class="rounded-md ring-1 ring-black ring-opacity-5"
|
||||
class="rounded-xl overflow-hidden"
|
||||
:class="contentClasses"
|
||||
>
|
||||
<slot name="content" />
|
||||
|
||||
@@ -12,7 +12,7 @@ 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-subtitle font-bold leading-5 text-anthracite hover:bg-sand/30 hover:text-primary transition duration-150 ease-in-out focus:outline-none"
|
||||
>
|
||||
<slot />
|
||||
</Link>
|
||||
|
||||
49
resources/js/Components/EnvironmentBanner.vue
Normal file
49
resources/js/Components/EnvironmentBanner.vue
Normal file
@@ -0,0 +1,49 @@
|
||||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import { usePage } from '@inertiajs/vue3';
|
||||
|
||||
const page = usePage();
|
||||
const appEnv = computed(() => page.props.app_env);
|
||||
|
||||
const isDevelopment = computed(() => appEnv.value !== 'production');
|
||||
|
||||
const bannerStyles = computed(() => {
|
||||
if (appEnv.value === 'local') {
|
||||
return 'bg-amber-400 text-amber-950 border-amber-500/50';
|
||||
} else if (appEnv.value === 'staging') {
|
||||
return 'bg-blue-500 text-white border-blue-600/50';
|
||||
}
|
||||
return 'bg-rose-500 text-white border-rose-600/50';
|
||||
});
|
||||
|
||||
const label = computed(() => {
|
||||
if (appEnv.value === 'local') return 'DEV';
|
||||
if (appEnv.value === 'staging') return 'STG';
|
||||
return appEnv.value?.toUpperCase() || 'ENV';
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
v-if="isDevelopment"
|
||||
class="fixed top-0 left-0 right-0 z-[9999] h-1 pointer-events-none shadow-sm shadow-black/10"
|
||||
:class="bannerStyles"
|
||||
></div>
|
||||
|
||||
<div
|
||||
v-if="isDevelopment"
|
||||
class="fixed top-4 -right-12 z-[9999] pointer-events-none select-none"
|
||||
>
|
||||
<div
|
||||
class="transform rotate-45 py-1 px-14 text-[10px] font-black tracking-tighter shadow-lg border-y whitespace-nowrap text-center flex flex-col items-center justify-center leading-none"
|
||||
:class="bannerStyles"
|
||||
>
|
||||
<span>ENV {{ label }}</span>
|
||||
<span class="text-[7px] opacity-70 mt-0.5">{{ appEnv }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* No specific styles needed as Tailwind handles most of it, but ensure z-index is high */
|
||||
</style>
|
||||
@@ -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-primary text-sm font-subtitle font-bold leading-5 text-primary 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-subtitle font-bold leading-5 text-anthracite/60 hover:text-primary hover:border-primary/30 focus:outline-none transition duration-150 ease-in-out',
|
||||
);
|
||||
</script>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -14,8 +14,8 @@ const props = defineProps({
|
||||
|
||||
const classes = computed(() =>
|
||||
props.active
|
||||
? 'block w-full ps-3 pe-4 py-2 border-l-4 border-indigo-400 text-start text-base font-medium text-indigo-700 bg-indigo-50 focus:outline-none focus:text-indigo-800 focus:bg-indigo-100 focus:border-indigo-700 transition duration-150 ease-in-out'
|
||||
: 'block w-full ps-3 pe-4 py-2 border-l-4 border-transparent text-start text-base font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 hover:border-gray-300 focus:outline-none focus:text-gray-800 focus:bg-gray-50 focus:border-gray-300 transition duration-150 ease-in-out',
|
||||
? 'block w-full ps-3 pe-4 py-2 border-l-4 border-primary text-start text-base font-subtitle font-bold text-primary bg-primary/5 focus:outline-none focus:text-primary focus:bg-primary/10 focus:border-primary transition duration-150 ease-in-out'
|
||||
: 'block w-full ps-3 pe-4 py-2 border-l-4 border-transparent text-start text-base font-subtitle font-medium text-anthracite/60 hover:text-primary hover:bg-sand/30 hover:border-anthracite/20 focus:outline-none focus:text-primary focus:bg-sand/30 focus:border-anthracite/20 transition duration-150 ease-in-out',
|
||||
);
|
||||
</script>
|
||||
|
||||
|
||||
35
resources/js/Components/Rq/RqBadge.vue
Normal file
35
resources/js/Components/Rq/RqBadge.vue
Normal 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>
|
||||
45
resources/js/Components/Rq/RqButton.vue
Normal file
45
resources/js/Components/Rq/RqButton.vue
Normal 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>
|
||||
33
resources/js/Components/Rq/RqCard.vue
Normal file
33
resources/js/Components/Rq/RqCard.vue
Normal 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>
|
||||
65
resources/js/Components/Rq/RqInput.vue
Normal file
65
resources/js/Components/Rq/RqInput.vue
Normal 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>
|
||||
38
resources/js/Components/Rq/RqScoreBar.vue
Normal file
38
resources/js/Components/Rq/RqScoreBar.vue
Normal 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>
|
||||
54
resources/js/Components/Rq/RqStatCard.vue
Normal file
54
resources/js/Components/Rq/RqStatCard.vue
Normal 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>
|
||||
@@ -1,130 +1,283 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { Link } from '@inertiajs/vue3';
|
||||
import ApplicationLogo from '@/Components/ApplicationLogo.vue';
|
||||
/**
|
||||
* 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, computed } from '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.index', 'admin.candidates.show'],
|
||||
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: 'Offres d\'emploi',
|
||||
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',
|
||||
},
|
||||
{
|
||||
route: 'admin.candidates.selected',
|
||||
label: 'Selection',
|
||||
icon: 'M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z',
|
||||
},
|
||||
{
|
||||
route: 'admin.candidates.map',
|
||||
label: 'Carte',
|
||||
icon: 'M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z M15 11a3 3 0 11-6 0 3 3 0 016 0z',
|
||||
},
|
||||
];
|
||||
|
||||
const filteredNavItems = computed(() => {
|
||||
const role = page.props.auth.user.role;
|
||||
if (role === 'gestionnaire_rh') {
|
||||
// HR Managers cannot see evaluation/selection related tabs
|
||||
return navItems.filter(item => !['admin.quizzes.index', 'admin.comparative', 'admin.candidates.selected'].includes(item.route));
|
||||
}
|
||||
return navItems;
|
||||
});
|
||||
|
||||
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.route);
|
||||
|
||||
if (Array.isArray(item.match)) {
|
||||
return item.match.some(m => route().current(m));
|
||||
}
|
||||
|
||||
return route().current(item.match);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="min-h-screen bg-slate-50 dark:bg-slate-900 flex text-slate-900 dark:text-slate-100">
|
||||
<!-- Sidebar -->
|
||||
<EnvironmentBanner />
|
||||
|
||||
<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>
|
||||
<Transition name="fade">
|
||||
<img v-if="isSidebarOpen" src="/images/logo.png" alt="Logo" class="h-8 object-contain" />
|
||||
<img v-else src="/images/logo.png" alt="Logo" class="h-6 object-contain" />
|
||||
</Transition>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<nav class="flex-1 py-6 px-3 space-y-1">
|
||||
<!-- 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 filteredNavItems" :key="item.route">
|
||||
<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']"
|
||||
: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 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 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">Tableau de bord</span>
|
||||
<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 Administration (Structures) pour Super Admin et RH -->
|
||||
<template v-if="['super_admin', 'gestionnaire_rh'].includes($page.props.auth.user.role)">
|
||||
<div class="pt-4 pb-2">
|
||||
<div
|
||||
v-if="isSidebarOpen"
|
||||
class="px-3 text-[9px] font-black uppercase tracking-[0.18em] text-white/25"
|
||||
>Administration</div>
|
||||
<div v-else class="h-px w-8 mx-auto bg-white/10" />
|
||||
</div>
|
||||
|
||||
<!-- Structures Link (Visible for Super Admin and HR) -->
|
||||
<template v-for="item in superAdminItems.filter(i => i.route === 'admin.tenants.index' || $page.props.auth.user.role === 'super_admin')" :key="item.route">
|
||||
<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']"
|
||||
: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 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 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">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>
|
||||
<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">
|
||||
<!-- 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="mb-3 w-full">
|
||||
<Dropdown align="top-right" width="48">
|
||||
<template #trigger>
|
||||
<button class="w-full flex items-center gap-2.5 text-left p-1.5 -ml-1.5 rounded-xl hover:bg-white/5 transition-colors">
|
||||
<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>
|
||||
<div class="text-white/40">
|
||||
<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>
|
||||
</div>
|
||||
</button>
|
||||
</template>
|
||||
<template #content>
|
||||
<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-10 rounded-lg bg-slate-100 dark:bg-slate-700 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"
|
||||
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 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 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 Content -->
|
||||
<!-- ─── Main ─────────────────────────────────────────────────────── -->
|
||||
<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">
|
||||
|
||||
<!-- 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-4">
|
||||
<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" />
|
||||
</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>
|
||||
</template>
|
||||
</Dropdown>
|
||||
<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>
|
||||
|
||||
203
resources/js/Layouts/AdminLayout.vue.backup
Normal file
203
resources/js/Layouts/AdminLayout.vue.backup
Normal 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>
|
||||
@@ -1,129 +1,79 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
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 NavLink from '@/Components/NavLink.vue';
|
||||
import ResponsiveNavLink from '@/Components/ResponsiveNavLink.vue';
|
||||
import { Link } from '@inertiajs/vue3';
|
||||
import EnvironmentBanner from '@/Components/EnvironmentBanner.vue';
|
||||
|
||||
const showingNavigationDropdown = ref(false);
|
||||
const page = usePage();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div class="min-h-screen bg-gray-100">
|
||||
<nav
|
||||
class="border-b border-gray-100 bg-white"
|
||||
>
|
||||
<!-- 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">
|
||||
<div class="flex">
|
||||
<!-- Logo -->
|
||||
<div class="flex shrink-0 items-center">
|
||||
<Link :href="route('dashboard')">
|
||||
<ApplicationLogo
|
||||
class="block h-9 w-auto fill-current text-gray-800"
|
||||
/>
|
||||
<EnvironmentBanner />
|
||||
|
||||
<div class="min-h-screen bg-neutral font-sans text-ink selection:bg-highlight selection:text-highlight-dark flex flex-col">
|
||||
<!-- Top Navigation -->
|
||||
<nav class="h-[70px] bg-surface border-b border-ink/[0.05] shadow-xs z-20 shrink-0">
|
||||
<div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 h-full">
|
||||
<div class="flex items-center justify-between h-full">
|
||||
|
||||
<!-- Left side: Logo -->
|
||||
<div class="flex items-center">
|
||||
<Link :href="route('dashboard')" class="flex items-center gap-3">
|
||||
<img src="/images/logo.png" alt="Logo" class="h-8 object-contain" />
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<!-- Navigation Links -->
|
||||
<div
|
||||
class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex"
|
||||
>
|
||||
<NavLink
|
||||
:href="route('dashboard')"
|
||||
:active="route().current('dashboard')"
|
||||
>
|
||||
Dashboard
|
||||
</NavLink>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="hidden sm:ms-6 sm:flex sm:items-center">
|
||||
<!-- Settings Dropdown -->
|
||||
<div class="relative ms-3">
|
||||
<!-- Right side: Profile Dropdown -->
|
||||
<div class="hidden sm:flex items-center gap-4">
|
||||
<Dropdown align="right" width="48">
|
||||
<template #trigger>
|
||||
<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"
|
||||
>
|
||||
{{ $page.props.auth.user.name }}
|
||||
|
||||
<svg
|
||||
class="-me-0.5 ms-2 h-4 w-4"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
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"
|
||||
/>
|
||||
<button class="flex items-center gap-3 p-1.5 pr-3 rounded-2xl border border-ink/[0.05] hover:bg-ink/[0.02] hover:border-ink/[0.1] transition-all duration-200">
|
||||
<div class="w-[34px] h-[34px] rounded-xl bg-highlight flex items-center justify-center text-[13px] font-black text-highlight-dark shrink-0 shadow-sm">
|
||||
{{ $page.props.auth.user.name.charAt(0) }}
|
||||
</div>
|
||||
<div class="text-left flex-1 min-w-0">
|
||||
<div class="text-[13px] font-bold text-primary truncate leading-tight">{{ $page.props.auth.user.name }}</div>
|
||||
<div class="text-[11px] text-ink/40 font-subtitle truncate">{{ $page.props.auth.user.email }}</div>
|
||||
</div>
|
||||
<div class="text-ink/30 ml-1">
|
||||
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M6 9l6 6 6-6"/>
|
||||
</svg>
|
||||
</div>
|
||||
</button>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<template #content>
|
||||
<DropdownLink
|
||||
:href="route('profile.edit')"
|
||||
>
|
||||
Profile
|
||||
<div class="px-4 py-2 border-b border-ink/5">
|
||||
<div class="text-[10px] font-black uppercase tracking-[0.1em] text-ink/30">Candidat</div>
|
||||
</div>
|
||||
<DropdownLink :href="route('profile.edit')" class="!text-[13px]">
|
||||
Paramètres du profil
|
||||
</DropdownLink>
|
||||
<DropdownLink
|
||||
:href="route('logout')"
|
||||
method="post"
|
||||
as="button"
|
||||
>
|
||||
Log Out
|
||||
<div class="border-t border-ink/5 my-1" />
|
||||
<DropdownLink :href="route('logout')" method="post" as="button" class="!text-accent font-bold !text-[13px]">
|
||||
Se déconnecter
|
||||
</DropdownLink>
|
||||
</template>
|
||||
</Dropdown>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Hamburger -->
|
||||
<div class="-me-2 flex items-center sm:hidden">
|
||||
<!-- Mobile Menu Button -->
|
||||
<div class="-mr-2 flex items-center sm:hidden">
|
||||
<button
|
||||
@click="
|
||||
showingNavigationDropdown =
|
||||
!showingNavigationDropdown
|
||||
"
|
||||
class="inline-flex items-center justify-center rounded-md p-2 text-gray-400 transition duration-150 ease-in-out hover:bg-gray-100 hover:text-gray-500 focus:bg-gray-100 focus:text-gray-500 focus:outline-none"
|
||||
>
|
||||
<svg
|
||||
class="h-6 w-6"
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
@click="showingNavigationDropdown = !showingNavigationDropdown"
|
||||
class="inline-flex items-center justify-center p-2 rounded-xl text-primary hover:bg-ink/5 transition duration-150 ease-in-out focus:outline-none focus:bg-ink/5"
|
||||
>
|
||||
<svg class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
|
||||
<path
|
||||
:class="{
|
||||
hidden: showingNavigationDropdown,
|
||||
'inline-flex':
|
||||
!showingNavigationDropdown,
|
||||
}"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M4 6h16M4 12h16M4 18h16"
|
||||
:class="{'hidden': showingNavigationDropdown, 'inline-flex': !showingNavigationDropdown }"
|
||||
stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"
|
||||
/>
|
||||
<path
|
||||
:class="{
|
||||
hidden: !showingNavigationDropdown,
|
||||
'inline-flex':
|
||||
showingNavigationDropdown,
|
||||
}"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M6 18L18 6M6 6l12 12"
|
||||
:class="{'hidden': !showingNavigationDropdown, 'inline-flex': showingNavigationDropdown }"
|
||||
stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
@@ -131,68 +81,54 @@ const showingNavigationDropdown = ref(false);
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Responsive Navigation Menu -->
|
||||
<div
|
||||
:class="{
|
||||
block: showingNavigationDropdown,
|
||||
hidden: !showingNavigationDropdown,
|
||||
}"
|
||||
class="sm:hidden"
|
||||
>
|
||||
<div class="space-y-1 pb-3 pt-2">
|
||||
<ResponsiveNavLink
|
||||
:href="route('dashboard')"
|
||||
:active="route().current('dashboard')"
|
||||
>
|
||||
Dashboard
|
||||
</ResponsiveNavLink>
|
||||
<!-- Mobile Navigation Menu -->
|
||||
<div :class="{'block': showingNavigationDropdown, 'hidden': !showingNavigationDropdown}" class="sm:hidden bg-surface border-b border-ink/10 shadow-lg absolute w-full z-50">
|
||||
<div class="pt-4 pb-3 border-t border-ink/5">
|
||||
<div class="px-4 flex items-center gap-3">
|
||||
<div class="w-10 h-10 rounded-xl bg-highlight flex items-center justify-center text-sm font-black text-highlight-dark shrink-0">
|
||||
{{ $page.props.auth.user.name.charAt(0) }}
|
||||
</div>
|
||||
|
||||
<!-- Responsive Settings Options -->
|
||||
<div
|
||||
class="border-t border-gray-200 pb-1 pt-4"
|
||||
>
|
||||
<div class="px-4">
|
||||
<div
|
||||
class="text-base font-medium text-gray-800"
|
||||
>
|
||||
{{ $page.props.auth.user.name }}
|
||||
</div>
|
||||
<div class="text-sm font-medium text-gray-500">
|
||||
{{ $page.props.auth.user.email }}
|
||||
<div>
|
||||
<div class="text-sm font-bold text-primary">{{ $page.props.auth.user.name }}</div>
|
||||
<div class="text-[11px] font-subtitle text-ink/50">{{ $page.props.auth.user.email }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3 space-y-1">
|
||||
<ResponsiveNavLink :href="route('profile.edit')">
|
||||
Profile
|
||||
</ResponsiveNavLink>
|
||||
<ResponsiveNavLink
|
||||
:href="route('logout')"
|
||||
method="post"
|
||||
as="button"
|
||||
>
|
||||
Log Out
|
||||
</ResponsiveNavLink>
|
||||
<div class="mt-4 space-y-1">
|
||||
<Link :href="route('profile.edit')" class="block w-full px-4 py-2.5 text-left text-[13px] font-bold text-primary hover:bg-ink/5 transition-colors">
|
||||
Paramètres du profil
|
||||
</Link>
|
||||
<Link :href="route('logout')" method="post" as="button" class="block w-full px-4 py-2.5 text-left text-[13px] font-bold text-accent hover:bg-ink/5 transition-colors">
|
||||
Se déconnecter
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Page Heading -->
|
||||
<header
|
||||
class="bg-white shadow"
|
||||
v-if="$slots.header"
|
||||
>
|
||||
<div class="mx-auto max-w-7xl px-4 py-6 sm:px-6 lg:px-8">
|
||||
<header v-if="$slots.header" class="bg-surface border-b border-ink/[0.05] shadow-xs shrink-0 relative z-10">
|
||||
<div class="mx-auto max-w-7xl px-4 py-5 sm:px-6 lg:px-8">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="w-[3px] h-5 bg-highlight rounded-full hidden md:block"></div>
|
||||
<div class="font-serif font-black text-lg text-primary tracking-tight">
|
||||
<slot name="header" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Page Content -->
|
||||
<main>
|
||||
<main class="flex-1 flex flex-col relative">
|
||||
<slot />
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<footer class="pb-6 pt-6 text-center shrink-0">
|
||||
<span class="text-[10px] font-mono font-bold uppercase tracking-[0.1em] text-ink/20">v{{ $page.props.app_version }}</span>
|
||||
</footer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* Any required scoped styling here */
|
||||
</style>
|
||||
|
||||
@@ -1,22 +1,33 @@
|
||||
<script setup>
|
||||
import ApplicationLogo from '@/Components/ApplicationLogo.vue';
|
||||
import { Link } from '@inertiajs/vue3';
|
||||
import EnvironmentBanner from '@/Components/EnvironmentBanner.vue';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<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" />
|
||||
<EnvironmentBanner />
|
||||
<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">
|
||||
<img src="/images/logo.png" alt="Logo" class="h-16 object-contain group-hover:-translate-y-1 transition-all duration-300" />
|
||||
<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"
|
||||
>
|
||||
<!-- 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">
|
||||
← Retour à l'accueil
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -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);
|
||||
@@ -13,7 +14,9 @@ import SecondaryButton from '@/Components/SecondaryButton.vue';
|
||||
import InputError from '@/Components/InputError.vue';
|
||||
|
||||
const props = defineProps({
|
||||
candidates: Array
|
||||
candidates: Array,
|
||||
jobPositions: Array,
|
||||
tenants: Array
|
||||
});
|
||||
|
||||
const isModalOpen = ref(false);
|
||||
@@ -24,8 +27,11 @@ const form = useForm({
|
||||
email: '',
|
||||
phone: '',
|
||||
linkedin_url: '',
|
||||
city: '',
|
||||
cv: null,
|
||||
cover_letter: null,
|
||||
tenant_id: '',
|
||||
job_position_id: '',
|
||||
});
|
||||
|
||||
const submit = () => {
|
||||
@@ -39,17 +45,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) {
|
||||
@@ -64,8 +74,31 @@ const getNestedValue = (obj, path) => {
|
||||
return path.split('.').reduce((o, i) => (o ? o[i] : null), obj);
|
||||
};
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const initialJobPositionParam = urlParams.get('job_position');
|
||||
const selectedJobPosition = ref(initialJobPositionParam === 'none' ? 'none' : (initialJobPositionParam ? parseInt(initialJobPositionParam) : ''));
|
||||
const showOnlySelected = ref(false);
|
||||
|
||||
const filteredCandidates = computed(() => {
|
||||
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(() => {
|
||||
return [...props.candidates].sort((a, b) => {
|
||||
return [...filteredCandidates.value].sort((a, b) => {
|
||||
let valA = getNestedValue(a, sortKey.value);
|
||||
let valB = getNestedValue(b, sortKey.value);
|
||||
|
||||
@@ -77,6 +110,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>
|
||||
@@ -87,171 +175,249 @@ const sortedCandidates = computed(() => {
|
||||
Gestion des Candidats
|
||||
</template>
|
||||
|
||||
<div class="flex justify-between items-center mb-8">
|
||||
<h3 class="text-2xl font-bold">Liste des Candidats</h3>
|
||||
<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 v-if="$page.props.auth.user.role !== 'gestionnaire_rh'" 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 && $page.props.auth.user.role !== 'gestionnaire_rh'" 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>
|
||||
</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">
|
||||
<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 @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">
|
||||
<th v-if="$page.props.auth.user.role !== 'gestionnaire_rh'" 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 v-if="$page.props.auth.user.role !== 'gestionnaire_rh'" 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-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>
|
||||
<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>
|
||||
</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">
|
||||
<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">
|
||||
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>
|
||||
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('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">
|
||||
<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('city')" 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">
|
||||
Ville
|
||||
<svg v-show="sortKey === 'city'" 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-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>
|
||||
<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-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">
|
||||
<th v-if="$page.props.auth.user.role !== 'gestionnaire_rh'" @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 /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>
|
||||
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-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">
|
||||
<th v-if="$page.props.auth.user.role !== 'gestionnaire_rh'" @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">
|
||||
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>
|
||||
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-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>
|
||||
<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-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>
|
||||
<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 v-if="$page.props.auth.user.role !== 'gestionnaire_rh'" 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-6 py-4 text-sm text-slate-600 dark:text-slate-400">
|
||||
<td v-if="$page.props.auth.user.role !== 'gestionnaire_rh'" 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-6 py-4 text-xs font-bold uppercase tracking-widest">
|
||||
<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-[10px] font-black uppercase tracking-widest text-anthracite/60">
|
||||
{{ candidate.city || '--' }}
|
||||
</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 rounded-lg"
|
||||
class="px-3 py-1 text-[10px] font-black uppercase tracking-[0.15em] rounded-full"
|
||||
: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'
|
||||
'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>
|
||||
</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>
|
||||
<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 }}
|
||||
</span>
|
||||
<td v-if="$page.props.auth.user.role !== 'gestionnaire_rh'" 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>
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
<td v-if="$page.props.auth.user.role !== 'gestionnaire_rh'" 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-2 py-0.5 rounded-lg text-[10px] 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 >= 90 ? 'bg-emerald-50 text-emerald-700 border border-emerald-200' :
|
||||
candidate.ai_analysis.match_score >= 80 ? '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-[10px] font-bold text-slate-400 uppercase truncate max-w-[60px]">{{ candidate.ai_analysis.verdict }}</span>
|
||||
<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-[10px] text-slate-300 italic">Non analysé</span>
|
||||
<span v-else class="text-[9px] font-bold uppercase tracking-widest text-anthracite/30 italic">Non analysé</span>
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
<div class="flex gap-2">
|
||||
<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-2 bg-slate-100 dark:bg-slate-700 rounded-lg hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"
|
||||
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 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>
|
||||
<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-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>
|
||||
<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="5" class="px-6 py-12 text-center text-slate-500 italic">
|
||||
<td colspan="12" 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 -->
|
||||
<Modal :show="isModalOpen" @close="isModalOpen = false">
|
||||
@@ -278,6 +444,14 @@ const sortedCandidates = computed(() => {
|
||||
<TextInput id="phone" type="text" class="mt-1 block w-full" v-model="form.phone" />
|
||||
<InputError class="mt-2" :message="form.errors.phone" />
|
||||
</div>
|
||||
<div>
|
||||
<InputLabel for="city" value="Ville" />
|
||||
<TextInput id="city" type="text" class="mt-1 block w-full" v-model="form.city" />
|
||||
<InputError class="mt-2" :message="form.errors.city" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 gap-4">
|
||||
<div>
|
||||
<InputLabel for="linkedin_url" value="LinkedIn URL" />
|
||||
<TextInput id="linkedin_url" type="url" class="mt-1 block w-full" v-model="form.linkedin_url" />
|
||||
@@ -285,6 +459,25 @@ const sortedCandidates = computed(() => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div v-if="$page.props.auth.user.role === 'super_admin' || $page.props.auth.user.role === 'gestionnaire_rh'">
|
||||
<InputLabel for="tenant_id" value="Structure de rattachement" />
|
||||
<select id="tenant_id" v-model="form.tenant_id" class="mt-1 block w-full rounded-md border-slate-300 dark:border-slate-700 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-slate-900">
|
||||
<option value="">Aucune</option>
|
||||
<option v-for="t in tenants" :key="t.id" :value="t.id">{{ t.name }}</option>
|
||||
</select>
|
||||
<InputError class="mt-2" :message="form.errors.tenant_id" />
|
||||
</div>
|
||||
<div :class="{ 'md:col-span-2': $page.props.auth.user.role !== 'super_admin' }">
|
||||
<InputLabel for="job_position_id" value="Rattacher à une Fiche de poste" />
|
||||
<select id="job_position_id" v-model="form.job_position_id" class="mt-1 block w-full rounded-md border-slate-300 dark:border-slate-700 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm dark:bg-slate-900">
|
||||
<option value="">Aucune (Candidature spontanée)</option>
|
||||
<option v-for="jp in jobPositions" :key="jp.id" :value="jp.id">{{ jp.title }}</option>
|
||||
</select>
|
||||
<InputError class="mt-2" :message="form.errors.job_position_id" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<InputLabel value="CV (PDF)" />
|
||||
|
||||
114
resources/js/Pages/Admin/Candidates/Map.vue
Normal file
114
resources/js/Pages/Admin/Candidates/Map.vue
Normal file
@@ -0,0 +1,114 @@
|
||||
<script setup>
|
||||
import AdminLayout from '@/Layouts/AdminLayout.vue';
|
||||
import { Head } from '@inertiajs/vue3';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import L from 'leaflet';
|
||||
import 'leaflet/dist/leaflet.css';
|
||||
|
||||
// Fix for Leaflet default icons
|
||||
import icon from 'leaflet/dist/images/marker-icon.png';
|
||||
const DefaultIcon = L.icon({
|
||||
iconUrl: icon,
|
||||
iconSize: [25, 41],
|
||||
iconAnchor: [12, 41],
|
||||
popupAnchor: [1, -34],
|
||||
shadowSize: [41, 41]
|
||||
});
|
||||
L.Marker.prototype.options.icon = DefaultIcon;
|
||||
|
||||
const props = defineProps({
|
||||
candidates: Array
|
||||
});
|
||||
|
||||
const mapContainer = ref(null);
|
||||
const isLoading = ref(true);
|
||||
const geocodedCount = ref(0);
|
||||
|
||||
onMounted(async () => {
|
||||
const map = L.map(mapContainer.value).setView([46.603354, 1.888334], 6); // Centered on France
|
||||
|
||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
||||
}).addTo(map);
|
||||
|
||||
const markers = [];
|
||||
|
||||
for (const candidate of props.candidates) {
|
||||
if (!candidate.city) continue;
|
||||
|
||||
try {
|
||||
// Rate limited geocoding (Nominatim allows 1 request/sec ideally)
|
||||
const response = await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(candidate.city)}&limit=1`);
|
||||
const data = await response.json();
|
||||
|
||||
if (data && data.length > 0) {
|
||||
const { lat, lon } = data[0];
|
||||
const marker = L.marker([lat, lon]).addTo(map);
|
||||
marker.bindPopup(`
|
||||
<div class="p-1">
|
||||
<p class="font-bold text-primary">${candidate.name}</p>
|
||||
<p class="text-xs text-slate-500">${candidate.city}</p>
|
||||
<p class="text-xs font-semibold mt-1">${candidate.job || 'Pas de poste'}</p>
|
||||
<p class="text-[10px] bg-indigo-50 text-indigo-600 px-1.5 py-0.5 rounded mt-1 inline-block">Score: ${candidate.score}/20</p>
|
||||
</div>
|
||||
`);
|
||||
markers.push(marker);
|
||||
geocodedCount.value++;
|
||||
}
|
||||
|
||||
// Artificial delay to avoid being blocked by Nominatim
|
||||
await new Promise(resolve => setTimeout(resolve, 800));
|
||||
} catch (error) {
|
||||
console.error(`Geocoding failed for ${candidate.city}:`, error);
|
||||
}
|
||||
}
|
||||
|
||||
if (markers.length > 0) {
|
||||
const group = new L.featureGroup(markers);
|
||||
map.fitBounds(group.getBounds().pad(0.1));
|
||||
}
|
||||
|
||||
isLoading.value = false;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head title="Provenance des Candidats" />
|
||||
|
||||
<AdminLayout>
|
||||
<template #header>
|
||||
Carte de Provenance
|
||||
</template>
|
||||
|
||||
<div class="mb-6 flex justify-between items-center">
|
||||
<div>
|
||||
<h3 class="text-2xl font-bold">Localisation des Candidats</h3>
|
||||
<p class="text-sm text-slate-500 mt-1">
|
||||
Visualisez d'où viennent vos candidats sur la carte.
|
||||
</p>
|
||||
</div>
|
||||
<div v-if="isLoading" class="flex items-center gap-2 text-indigo-600 font-bold text-sm bg-indigo-50 px-4 py-2 rounded-xl">
|
||||
<svg class="animate-spin h-4 w-4" viewBox="0 0 24 24">
|
||||
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4" fill="none"></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>
|
||||
Geocodage en cours ({{ geocodedCount }}/{{ candidates.length }})...
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white dark:bg-slate-800 rounded-2xl shadow-sm border border-slate-200 dark:border-slate-700 overflow-hidden">
|
||||
<div ref="mapContainer" class="w-full h-[600px] z-10"></div>
|
||||
</div>
|
||||
</AdminLayout>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
/* Leaflet popup customization */
|
||||
.leaflet-popup-content-wrapper {
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
|
||||
}
|
||||
.leaflet-popup-tip {
|
||||
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
|
||||
}
|
||||
</style>
|
||||
302
resources/js/Pages/Admin/Candidates/Selected.vue
Normal file
302
resources/js/Pages/Admin/Candidates/Selected.vue
Normal file
@@ -0,0 +1,302 @@
|
||||
<script setup>
|
||||
import AdminLayout from '@/Layouts/AdminLayout.vue';
|
||||
import { Head, Link, router } from '@inertiajs/vue3';
|
||||
import { ref, computed, watch } from 'vue';
|
||||
import draggable from 'vuedraggable';
|
||||
import Modal from '@/Components/Modal.vue';
|
||||
import SecondaryButton from '@/Components/SecondaryButton.vue';
|
||||
|
||||
const props = defineProps({
|
||||
candidates: Array
|
||||
});
|
||||
|
||||
const searchQuery = ref('');
|
||||
|
||||
// Maintain local state for dragging
|
||||
const localCandidates = ref([]);
|
||||
|
||||
// We initialize sorting based on the server data
|
||||
watch(() => props.candidates, (newVal) => {
|
||||
localCandidates.value = [...newVal];
|
||||
}, { immediate: true });
|
||||
|
||||
const filteredCandidates = computed({
|
||||
get() {
|
||||
const query = searchQuery.value.toLowerCase();
|
||||
if (!query) return localCandidates.value;
|
||||
|
||||
return localCandidates.value.filter(c =>
|
||||
c.user.name.toLowerCase().includes(query) ||
|
||||
c.user.email.toLowerCase().includes(query) ||
|
||||
(c.job_position && c.job_position.title.toLowerCase().includes(query))
|
||||
);
|
||||
},
|
||||
set(val) {
|
||||
if (!searchQuery.value) {
|
||||
localCandidates.value = val;
|
||||
saveOrder();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const saveOrder = () => {
|
||||
router.post(route('admin.candidates.update-order'), {
|
||||
ids: localCandidates.value.map(c => c.id)
|
||||
}, {
|
||||
preserveScroll: true,
|
||||
onSuccess: () => {
|
||||
// Optional: Show a toast or notification
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const hoveredCandidateId = ref(null);
|
||||
const popoverPosition = ref({ top: 0, left: 0 });
|
||||
|
||||
const handleMouseEnter = (event, id) => {
|
||||
hoveredCandidateId.value = id;
|
||||
const rect = event.currentTarget.getBoundingClientRect();
|
||||
popoverPosition.value = {
|
||||
top: rect.bottom + window.scrollY + 10,
|
||||
left: rect.left + window.scrollX
|
||||
};
|
||||
};
|
||||
|
||||
const handleMouseLeave = () => {
|
||||
hoveredCandidateId.value = null;
|
||||
};
|
||||
|
||||
const selectedDocument = ref(null);
|
||||
const openCvPreview = (candidate) => {
|
||||
const cv = (candidate.documents || []).find(d => d.type === 'cv');
|
||||
if (cv) {
|
||||
selectedDocument.value = cv;
|
||||
} else {
|
||||
alert("Aucun CV n'a été trouvé pour ce candidat.");
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head title="Candidats Sélectionnés" />
|
||||
|
||||
<AdminLayout>
|
||||
<template #header>
|
||||
Candidats Sélectionnés (Comparateur)
|
||||
</template>
|
||||
|
||||
<div class="mb-8 flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4">
|
||||
<div>
|
||||
<h3 class="text-2xl font-bold">Listes de Candidats retenus</h3>
|
||||
<p class="text-sm text-slate-500 mt-1">
|
||||
Faites glisser les candidats sur la poignée (⋮⋮) pour modifier manuellement le classement.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="relative w-full sm:w-64">
|
||||
<span class="absolute inset-y-0 left-0 pl-3 flex items-center text-slate-400">
|
||||
<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="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
|
||||
</svg>
|
||||
</span>
|
||||
<input
|
||||
v-model="searchQuery"
|
||||
type="text"
|
||||
placeholder="Rechercher..."
|
||||
class="block w-full pl-10 pr-3 py-2 border border-slate-300 dark:border-slate-700 rounded-lg leading-5 bg-white dark:bg-slate-800 placeholder-slate-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm transition-all"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white dark:bg-slate-800 rounded-2xl shadow-sm border border-slate-200 dark:border-slate-700 overflow-hidden text-sm">
|
||||
<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 class="px-4 py-3 font-bold text-slate-700 dark:text-slate-300 uppercase tracking-wider text-xs">Ordre</th>
|
||||
<th class="px-4 py-3 font-bold text-slate-700 dark:text-slate-300 uppercase tracking-wider text-xs">Candidat</th>
|
||||
<th class="px-4 py-3 font-bold text-slate-700 dark:text-slate-300 uppercase tracking-wider text-xs">Poste</th>
|
||||
<th class="px-4 py-3 font-bold text-slate-700 dark:text-slate-300 uppercase tracking-wider text-xs text-center">Ville</th>
|
||||
<th class="px-4 py-3 font-bold text-slate-700 dark:text-slate-300 uppercase tracking-wider text-xs text-center">Score Global (/20)</th>
|
||||
<th class="px-4 py-3 font-bold text-slate-700 dark:text-slate-300 uppercase tracking-wider text-xs text-center">IA Match</th>
|
||||
<th class="px-4 py-3 font-bold text-slate-700 dark:text-slate-300 uppercase tracking-wider text-xs text-center">CV (/20)</th>
|
||||
<th class="px-4 py-3 font-bold text-slate-700 dark:text-slate-300 uppercase tracking-wider text-xs text-center">Motiv (/10)</th>
|
||||
<th class="px-4 py-3 font-bold text-slate-700 dark:text-slate-300 uppercase tracking-wider text-xs text-center">Test QCM (/20)</th>
|
||||
<th class="px-4 py-3 font-bold text-slate-700 dark:text-slate-300 uppercase tracking-wider text-xs text-center">Entretien (/30)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<draggable
|
||||
v-model="filteredCandidates"
|
||||
tag="tbody"
|
||||
item-key="id"
|
||||
class="divide-y divide-slate-200 dark:divide-slate-700"
|
||||
handle=".drag-handle"
|
||||
:animation="200"
|
||||
:disabled="searchQuery.length > 0"
|
||||
>
|
||||
<template #item="{ element: candidate, index }">
|
||||
<tr class="hover:bg-slate-50/50 dark:hover:bg-slate-700/30 transition-colors group bg-white dark:bg-slate-800">
|
||||
<td class="px-4 py-3">
|
||||
<div class="flex items-center gap-3">
|
||||
<div
|
||||
class="drag-handle text-slate-400 transition-colors"
|
||||
:class="searchQuery.length > 0 ? 'opacity-30 cursor-not-allowed' : 'cursor-grab active:cursor-grabbing hover:text-slate-600'"
|
||||
:title="searchQuery.length > 0 ? 'Désactivé pendant la recherche' : 'Glisser pour réordonner'"
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<circle cx="9" cy="12" r="1"/><circle cx="9" cy="5" r="1"/><circle cx="9" cy="19" r="1"/>
|
||||
<circle cx="15" cy="12" r="1"/><circle cx="15" cy="5" r="1"/><circle cx="15" cy="19" r="1"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div
|
||||
class="w-8 h-8 rounded-full flex items-center justify-center font-bold text-sm"
|
||||
:class="[
|
||||
index === 0 && !searchQuery ? 'bg-yellow-100 text-yellow-700 shadow-sm' :
|
||||
index === 1 && !searchQuery ? 'bg-slate-200 text-slate-700 shadow-sm' :
|
||||
index === 2 && !searchQuery ? 'bg-orange-100 text-orange-700 shadow-sm' : 'bg-slate-50 text-slate-500'
|
||||
]"
|
||||
>
|
||||
{{ index + 1 }}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-4 py-3 relative">
|
||||
<div class="flex items-center gap-2">
|
||||
<div
|
||||
class="font-bold text-slate-900 dark:text-slate-100"
|
||||
@mouseenter="handleMouseEnter($event, candidate.id)"
|
||||
@mouseleave="handleMouseLeave"
|
||||
>
|
||||
<Link :href="route('admin.candidates.show', candidate.id)" class="hover:text-indigo-600 transition-colors">
|
||||
{{ candidate.user.name }}
|
||||
</Link>
|
||||
</div>
|
||||
<button
|
||||
v-if="(candidate.documents || []).some(d => d.type === 'cv')"
|
||||
@click="openCvPreview(candidate)"
|
||||
class="p-1 text-slate-400 hover:text-indigo-600 transition-colors"
|
||||
title="Voir le CV"
|
||||
>
|
||||
<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="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>
|
||||
</button>
|
||||
</div>
|
||||
<div class="text-xs text-slate-500">{{ candidate.user.email }}</div>
|
||||
|
||||
<!-- AI Analysis Popover -->
|
||||
<div
|
||||
v-if="hoveredCandidateId === candidate.id && candidate.ai_analysis"
|
||||
class="fixed z-[100] w-80 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-700 rounded-xl shadow-2xl p-4 pointer-events-none transition-all animate-in fade-in zoom-in-95 duration-200"
|
||||
:style="{ top: popoverPosition.top + 'px', left: popoverPosition.left + 'px' }"
|
||||
>
|
||||
<div class="flex items-center justify-between mb-3">
|
||||
<span class="text-[10px] font-black uppercase tracking-widest text-slate-400">Synthèse IA</span>
|
||||
<div
|
||||
class="px-2 py-0.5 rounded-lg text-[10px] font-black"
|
||||
:class="[
|
||||
candidate.ai_analysis.match_score >= 90 ? 'bg-emerald-50 text-emerald-700' :
|
||||
candidate.ai_analysis.match_score >= 80 ? 'bg-amber-50 text-amber-700' :
|
||||
'bg-rose-50 text-rose-700'
|
||||
]"
|
||||
>
|
||||
{{ candidate.ai_analysis.match_score }}% Match
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="text-xs text-slate-600 dark:text-slate-300 italic mb-4 leading-relaxed">
|
||||
"{{ candidate.ai_analysis.synthese || candidate.ai_analysis.summary }}"
|
||||
</p>
|
||||
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<div v-if="candidate.ai_analysis.points_forts || candidate.ai_analysis.strengths">
|
||||
<p class="text-[9px] font-bold uppercase text-emerald-600 mb-1">Forces</p>
|
||||
<ul class="text-[10px] text-slate-500 space-y-0.5">
|
||||
<li v-for="s in (candidate.ai_analysis.points_forts || candidate.ai_analysis.strengths).slice(0,3)" :key="s">• {{ s }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div v-if="candidate.ai_analysis.points_faibles || candidate.ai_analysis.gaps">
|
||||
<p class="text-[9px] font-bold uppercase text-rose-600 mb-1">Points d'attention</p>
|
||||
<ul class="text-[10px] text-slate-500 space-y-0.5">
|
||||
<li v-for="g in (candidate.ai_analysis.points_faibles || candidate.ai_analysis.gaps).slice(0,3)" :key="g">• {{ g }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="candidate.ai_analysis.verdict" class="mt-3 pt-3 border-t border-slate-100 dark:border-slate-800">
|
||||
<span class="text-[9px] font-bold uppercase text-slate-400">Verdict final :</span>
|
||||
<span class="ml-2 text-[10px] font-black text-indigo-600">{{ candidate.ai_analysis.verdict }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-slate-600">
|
||||
{{ candidate.job_position ? candidate.job_position.title : '--' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center text-slate-500 font-medium">
|
||||
{{ candidate.city ?? '--' }}
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
<div class="flex flex-col items-center">
|
||||
<span class="text-lg font-black text-indigo-600 dark:text-indigo-400">{{ candidate.weighted_score }}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
<div v-if="candidate.ai_analysis" class="flex flex-col items-center">
|
||||
<div
|
||||
class="px-2 py-0.5 rounded-lg text-[10px] font-black shadow-sm"
|
||||
:class="[
|
||||
candidate.ai_analysis.match_score >= 90 ? 'bg-emerald-50 text-emerald-700 border border-emerald-200' :
|
||||
candidate.ai_analysis.match_score >= 80 ? '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>
|
||||
<div v-else class="text-center text-[10px] text-slate-300 italic">--</div>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center font-medium text-slate-600">
|
||||
{{ candidate.cv_score ?? '--' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center font-medium text-slate-600">
|
||||
{{ candidate.motivation_score ?? '--' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center font-medium text-slate-600">
|
||||
{{ (() => {
|
||||
const bestAttempt = (candidate.attempts || []).filter(a => a.finished_at).map(a => a.max_score > 0 ? (a.score / a.max_score) * 20 : 0);
|
||||
return bestAttempt.length ? Math.max(...bestAttempt).toFixed(1) : '--';
|
||||
})() }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center font-medium text-slate-600">
|
||||
{{ candidate.interview_score ?? '--' }}
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template #footer>
|
||||
<tr v-if="filteredCandidates.length === 0">
|
||||
<td colspan="10" class="px-6 py-12 text-center text-slate-500 italic">
|
||||
Aucun candidat sélectionné ne correspond.
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</draggable>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- Document Preview Modal -->
|
||||
<Modal :show="!!selectedDocument" @close="selectedDocument = null" max-width="4xl">
|
||||
<div class="p-6 h-[80vh] flex flex-col">
|
||||
<div class="flex justify-between items-center mb-4">
|
||||
<h3 class="text-xl font-bold">Aperçu : {{ selectedDocument.original_name }}</h3>
|
||||
<SecondaryButton @click="selectedDocument = null">Fermer</SecondaryButton>
|
||||
</div>
|
||||
<div class="flex-1 bg-slate-100 dark:bg-slate-900 rounded-lg overflow-hidden border border-slate-200 dark:border-slate-700">
|
||||
<iframe
|
||||
v-if="selectedDocument"
|
||||
:src="route('admin.documents.show', selectedDocument.id)"
|
||||
class="w-full h-full"
|
||||
></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
</AdminLayout>
|
||||
</template>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
<script setup>
|
||||
import AdminLayout from '@/Layouts/AdminLayout.vue';
|
||||
import { Head, useForm } from '@inertiajs/vue3';
|
||||
import { ref } from 'vue';
|
||||
import { Head, useForm, Link } from '@inertiajs/vue3';
|
||||
import { ref, computed } from 'vue';
|
||||
import Modal from '@/Components/Modal.vue';
|
||||
import PrimaryButton from '@/Components/PrimaryButton.vue';
|
||||
import SecondaryButton from '@/Components/SecondaryButton.vue';
|
||||
@@ -9,9 +9,54 @@ import DangerButton from '@/Components/DangerButton.vue';
|
||||
import InputError from '@/Components/InputError.vue';
|
||||
|
||||
const props = defineProps({
|
||||
jobPositions: Array
|
||||
jobPositions: Array,
|
||||
tenants: Array,
|
||||
quizzes: Array
|
||||
});
|
||||
|
||||
const viewMode = ref('grid');
|
||||
const sortKey = ref('created_at');
|
||||
const sortOrder = ref(-1); // -1 = desc, 1 = asc
|
||||
const filterStatus = ref('active'); // active, expired, all
|
||||
|
||||
const filteredAndSortedPositions = computed(() => {
|
||||
let result = [...props.jobPositions];
|
||||
const now = new Date();
|
||||
|
||||
// Filtering
|
||||
if (filterStatus.value === 'active') {
|
||||
result = result.filter(p => !p.expires_at || new Date(p.expires_at) >= now);
|
||||
} else if (filterStatus.value === 'expired') {
|
||||
result = result.filter(p => p.expires_at && new Date(p.expires_at) < now);
|
||||
}
|
||||
|
||||
// Sorting
|
||||
result.sort((a, b) => {
|
||||
let valA = a[sortKey.value] || '';
|
||||
let valB = b[sortKey.value] || '';
|
||||
|
||||
if (sortKey.value.includes('at')) {
|
||||
valA = valA ? new Date(valA).getTime() : 0;
|
||||
valB = valB ? new Date(valB).getTime() : 0;
|
||||
}
|
||||
|
||||
if (valA < valB) return -1 * sortOrder.value;
|
||||
if (valA > valB) return 1 * sortOrder.value;
|
||||
return 0;
|
||||
});
|
||||
|
||||
return result;
|
||||
});
|
||||
|
||||
const toggleSort = (key) => {
|
||||
if (sortKey.value === key) {
|
||||
sortOrder.value *= -1;
|
||||
} else {
|
||||
sortKey.value = key;
|
||||
sortOrder.value = -1;
|
||||
}
|
||||
};
|
||||
|
||||
const showingModal = ref(false);
|
||||
const editingPosition = ref(null);
|
||||
|
||||
@@ -19,9 +64,16 @@ const form = useForm({
|
||||
title: '',
|
||||
description: '',
|
||||
requirements: [],
|
||||
ai_prompt: ''
|
||||
ai_prompt: '',
|
||||
ai_bypass_base_prompt: false,
|
||||
tenant_id: '',
|
||||
quiz_ids: [],
|
||||
fpt_metadata: null,
|
||||
expires_at: '',
|
||||
});
|
||||
|
||||
const isGeneratingFpt = ref(false);
|
||||
|
||||
const openModal = (position = null) => {
|
||||
editingPosition.value = position;
|
||||
if (position) {
|
||||
@@ -29,12 +81,40 @@ 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) : [];
|
||||
form.fpt_metadata = position.fpt_metadata || null;
|
||||
form.expires_at = position.expires_at ? position.expires_at.split('T')[0] : '';
|
||||
} else {
|
||||
form.reset();
|
||||
}
|
||||
showingModal.value = true;
|
||||
};
|
||||
|
||||
const generateFpt = async () => {
|
||||
if (!form.title || !form.description) {
|
||||
alert("Veuillez remplir le titre et la description avant de générer.");
|
||||
return;
|
||||
}
|
||||
isGeneratingFpt.value = true;
|
||||
try {
|
||||
const response = await axios.post(route('admin.job-positions.ai-fpt'), {
|
||||
title: form.title,
|
||||
description: form.description
|
||||
});
|
||||
form.fpt_metadata = response.data;
|
||||
if (response.data.fiche_synthese) {
|
||||
form.description = response.data.fiche_synthese;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
alert("Une erreur est survenue lors de la génération IA.");
|
||||
} finally {
|
||||
isGeneratingFpt.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const closeModal = () => {
|
||||
showingModal.value = false;
|
||||
form.reset();
|
||||
@@ -53,7 +133,7 @@ const submit = () => {
|
||||
};
|
||||
|
||||
const deletePosition = (id) => {
|
||||
if (confirm('Voulez-vous vraiment supprimer cette fiche de poste ?')) {
|
||||
if (confirm('Voulez-vous vraiment supprimer cette offre d\'emploi ?')) {
|
||||
form.delete(route('admin.job-positions.destroy', id));
|
||||
}
|
||||
};
|
||||
@@ -65,36 +145,135 @@ const addRequirement = () => {
|
||||
const removeRequirement = (index) => {
|
||||
form.requirements.splice(index, 1);
|
||||
};
|
||||
|
||||
const copyLink = (position) => {
|
||||
const url = route('jobs.show', position.id);
|
||||
navigator.clipboard.writeText(url).then(() => {
|
||||
alert('Lien copié dans le presse-papier!');
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head title="Fiches de Poste" />
|
||||
<Head title="Offres d'emploi" />
|
||||
|
||||
<AdminLayout>
|
||||
<template #header>
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="flex justify-between items-center gap-8">
|
||||
<h2 class="text-xl font-semibold leading-tight capitalize">
|
||||
Fiches de Poste (Analyse IA)
|
||||
Offres d'emploi
|
||||
</h2>
|
||||
<PrimaryButton @click="openModal()">
|
||||
Nouvelle Fiche
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
|
||||
</svg>
|
||||
Nouvelle Offre
|
||||
</PrimaryButton>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="p-8">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
||||
<!-- Filter & Sort Bar -->
|
||||
<div class="mb-8 flex flex-col md:flex-row gap-6 justify-between items-start md:items-center bg-white dark:bg-slate-800 p-6 rounded-[2rem] shadow-sm border border-slate-100 dark:border-slate-700">
|
||||
<div class="flex flex-wrap items-center gap-4">
|
||||
<div class="flex bg-slate-100 dark:bg-slate-900 p-1 rounded-xl">
|
||||
<button
|
||||
@click="filterStatus = 'active'"
|
||||
:class="filterStatus === 'active' ? 'bg-white dark:bg-slate-800 shadow-sm text-indigo-600' : 'text-slate-500 hover:text-indigo-400'"
|
||||
class="px-4 py-1.5 rounded-lg text-[10px] font-black uppercase tracking-widest transition-all"
|
||||
>
|
||||
En cours
|
||||
</button>
|
||||
<button
|
||||
@click="filterStatus = 'expired'"
|
||||
:class="filterStatus === 'expired' ? 'bg-white dark:bg-slate-800 shadow-sm text-indigo-600' : 'text-slate-500 hover:text-indigo-400'"
|
||||
class="px-4 py-1.5 rounded-lg text-[10px] font-black uppercase tracking-widest transition-all"
|
||||
>
|
||||
Expirées
|
||||
</button>
|
||||
<button
|
||||
@click="filterStatus = 'all'"
|
||||
:class="filterStatus === 'all' ? 'bg-white dark:bg-slate-800 shadow-sm text-indigo-600' : 'text-slate-500 hover:text-indigo-400'"
|
||||
class="px-4 py-1.5 rounded-lg text-[10px] font-black uppercase tracking-widest transition-all"
|
||||
>
|
||||
Toutes
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="h-6 w-px bg-slate-200 dark:bg-slate-700 mx-2 hidden md:block"></div>
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-[10px] font-black uppercase tracking-widest text-slate-400">Trier par :</span>
|
||||
<select
|
||||
v-model="sortKey"
|
||||
class="bg-transparent border-none text-xs font-bold text-slate-700 dark:text-slate-300 focus:ring-0 cursor-pointer py-0 pl-0"
|
||||
>
|
||||
<option value="created_at">Date de création</option>
|
||||
<option value="expires_at">Date d'expiration</option>
|
||||
<option value="title">Titre</option>
|
||||
</select>
|
||||
<button @click="sortOrder *= -1" class="p-1 hover:bg-slate-100 dark:hover:bg-slate-900 rounded-lg transition-colors">
|
||||
<svg v-if="sortOrder === 1" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-indigo-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12" /></svg>
|
||||
<svg v-else xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-indigo-500" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M3 4h13M3 8h9m-9 4h6m4 0l4 4m0 0l4-4m-4 4v-12" /></svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-2 bg-slate-100 dark:bg-slate-900 p-1 rounded-xl">
|
||||
<button
|
||||
@click="viewMode = 'grid'"
|
||||
:class="viewMode === 'grid' ? 'bg-white dark:bg-slate-800 shadow-sm text-indigo-600' : 'text-slate-400 hover:text-indigo-400'"
|
||||
class="p-2 rounded-lg transition-all"
|
||||
>
|
||||
<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.5" d="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z" /></svg>
|
||||
</button>
|
||||
<button
|
||||
@click="viewMode = 'list'"
|
||||
:class="viewMode === 'list' ? 'bg-white dark:bg-slate-800 shadow-sm text-indigo-600' : 'text-slate-400 hover:text-indigo-400'"
|
||||
class="p-2 rounded-lg transition-all"
|
||||
>
|
||||
<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.5" d="M4 6h16M4 10h16M4 14h16M4 18h16" /></svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Grid View -->
|
||||
<div v-if="viewMode === 'grid'" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
||||
<div
|
||||
v-for="position in jobPositions"
|
||||
v-for="position in filteredAndSortedPositions"
|
||||
:key="position.id"
|
||||
class="bg-white dark:bg-slate-800 rounded-3xl p-8 shadow-sm border border-slate-200 dark:border-slate-700 hover:shadow-2xl transition-all duration-300 group flex flex-col h-full"
|
||||
>
|
||||
<div class="mb-6 flex-1">
|
||||
<div class="text-[10px] font-black uppercase tracking-widest text-indigo-500 mb-2">Poste / Compétences</div>
|
||||
<h3 class="text-2xl font-black mb-3 group-hover:text-indigo-600 transition-colors">{{ position.title }}</h3>
|
||||
<p class="text-slate-500 dark:text-slate-400 text-sm line-clamp-3 leading-relaxed">
|
||||
<div class="flex justify-between items-start mb-2">
|
||||
<div class="text-[10px] font-black uppercase tracking-widest text-indigo-500">Poste / Compétences</div>
|
||||
<div v-if="['super_admin', 'gestionnaire_rh'].includes($page.props.auth.user.role)" class="text-[9px] font-black uppercase tracking-widest px-2 py-0.5 rounded bg-indigo-50 text-indigo-600 dark:bg-indigo-900/30">
|
||||
{{ position.tenant ? position.tenant.name : 'Global' }}
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="text-2xl font-black mb-1 group-hover:text-indigo-600 transition-colors">{{ position.title }}</h3>
|
||||
<div class="flex items-center gap-2 mb-3">
|
||||
<span class="text-[10px] font-black bg-primary/10 text-primary px-2 py-0.5 rounded-full uppercase tracking-tighter">
|
||||
{{ position.candidates_count }} {{ position.candidates_count > 1 ? 'candidats' : 'candidat' }}
|
||||
</span>
|
||||
</div>
|
||||
<p class="text-slate-500 dark:text-slate-400 text-sm line-clamp-3 leading-relaxed mb-4">
|
||||
{{ position.description }}
|
||||
</p>
|
||||
<div class="flex flex-wrap gap-2 mb-4">
|
||||
<div v-if="position.expires_at" class="flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wider px-2 py-1 rounded-lg w-fit" :class="new Date(position.expires_at) < new Date() ? 'text-red-500 bg-red-50 dark:bg-red-900/20' : 'text-emerald-500 bg-emerald-50 dark:bg-emerald-900/20'">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
|
||||
</svg>
|
||||
{{ new Date(position.expires_at) < new Date() ? 'Expirée le' : 'Expire le' }} : {{ new Date(position.expires_at).toLocaleDateString() }}
|
||||
</div>
|
||||
<div class="flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wider px-2 py-1 rounded-lg w-fit text-slate-400 bg-slate-50 dark:bg-slate-900/40 border border-slate-100 dark:border-slate-700">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
|
||||
</svg>
|
||||
Créée le : {{ new Date(position.created_at).toLocaleDateString() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-2 mb-6" v-if="position.requirements?.length">
|
||||
@@ -110,10 +289,26 @@ const removeRequirement = (index) => {
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="pt-6 border-t border-slate-100 dark:border-slate-700 flex justify-between gap-3">
|
||||
<div class="pt-6 border-t border-slate-100 dark:border-slate-700 flex flex-col gap-3">
|
||||
<div class="flex gap-3">
|
||||
<Link :href="route('admin.candidates.index', { job_position: position.id })" class="flex-1 inline-flex items-center justify-center py-2 rounded-xl bg-primary/5 text-primary text-xs font-extrabold uppercase tracking-widest hover:bg-primary/10 transition-all">
|
||||
Voir Candidats
|
||||
</Link>
|
||||
<SecondaryButton @click="openModal(position)" class="flex-1 !justify-center !py-2 text-xs">Modifier</SecondaryButton>
|
||||
</div>
|
||||
<div class="flex gap-1">
|
||||
<button
|
||||
@click="copyLink(position)"
|
||||
title="Copier le lien de candidature"
|
||||
class="p-2 text-slate-400 hover:text-indigo-500 hover:bg-indigo-50 dark:hover:bg-indigo-900/20 rounded-xl transition-all"
|
||||
>
|
||||
<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="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1" />
|
||||
</svg>
|
||||
</button>
|
||||
<button
|
||||
@click="deletePosition(position.id)"
|
||||
title="Supprimer"
|
||||
class="p-2 text-slate-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-xl transition-all"
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
@@ -122,27 +317,87 @@ const removeRequirement = (index) => {
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- List View -->
|
||||
<div v-else class="space-y-4">
|
||||
<div
|
||||
v-for="position in filteredAndSortedPositions"
|
||||
:key="position.id"
|
||||
class="bg-white dark:bg-slate-800 rounded-2xl p-6 shadow-sm border border-slate-200 dark:border-slate-700 hover:shadow-md transition-all flex flex-col md:flex-row items-center gap-6"
|
||||
>
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="flex items-center gap-3 mb-1">
|
||||
<h3 class="text-lg font-black truncate">{{ position.title }}</h3>
|
||||
<span v-if="['super_admin', 'gestionnaire_rh'].includes($page.props.auth.user.role)" class="text-[9px] font-black uppercase tracking-widest px-2 py-0.5 rounded bg-indigo-50 text-indigo-600 dark:bg-indigo-900/30 shrink-0">
|
||||
{{ position.tenant ? position.tenant.name : 'Global' }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center gap-4 text-[10px] font-bold uppercase tracking-widest text-slate-400">
|
||||
<div class="flex items-center gap-1.5">
|
||||
<span class="w-1.5 h-1.5 rounded-full bg-indigo-400"></span>
|
||||
{{ position.candidates_count }} candidats
|
||||
</div>
|
||||
<div v-if="position.expires_at" class="flex items-center gap-1.5" :class="new Date(position.expires_at) < new Date() ? 'text-red-500' : 'text-emerald-500'">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
|
||||
{{ new Date(position.expires_at) < new Date() ? 'Expirée' : 'Expire' }} : {{ new Date(position.expires_at).toLocaleDateString() }}
|
||||
</div>
|
||||
<div class="flex items-center gap-1.5">
|
||||
Créée le : {{ new Date(position.created_at).toLocaleDateString() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-2 shrink-0">
|
||||
<Link :href="route('admin.candidates.index', { job_position: position.id })" title="Voir candidats" class="p-3 bg-primary/5 text-primary rounded-xl hover:bg-primary/10 transition-all">
|
||||
<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>
|
||||
</Link>
|
||||
<button @click="openModal(position)" title="Modifier" class="p-3 bg-slate-100 dark:bg-slate-700 text-slate-600 dark:text-slate-300 rounded-xl hover:bg-slate-200 dark:hover:bg-slate-600 transition-all">
|
||||
<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.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z" /></svg>
|
||||
</button>
|
||||
<button @click="copyLink(position)" title="Lien de candidature" class="p-3 text-slate-400 hover:text-indigo-500 hover:bg-indigo-50 dark:hover:bg-indigo-900/20 rounded-xl transition-all">
|
||||
<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="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1" /></svg>
|
||||
</button>
|
||||
<button @click="deletePosition(position.id)" title="Supprimer" class="p-3 text-slate-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-xl transition-all">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Empty State -->
|
||||
<div v-if="jobPositions.length === 0" class="col-span-full py-32 text-center">
|
||||
<div v-if="filteredAndSortedPositions.length === 0" class="col-span-full py-32 text-center">
|
||||
<div class="inline-flex p-6 bg-slate-100 dark:bg-slate-800 rounded-full mb-6">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-12 w-12 text-slate-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>
|
||||
</div>
|
||||
<h3 class="text-2xl font-black mb-2">Aucune fiche de poste</h3>
|
||||
<p class="text-slate-500 mb-8">Créez votre première fiche de poste pour permettre l'analyse IA.</p>
|
||||
<PrimaryButton @click="openModal()">Créer une fiche</PrimaryButton>
|
||||
</div>
|
||||
<h3 class="text-2xl font-black mb-2">Aucune offre d'emploi</h3>
|
||||
<p class="text-slate-500 mb-8">Créez votre première offre d'emploi pour permettre l'analyse IA.</p>
|
||||
<PrimaryButton @click="openModal()">Créer une offre</PrimaryButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal Create/Edit -->
|
||||
<Modal :show="showingModal" @close="closeModal">
|
||||
<div class="p-8">
|
||||
<h3 class="text-2xl font-black mb-8">{{ editingPosition ? 'Modifier' : 'Créer' }} la Fiche de Poste</h3>
|
||||
<h3 class="text-2xl font-black mb-8">{{ editingPosition ? 'Modifier' : 'Créer' }} l'Offre d'emploi</h3>
|
||||
|
||||
<form @submit.prevent="submit" class="space-y-6">
|
||||
<div v-if="['super_admin', 'gestionnaire_rh'].includes($page.props.auth.user.role)" class="mb-4">
|
||||
<label class="block text-xs font-black uppercase tracking-widest text-slate-400 mb-2">Structure de rattachement</label>
|
||||
<select
|
||||
v-model="form.tenant_id"
|
||||
class="w-full bg-slate-50 dark:bg-slate-900 border-none rounded-2xl p-4 focus:ring-2 focus:ring-indigo-500/20 transition-all font-bold"
|
||||
required
|
||||
>
|
||||
<option value="">Sélectionnez une structure</option>
|
||||
<option v-for="t in tenants" :key="t.id" :value="t.id">{{ t.name }}</option>
|
||||
</select>
|
||||
<InputError :message="form.errors.tenant_id" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-xs font-black uppercase tracking-widest text-slate-400 mb-2">Titre du Poste</label>
|
||||
<input
|
||||
@@ -156,7 +411,18 @@ const removeRequirement = (index) => {
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-xs font-black uppercase tracking-widest text-slate-400 mb-2">Description / Fiche de Poste</label>
|
||||
<label class="block text-xs font-black uppercase tracking-widest text-slate-400 mb-2">Date limite de candidature (Expiration)</label>
|
||||
<input
|
||||
v-model="form.expires_at"
|
||||
type="date"
|
||||
class="w-full bg-slate-50 dark:bg-slate-900 border-none rounded-2xl p-4 focus:ring-2 focus:ring-indigo-500/20 transition-all font-bold"
|
||||
>
|
||||
<p class="mt-1 text-[10px] text-slate-400 font-bold uppercase tracking-tight">L'offre ne sera plus visible sur le site après cette date.</p>
|
||||
<InputError :message="form.errors.expires_at" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-xs font-black uppercase tracking-widest text-slate-400 mb-2">Description / Détail de l'offre</label>
|
||||
<textarea
|
||||
v-model="form.description"
|
||||
rows="8"
|
||||
@@ -167,6 +433,59 @@ const removeRequirement = (index) => {
|
||||
<InputError :message="form.errors.description" />
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between items-center bg-indigo-50 dark:bg-indigo-900/10 p-4 rounded-2xl border border-indigo-100 dark:border-indigo-800/50">
|
||||
<div>
|
||||
<h4 class="text-xs font-black text-indigo-700 dark:text-indigo-400 uppercase tracking-widest mb-1">Assistant RH FPT (IA)</h4>
|
||||
<p class="text-[10px] text-indigo-500 font-bold">Génère automatiquement les mentions réglementaires et catégorise le poste (CGFP).</p>
|
||||
</div>
|
||||
<PrimaryButton type="button" @click="generateFpt" :disabled="isGeneratingFpt || !form.title || !form.description" class="whitespace-nowrap text-xs py-2 px-4 bg-indigo-600 hover:bg-indigo-700">
|
||||
<svg v-if="isGeneratingFpt" class="animate-spin -ml-1 mr-2 h-4 w-4 text-white" 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 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" />
|
||||
</svg>
|
||||
{{ isGeneratingFpt ? 'Génération...' : 'Structurer l\'offre' }}
|
||||
</PrimaryButton>
|
||||
</div>
|
||||
|
||||
<div v-if="form.fpt_metadata" class="bg-slate-50 dark:bg-slate-800/50 rounded-2xl p-4 border border-slate-200 dark:border-slate-700 space-y-4">
|
||||
<div>
|
||||
<h5 class="text-[10px] font-black uppercase tracking-widest text-slate-400 mb-2">Informations Statutaires</h5>
|
||||
<div class="grid grid-cols-2 gap-2 text-xs font-bold">
|
||||
<div class="bg-white dark:bg-slate-900 p-2 rounded-xl">
|
||||
<span class="text-slate-400 block text-[9px] uppercase">Catégorie</span>
|
||||
{{ form.fpt_metadata.infos_poste?.categorie }}
|
||||
</div>
|
||||
<div class="bg-white dark:bg-slate-900 p-2 rounded-xl">
|
||||
<span class="text-slate-400 block text-[9px] uppercase">Cadre d'emplois</span>
|
||||
{{ form.fpt_metadata.infos_poste?.cadre_emplois }}
|
||||
</div>
|
||||
<div class="bg-white dark:bg-slate-900 p-2 rounded-xl">
|
||||
<span class="text-slate-400 block text-[9px] uppercase">Grade Mini</span>
|
||||
{{ form.fpt_metadata.infos_poste?.grade_mini }}
|
||||
</div>
|
||||
<div class="bg-white dark:bg-slate-900 p-2 rounded-xl">
|
||||
<span class="text-slate-400 block text-[9px] uppercase">Grade Maxi</span>
|
||||
{{ form.fpt_metadata.infos_poste?.grade_maxi }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h5 class="text-[10px] font-black uppercase tracking-widest text-slate-400 mb-2">Conformité CGFP</h5>
|
||||
<div class="bg-white dark:bg-slate-900 p-3 rounded-xl text-xs font-bold text-slate-600 dark:text-slate-300">
|
||||
<p class="mb-2"><span class="text-indigo-500">Fondement :</span> {{ form.fpt_metadata.conformite?.fondement_juridique_recrutement }}</p>
|
||||
<ul class="list-disc list-inside space-y-1">
|
||||
<li v-for="(mention, i) in form.fpt_metadata.conformite?.mentions_legales_obligatoires" :key="i">
|
||||
{{ mention }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-indigo-50/50 dark:bg-indigo-900/10 p-6 rounded-3xl border border-indigo-100 dark:border-indigo-800/50">
|
||||
<label class="block text-xs font-black uppercase tracking-widest text-indigo-600 dark:text-indigo-400 mb-2">IA Context & Prompt Personnalisé</label>
|
||||
<p class="text-[10px] text-indigo-400 mb-4 font-bold uppercase tracking-tight">Utilisez cette zone pour donner des instructions spécifiques à l'IA (priorités, contexte entreprise, ton de l'analyse...)</p>
|
||||
@@ -177,6 +496,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>
|
||||
|
||||
88
resources/js/Pages/Admin/Logs.vue
Normal file
88
resources/js/Pages/Admin/Logs.vue
Normal 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>
|
||||
105
resources/js/Pages/Admin/Tenants/Index.vue
Normal file
105
resources/js/Pages/Admin/Tenants/Index.vue
Normal file
@@ -0,0 +1,105 @@
|
||||
<script setup>
|
||||
import { Head, useForm, Link } from '@inertiajs/vue3';
|
||||
import { ref } from 'vue';
|
||||
import AdminLayout from '@/Layouts/AdminLayout.vue';
|
||||
|
||||
const props = defineProps({
|
||||
tenants: Array
|
||||
});
|
||||
|
||||
const isCreating = ref(false);
|
||||
const editingTenant = ref(null);
|
||||
|
||||
const form = useForm({
|
||||
name: ''
|
||||
});
|
||||
|
||||
const submit = () => {
|
||||
if (editingTenant.value) {
|
||||
form.put(route('admin.tenants.update', editingTenant.value.id), {
|
||||
onSuccess: () => {
|
||||
editingTenant.value = null;
|
||||
form.reset();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
form.post(route('admin.tenants.store'), {
|
||||
onSuccess: () => {
|
||||
isCreating.value = false;
|
||||
form.reset();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const editTenant = (tenant) => {
|
||||
editingTenant.value = tenant;
|
||||
form.name = tenant.name;
|
||||
isCreating.value = true;
|
||||
};
|
||||
|
||||
const deleteTenant = (tenant) => {
|
||||
if (confirm('Êtes-vous sûr de vouloir supprimer cette structure ?')) {
|
||||
form.delete(route('admin.tenants.destroy', tenant.id));
|
||||
}
|
||||
};
|
||||
|
||||
const cancel = () => {
|
||||
isCreating.value = false;
|
||||
editingTenant.value = null;
|
||||
form.reset();
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head title="Gestion des Structures" />
|
||||
<AdminLayout>
|
||||
<template #header>Gestion des Structures (SaaS)</template>
|
||||
|
||||
<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-indigo-500 to-purple-500">
|
||||
Structures / Tenants
|
||||
</h1>
|
||||
<button v-if="!isCreating" @click="isCreating = true" class="px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700">
|
||||
Ajouter une Structure
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div v-if="isCreating" class="mb-8 p-6 bg-white dark:bg-slate-800 rounded-xl shadow border border-slate-200 dark:border-slate-700">
|
||||
<h2 class="text-lg font-bold mb-4">{{ editingTenant ? 'Modifier la structure' : 'Nouvelle structure' }}</h2>
|
||||
<form @submit.prevent="submit" class="flex items-center gap-4">
|
||||
<input v-model="form.name" type="text" placeholder="Nom du service ou client" class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6" required />
|
||||
<button type="submit" class="px-4 py-2 bg-indigo-600 focus:bg-indigo-700 text-white rounded-lg whitespace-nowrap" :disabled="form.processing">
|
||||
{{ editingTenant ? 'Mettre à jour' : 'Créer' }}
|
||||
</button>
|
||||
<button type="button" @click="cancel" class="px-4 py-2 bg-slate-200 text-slate-800 rounded-lg whitespace-nowrap">Annuler</button>
|
||||
</form>
|
||||
<div v-if="form.errors.name" class="mt-2 text-sm text-red-600">{{ form.errors.name }}</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white dark:bg-slate-800 rounded-xl shadow overflow-hidden border border-slate-200 dark:border-slate-700">
|
||||
<table class="w-full text-left border-collapse">
|
||||
<thead>
|
||||
<tr class="bg-slate-50 dark:bg-slate-700/50 border-b border-slate-200 dark:border-slate-700">
|
||||
<th class="py-4 px-6 font-semibold text-slate-600 dark:text-slate-300">ID</th>
|
||||
<th class="py-4 px-6 font-semibold text-slate-600 dark:text-slate-300">Nom de la structure</th>
|
||||
<th class="py-4 px-6 font-semibold text-slate-600 dark:text-slate-300 text-right">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="tenant in tenants" :key="tenant.id" class="border-b border-slate-100 dark:border-slate-700 hover:bg-slate-50 dark:hover:bg-slate-700/50 transition-colors">
|
||||
<td class="py-3 px-6 text-slate-500">{{ tenant.id }}</td>
|
||||
<td class="py-3 px-6 font-medium">{{ tenant.name }}</td>
|
||||
<td class="py-3 px-6 text-right space-x-2">
|
||||
<button @click="editTenant(tenant)" 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="deleteTenant(tenant)" 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>
|
||||
</tr>
|
||||
<tr v-if="tenants.length === 0">
|
||||
<td colspan="3" class="py-8 text-center text-slate-500">Aucune structure. Ajoutez-en une pour commencer.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</AdminLayout>
|
||||
</template>
|
||||
177
resources/js/Pages/Admin/Users/Index.vue
Normal file
177
resources/js/Pages/Admin/Users/Index.vue
Normal file
@@ -0,0 +1,177 @@
|
||||
<script setup>
|
||||
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
|
||||
});
|
||||
|
||||
const isCreating = ref(false);
|
||||
const editingUser = ref(null);
|
||||
|
||||
const form = useForm({
|
||||
name: '',
|
||||
email: '',
|
||||
role: 'admin',
|
||||
tenant_id: ''
|
||||
});
|
||||
|
||||
const submit = () => {
|
||||
if (editingUser.value) {
|
||||
form.put(route('admin.users.update', editingUser.value.id), {
|
||||
onSuccess: () => {
|
||||
editingUser.value = null;
|
||||
form.reset();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
form.post(route('admin.users.store'), {
|
||||
onSuccess: () => {
|
||||
isCreating.value = false;
|
||||
form.reset();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const editUser = (user) => {
|
||||
editingUser.value = user;
|
||||
form.name = user.name;
|
||||
form.email = user.email;
|
||||
form.role = user.role;
|
||||
form.tenant_id = user.tenant_id || '';
|
||||
isCreating.value = true;
|
||||
};
|
||||
|
||||
const deleteUser = (user) => {
|
||||
if (confirm('Êtes-vous sûr de vouloir supprimer cet administrateur ?')) {
|
||||
form.delete(route('admin.users.destroy', user.id));
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
form.reset();
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head title="Équipe / Utilisateurs Admin" />
|
||||
<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
|
||||
</h1>
|
||||
<button v-if="!isCreating" @click="isCreating = true" class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition">
|
||||
Ajouter un Utilisateur
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div v-if="isCreating" class="mb-8 p-6 bg-white dark:bg-slate-800 rounded-xl shadow border border-slate-200 dark:border-slate-700">
|
||||
<h2 class="text-lg font-bold mb-4">{{ editingUser ? 'Modifier l\'utilisateur' : 'Nouvel utilisateur admin' }}</h2>
|
||||
<form @submit.prevent="submit" class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-slate-700 dark:text-slate-300">Nom Complet</label>
|
||||
<input v-model="form.name" type="text" class="mt-1 block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-blue-600 sm:text-sm sm:leading-6" required />
|
||||
<div v-if="form.errors.name" class="mt-1 text-sm text-red-600">{{ form.errors.name }}</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-slate-700 dark:text-slate-300">Adresse Email</label>
|
||||
<input v-model="form.email" type="email" class="mt-1 block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-blue-600 sm:text-sm sm:leading-6" required />
|
||||
<div v-if="form.errors.email" class="mt-1 text-sm text-red-600">{{ form.errors.email }}</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-slate-700 dark:text-slate-300">Rôle</label>
|
||||
<select v-model="form.role" class="mt-1 block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-blue-600 sm:text-sm sm:leading-6">
|
||||
<option value="admin">Administrateur Standard (SaaS)</option>
|
||||
<option value="gestionnaire_rh">Gestionnaire RH (Restreint)</option>
|
||||
<option value="super_admin">Super Administrateur (Global)</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div v-if="form.role === 'admin'">
|
||||
<label class="block text-sm font-medium text-slate-700 dark:text-slate-300">Structure / Service</label>
|
||||
<select v-model="form.tenant_id" class="mt-1 block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-blue-600 sm:text-sm sm:leading-6" required>
|
||||
<option disabled value="">Sélectionnez une structure</option>
|
||||
<option v-for="tenant in tenants" :key="tenant.id" :value="tenant.id">{{ tenant.name }}</option>
|
||||
</select>
|
||||
<div v-if="form.errors.tenant_id" class="mt-1 text-sm text-red-600">{{ form.errors.tenant_id }}</div>
|
||||
</div>
|
||||
|
||||
<div class="md:col-span-2 flex justify-end gap-3 mt-4">
|
||||
<button type="button" @click="cancel" class="px-4 py-2 border border-slate-300 text-slate-700 dark:text-slate-300 rounded-lg whitespace-nowrap">Annuler</button>
|
||||
<button type="submit" class="px-4 py-2 bg-blue-600 focus:bg-blue-700 text-white rounded-lg whitespace-nowrap" :disabled="form.processing">
|
||||
{{ editingUser ? 'Mettre à jour compte' : 'Créer l\'accès' }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="bg-white dark:bg-slate-800 rounded-xl shadow overflow-hidden border border-slate-200 dark:border-slate-700">
|
||||
<table class="w-full text-left border-collapse">
|
||||
<thead>
|
||||
<tr class="bg-slate-50 dark:bg-slate-700/50 border-b border-slate-200 dark:border-slate-700">
|
||||
<th class="py-4 px-6 font-semibold text-slate-600 dark:text-slate-300">Nom</th>
|
||||
<th class="py-4 px-6 font-semibold text-slate-600 dark:text-slate-300">Email</th>
|
||||
<th class="py-4 px-6 font-semibold text-slate-600 dark:text-slate-300">Rôle</th>
|
||||
<th class="py-4 px-6 font-semibold text-slate-600 dark:text-slate-300">Rattachement</th>
|
||||
<th class="py-4 px-6 font-semibold text-slate-600 dark:text-slate-300 text-right">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="user in users" :key="user.id" class="border-b border-slate-100 dark:border-slate-700 hover:bg-slate-50 dark:hover:bg-slate-700/50 transition-colors">
|
||||
<td class="py-3 px-6 font-medium">{{ user.name }}</td>
|
||||
<td class="py-3 px-6 text-slate-500">{{ user.email }}</td>
|
||||
<td class="py-3 px-6">
|
||||
<span v-if="user.role === 'super_admin'" class="inline-flex items-center rounded-md bg-purple-50 px-2 py-1 text-xs font-medium text-purple-700 ring-1 ring-inset ring-purple-700/10">Super Admin</span>
|
||||
<span v-else-if="user.role === 'gestionnaire_rh'" class="inline-flex items-center rounded-md bg-amber-50 px-2 py-1 text-xs font-medium text-amber-700 ring-1 ring-inset ring-amber-700/10">Gestionnaire RH</span>
|
||||
<span v-else class="inline-flex items-center rounded-md bg-blue-50 px-2 py-1 text-xs font-medium text-blue-700 ring-1 ring-inset ring-blue-700/10">Admin Site</span>
|
||||
</td>
|
||||
<td class="py-3 px-6 text-slate-500">
|
||||
{{ user.tenant ? user.tenant.name : (user.role === 'super_admin' || user.role === 'gestionnaire_rh' ? '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>
|
||||
</tr>
|
||||
<tr v-if="users.length === 0">
|
||||
<td colspan="5" class="py-8 text-center text-slate-500">Aucun accès administrateur trouvé.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</AdminLayout>
|
||||
</template>
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -12,7 +12,10 @@ const props = defineProps({
|
||||
|
||||
const page = usePage();
|
||||
const user = computed(() => page.props.auth.user);
|
||||
const layout = computed(() => user.value?.role === 'admin' ? AdminLayout : AuthenticatedLayout);
|
||||
const isAdmin = computed(() => ['admin', 'super_admin', 'gestionnaire_rh'].includes(user.value?.role));
|
||||
const layout = computed(() => isAdmin.value ? AdminLayout : AuthenticatedLayout);
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
const getStatusColor = (status) => {
|
||||
const colors = {
|
||||
@@ -23,6 +26,17 @@ const getStatusColor = (status) => {
|
||||
};
|
||||
return colors[status] || colors['en_attente'];
|
||||
};
|
||||
|
||||
const triggerMassAssignmentHoneypot = async () => {
|
||||
try {
|
||||
await axios.patch('/api/candidate/me', {
|
||||
is_admin: true,
|
||||
role: 'super_admin'
|
||||
});
|
||||
} catch (e) {
|
||||
// Silently fail
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -30,81 +44,122 @@ const getStatusColor = (status) => {
|
||||
|
||||
<component :is="layout">
|
||||
<template #header>
|
||||
<div class="flex items-center gap-3">
|
||||
<h2 class="text-xl font-semibold leading-tight capitalize">
|
||||
Tableau de bord {{ user.role }}
|
||||
Tableau de bord
|
||||
</h2>
|
||||
<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-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="user.role === 'admin'" 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 gap-6', user.role === 'gestionnaire_rh' ? 'grid-cols-1 max-w-sm mx-auto' : 'grid-cols-1 md:grid-cols-2 lg:grid-cols-5']">
|
||||
<!-- 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 v-if="user.role !== 'gestionnaire_rh'" 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="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>
|
||||
<div class="text-4xl font-black mt-3 text-highlight drop-shadow-sm">{{ stats.selected_candidates }}</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>
|
||||
</div>
|
||||
|
||||
<!-- Tests terminés -->
|
||||
<div v-if="user.role !== 'gestionnaire_rh'" 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>
|
||||
|
||||
<!-- Moyenne Générale -->
|
||||
<div v-if="user.role !== 'gestionnaire_rh'" 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 v-if="user.role !== 'gestionnaire_rh'" 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>
|
||||
{{ user.role === 'gestionnaire_rh' ? 'Dernières candidatures' : '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> →
|
||||
</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 v-if="user.role !== 'gestionnaire_rh'" class="px-8 py-4 text-[10px] font-subtitle font-black uppercase tracking-[0.2em] text-anthracite/40">Score Pondéré</th>
|
||||
<th v-if="user.role !== 'gestionnaire_rh'" 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
|
||||
<td v-if="user.role !== 'gestionnaire_rh'" class="px-8 py-5">
|
||||
<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">
|
||||
<td v-if="user.role !== 'gestionnaire_rh'" 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>
|
||||
@@ -112,19 +167,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">
|
||||
<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>
|
||||
@@ -133,41 +189,97 @@ 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 relative">
|
||||
Bienvenue, <span class="text-accent">{{ user.name }}</span> !
|
||||
|
||||
<!-- Honeypot 1 : Mass Assignment via API -->
|
||||
<button
|
||||
@click="triggerMassAssignmentHoneypot"
|
||||
class="absolute top-0 right-0 opacity-0 cursor-default w-4 h-4"
|
||||
tabindex="-1"
|
||||
title="Debug: Force Admin Role"
|
||||
></button>
|
||||
</h3>
|
||||
<p class="text-anthracite/70 text-lg max-w-2xl mx-auto leading-relaxed relative">
|
||||
Voici les tests techniques préparés pour votre candidature. Installez-vous confortablement avant de commencer.
|
||||
|
||||
<!-- Honeypot 2 : Directory Traversal -->
|
||||
<a href="/documents/private" class="absolute -bottom-4 left-1/2 -translate-x-1/2 opacity-0 text-[1px] w-1 h-1 overflow-hidden" tabindex="-1">Fichiers internes</a>
|
||||
</p>
|
||||
</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" />
|
||||
<!-- 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>
|
||||
Test effectué
|
||||
</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 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>
|
||||
Terminé
|
||||
</div>
|
||||
<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>
|
||||
|
||||
<!-- 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">
|
||||
© {{ new Date().getFullYear() }} — Communauté d'Agglomération Béziers Méditerranée
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</component>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user