Commit f7115bec authored by Lucas Détré's avatar Lucas Détré

add idcc and catalogue search to outils page

parent 04e7edf0
<template>
<div id="Catalogue">
<div class="container">
<div class="row">
<div class="col-md-6">
<h2>Catalogue</h2>
<input type="text" ref="intercarif" placeholder="Identifiant INTERCARIF" v-model="intercarif">
<input @click="search()" type="button" class="btn btn-info" value="Chercher">
<p>Plus d'info sur le format du catalogue: <a href="http://lheo.gouv.fr/langage">http://lheo.gouv.fr/langage</a>.</p>
</div>
<div class="col-md-6">
<div class=results v-if="Object.keys(this.results).length">
<h2>Formation</h2>
<pre v-if="this.results">{{ this.results }}</pre>
<p v-if="this.intercarif && !this.results">
Aucune formation trouvée avec l'identifiant «{{ this.intercarif }}».
</p>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data: function () {
return {
intercarif: "",
results: {}
}
},
methods: {
search: function () {
this.$http.get('/explore/catalog?id='+this.intercarif).then(response => {
this.results = response.body;
}).created;
}
}
}
</script>
<template>
<div id="IDCCSearch">
<div class="container">
<div class="row">
<div class="col-md-6">
<h2>Recherche IDCC</h2>
<input type="text" ref="idcc" placeholder="Chercher une convention collective" v-model="idcc">
<input @click="search()" type="button" class="btn btn-info" value="Chercher">
</div>
<div class="col-md-6">
<div class="results" v-if="Object.keys(this.results).length">
<h2>Conventions collectives</h2>
<ul v-if="Object.keys(this.results).length">
<li v-for="(result,code) in this.results" :key="code">
{{ result['convention collective'] }}
<strong>({{ code }})</strong>
</li>
</ul>
<p v-if="this.idcc && !Object.keys(this.results).length">
Aucune convention collective trouvée pour la recherche «{{ this.idcc }}».</p>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'IDCCSearch',
data: function () {
return {
idcc: "",
results: {}
}
},
methods: {
search: function () {
this.$http.get('/idcc?q='+this.idcc).then(response => {
this.results = response.body;
}).created;
}
}
}
</script>
<template>
<div id="Outils"></div>
<div id="Outils">
<IDCCSearch class="section-outil"></IDCCSearch>
<hr class="outil-horizontal-separator">
<Catalogue class="section-outil"></Catalogue>
</div>
</template>
<script>
import IDCCSearch from './IDCCSearch.vue'
import Catalogue from './Catalogue.vue'
export default {
name: 'Outils'
name: 'Outils',
components: {
IDCCSearch,
Catalogue
}
}
</script>
<style scoped>
.section-outil {
padding-top: 3rem;
padding-bottom: 3rem;
margin-left: 2rem;
}
.btn-info {
padding: 1rem;
}
</style>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment