Agregada funcionalidad para ocultar cursos

add-license-1
Araozu 2020-08-11 08:02:18 -05:00
parent bcdbae4a5a
commit 8ddd80d22d
3 changed files with 52 additions and 22 deletions

View File

@ -1,44 +1,47 @@
<template lang="pug"> <template lang="pug">
div.info_curso(:style="estiloCurso") div.info_curso(:style="estiloCurso")
h4.titulo_curso(@mouseenter="resaltarTodasCeldas" @mouseleave="quitarResaltadoCeldas") div(:style="cursoOculto? {opacity: '0.5'}: {}")
// input.marcador_curso(type="checkbox" v-model="cursoAgregado") h4.titulo_curso(@mouseenter="resaltarTodasCeldas" @mouseleave="quitarResaltadoCeldas")
span.ancho {{ curso.abreviado }} >&nbsp; // input.marcador_curso(type="checkbox" v-model="cursoAgregado")
| {{ curso.nombre }} span.ancho {{ curso.abreviado }} >&nbsp;
table.datos | {{ curso.nombre }}
tr table.datos
bloque(v-for="(grupos, profesor) in teoria" tr
:grupos="grupos" bloque(v-for="(grupos, profesor) in teoria"
:profesor="profesor"
:nombreAño="nombreAño"
:abreviado="curso.abreviado"
:key="profesor"
)
tr
template(v-if="!laboratorioVacio")
bloque(v-for="(grupos, profesor) in laboratorio"
:grupos="grupos" :grupos="grupos"
:profesor="profesor" :profesor="profesor"
:esLab="true"
:nombreAño="nombreAño" :nombreAño="nombreAño"
:abreviado="curso.abreviado" :abreviado="curso.abreviado"
:key="profesor" :key="profesor"
) )
template(v-else) tr
td template(v-if="!laboratorioVacio")
span.ancho | _ bloque(v-for="(grupos, profesor) in laboratorio"
:grupos="grupos"
:profesor="profesor"
:esLab="true"
:nombreAño="nombreAño"
:abreviado="curso.abreviado"
:key="profesor"
)
template(v-else)
td
span.ancho | _
div.acciones-cursos div.acciones-cursos
span.material-icons(@click.stop="agregarCursoAMiHorario" :title="cursoAgregado? 'Quitar': 'Agregar'") span.material-icons(@click.stop="agregarCursoAMiHorario" :title="cursoAgregado? 'Quitar': 'Agregar'")
| {{ cursoAgregado? "remove": "add" }} | {{ cursoAgregado? "remove": "add" }}
span.material-icons(@click.stop="ocultar_mostrarCursoV" :title="cursoOculto? 'Mostrar': 'Ocultar'")
| {{ cursoOculto? 'visibility_off': 'visibility' }}
// //
</template> </template>
<script lang="coffee"> <script lang="coffee">
import {computed, onMounted, onUnmounted} from "vue" import {ref, computed, onMounted, onUnmounted} from "vue"
import {useStore} from "vuex" import {useStore} from "vuex"
import { import {
resaltarCurso resaltarCurso
@ -46,11 +49,13 @@ div.info_curso(:style="estiloCurso")
resaltarGrupoCurso resaltarGrupoCurso
removerResaltadoGrupo removerResaltadoGrupo
obtenerClaseGrupoCurso obtenerClaseGrupoCurso
ocultar_mostrarCurso
} from "./tablaHorarios/funcionesResaltado.coffee" } from "./tablaHorarios/funcionesResaltado.coffee"
import bloque from "./curso/bloque" import bloque from "./curso/bloque"
setup = (props) => setup = (props) =>
store = useStore() store = useStore()
cursoOculto = ref false
esMiHorario = computed (=> props.nombreAño is "Mi horario") esMiHorario = computed (=> props.nombreAño is "Mi horario")
teoria = computed (=> teoria = computed (=>
@ -113,6 +118,10 @@ div.info_curso(:style="estiloCurso")
datos: props.curso datos: props.curso
} }
ocultar_mostrarCursoV = =>
cursoOculto.value = !cursoOculto.value
ocultar_mostrarCurso props.nombreAño, props.curso.abreviado
obtenerClase = (grupo, esLab) => obtenerClase = (grupo, esLab) =>
obtenerClaseGrupoCurso props.nombreAño, props.curso.abreviado, grupo, esLab obtenerClaseGrupoCurso props.nombreAño, props.curso.abreviado, grupo, esLab
@ -165,6 +174,7 @@ div.info_curso(:style="estiloCurso")
onUnmounted desprocesarTeoria onUnmounted desprocesarTeoria
{ {
cursoOculto
esMiHorario esMiHorario
teoria teoria
laboratorio laboratorio
@ -179,6 +189,7 @@ div.info_curso(:style="estiloCurso")
desprocesarTeoria desprocesarTeoria
resaltarTodasCeldas resaltarTodasCeldas
quitarResaltadoCeldas quitarResaltadoCeldas
ocultar_mostrarCursoV
} }
export default { export default {

View File

@ -4,6 +4,22 @@ ejecutarEnElementos = (clase, funcion) =>
funcion elemento funcion elemento
#: Txt -> Txt -> ()
export ocultar_mostrarCurso = (nombreAnio, cursoAbreviado) =>
nombreAnioF = nombreAnio.substring 0, (nombreAnio.indexOf " ")
clase = "_#{ nombreAnioF }_#{ cursoAbreviado }"
ejecutarEnElementos clase, (el) =>
clases = el.className
if (clases.indexOf "cursor_click") == -1
if (el.getAttribute "oculto") == "true"
el.removeAttribute "oculto"
clases = clases.replace "celda-oculta", ""
el.className = clases
else
el.setAttribute "oculto", "true"
el.className += " celda-oculta"
#: Txt -> Txt -> () #: Txt -> Txt -> ()
export resaltarCurso = (nombreAño, cursoAbreviado) => export resaltarCurso = (nombreAño, cursoAbreviado) =>

View File

@ -69,6 +69,9 @@ $duracionTransicion: 100ms
color: white color: white
.celda-oculta
display: none
@media only screen and (min-width: 777px) @media only screen and (min-width: 777px)
.mostrar-en-tablet .mostrar-en-tablet