2018-03-01 17:26:07 +00:00
< template >
2018-03-08 17:00:39 +00:00
< div id = 'CONTAINER' class = 'card' >
2018-03-03 18:37:38 +00:00
2018-03-08 17:00:39 +00:00
< div class = 'card filter' >
2018-03-17 17:26:09 +00:00
< div v -for = ' ( filter_grp , gname ) in gstore.filters ' : title = 'gname' data -unblur -filter >
2018-03-08 17:00:39 +00:00
2018-03-17 17:26:09 +00:00
< div class = 'fold-toggle' : data -show = ' gstore.filters [ gname ] [ 0 ] .visible ? 1 : 0 ' @ click = 'gstore.show_fgroup(gname)' : data -count = ' gstore.filters [ gname ] [ 0 ] .active.length ' data -unblur -filter > { { gname } } < / div >
2018-03-08 17:00:39 +00:00
2018-03-17 17:26:09 +00:00
< div class = 'fold' data -unblur -filter >
< span v -for = ' ( data , i ) in filter_grp ' v -if = ' i > 0 ' :class="data.active == true ? ' active ' : ' '" @click=' gstore . toggle _filter ( gname , i ) ; gstore . filter _handler ( gname ) ; ' :title=' data . code ' data - unblur - filter > { { data . name } } < / span >
2018-03-08 17:00:39 +00:00
< / div >
< / div >
< / div >
2018-03-03 18:37:38 +00:00
2018-03-04 16:23:35 +00:00
< div class = 'card container' >
2018-03-03 18:37:38 +00:00
2018-03-07 17:49:28 +00:00
< input class = 'card instant-search neutral' type = 'text' @ keyup = 'gstore.is_handler($event)' placeholder = 'Recherche instantannée' id = 'teacher_view_instant_search' >
2018-03-12 10:23:29 +00:00
< button class = 'card toggle valid' : data -active = ' gstore.create_card ? 1 : 0 ' @ click = 'gstore.create_card=!gstore.create_card' title = 'Créer un enseignant' > + < / button >
2018-03-07 17:49:28 +00:00
< section class = 'valid' data -create = ' ' v -show = ' gstore.create_card ' >
2018-03-06 15:05:29 +00:00
2018-03-07 13:34:44 +00:00
< select class = 'category' v -model = ' gstore.create_cat ' >
< option selected = 'selected' disabled = 'disabled' value = '-' > Catégorie d ' enseignant < / option >
2018-03-06 15:20:31 +00:00
< option v -for = ' cat in gstore.categories ' : value = 'cat.idCategorie' > { { cat . labelCategorie } } < / option >
2018-03-06 15:05:29 +00:00
< / select >
< h1 >
2018-03-07 13:34:44 +00:00
< input type = 'text' placeholder = 'Prénom Nom' v -model = ' gstore.create_name ' >
2018-03-07 18:00:21 +00:00
< span data -visible = ' 1 ' > ( < input type = 'text' placeholder = 'identifiant' v -model = ' gstore.create_cas ' > ) < / span >
2018-03-06 15:05:29 +00:00
< / h1 >
< div class = 'table' >
< div >
2018-03-07 13:34:44 +00:00
< span > < input type = 'text' placeholder = '???' v -model = ' gstore.create_h ' > < / span >
2018-03-06 15:05:29 +00:00
< span > heures à faire < / span >
< / div >
< / div >
2018-03-07 13:43:04 +00:00
< div : class = "gstore.create_err.length > 0 ? 'sub warning' : 'sub'" : data -valid = ' gstore.create_err_valid ? 1 : 0 ' > { { gstore . create _err } } < / div >
2018-03-06 15:05:29 +00:00
< div class = 'footer' >
2018-03-07 13:34:44 +00:00
< button class = 'valid' @ click = 'gstore.ic_handler()' > Créer l ' enseignant < / button >
2018-03-06 15:05:29 +00:00
< / div >
< / section >
2018-03-14 09:30:51 +00:00
< section v -if = ' gstore.professors.length < = 0 ' data -anim = ' 0 ' > Aucun enseignant trouvé < / section >
2018-03-04 16:23:35 +00:00
2018-03-07 13:58:01 +00:00
< section v -for = ' ( prof , pi ) in gstore.professors '
2018-03-08 13:02:33 +00:00
: class = "gstore.edit_i==pi ? 'search' : ''"
2018-03-04 17:15:48 +00:00
: data - id = 'prof.idProfesseur'
: data - category = 'prof.idCat'
: data - lname = 'prof.lastName'
: data - fname = 'prof.firstName' >
2018-03-08 12:58:30 +00:00
<!-- if VIEW MODE -- >
< div class = 'goo-menu' v -show = ' gstore.edit_i ! = pi ' >
2018-03-12 10:23:29 +00:00
< div class = 'admin' : data -admin = ' prof.idProfesseur ' : data -active = ' prof.admin ? 1 : 0 ' title = 'Admin' @click ="gstore.ia_handler(pi)" > < / div >
< div class = 'remove' : data -remove = ' prof.idProfesseur ' title = 'Supprimer' @click ="gstore.ir_handler(prof.idProfesseur)" > < / div >
< div class = 'edit' : data -edit = ' prof.idProfesseur ' title = 'Modifier' @click ="gstore.ie_toggle(pi)" > < / div >
2018-03-08 11:12:12 +00:00
< / div >
2018-03-07 11:12:50 +00:00
2018-03-08 12:58:30 +00:00
<!-- if VIEW MODE -- >
< span v -show = ' gstore.edit_i ! = pi ' class = 'category' > { { prof . categorie } } < / span >
<!-- if EDIT MODE -- >
< select v -show = ' gstore.edit_i = = pi ' v -model = ' gstore.edit_cat ' class = 'category' >
< option selected = 'selected' disabled = 'disabled' value = '-' > Catégorie d ' enseignant < / option >
< option v -for = ' cat in gstore.categories ' : value = 'cat.idCategorie' > { { cat . labelCategorie } } < / option >
< / select >
<!-- endif -- >
<!-- if VIEW MODE -- >
2018-03-12 10:23:29 +00:00
< h1 v -show = ' gstore.edit_i ! = pi ' : class = "prof.hoursToDo > prof.equiTD ? 'warning' : ''" : title = "prof.hoursToDo > prof.equiTD ? 'Attention: heures manquantes' : ''" > { { prof . firstName } } { { prof . lastName } } < span : data -visible = ' prof.casLogin.length ' > ( { { prof . casLogin } } ) < / span > < / h1 >
2018-03-08 12:58:30 +00:00
<!-- if EDIT MODE -- >
< h1 v -show = ' gstore.edit_i = = pi ' : class = "prof.hoursToDo > prof.equiTD ? 'warning' : ''" >
< input type = 'text' placeholder = 'Prénom Nom' v -model = ' gstore.edit_name ' >
< span data -visible = ' 1 ' > ( < input type = 'text' placeholder = 'identifiant' v -model = ' gstore.edit_cas ' > ) < / span >
< / h1 >
<!-- endif -- >
2018-03-04 16:23:35 +00:00
< div class = 'table' >
< div >
2018-03-08 12:58:30 +00:00
<!-- if VIEW MODE -- >
< span v -show = ' gstore.edit_i ! = pi ' > { { prof . hoursToDo } } < / span >
<!-- if EDIT MODE -- >
< span v -show = ' gstore.edit_i = = pi ' > < input type = 'text' placeholder = '???' v -model = ' gstore.edit_h ' > < / span >
<!-- endif -- >
2018-03-04 16:23:35 +00:00
< span > heures à faire < / span >
< / div >
2018-03-12 10:23:29 +00:00
< div title = 'équivalents TD' >
2018-03-06 14:02:36 +00:00
< span > { { prof . equiTD } } < / span >
2018-03-26 11:23:32 +00:00
< span > HETD < / span >
2018-03-04 16:23:35 +00:00
< / div >
2018-03-03 18:37:38 +00:00
< / div >
2018-03-04 16:23:35 +00:00
2018-03-08 12:58:30 +00:00
<!-- if VIEW MODE -- >
2018-03-26 11:23:32 +00:00
< div v -show = ' gstore.edit_i ! = pi ' class = 'sub' title = 'total des heures prévues' > < strong > { { prof . VHCours + prof . VHTd + prof . VHTp } } < / strong > heures présentielles < / div >
2018-03-26 11:23:32 +00:00
< div v -show = ' gstore.edit_i ! = pi ' class = 'pdfdl' title = 'Télécharger la fiche' @ click = 'gstore.id_handler(prof.idProfesseur)' > fiche < / div >
2018-03-08 12:58:30 +00:00
<!-- if EDIT MODE -- >
< div v -show = ' gstore.edit_i = = pi ' : class = "gstore.edit_err.length > 0 ? 'sub warning' : 'sub'" : data -valid = ' gstore.edit_err_valid ? 1 : 0 ' > { { gstore . edit _err } } < / div >
<!-- endif -- >
2018-03-04 16:23:35 +00:00
< div class = 'footer' >
2018-03-08 12:58:30 +00:00
<!-- if VIEW MODE -- >
< span v -show = ' gstore.edit_i ! = pi ' : class = "(prof.VHCours == 0) ? 'course' : 'course active'" > { { prof . VHCours } } h < span > Cours < / span > < / span >
< hr v -show = ' gstore.edit_i ! = pi ' >
2018-03-12 10:23:29 +00:00
< span v -show = ' gstore.edit_i ! = pi ' : class = "(prof.VHTd == 0) ? 'td' : 'td active'" > { { prof . VHTd } } h < span > TD < / span > < / span >
2018-03-08 12:58:30 +00:00
< hr v -show = ' gstore.edit_i ! = pi ' >
2018-03-12 10:23:29 +00:00
< span v -show = ' gstore.edit_i ! = pi ' : class = "(prof.VHTp == 0) ? 'tp' : 'tp active'" > { { prof . VHTp } } h < span > TP < / span > < / span >
2018-03-08 12:58:30 +00:00
<!-- if EDIT MODE -- >
< button v -show = ' gstore.edit_i = = pi ' class = 'search' @ click = 'gstore.ie_handler(pi)' > Modifier l ' enseignant < / button >
< button v -show = ' gstore.edit_i = = pi ' class = 'grey' @ click = 'gstore.ie_toggle(-1)' > Annuler < / button >
<!-- endif -- >
2018-03-03 18:37:38 +00:00
< / div >
2018-03-04 16:23:35 +00:00
< / section >
< / div >
2018-03-01 17:26:07 +00:00
< / div >
< / template >
< script >
export default {
name : 'CONTAINER_VIEW' ,
data ( ) {
return { gstore : gstore . get }
2018-03-17 17:26:09 +00:00
} ,
beforeMount ( ) {
// set onblur to hide filter
window . onblur . link ( 'teacher.filter' , ( e ) => {
// ignore [data-unblur-filter] elements
if ( e . target . getAttribute ( 'data-unblur-filter' ) !== null )
return ;
// else: hide
gstore . get . show _fgroup ( - 1 ) ;
} ) ;
2018-03-01 17:26:07 +00:00
}
}
2018-03-26 11:27:20 +00:00
< / script >