fix(ai-chat): harden prompt security against injections, fix login methods detection & align desktop input dock (v3.8.43)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "frontend",
|
||||
"version": "3.8.42",
|
||||
"version": "3.8.43",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -330,7 +330,10 @@
|
||||
const typing = document.getElementById('aiChatTyping');
|
||||
const sendBtn = document.getElementById('aiChatSendBtn');
|
||||
|
||||
if (textarea) textarea.value = '';
|
||||
if (textarea) {
|
||||
textarea.value = '';
|
||||
textarea.style.height = '24px';
|
||||
}
|
||||
|
||||
appendMessage('user', queryText, [], true);
|
||||
|
||||
@@ -510,8 +513,15 @@
|
||||
appendMessage('assistant', getWelcomeMessage(role, name), getDefaultOptions(role), false);
|
||||
}
|
||||
|
||||
// Atajo Enter en desktop
|
||||
// Ajuste dinámico de altura y atajo Enter
|
||||
if (textarea) {
|
||||
textarea.addEventListener('input', () => {
|
||||
textarea.style.height = '24px';
|
||||
const newHeight = Math.min(textarea.scrollHeight, 80);
|
||||
if (newHeight > 24) {
|
||||
textarea.style.height = `${newHeight}px`;
|
||||
}
|
||||
});
|
||||
textarea.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Enter' && !e.shiftKey) {
|
||||
e.preventDefault();
|
||||
|
||||
+3
-3
@@ -86,9 +86,9 @@ const env = nunjucks.configure(path.join(__dirname, '../views'), {
|
||||
});
|
||||
|
||||
// Versiones institucionales del sistema
|
||||
const APP_VERSION = '3.8.42';
|
||||
const FRONTEND_VERSION = '3.8.42';
|
||||
const BACKEND_VERSION = '3.8.42';
|
||||
const APP_VERSION = '3.8.43';
|
||||
const FRONTEND_VERSION = '3.8.43';
|
||||
const BACKEND_VERSION = '3.8.43';
|
||||
|
||||
env.addGlobal('app_version', APP_VERSION);
|
||||
env.addGlobal('frontend_version', FRONTEND_VERSION);
|
||||
|
||||
+149
-128
@@ -8,19 +8,21 @@
|
||||
<div class="d-flex flex-wrap align-items-center justify-content-between gap-3 mb-4">
|
||||
<div>
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<span class="badge bg-warning-subtle text-warning-emphasis border border-warning-subtle rounded-pill px-3 py-1 fw-semibold">
|
||||
<span
|
||||
class="badge bg-warning-subtle text-warning-emphasis border border-warning-subtle rounded-pill px-3 py-1 fw-semibold">
|
||||
<i class="bi bi-tag-fill me-1"></i> Bedelía & Servicios
|
||||
</span>
|
||||
<span class="text-muted small">Módulo SDD-012</span>
|
||||
</div>
|
||||
<h1 class="h3 fw-bold mt-1 mb-0">Gestión de Convenios & Beneficios</h1>
|
||||
<p class="text-muted small mb-0">Administra las promociones comerciales, descuentos en cafeterías, librerías y beneficios para la comunidad UniCABA.</p>
|
||||
<p class="text-muted small mb-0">Administra las promociones comerciales, descuentos en cafeterías, librerías
|
||||
y beneficios para la comunidad UniCABA.</p>
|
||||
</div>
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<a href="/benefits" class="btn btn-outline-secondary btn-sm rounded-pill px-3">
|
||||
<i class="bi bi-eye me-1"></i> Ver Catálogo Público
|
||||
</a>
|
||||
<button type="button" class="btn btn-primary btn-sm rounded-pill px-3 shadow-sm" data-bs-toggle="modal" data-bs-target="#benefitModal" onclick="openCreateModal()">
|
||||
<button type="button" class="btn btn-primary btn-sm rounded-pill px-3 shadow-sm" data-bs-toggle="modal"
|
||||
data-bs-target="#benefitModal" onclick="openCreateModal()">
|
||||
<i class="bi bi-plus-lg me-1"></i> Nuevo Convenio
|
||||
</button>
|
||||
</div>
|
||||
@@ -52,7 +54,7 @@
|
||||
<h3 class="fw-bold mb-0 text-success mt-1" id="activeCount">
|
||||
{% set active_count = 0 %}
|
||||
{% for b in benefits %}
|
||||
{% if b.is_active %}{% set active_count = active_count + 1 %}{% endif %}
|
||||
{% if b.is_active %}{% set active_count = active_count + 1 %}{% endif %}
|
||||
{% endfor %}
|
||||
{{ active_count }}
|
||||
</h3>
|
||||
@@ -93,10 +95,12 @@
|
||||
|
||||
<!-- Tabla Principal de Convenios -->
|
||||
<div class="card border-0 shadow-sm rounded-4 overflow-hidden">
|
||||
<div class="card-header bg-body border-0 py-3 px-4 d-flex flex-wrap align-items-center justify-content-between gap-3">
|
||||
<div
|
||||
class="card-header bg-body border-0 py-3 px-4 d-flex flex-wrap align-items-center justify-content-between gap-3">
|
||||
<h5 class="fw-bold mb-0">Nómina de Convenios Registrados</h5>
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<input type="text" id="tableFilter" class="form-control form-control-sm rounded-pill px-3" placeholder="Filtrar por comercio o título..." style="min-width: 240px;">
|
||||
<input type="text" id="tableFilter" class="form-control form-control-sm rounded-pill px-3"
|
||||
placeholder="Filtrar por comercio o título..." style="min-width: 240px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
@@ -116,117 +120,124 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if benefits and benefits | length > 0 %}
|
||||
{% for b in benefits %}
|
||||
<tr id="benefit-row-{{ b.id }}" data-search="{{ b.title | lower }} {{ b.partner_name | lower }} {{ b.category | lower }}">
|
||||
<td class="ps-4">
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<div class="rounded-3 p-2 bg-primary-subtle text-primary d-flex align-items-center justify-content-center" style="width: 42px; height: 42px;">
|
||||
{% if b.category == 'GASTRONOMIA' %}
|
||||
<i class="bi bi-cup-hot fs-5"></i>
|
||||
{% elif b.category == 'LIBRERIA' %}
|
||||
<i class="bi bi-book fs-5"></i>
|
||||
{% elif b.category == 'TECNOLOGIA' %}
|
||||
<i class="bi bi-laptop fs-5"></i>
|
||||
{% elif b.category == 'SALUD_DEPORTE' %}
|
||||
<i class="bi bi-heart-pulse fs-5"></i>
|
||||
{% else %}
|
||||
<i class="bi bi-tag fs-5"></i>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div>
|
||||
<div class="fw-bold text-dark">{{ b.title }}</div>
|
||||
<div class="small text-muted"><i class="bi bi-shop me-1"></i>{{ b.partner_name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge bg-secondary-subtle text-secondary-emphasis rounded-pill px-2 py-1 small">
|
||||
{{ b.category }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge bg-danger-subtle text-danger border border-danger-subtle rounded-pill px-2 py-1 fw-bold">
|
||||
{{ b.discount_label }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="small text-muted">
|
||||
<i class="bi bi-geo-alt me-1"></i>{{ b.building_name or 'Todas las Sedes' }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
{% if b.target_roles == 'ALL' %}
|
||||
<span class="badge bg-info-subtle text-info rounded-pill px-2">Todos</span>
|
||||
{% elif 'ALUMNO' in b.target_roles and 'DOCENTE' in b.target_roles %}
|
||||
<span class="badge bg-primary-subtle text-primary rounded-pill px-2">Alumnos & Docentes</span>
|
||||
{% elif 'ALUMNO' in b.target_roles %}
|
||||
<span class="badge bg-success-subtle text-success rounded-pill px-2">Solo Alumnos</span>
|
||||
{% elif 'DOCENTE' in b.target_roles %}
|
||||
<span class="badge bg-warning-subtle text-warning-emphasis rounded-pill px-2">Solo Docentes</span>
|
||||
{% else %}
|
||||
<span class="badge bg-secondary-subtle text-secondary rounded-pill px-2">{{ b.target_roles }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<div class="small">
|
||||
<div><i class="bi bi-calendar-check me-1 text-success"></i>Desde: {{ b.valid_from }}</div>
|
||||
{% if b.valid_until %}
|
||||
<div><i class="bi bi-calendar-x me-1 text-danger"></i>Hasta: {{ b.valid_until }}</div>
|
||||
{% for b in benefits %}
|
||||
<tr id="benefit-row-{{ b.id }}"
|
||||
data-search="{{ b.title | lower }} {{ b.partner_name | lower }} {{ b.category | lower }}">
|
||||
<td class="ps-4">
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<div class="rounded-3 p-2 bg-primary-subtle text-primary d-flex align-items-center justify-content-center"
|
||||
style="width: 42px; height: 42px;">
|
||||
{% if b.category == 'GASTRONOMIA' %}
|
||||
<i class="bi bi-cup-hot fs-5"></i>
|
||||
{% elif b.category == 'LIBRERIA' %}
|
||||
<i class="bi bi-book fs-5"></i>
|
||||
{% elif b.category == 'TECNOLOGIA' %}
|
||||
<i class="bi bi-laptop fs-5"></i>
|
||||
{% elif b.category == 'SALUD_DEPORTE' %}
|
||||
<i class="bi bi-heart-pulse fs-5"></i>
|
||||
{% else %}
|
||||
<div class="text-muted"><i class="bi bi-infinity me-1"></i>Indefinido</div>
|
||||
<i class="bi bi-tag fs-5"></i>
|
||||
{% endif %}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
{% if b.coupon_code %}
|
||||
<code class="px-2 py-1 bg-light rounded text-primary fw-bold small border">{{ b.coupon_code }}</code>
|
||||
<div>
|
||||
<div class="fw-bold text-dark">{{ b.title }}</div>
|
||||
<div class="small text-muted"><i class="bi bi-shop me-1"></i>{{ b.partner_name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span
|
||||
class="badge bg-secondary-subtle text-secondary-emphasis rounded-pill px-2 py-1 small">
|
||||
{{ b.category }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span
|
||||
class="badge bg-danger-subtle text-danger border border-danger-subtle rounded-pill px-2 py-1 fw-bold">
|
||||
{{ b.discount_label }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="small text-muted">
|
||||
<i class="bi bi-geo-alt me-1"></i>{{ b.building_name or 'Todas las Sedes' }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
{% if b.target_roles == 'ALL' %}
|
||||
<span class="badge bg-info-subtle text-info rounded-pill px-2">Todos</span>
|
||||
{% elif 'ALUMNO' in b.target_roles and 'DOCENTE' in b.target_roles %}
|
||||
<span class="badge bg-primary-subtle text-primary rounded-pill px-2">Alumnos &
|
||||
Docentes</span>
|
||||
{% elif 'ALUMNO' in b.target_roles %}
|
||||
<span class="badge bg-success-subtle text-success rounded-pill px-2">Solo Alumnos</span>
|
||||
{% elif 'DOCENTE' in b.target_roles %}
|
||||
<span class="badge bg-warning-subtle text-warning-emphasis rounded-pill px-2">Solo
|
||||
Docentes</span>
|
||||
{% else %}
|
||||
<span class="badge bg-secondary-subtle text-secondary rounded-pill px-2">{{ b.target_roles
|
||||
}}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<div class="small">
|
||||
<div><i class="bi bi-calendar-check me-1 text-success"></i>Desde: {{ b.valid_from }}
|
||||
</div>
|
||||
{% if b.valid_until %}
|
||||
<div><i class="bi bi-calendar-x me-1 text-danger"></i>Hasta: {{ b.valid_until }}</div>
|
||||
{% else %}
|
||||
<span class="text-muted small">Credencial</span>
|
||||
<div class="text-muted"><i class="bi bi-infinity me-1"></i>Indefinido</div>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="form-check form-switch d-inline-block">
|
||||
<input class="form-check-input switch-toggle-status" type="checkbox" role="switch" id="switch-{{ b.id }}" data-id="{{ b.id }}" {% if b.is_active %}checked{% endif %}>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-end pe-4">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button type="button" class="btn btn-outline-secondary rounded-start-pill btn-edit-benefit" title="Editar"
|
||||
data-id="{{ b.id }}"
|
||||
data-title="{{ b.title }}"
|
||||
data-partner="{{ b.partner_name }}"
|
||||
data-category="{{ b.category }}"
|
||||
data-discount="{{ b.discount_label }}"
|
||||
data-coupon="{{ b.coupon_code or '' }}"
|
||||
data-building="{{ b.building_id or '' }}"
|
||||
data-roles="{{ b.target_roles or 'ALL' }}"
|
||||
data-from="{{ b.valid_from or '' }}"
|
||||
data-until="{{ b.valid_until or '' }}"
|
||||
data-desc="{{ b.description or '' }}"
|
||||
data-terms="{{ b.terms_conditions or '' }}"
|
||||
data-active="{{ '1' if b.is_active else '0' }}">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-danger rounded-end-pill btn-delete-benefit" title="Eliminar"
|
||||
data-id="{{ b.id }}"
|
||||
data-title="{{ b.title }}">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="9" class="text-center py-5 text-muted">
|
||||
<i class="bi bi-tags display-4 d-block mb-3 text-secondary opacity-50"></i>
|
||||
<h5>No hay convenios cargados aún</h5>
|
||||
<p class="small text-muted mb-3">Comienza creando promociones de cafetería, librerías y comercios para los alumnos y docentes.</p>
|
||||
<button type="button" class="btn btn-primary btn-sm rounded-pill px-4" data-bs-toggle="modal" data-bs-target="#benefitModal" onclick="openCreateModal()">
|
||||
<i class="bi bi-plus-lg me-1"></i> Crear Primer Convenio
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
{% if b.coupon_code %}
|
||||
<code
|
||||
class="px-2 py-1 bg-light rounded text-primary fw-bold small border">{{ b.coupon_code }}</code>
|
||||
{% else %}
|
||||
<span class="text-muted small">Credencial</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="form-check form-switch d-inline-block">
|
||||
<input class="form-check-input switch-toggle-status" type="checkbox" role="switch"
|
||||
id="switch-{{ b.id }}" data-id="{{ b.id }}" {% if b.is_active %}checked{% endif %}>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-end pe-4">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button type="button"
|
||||
class="btn btn-outline-secondary rounded-start-pill btn-edit-benefit" title="Editar"
|
||||
data-id="{{ b.id }}" data-title="{{ b.title }}" data-partner="{{ b.partner_name }}"
|
||||
data-category="{{ b.category }}" data-discount="{{ b.discount_label }}"
|
||||
data-coupon="{{ b.coupon_code or '' }}" data-building="{{ b.building_id or '' }}"
|
||||
data-roles="{{ b.target_roles or 'ALL' }}" data-from="{{ b.valid_from or '' }}"
|
||||
data-until="{{ b.valid_until or '' }}" data-desc="{{ b.description or '' }}"
|
||||
data-terms="{{ b.terms_conditions or '' }}"
|
||||
data-active="{{ '1' if b.is_active else '0' }}">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<button type="button" class="btn btn-outline-danger rounded-end-pill btn-delete-benefit"
|
||||
title="Eliminar" data-id="{{ b.id }}" data-title="{{ b.title }}">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="9" class="text-center py-5 text-muted">
|
||||
<i class="bi bi-tags display-4 d-block mb-3 text-secondary opacity-50"></i>
|
||||
<h5>No hay convenios cargados aún</h5>
|
||||
<p class="small text-muted mb-3">Comienza creando promociones de cafetería, librerías y
|
||||
comercios para los alumnos y docentes.</p>
|
||||
<button type="button" class="btn btn-primary btn-sm rounded-pill px-4"
|
||||
data-bs-toggle="modal" data-bs-target="#benefitModal" onclick="openCreateModal()">
|
||||
<i class="bi bi-plus-lg me-1"></i> Crear Primer Convenio
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -243,19 +254,22 @@
|
||||
<h5 class="modal-title fw-bold" id="benefitModalLabel">
|
||||
<i class="bi bi-tag-fill me-2"></i> Nuevo Convenio Comercial
|
||||
</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"
|
||||
aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body p-4">
|
||||
<input type="hidden" id="benefitId" name="benefitId">
|
||||
|
||||
|
||||
<div class="row g-3">
|
||||
<div class="col-md-7">
|
||||
<label class="form-label small fw-bold">Título de la Promoción *</label>
|
||||
<input type="text" class="form-control" id="title" name="title" required placeholder="Ej: 20% en Cafetería La Estación">
|
||||
<input type="text" class="form-control" id="title" name="title" required
|
||||
placeholder="Ej: 20% en Cafetería La Estación">
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<label class="form-label small fw-bold">Comercio / Entidad *</label>
|
||||
<input type="text" class="form-control" id="partner_name" name="partner_name" required placeholder="Ej: Café Martínez Central">
|
||||
<input type="text" class="form-control" id="partner_name" name="partner_name" required
|
||||
placeholder="Ej: Café Martínez Central">
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
@@ -272,11 +286,13 @@
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label small fw-bold">Etiqueta de Descuento *</label>
|
||||
<input type="text" class="form-control" id="discount_label" name="discount_label" required placeholder="Ej: 20% OFF / 2x1">
|
||||
<input type="text" class="form-control" id="discount_label" name="discount_label" required
|
||||
placeholder="Ej: 20% OFF / 2x1">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label small fw-bold">Código de Cupón (Opcional)</label>
|
||||
<input type="text" class="form-control" id="coupon_code" name="coupon_code" placeholder="Ej: UNICABA-20">
|
||||
<input type="text" class="form-control" id="coupon_code" name="coupon_code"
|
||||
placeholder="Ej: UNICABA-20">
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
@@ -309,24 +325,29 @@
|
||||
|
||||
<div class="col-12">
|
||||
<label class="form-label small fw-bold">Descripción del Beneficio</label>
|
||||
<textarea class="form-control" id="description" name="description" rows="2" placeholder="Detalles de cómo aprovechar el beneficio en el local..."></textarea>
|
||||
<textarea class="form-control" id="description" name="description" rows="2"
|
||||
placeholder="Detalles de cómo aprovechar el beneficio en el local..."></textarea>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label class="form-label small fw-bold">Términos & Condiciones</label>
|
||||
<textarea class="form-control" id="terms_conditions" name="terms_conditions" rows="2" placeholder="Válido de lunes a viernes con credencial universitaria vigente..."></textarea>
|
||||
<textarea class="form-control" id="terms_conditions" name="terms_conditions" rows="2"
|
||||
placeholder="Válido de lunes a viernes con credencial universitaria vigente..."></textarea>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="form-check form-switch mt-2">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="is_active" name="is_active" checked>
|
||||
<label class="form-check-label fw-semibold" for="is_active">Publicar inmediatamente en el catálogo de alumnos y docentes</label>
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="is_active"
|
||||
name="is_active" checked>
|
||||
<label class="form-check-label fw-semibold" for="is_active">Publicar inmediatamente en
|
||||
el catálogo de alumnos y docentes</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-light py-3 px-4">
|
||||
<button type="button" class="btn btn-outline-secondary rounded-pill px-4" data-bs-dismiss="modal">Cancelar</button>
|
||||
<button type="button" class="btn btn-outline-secondary rounded-pill px-4"
|
||||
data-bs-dismiss="modal">Cancelar</button>
|
||||
<button type="submit" class="btn btn-primary rounded-pill px-4" id="submitBtn">
|
||||
<i class="bi bi-check-lg me-1"></i> Guardar Convenio
|
||||
</button>
|
||||
@@ -338,7 +359,7 @@
|
||||
|
||||
<script>
|
||||
// Filtro en tiempo real de la tabla
|
||||
document.getElementById('tableFilter').addEventListener('input', function(e) {
|
||||
document.getElementById('tableFilter').addEventListener('input', function (e) {
|
||||
const val = e.target.value.toLowerCase().trim();
|
||||
const rows = document.querySelectorAll('#benefitsTable tbody tr[data-search]');
|
||||
rows.forEach(r => {
|
||||
@@ -347,8 +368,8 @@
|
||||
});
|
||||
});
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.addEventListener('click', function(e) {
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
document.addEventListener('click', function (e) {
|
||||
const editBtn = e.target.closest('.btn-edit-benefit');
|
||||
if (editBtn) {
|
||||
openEditModal({
|
||||
@@ -376,7 +397,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('change', function(e) {
|
||||
document.addEventListener('change', function (e) {
|
||||
const sw = e.target.closest('.switch-toggle-status');
|
||||
if (sw) {
|
||||
toggleStatus(sw.getAttribute('data-id'));
|
||||
@@ -452,4 +473,4 @@
|
||||
setTimeout(() => { container.innerHTML = ''; }, 4000);
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
@@ -151,6 +151,10 @@
|
||||
transform: scale(1.08);
|
||||
box-shadow: 0 12px 30px rgba(180, 62, 142, 0.5) !important;
|
||||
}
|
||||
/* Ocultar botón lanzador inmediatamente al abrir el chat (Desktop y Móvil) */
|
||||
.ai-chat-launcher.chat-open {
|
||||
display: none !important;
|
||||
}
|
||||
.ai-launcher-icon {
|
||||
font-size: 1.45rem;
|
||||
line-height: 1;
|
||||
@@ -458,6 +462,11 @@
|
||||
border: 1px solid #CBD5E1;
|
||||
border-radius: 28px;
|
||||
padding: 6px 8px 6px 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-height: 48px;
|
||||
box-sizing: border-box;
|
||||
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
.ai-input-pill-container:focus-within {
|
||||
@@ -465,8 +474,8 @@
|
||||
box-shadow: 0 0 0 3px rgba(180, 62, 142, 0.15);
|
||||
}
|
||||
.ai-input-plus-btn {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
border: none;
|
||||
background: #F1F5F9;
|
||||
@@ -477,6 +486,7 @@
|
||||
cursor: pointer;
|
||||
font-size: 0.95rem;
|
||||
flex-shrink: 0;
|
||||
padding: 0;
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
.ai-input-plus-btn:hover {
|
||||
@@ -485,34 +495,53 @@
|
||||
}
|
||||
.ai-chat-textarea {
|
||||
background: transparent !important;
|
||||
border: none !important;
|
||||
box-shadow: none !important;
|
||||
outline: none !important;
|
||||
resize: none;
|
||||
height: 24px;
|
||||
min-height: 24px;
|
||||
max-height: 80px;
|
||||
font-size: 0.95rem;
|
||||
color: #0F172A;
|
||||
line-height: 1.4;
|
||||
line-height: 24px;
|
||||
padding: 0 4px !important;
|
||||
margin: 0 !important;
|
||||
flex: 1;
|
||||
overflow-y: hidden;
|
||||
display: block;
|
||||
}
|
||||
.ai-chat-textarea::placeholder {
|
||||
color: #94A3B8;
|
||||
font-size: 0.95rem;
|
||||
line-height: 24px;
|
||||
}
|
||||
.ai-send-btn {
|
||||
background: transparent;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
background: #B43E8E;
|
||||
border: none;
|
||||
color: #B43E8E;
|
||||
border-radius: 50%;
|
||||
color: #ffffff !important;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
transition: transform 0.15s ease, color 0.15s ease;
|
||||
transition: transform 0.15s ease, background-color 0.15s ease;
|
||||
}
|
||||
.ai-send-btn i {
|
||||
font-size: 1.25rem !important;
|
||||
line-height: 1;
|
||||
}
|
||||
.ai-send-btn:hover {
|
||||
color: #8C256B;
|
||||
background: #8C256B;
|
||||
transform: scale(1.08);
|
||||
}
|
||||
.ai-send-btn:disabled {
|
||||
color: #CBD5E1;
|
||||
background: #E2E8F0;
|
||||
color: #94A3B8 !important;
|
||||
cursor: not-allowed;
|
||||
transform: none;
|
||||
}
|
||||
@@ -602,10 +631,15 @@
|
||||
color: #F8FAFC;
|
||||
}
|
||||
[data-bs-theme="dark"] .ai-send-btn {
|
||||
color: #FF8AB6;
|
||||
background: #EC4899;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
[data-bs-theme="dark"] .ai-send-btn:hover {
|
||||
color: #FFA5C8;
|
||||
background: #DB2777;
|
||||
}
|
||||
[data-bs-theme="dark"] .ai-send-btn:disabled {
|
||||
background: #334155;
|
||||
color: #64748B !important;
|
||||
}
|
||||
[data-bs-theme="dark"] .ai-sheet-handle {
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
|
||||
Reference in New Issue
Block a user