From cd9f342edac139cb87e10bb42d53c82823fa27b3 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Fri, 16 Mar 2018 15:18:57 +0100 Subject: [PATCH] [webpack.ue.view] no more need for $router (it is in Gstore) for navigation funcs [webpack.ue.manage] eased 'rem_form' (by index no more ID) + fetch professors / created layout for changing professor for a cours|TD|TP --- webpack/component/ue/manage.vue | 32 +++- webpack/component/ue/view.vue | 2 +- webpack/data/ue.js | 245 ++++++++++++++++++++----------- webpack/scss/container/list.scss | 65 ++++---- 4 files changed, 220 insertions(+), 124 deletions(-) diff --git a/webpack/component/ue/manage.vue b/webpack/component/ue/manage.vue index 383398f..16e4659 100644 --- a/webpack/component/ue/manage.vue +++ b/webpack/component/ue/manage.vue @@ -9,8 +9,8 @@
-
Type
enseignant
+
volume horaire
formations
@@ -21,13 +21,16 @@ v-for='(c,i) in gstore.manage.cours' :data-id='c.idCours'> +
Cours
-
{{ c.idProf ? `${c.firstName} ${c.lastName}` : 'Aucun enseignant affecté' }}
{{ c.volume }}
{{ gstore.form_by_id(f).labelForm || '???' }} - +
@@ -52,13 +55,16 @@ data-anim-incoming='1' :data-anim-bounce='gstore.nav_anim.out?1:0'> +
TD
-
{{ td.idProf ? `${td.firstName} ${td.lastName}` : 'Aucun enseignant affecté' }}
{{ td.volume }}
{{ gstore.form_by_id(f).labelForm || '???' }} - +
@@ -83,13 +89,16 @@ data-anim-incoming='1' :data-anim-bounce='gstore.nav_anim.out?1:0'> +
TP
-
{{ tp.idProf ? `${tp.firstName} ${tp.lastName}` : 'Aucun enseignant affecté' }}
{{ tp.volume }}
{{ gstore.form_by_id(f).labelForm || '???' }} - +
@@ -123,7 +132,14 @@ return { gstore: gstore.get } }, beforeMount(){ - gstore.get.manage_load(this.$route.params.code, this.$router); + + /* (1) Try to load data */ + gstore.get.load_ue_groups(this.$route.params.code, 3).catch( (err) => { // try at max 3 times (200ms each) for UE to be loaded + + /* (2) On error -> go to 'view' page */ + gstore.get.router.push('/ue/view/'); + + }); } } diff --git a/webpack/component/ue/view.vue b/webpack/component/ue/view.vue index 2f773fa..4cd2182 100644 --- a/webpack/component/ue/view.vue +++ b/webpack/component/ue/view.vue @@ -105,7 +105,7 @@