# Maintenance Mode ("Coming Soon") Page

## Summary

Toggle-able maintenance mode managed from admin panel. When enabled, all public pages redirect to a standalone `/wkrotce` page with branding, messaging, and waitlist signup form. Admin panel remains accessible.

## Components

### 1. SiteSettings Entity — new field

- `maintenanceMode: bool`, default `true` (site launches in maintenance)
- Doctrine migration adds `maintenance_mode BOOLEAN DEFAULT 1` column

### 2. SiteSettingsService — new method

- `isMaintenanceMode(): bool`

### 3. Admin Settings Toggle

- New toggle in `/admin/ustawienia` alongside existing monetization toggle
- Label: "Tryb konserwacji (strona wkrótce)"
- Same styling as monetization toggle

### 4. MaintenanceSubscriber

- `KernelEvents::REQUEST`, priority 10
- Redirect 302 to `/wkrotce` when ALL conditions are true:
  - `maintenanceMode === true`
  - Path does NOT start with: `/admin`, `/api/waitlist`, `/wkrotce`
  - In dev environment only: also skip `/_profiler`, `/_wdt`
  - Current user does NOT have `ROLE_ADMIN`
- Skip non-main requests (`!$event->isMainRequest()`)

### 5. ComingSoonController

- Route: `GET /wkrotce` → `app_coming_soon`
- Renders `coming_soon/index.html.twig`
- Passes: `turnstile_site_key`, `waitlist_count`
- If maintenance mode is OFF, redirect to homepage

### 6. Template — `templates/coming_soon/index.html.twig`

Standalone page (does NOT extend `base.html.twig`):
- Own `<html>`, `<head>` with Tailwind CSS, Inter font, importmap for Stimulus
- Background: cream `#FFFDF7`
- Logo TROPO centered top
- Large heading: "Startujemy niedługo"
- Subtitle with short message
- Waitlist form (reuses `waitlist_controller.js` Stimulus controller + Turnstile)
- Character icons (Scout, Blitz, Nova, Echo) as decorative elements
- Fully responsive, clean, minimal design

### 7. Migration

- `ALTER TABLE site_settings ADD maintenance_mode BOOLEAN DEFAULT 1 NOT NULL`
