2018-03-05 18:39:56 +00:00
< template >
2018-03-11 16:31:46 +00:00
< div id = 'CONTAINER' class = 'card' >
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 >
< h1 >
< 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 >
< 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 >
< / 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-12 10:28:22 +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 = '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-13 20:24:55 +00:00
< h1 v -show = ' gstore.edit_i ! = pi ' > { { ue . label } } < span : data -visible = ' 1 ' > ( { { ue . code } } ) < / span > < / h1 >
2018-03-11 16:31:46 +00:00
<!-- if EDIT MODE -- >
< h1 v -show = ' gstore.edit_i = = pi ' : class = "ue.required ? 'warning' : ''" >
< input type = 'text' placeholder = 'Libellé' v -model = ' gstore.edit_label ' >
2018-03-11 18:34:11 +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 -- >
<!-- if VIEW MODE -- >
2018-03-14 16:40:41 +00:00
< div v -show = ' gstore.edit_i ! = pi ' : class = "ue.required ? 'sub pin' : 'sub pin neutral'" > { { ue . required ? 'UE obligatoire' : 'UE optionnelle' } } < / div >
2018-03-11 17:08:27 +00:00
< div v -show = ' gstore.edit_i ! = pi ' class = 'sub' > < strong > { { ue . volumeCours + ue . volumeTD + ue . volumeTP } } h < / strong > totales < / div >
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 -- >
< div class = 'footer' >
<!-- if VIEW MODE -- >
< span v -show = ' gstore.edit_i ! = pi ' : class = "(ue.volumeCours == 0) ? 'course' : 'course active'" > { { ue . volumeCours } } h < span > Cours < / span > < / span >
< hr v -show = ' gstore.edit_i ! = pi ' >
< span v -show = ' gstore.edit_i ! = pi ' : class = "(ue.volumeTD == 0) ? 'td' : 'td active'" > { { ue . volumeTD } } h < span > TD < / span > < / span >
< hr v -show = ' gstore.edit_i ! = pi ' >
< span v -show = ' gstore.edit_i ! = pi ' : class = "(ue.volumeTP == 0) ? 'tp' : 'tp active'" > { { ue . volumeTP } } h < span > TP < / span > < / span >
2018-03-11 16:48:50 +00:00
2018-03-11 16:31:46 +00:00
<!-- if EDIT MODE -- >
2018-03-11 16:48:50 +00:00
< span v -show = ' gstore.edit_i = = pi ' class = 'course' > < input type = 'text' placeholder = '???' v -model = ' gstore.edit_vol.c ' > < span > Cours < / span > < / span >
< hr v -show = ' gstore.edit_i = = pi ' >
< span v -show = ' gstore.edit_i = = pi ' class = 'td' > < input type = 'text' placeholder = '???' v -model = ' gstore.edit_vol.td ' > < span > TD < / span > < / span >
< hr v -show = ' gstore.edit_i = = pi ' >
< span v -show = ' gstore.edit_i = = pi ' class = 'tp' > < input type = 'text' placeholder = '???' v -model = ' gstore.edit_vol.tp ' > < span > TP < / span > < / span >
2018-03-11 16:31:46 +00:00
<!-- endif -- >
< / div >
2018-03-11 16:48:50 +00:00
2018-03-12 18:50:33 +00:00
<!-- if VIEW MODE -- >
< div class = 'footer' v -show = ' gstore.edit_i ! = pi ' >
< button class = 'neutral' @ click = 'gstore.nav_in($router, pi)' > Configurer < / button >
< / 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-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 }
}
}
< / script > s