ptut-vhost/webpack/component/teacher/view.vue

139 lines
5.7 KiB
Vue
Raw Permalink Normal View History

2018-03-01 17:26:07 +00:00
<template>
<div id='CONTAINER' class='card'>
<div class='card filter'>
<div v-for='(filter_grp, gname) in gstore.filters' :title='gname'>
<div class='fold-toggle' :data-show='gstore.filters[gname][0].visible?1:0' @click='gstore.show_fgroup(gname)' :data-count='gstore.filters[gname][0].active.length'>{{ gname }}</div>
<div class='fold'>
<span v-for='(data, i) in filter_grp' v-if='i > 0' :class="data.active == true ? 'active' : ''" @click='gstore.toggle_filter(gname, i); gstore.filter_handler(gname);' :title='data.code'>{{ data.name }}</span>
</div>
</div>
</div>
<div class='card container'>
<input class='card instant-search neutral' type='text' @keyup='gstore.is_handler($event)' placeholder='Recherche instantannée' id='teacher_view_instant_search'>
<button class='card toggle valid' :data-active='gstore.create_card?1:0' @click='gstore.create_card=!gstore.create_card' title='Créer un enseignant'>+</button>
<section class='valid' data-create='' v-show='gstore.create_card'>
<select class='category' v-model='gstore.create_cat'>
<option selected='selected' disabled='disabled' value='-'>Catégorie d'enseignant</option>
<option v-for='cat in gstore.categories' :value='cat.idCategorie'>{{ cat.labelCategorie }}</option>
</select>
<h1>
<input type='text' placeholder='Prénom Nom' v-model='gstore.create_name'>
<span data-visible='1'>(<input type='text' placeholder='identifiant' v-model='gstore.create_cas'>)</span>
</h1>
<div class='table'>
<div>
<span><input type='text' placeholder='???' v-model='gstore.create_h'></span>
<span>heures à faire</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='footer'>
<button class='valid' @click='gstore.ic_handler()'>Créer l'enseignant</button>
</div>
</section>
<section v-if='gstore.professors.length <= 0' data-anim='0'>Aucun enseignant trouvé</section>
<section v-for='(prof, pi) in gstore.professors'
:class="gstore.edit_i==pi ? 'search' : ''"
:data-id='prof.idProfesseur'
:data-category='prof.idCat'
:data-lname='prof.lastName'
:data-fname='prof.firstName'>
<!-- if VIEW MODE -->
<div class='goo-menu' v-show='gstore.edit_i!=pi'>
<div class='admin' :data-admin='prof.idProfesseur' :data-active='prof.admin?1:0' title='Admin' @click="gstore.ia_handler(pi)"></div>
<div class='remove' :data-remove='prof.idProfesseur' title='Supprimer' @click="gstore.ir_handler(prof.idProfesseur)"></div>
<div class='edit' :data-edit='prof.idProfesseur' title='Modifier' @click="gstore.ie_toggle(pi)"></div>
</div>
<!-- if VIEW MODE -->
<span v-show='gstore.edit_i!=pi' class='category'>{{ prof.categorie }}</span>
<!-- if EDIT MODE -->
<select v-show='gstore.edit_i==pi' v-model='gstore.edit_cat' class='category'>
<option selected='selected' disabled='disabled' value='-'>Catégorie d'enseignant</option>
<option v-for='cat in gstore.categories' :value='cat.idCategorie'>{{ cat.labelCategorie }}</option>
</select>
<!-- endif -->
<!-- if VIEW MODE -->
<h1 v-show='gstore.edit_i!=pi' :class="prof.hoursToDo > prof.equiTD ? 'warning' : ''" :title="prof.hoursToDo > prof.equiTD ? 'Attention: heures manquantes' : ''">{{ prof.firstName }} {{ prof.lastName }} <span :data-visible='prof.casLogin.length'>({{ prof.casLogin }})</span></h1>
<!-- if EDIT MODE -->
<h1 v-show='gstore.edit_i==pi' :class="prof.hoursToDo > prof.equiTD ? 'warning' : ''">
<input type='text' placeholder='Prénom Nom' v-model='gstore.edit_name'>
<span data-visible='1'>(<input type='text' placeholder='identifiant' v-model='gstore.edit_cas'>)</span>
</h1>
<!-- endif -->
<div class='table'>
<div>
<!-- if VIEW MODE -->
<span v-show='gstore.edit_i!=pi'>{{prof.hoursToDo}}</span>
<!-- if EDIT MODE -->
<span v-show='gstore.edit_i==pi'><input type='text' placeholder='???' v-model='gstore.edit_h'></span>
<!-- endif -->
<span>heures à faire</span>
</div>
<div title='équivalents TD'>
<span>{{ prof.equiTD }}</span>
<span>heures prévues</span>
</div>
</div>
<!-- if VIEW MODE -->
<div v-show='gstore.edit_i!=pi' class='sub' title='total des heures prévues'><strong>{{ prof.VHCours + prof.VHTd + prof.VHTp }}h</strong> réelles prévues</div>
<!-- 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>
<!-- endif -->
<div class='footer'>
<!-- if VIEW MODE -->
<span v-show='gstore.edit_i!=pi' :class="(prof.VHCours == 0) ? 'course' : 'course active'">{{ prof.VHCours }}h <span>Cours</span></span>
<hr v-show='gstore.edit_i!=pi'>
<span v-show='gstore.edit_i!=pi' :class="(prof.VHTd == 0) ? 'td' : 'td active'" >{{ prof.VHTd }}h <span>TD</span></span>
<hr v-show='gstore.edit_i!=pi'>
<span v-show='gstore.edit_i!=pi' :class="(prof.VHTp == 0) ? 'tp' : 'tp active'" >{{ prof.VHTp }}h <span>TP</span></span>
<!-- if EDIT MODE -->
<button v-show='gstore.edit_i==pi' class='search' @click='gstore.ie_handler(pi)'>Modifier l'enseignant</button>
<button v-show='gstore.edit_i==pi' class='grey' @click='gstore.ie_toggle(-1)'>Annuler</button>
<!-- endif -->
</div>
</section>
</div>
2018-03-01 17:26:07 +00:00
</div>
</template>
<script>
export default {
name: 'CONTAINER_VIEW',
data(){
return { gstore: gstore.get }
}
}
</script>