Maj
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<result-list>
|
||||
<div class="results">
|
||||
|
||||
<div class="message" if={ props.results.length === 0 && props.hasSearched && !props.loading }>
|
||||
Aucun résultat trouvé
|
||||
</div>
|
||||
@@ -8,26 +9,41 @@
|
||||
Chargement...
|
||||
</div>
|
||||
|
||||
<div each={ (f, i) in props.results } key={ f.id } class="card">
|
||||
<h3>{ f.nom }</h3>
|
||||
<p><b>Établissement :</b> { f.etablissement }</p>
|
||||
<p><b>Ville :</b> { f.ville } ({ f.departement })</p>
|
||||
<p><b>Filière :</b> { f.filiere }</p>
|
||||
<p><b>Taux d'accès :</b> { f.tauxAcces }%</p>
|
||||
<div each={ (formation, index) in props.results } key={ formation.id } class="card">
|
||||
<h3>{ formation.nom }</h3>
|
||||
<p><b>Établissement :</b> { formation.etablissement }</p>
|
||||
<p><b>Ville :</b> { formation.ville } ({ formation.departement })</p>
|
||||
<p><b>Filière :</b> { formation.filiere }</p>
|
||||
<p><b>Taux d'accès :</b> { formation.tauxAcces }%</p>
|
||||
|
||||
<button onclick={ () => props.ondetail(i) }>Voir détail</button>
|
||||
<button onclick={ () => props.onselect(i) }>Ajouter à la sélection</button>
|
||||
<button onclick={ () => locateOnMap(f) } if={ f.latitude != null }>Localiser</button>
|
||||
<button onclick={ afficherDetail.bind(this, index) }>Voir détail</button>
|
||||
<button onclick={ ajouterALaSelection.bind(this, index) }>Ajouter à la sélection</button>
|
||||
<button onclick={ localiserSurCarte.bind(this, formation) } if={ formation.latitude != null }>Localiser</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
locateOnMap(f) {
|
||||
|
||||
// Déclencher l'affichage du détail d'une formation
|
||||
afficherDetail(index) {
|
||||
this.props.ondetail(index)
|
||||
},
|
||||
|
||||
// Ajouter une formation à la sélection
|
||||
ajouterALaSelection(index) {
|
||||
this.props.onselect(index)
|
||||
},
|
||||
|
||||
// Centrer la carte sur la formation
|
||||
localiserSurCarte(formation) {
|
||||
if (window.mapFocus) {
|
||||
window.mapFocus(f.id)
|
||||
window.mapFocus(formation.id)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
</result-list>
|
||||
|
||||
Reference in New Issue
Block a user