- Se implemento la habilidad de ordenar los siguientes 5 proyectos en el tablero

This commit is contained in:
2026-06-10 23:04:56 -06:00
parent 0d37dda9de
commit f8e7a0d7b9
3 changed files with 155 additions and 12 deletions
+5
View File
@@ -0,0 +1,5 @@
# Antigravity AI Rules
1. **Permiso explícito obligatorio para modificar archivos**:
- El asistente de IA **NUNCA** debe crear, modificar o eliminar ningún archivo del espacio de trabajo sin la autorización previa y explícita del usuario en el chat.
- El asistente debe presentar la propuesta detallada (como un diff o explicación de las líneas a cambiar) y esperar a que el usuario confirme (ej. "procede", "aplica el cambio") antes de ejecutar cualquier herramienta de escritura o modificación de archivos.
+80 -12
View File
@@ -1980,18 +1980,7 @@ $('#accionHabilidadEspecial').click(function () {
guardaSesion() guardaSesion()
} }
} else if (accionQuincenal === 'Ordenar los próximos 5 proyectos') { } else if (accionQuincenal === 'Ordenar los próximos 5 proyectos') {
// Actualizamos lastUsed abrirDialogoOrdenarProyectos(elArreglo, quincenaActual);
setArrayValue(elArreglo, 'accionEspecialLastUsed', quincenaActual)
// Aquí el código de Investigación y Desarrollo: "Ordenar los próximos 5 proyectos"
window.alert(
'¡Acción especial activada (Investigación y Desarrollo)!'
)
// Se guarda el avance
if (typeof guardaSesion === 'function') {
guardaSesion()
}
} else if (accionQuincenal === 'Omitir un mantenimiento') { } else if (accionQuincenal === 'Omitir un mantenimiento') {
// Actualizamos lastUsed // Actualizamos lastUsed
setArrayValue(elArreglo, 'accionEspecialLastUsed', quincenaActual) setArrayValue(elArreglo, 'accionEspecialLastUsed', quincenaActual)
@@ -3706,4 +3695,83 @@ window.confirm = function (message, callback, customWidth) {
}, },
}) })
} }
function abrirDialogoOrdenarProyectos(elArreglo, quincenaActual) {
let proyectosAOrdenar = siguientesProyectos.slice(0, 5);
let proyectosRestantes = siguientesProyectos.slice(5);
let container = $('<div></div>');
container.append('<p style="margin-bottom: 15px; font-size: 14px;">Arrastra los proyectos para ordenar la prioridad en la que aparecerán:</p>');
let list = $('<ul id="sortable-proyectos" style="list-style-type: none; padding: 0; margin: 0;"></ul>');
proyectosAOrdenar.forEach((p, idx) => {
let item = $(`
<li class="ui-state-default" data-id="${p.id}" style="margin: 8px 0; padding: 10px; border: 2px solid gray; border-radius: 4px; background-color: #f9f9f9; cursor: grab; display: flex; justify-content: space-between; align-items: center; font-size: 14px;">
<span style="font-weight: bold;">${idx + 1}. ${p.nombreProyecto}</span>
<span style="font-size: 11px; background-color: #eee; padding: 2px 6px; border-radius: 3px; color: #555;">${p.departamento}</span>
</li>
`);
list.append(item);
});
container.append(list);
container.dialog({
modal: true,
title: 'Ordenar Próximos 5 Proyectos',
width: 500,
open: function() {
list.sortable({
placeholder: "ui-state-highlight",
forcePlaceholderSize: true,
update: function(event, ui) {
list.find('li').each(function(index) {
let nombre = $(this).find('span').first().text();
nombre = nombre.replace(/^\d+\.\s*/, '');
$(this).find('span').first().text((index + 1) + '. ' + nombre);
});
}
});
list.disableSelection();
$('<style id="sortable-style">.ui-state-highlight { height: 40px; background-color: #ffffcc; border: 2px dashed #999; margin: 8px 0; border-radius: 4px; }</style>').appendTo('head');
},
close: function() {
$('#sortable-style').remove();
$(this).dialog('destroy').remove();
},
buttons: {
"Guardar Orden": function() {
let nuevoOrdenIds = [];
list.find('li').each(function() {
nuevoOrdenIds.push(parseInt($(this).data('id')));
});
let nuevosSiguientes = [];
nuevoOrdenIds.forEach(id => {
let proj = proyectos.find(p => p.id === id);
if (proj) nuevosSiguientes.push(proj);
});
nuevosSiguientes = nuevosSiguientes.concat(proyectosRestantes);
siguientesProyectos = nuevosSiguientes;
proyectos.forEach(p => {
if (p.estatus === 'En siguientes') p.estatus = 'Pendiente';
});
siguientesProyectos.forEach(p => {
let proj = proyectos.find(pr => pr.id === p.id);
if (proj) proj.estatus = 'En siguientes';
});
setArrayValue(elArreglo, 'accionEspecialLastUsed', quincenaActual);
var audio = new Audio('./Microwave_bell.wav');
audio.play();
window.alert('¡Orden de proyectos actualizado con éxito!');
if (typeof guardaSesion === 'function') guardaSesion();
$(this).dialog('close');
},
"Cancelar": function() { $(this).dialog('close'); }
}
});
}
// </script> // </script>
+70
View File
@@ -214,6 +214,27 @@
.nav-button:hover { .nav-button:hover {
background-color: #0056b3; background-color: #0056b3;
} }
/* Estilos para que los diálogos/alertas jQuery UI se muestren de color rojo (carmesí) */
.ui-dialog-titlebar {
background-color: crimson;
color: white;
}
.ui-widget.ui-widget-content {
border-color: crimson;
border-width: 5px;
}
.ui-dialog .ui-dialog-content {
font-size: 16px;
font-weight: bold;
text-align: center;
}
.ui-dialog .ui-dialog-buttonpane button {
font-size: 17px;
}
</style> </style>
<!-- Scripts base --> <!-- Scripts base -->
<script src="js/jquery-3.5.1.min.js"></script> <script src="js/jquery-3.5.1.min.js"></script>
@@ -408,6 +429,12 @@
</table> </table>
</td> </td>
</tr> </tr>
<!-- Fila de Habilidad Especial -->
<tr class="fila-habilidad-especial" style="display: none; background-color: #f0f0f0; border-top: 1px solid gray;">
<td colspan="3" style="text-align: center; font-size: 16px; padding: 4px; font-weight: bold; color: #444;">
HE: <span class="texto-habilidad-especial"></span>
</td>
</tr>
</table> </table>
</div> </div>
@@ -441,6 +468,12 @@
</table> </table>
</td> </td>
</tr> </tr>
<!-- Fila de Habilidad Especial -->
<tr class="fila-habilidad-especial" style="display: none; background-color: #f0f0f0; border-top: 1px solid gray;">
<td colspan="3" style="text-align: center; font-size: 16px; padding: 4px; font-weight: bold; color: #444;">
HE: <span class="texto-habilidad-especial"></span>
</td>
</tr>
</table> </table>
</div> </div>
@@ -474,6 +507,12 @@
</table> </table>
</td> </td>
</tr> </tr>
<!-- Fila de Habilidad Especial -->
<tr class="fila-habilidad-especial" style="display: none; background-color: #f0f0f0; border-top: 1px solid gray;">
<td colspan="3" style="text-align: center; font-size: 16px; padding: 4px; font-weight: bold; color: #444;">
HE: <span class="texto-habilidad-especial"></span>
</td>
</tr>
</table> </table>
</div> </div>
@@ -507,6 +546,12 @@
</table> </table>
</td> </td>
</tr> </tr>
<!-- Fila de Habilidad Especial -->
<tr class="fila-habilidad-especial" style="display: none; background-color: #f0f0f0; border-top: 1px solid gray;">
<td colspan="3" style="text-align: center; font-size: 16px; padding: 4px; font-weight: bold; color: #444;">
HE: <span class="texto-habilidad-especial"></span>
</td>
</tr>
</table> </table>
</div> </div>
@@ -540,6 +585,12 @@
</table> </table>
</td> </td>
</tr> </tr>
<!-- Fila de Habilidad Especial -->
<tr class="fila-habilidad-especial" style="display: none; background-color: #f0f0f0; border-top: 1px solid gray;">
<td colspan="3" style="text-align: center; font-size: 16px; padding: 4px; font-weight: bold; color: #444;">
HE: <span class="texto-habilidad-especial"></span>
</td>
</tr>
</table> </table>
</div> </div>
@@ -573,6 +624,12 @@
</table> </table>
</td> </td>
</tr> </tr>
<!-- Fila de Habilidad Especial -->
<tr class="fila-habilidad-especial" style="display: none; background-color: #f0f0f0; border-top: 1px solid gray;">
<td colspan="3" style="text-align: center; font-size: 16px; padding: 4px; font-weight: bold; color: #444;">
HE: <span class="texto-habilidad-especial"></span>
</td>
</tr>
</table> </table>
</div> </div>
@@ -648,6 +705,16 @@
// Actualizar activos // Actualizar activos
deptoCard.find('#activoCh1').text(findArrayValue(deptoArr, 'activo1')); deptoCard.find('#activoCh1').text(findArrayValue(deptoArr, 'activo1'));
deptoCard.find('#activoCh2').text(findArrayValue(deptoArr, 'activo2')); deptoCard.find('#activoCh2').text(findArrayValue(deptoArr, 'activo2'));
// Mostrar/Ocultar Habilidad Especial si ya se acreditó
const accionEspecial = findArrayValue(deptoArr, 'accionEspecialQuincenal');
const rowHE = deptoCard.find('.fila-habilidad-especial');
if (accionEspecial && accionEspecial !== '') {
rowHE.find('.texto-habilidad-especial').text(accionEspecial);
rowHE.show();
} else {
rowHE.hide();
}
} }
function actualizarResumenUI() { function actualizarResumenUI() {
@@ -1173,6 +1240,9 @@
$(this).dialog('destroy').remove(); $(this).dialog('destroy').remove();
}, },
}); });
} else if (accionQuincenal === 'Ordenar los próximos 5 proyectos') {
alert('Esta habilidad especial solo se puede utilizar desde el tablero de juego.');
return;
} else { } else {
// Para las demás habilidades que solo muestran un mensaje // Para las demás habilidades que solo muestran un mensaje
setArrayValue(elArreglo, 'accionEspecialLastUsed', quincenaActual); setArrayValue(elArreglo, 'accionEspecialLastUsed', quincenaActual);