From 4999dcee05746c321518242b90873203c80c1bf7 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 13 Mar 2018 21:24:55 +0100 Subject: [PATCH] [webpack.ue.view] added 'formations' list for each UE --- webpack/component/ue/view.vue | 9 ++++++++- webpack/data/ue.js | 20 ++++++++++++++++++++ webpack/scss/container.scss | 7 +++++-- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/webpack/component/ue/view.vue b/webpack/component/ue/view.vue index 789ad29..3d0c66b 100644 --- a/webpack/component/ue/view.vue +++ b/webpack/component/ue/view.vue @@ -62,7 +62,7 @@ -

{{ ue.label }}({{ ue.code }})

+

{{ ue.label }}({{ ue.code }})

@@ -73,7 +73,14 @@ +
{{ ue.required ? 'UE obligatoire' : 'UE optionnelle' }}
{{ ue.volumeCours + ue.volumeTD + ue.volumeTP }}h totales
+
+ {{ gstore.form_by_id(form_id).labelForm }} + M2 INFO (S1) + LPRO +
+
{{ gstore.edit_err }}
diff --git a/webpack/data/ue.js b/webpack/data/ue.js index ca4d41e..b1b9abc 100644 --- a/webpack/data/ue.js +++ b/webpack/data/ue.js @@ -35,6 +35,26 @@ api.call('GET formation', {}, function(rs){ }); +/* (3) Get Formation label */ +gstore.add('form_by_id', function(form_id){ + + /* (1) Abort if wrong form_id */ + if( form_id == null ) + return null; + + /* (2.1) Find index in gstore */ + var gi = gstore.get.formations.map( (data, i) => { return ( data.idForm && data.idForm == form_id ) ? i : ''; }).join(''); + console.log(gi); + + /* (2.2) Exit if not found */ + if( isNaN(gi) ) + return null; + + return gstore.get.formations[gi]; + +}); + + /* (2) Manage Instant Search (IS) diff --git a/webpack/scss/container.scss b/webpack/scss/container.scss index ff5ef1a..59fe107 100644 --- a/webpack/scss/container.scss +++ b/webpack/scss/container.scss @@ -682,13 +682,12 @@ align-items: flex-start; flex-wrap: wrap; - /* (9.1) inner tags */ & > span{ padding: .2em .5em; margin-right: .5em; - border: 1px solid #ddd; + border: 1px solid lighten($form-neutral-color, 5%); border-radius: 3px; background-color: #f9f9f9; @@ -696,6 +695,10 @@ color: #999; font-size: .8em; + &.valid{ border-color: lighten($form-valid-color, 20%); } + &.invalid{ border-color: lighten($form-invalid-color, 20%); } + &.search{ border-color: lighten($form-search-color, 10%); } + } }