[ue.view] create card with same design as others [data.ue] created handler 'ic_reset' + added button 'CANCEL' to reset form & untoggle

This commit is contained in:
xdrm-brackets 2018-03-30 17:29:34 +02:00
parent 7b8c01b38a
commit 365e1eb567
2 changed files with 27 additions and 3 deletions

View File

@ -15,11 +15,23 @@
<option v-for='form in gstore.formations' :value='form.idForm'>{{ form.labelForm }}</option> <option v-for='form in gstore.formations' :value='form.idForm'>{{ form.labelForm }}</option>
</select> </select>
<h1> <h1 class='pin'>
<input type='text' placeholder='Libellé' v-model='gstore.create_label'> <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> <span data-visible='1'>(<input type='text' placeholder='code' v-model='gstore.create_code'>)</span>
</h1> </h1>
<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>
<div :class="gstore.create_err.length > 0 ? 'sub warning' : 'sub'" :data-valid='gstore.create_err_valid?1:0'>{{ gstore.create_err }}</div> <div :class="gstore.create_err.length > 0 ? 'sub warning' : 'sub'" :data-valid='gstore.create_err_valid?1:0'>{{ gstore.create_err }}</div>
<div class='footer'> <div class='footer'>
@ -32,6 +44,7 @@
<div class='footer'> <div class='footer'>
<button class='valid' @click='gstore.ic_handler()'>Créer l'UE</button> <button class='valid' @click='gstore.ic_handler()'>Créer l'UE</button>
<button class='neutral' @click='gstore.ic_reset(); gstore.create_card=false'>Annuler</button>
</div> </div>
</section> </section>
@ -71,7 +84,6 @@
</h1> </h1>
<!-- endif --> <!-- endif -->
<!-- if VIEW MODE -->
<div class='table little'> <div class='table little'>
<div> <div>
<span class='active reflow' :data-error='ue.nbrCours>ue.nbrProfCours || ue.modCours > 0?1:0'>{{ ue.nbrCours }} CM</span> <span class='active reflow' :data-error='ue.nbrCours>ue.nbrProfCours || ue.modCours > 0?1:0'>{{ ue.nbrCours }} CM</span>

View File

@ -133,7 +133,19 @@ gstore.add('create_vol', { c: '', td: '', tp: ''});
gstore.add('create_err_valid', false); gstore.add('create_err_valid', false);
gstore.add('create_err', ''); gstore.add('create_err', '');
/* (4) Define create handler */ /* (4) Define reset handler */
gstore.add('ic_reset', function(){
gstore.add('create_form', '-');
gstore.add('create_label', '');
gstore.add('create_code', '');
gstore.add('create_vol', { c: '', td: '', tp: ''});
gstore.add('create_err_valid', false);
gstore.add('create_err', '');
});
/* (5) Define create handler */
gstore.add('ic_handler', function(){ gstore.add('ic_handler', function(){
/* (4.1) Trim text input */ /* (4.1) Trim text input */