Add new files and make code improvements
This commit is contained in:
19
puestos.php
19
puestos.php
@@ -34,7 +34,7 @@
|
||||
|
||||
<main class="container-fluid px-4 mt-4" id="app" v-cloak @vue:mounted="mounted" style="min-height: 70vh;"
|
||||
v-scope="{new_puesto: null}">
|
||||
|
||||
<!-- {{modificado}} -->
|
||||
<div class="marco alert alert-success" role="alert" v-if="message">
|
||||
{{message}}
|
||||
</div>
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
<div class="d-flex flex-wrap marco justify-content-around">
|
||||
<div class="accordion col-10 mx-auto my-5" id="puestos"
|
||||
v-scope="{selected_carrera_id: -1, current_materia: null, current_encargado: null}"
|
||||
v-scope="{selected_carrera_id: 0, current_materia: null, current_encargado: null}"
|
||||
v-if="puestos.length">
|
||||
|
||||
<div class="card mb-3 shadow-lg" v-for="(puesto, index) in puestos" :key="puesto.puesto_id">
|
||||
@@ -106,7 +106,7 @@
|
||||
<hr>
|
||||
|
||||
<?php if ($user->acceso == 'w') { ?>
|
||||
<div class="form-row justify-content-around align-items-center mb-2"
|
||||
<!-- <div class="form-row justify-content-around align-items-center mb-2"
|
||||
v-show="carreras.length">
|
||||
<label :for="`carrera-${puesto.puesto_id}`" class="col-2 barra-right">
|
||||
Carrera
|
||||
@@ -129,7 +129,7 @@
|
||||
</ul>
|
||||
<input type="hidden" id="carrera_id" name="id">
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="form-row justify-content-around align-items-center"
|
||||
v-scope="{to_add_materia: null}">
|
||||
@@ -186,10 +186,9 @@
|
||||
<li class="list-group-item list-group-item-action d-flex justify-content-between align-items-center"
|
||||
v-for="materia in puesto.materias" :key="materia.materia_id"
|
||||
<?php if ($user->acceso == 'w') { ?>
|
||||
@click="puesto.materias.splice(puesto.materias.indexOf(materia), 1); materias.push(materia)"
|
||||
@click="modificado = true; puesto.materias.splice(puesto.materias.indexOf(materia), 1); materias.push(materia)"
|
||||
<?php } ?>
|
||||
style="cursor: pointer; transition: background-color 0.3s ease;">
|
||||
|
||||
<span class="flex-grow-1">
|
||||
{{materia.clave_materia}} - {{materia.materia_nombre}}
|
||||
</span>
|
||||
@@ -312,8 +311,16 @@
|
||||
<script src="js/puestos.js?<?= rand(0, 2) ?>" type="module"></script>
|
||||
<script src="js/scrollables.js"></script>
|
||||
<script>
|
||||
let modificado = false;
|
||||
|
||||
$(document).ready(function () {
|
||||
$('.collapse').collapse
|
||||
|
||||
window.onbeforeunload = function () {
|
||||
if (modificado) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user