fase 2.3: portal publico de reservas en linea (5 endpoints anonimos con rate limit y token HMAC, wizard movil, gestion/cancelacion por enlace, distintivo en agenda, editor y enlace publico en Configuracion); apagado por defecto

This commit is contained in:
2026-10-11 08:28:33 +00:00
parent 358b85afcd
commit add9b28188
14 changed files with 1859 additions and 4 deletions

View File

@@ -6,11 +6,15 @@ import { Button, Input } from '../components/ui';
import { odooApi } from '../services/odoo';
import { useAuth } from '../lib/auth';
import { useTheme } from '../lib/theme';
import { useBookingConfig } from '../lib/publicBooking';
const Login: FC = () => {
const { login, brand, setBrand } = useAuth();
const { theme } = useTheme();
const navigate = useNavigate();
// Enlace público de reservas: solo se muestra si el portal está activo
// (con reservas_online.activo=false el endpoint responde 404 y no aparece).
const { active: reservasActivas } = useBookingConfig();
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
const [showPassword, setShowPassword] = useState(false);
@@ -136,6 +140,18 @@ const Login: FC = () => {
</Button>
</form>
{reservasActivas && (
<p className="text-center text-xs mt-5">
<a
href="/reservar"
className="inline-flex items-center gap-1 underline underline-offset-2 hover:opacity-80"
style={{ color: isHomeNest ? 'var(--text-muted)' : 'rgba(255,255,255,0.6)' }}
>
Reservar en línea
</a>
</p>
)}
<p className="text-center text-xs mt-6" style={{ color: isHomeNest ? 'var(--text-muted)' : 'rgba(255,255,255,0.3)' }}>
{brand.pie}
</p>