[webpack.ue.view] added 'formations' list for each UE

This commit is contained in:
xdrm-brackets 2018-03-13 21:24:55 +01:00
parent 7d2d59402b
commit 4999dcee05
3 changed files with 33 additions and 3 deletions

View File

@ -62,7 +62,7 @@
<!-- endif --> <!-- endif -->
<!-- if VIEW MODE --> <!-- if VIEW MODE -->
<h1 v-show='gstore.edit_i!=pi' :class="ue.required ? 'warning' : ''" :title='ue.required?"UE obligatoire":"UE optionnelle"'>{{ ue.label }}<span :data-visible='1'>({{ ue.code }})</span></h1> <h1 v-show='gstore.edit_i!=pi'>{{ ue.label }}<span :data-visible='1'>({{ ue.code }})</span></h1>
<!-- if EDIT MODE --> <!-- if EDIT MODE -->
<h1 v-show='gstore.edit_i==pi' :class="ue.required ? 'warning' : ''"> <h1 v-show='gstore.edit_i==pi' :class="ue.required ? 'warning' : ''">
<input type='text' placeholder='Libellé' v-model='gstore.edit_label'> <input type='text' placeholder='Libellé' v-model='gstore.edit_label'>
@ -73,7 +73,14 @@
<!-- if VIEW MODE --> <!-- if VIEW MODE -->
<div v-show='gstore.edit_i!=pi' :class="ue.required ? 'sub warning' : 'sub'">{{ ue.required ? 'UE obligatoire' : 'UE optionnelle' }}</div>
<div v-show='gstore.edit_i!=pi' class='sub'><strong>{{ ue.volumeCours + ue.volumeTD + ue.volumeTP }}h</strong> totales</div> <div v-show='gstore.edit_i!=pi' class='sub'><strong>{{ ue.volumeCours + ue.volumeTD + ue.volumeTP }}h</strong> totales</div>
<div v-show='gstore.edit_i!=pi' class='taglist'>
<span v-for='form_id in ue.formations' :class="!!gstore.form_by_id(form_id).isInternal ? 'search' : ''">{{ gstore.form_by_id(form_id).labelForm }}</span>
<span class='search'>M2 INFO (S1)</span>
<span>LPRO</span>
</div>
<!-- if EDIT MODE --> <!-- 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> <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 --> <!-- endif -->

View File

@ -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) /* (2) Manage Instant Search (IS)

View File

@ -682,13 +682,12 @@
align-items: flex-start; align-items: flex-start;
flex-wrap: wrap; flex-wrap: wrap;
/* (9.1) inner tags */ /* (9.1) inner tags */
& > span{ & > span{
padding: .2em .5em; padding: .2em .5em;
margin-right: .5em; margin-right: .5em;
border: 1px solid #ddd; border: 1px solid lighten($form-neutral-color, 5%);
border-radius: 3px; border-radius: 3px;
background-color: #f9f9f9; background-color: #f9f9f9;
@ -696,6 +695,10 @@
color: #999; color: #999;
font-size: .8em; 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%); }
} }
} }