2018-03-05 18:39:56 +00:00
< template >
2018-03-11 16:31:46 +00:00
< div id = 'CONTAINER' class = 'card' >
2018-03-30 16:32:13 +00:00
< div class = 'card filter' >
< div v -for = ' ( filter_grp , gname ) in gstore.filters ' : title = 'gname' data -unblur -filter >
< 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 >
< 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 >
< / div >
< / div >
< / div >
2018-03-14 18:57:31 +00:00
< div class = 'card container' : data -anim -outgoing = ' gstore.nav_anim.in ? 1 : 0 ' >
2018-03-11 16:31:46 +00:00
2018-03-14 18:57:31 +00:00
< input data -anim = ' 0 ' class = 'card instant-search neutral' type = 'text' @ keyup = 'gstore.is_handler($event)' placeholder = 'Recherche instantannée' id = 'ue_view_instant_search' >
< button data -anim = ' 0 ' class = 'card toggle valid' : data -active = ' gstore.create_card ? 1 : 0 ' @ click = 'gstore.create_card=!gstore.create_card' title = 'Créer une UE' > + < / button >
2018-03-11 16:31:46 +00:00
< section class = 'valid' data -create = ' ' v -show = ' gstore.create_card ' >
< select v -model = ' gstore.create_form ' class = 'category' >
< option selected = 'selected' disabled = 'disabled' value = '-' > Formation par défaut < / option >
2018-03-12 10:28:22 +00:00
< option value = '-1' > Aucune formation par défaut < / option >
2018-03-11 16:31:46 +00:00
< option v -for = ' form in gstore.formations ' : value = 'form.idForm' > { { form . labelForm } } < / option >
< / select >
2018-03-30 15:29:34 +00:00
< h1 class = 'pin' >
2018-03-11 16:31:46 +00:00
< input type = 'text' placeholder = 'Libellé' v -model = ' gstore.create_label ' >
< span data -visible = ' 1 ' > ( < input type = 'text' placeholder = 'code' v -model = ' gstore.create_code ' > ) < / span >
< / h1 >
2018-03-30 15:29:34 +00:00
< div class = 'table little' >
< div >
< span class = 'notlast active reflow' data -error = ' 0 ' > 0 CM < / span >
< / div >
< div >
< span class = 'notlast active reflow' data -error = ' 0 ' > 0 TD < / span >
< / div >
< div >
< span class = 'notlast active reflow' data -error = ' 0 ' > 0 TP < / span >
< / div >
< / div >
2018-03-11 16:31:46 +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-11 16:48:50 +00:00
< div class = 'footer' >
< span class = 'course' > < input type = 'text' placeholder = '???' v -model = ' gstore.create_vol.c ' > < span > Cours < / span > < / span >
< hr >
< span class = 'td' > < input type = 'text' placeholder = '???' v -model = ' gstore.create_vol.td ' > < span > TD < / span > < / span >
< hr >
< span class = 'tp' > < input type = 'text' placeholder = '???' v -model = ' gstore.create_vol.tp ' > < span > TP < / span > < / span >
< / div >
2018-03-11 16:31:46 +00:00
< div class = 'footer' >
< button class = 'valid' @ click = 'gstore.ic_handler()' > Créer l ' UE < / button >
2018-03-30 15:29:34 +00:00
< button class = 'neutral' @ click = 'gstore.ic_reset(); gstore.create_card=false' > Annuler < / button >
2018-03-11 16:31:46 +00:00
< / div >
< / section >
2018-03-14 09:30:51 +00:00
< section v -if = ' gstore.ues.length < = 0 ' data -anim = ' 0 ' > Aucune UE trouvée < / section >
2018-03-11 16:31:46 +00:00
< section v -for = ' ( ue , pi ) in gstore.ues '
: class = "gstore.edit_i==pi ? 'search' : ''"
: data - id = 'ue.code'
: data - label = 'ue.label' >
<!-- if VIEW MODE -- >
< div class = 'goo-menu' v -show = ' gstore.edit_i ! = pi ' >
2018-03-29 17:30:05 +00:00
< div class = 'enabled' : data -enabled = ' ue.code ' : data -active = ' ue.disabled ? 0 : 1 ' title = 'UE activée' @click ="gstore.ia_handler(pi)" > < / div >
< div class = 'required' : data -required = ' ue.code ' : data -active = ' ue.required ? 1 : 0 ' title = 'UE obligatoire' @click ="gstore.io_handler(pi)" > < / div >
< div class = 'remove' : data -remove = ' ue.code ' title = 'Supprimer' @click ="gstore.ir_handler(ue.code)" > < / div >
< div class = 'edit' : data -edit = ' ue.code ' title = 'Modifier' @click ="gstore.ie_toggle(pi)" > < / div >
2018-03-11 16:31:46 +00:00
< / div >
<!-- if VIEW MODE -- >
2018-03-12 10:28:22 +00:00
< span v -show = ' gstore.edit_i ! = pi ' class = 'category' > { { ue . labelForm || 'Aucune formation par défaut' } } < / span >
2018-03-11 16:31:46 +00:00
<!-- if EDIT MODE -- >
< select v -show = ' gstore.edit_i = = pi ' v -model = ' gstore.edit_form ' class = 'category' >
2018-03-11 17:08:27 +00:00
< option selected = 'selected' disabled = 'disabled' value = '-' > Formation par défaut < / option >
2018-03-12 10:28:22 +00:00
< option value = '-1' > Aucune formation par défaut < / option >
2018-03-11 16:31:46 +00:00
< option v -for = ' form in gstore.formations ' : value = 'form.idForm' > { { form . labelForm } } < / option >
< / select >
<!-- endif -- >
<!-- if VIEW MODE -- >
2018-03-29 19:21:37 +00:00
< h1 v -show = ' gstore.edit_i ! = pi ' : class = 'ue.required?`pin`:`pin disabled`' : title = 'ue.required?`obligatoire`:`optionnelle`' > < span : data -strike = ' ue.disabled ? 1 : 0 ' > { { ue . label } } < / span > < span : data -visible = ' 1 ' > ( { { ue . code } } ) < / span > < / h1 >
2018-03-11 16:31:46 +00:00
<!-- if EDIT MODE -- >
2018-03-29 19:21:37 +00:00
< h1 v -show = ' gstore.edit_i = = pi ' : class = 'ue.required?`pin`:`pin disabled`' >
2018-03-11 16:31:46 +00:00
< input type = 'text' placeholder = 'Libellé' v -model = ' gstore.edit_label ' >
2018-03-19 22:32:09 +00:00
<!-- < span : data -visible = ' 1 ' > ( { { ue . code } } ) < / span > -- >
< span data -visible = ' 1 ' > ( < input type = 'text' placeholder = 'code' v -model = ' gstore.edit_code ' > ) < / span >
2018-03-11 16:31:46 +00:00
< / h1 >
<!-- endif -- >
2018-03-29 19:36:57 +00:00
< div class = 'table little' >
2018-03-29 19:21:37 +00:00
< div >
2018-03-30 15:16:56 +00:00
< span class = 'active reflow' : data -error = ' ue.nbrCours > ue . nbrProfCours || ue . modCours > 0 ? 1 : 0 ' > { { ue . nbrCours } } CM < / span >
< span v -show = ' ue.nbrCours > ue . nbrProfCours ' class=' notlast user - icon reflow nospace ' :data-tooltip=' ` ${ ue . nbrCours - ue . nbrProfCours } enseignant(s) manquant(s) ` ' > < / span >
< span v -show = ' ue.modCours > 0 ' class=' notlast time - icon reflow nospace ' :data-tooltip=' ` ${ ue . volumeCours - ue . modCours } à ajouter | ${ ue . modCours } à enlever ` ' > < / span >
2018-03-29 19:21:37 +00:00
< / div >
< div >
2018-03-30 15:16:56 +00:00
< span class = 'active reflow' : data -error = ' ue.nbrTD > ue . nbrProfTD || ue . modTD > 0 ? 1 : 0 ' > { { ue . nbrTD } } TD < / span >
< span v -show = ' ue.nbrTD > ue . nbrProfTD ' class=' notlast user - icon reflow nospace ' :data-tooltip=' ` ${ ue . nbrCours - ue . nbrProfCours } enseignant(s) manquant(s) ` ' > < / span >
< span v -show = ' ue.modTD > 0 ' class=' notlast time - icon reflow nospace ' :data-tooltip=' ` ${ ue . volumeTD - ue . modTD } à ajouter | ${ ue . modTD } à enlever ` ' > < / span >
2018-03-29 19:21:37 +00:00
< / div >
< div >
2018-03-30 15:16:56 +00:00
< span class = 'active reflow' : data -error = ' ue.nbrTP > ue . nbrProfTP || ue . modTP > 0 ? 1 : 0 ' > { { ue . nbrTP } } TP < / span >
< span v -show = ' ue.nbrTP > ue . nbrProfTP ' class=' notlast user - icon reflow nospace ' :data-tooltip=' ` ${ ue . nbrCours - ue . nbrProfCours } enseignant(s) manquant(s) ` ' > < / span >
< span v -show = ' ue.modTP > 0 ' class=' notlast time - icon reflow nospace ' :data-tooltip=' ` ${ ue . volumeTP - ue . modTP } à ajouter | ${ ue . modTP } à enlever ` ' > < / span >
2018-03-29 19:21:37 +00:00
< / div >
< / div >
2018-03-11 16:31:46 +00:00
<!-- if VIEW MODE -- >
2018-03-13 20:24:55 +00:00
< div v -show = ' gstore.edit_i ! = pi ' class = 'taglist' >
2018-03-14 16:40:41 +00:00
< span v -if = ' ue.formations.length = = 0 ' class = 'tag invalid' > Aucune formation < / span >
< span v -for = ' form_id in ue.formations ' : class = "!!gstore.form_by_id(form_id).isInternal ? 'tag search' : 'tag'" > { { gstore . form _by _id ( form _id ) . labelForm || '???' } } < / span >
2018-03-13 20:24:55 +00:00
< / div >
2018-03-11 16:31:46 +00:00
<!-- if EDIT MODE -- >
2018-03-11 17:08:27 +00:00
< 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 >
2018-03-11 16:31:46 +00:00
<!-- endif -- >
2018-03-12 18:50:33 +00:00
<!-- if VIEW MODE -- >
< div class = 'footer' v -show = ' gstore.edit_i ! = pi ' >
2018-03-16 14:18:57 +00:00
< button class = 'neutral' @ click = 'gstore.nav_in(pi)' > Configurer < / button >
2018-03-12 18:50:33 +00:00
< / div >
2018-03-11 16:48:50 +00:00
<!-- if EDIT MODE -- >
< div class = 'footer' v -show = ' gstore.edit_i = = pi ' >
2018-03-12 18:50:33 +00:00
< button class = 'search' @ click = 'gstore.ie_handler(pi)' > Modifier l ' UE < / button >
< button class = 'grey' @ click = 'gstore.ie_toggle(-1)' > Annuler < / button >
2018-03-11 16:48:50 +00:00
< / div >
2018-03-12 18:50:33 +00:00
<!-- endif -- >
2018-03-11 16:48:50 +00:00
2018-03-29 17:30:05 +00:00
< div class = 'info' >
2018-03-29 19:21:37 +00:00
< strong class = 'cm reflow' > { { ue . volumeCours } } < / strong > CM
< strong class = 'td reflow' > { { ue . volumeTD } } < / strong > TD
< strong class = 'tp reflow' > { { ue . volumeTP } } < / strong > TP →
< strong > { { ue . volumeCours + ue . volumeTD + ue . volumeTP } } h < / strong >
2018-03-29 17:30:05 +00:00
< / div >
2018-03-11 16:31:46 +00:00
< / section >
< / div >
2018-03-05 18:39:56 +00:00
< / div >
< / template >
< script >
export default {
name : 'CONTAINER_VIEW' ,
data ( ) {
return { gstore : gstore . get }
2018-03-30 16:32:13 +00:00
} ,
beforeMount ( ) {
// set onblur to hide filter
window . onblur . link ( 'ue.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-05 18:39:56 +00:00
}
< / script > s