routeurs c fait, mais depuis mon windows avec des #. jsp si ca marchera sur dwarves. d'apres claude, il me suffira de copier coller un repertoire dist/ ... jespere que ce sera le cas, car je n'aurais pas vrmt le temps ni, surtt, le materiel pr tester ca avant la soutenance.

This commit is contained in:
camille
2026-03-28 17:33:56 +01:00
parent 43589e583e
commit a7a9d5f75c
5 changed files with 42 additions and 14 deletions
+7
View File
@@ -11,3 +11,10 @@ export async function recupereFormations(motCle, limit = 20)
return data.results; return data.results;
} }
export async function recupereFormation(id) {
const url = `${API_BASE}?where=cod_aff_form="${id}"&limit=1`
const response = await fetch(url)
const data = await response.json()
return data.results[0]
}
@@ -1,6 +1,6 @@
<carte-formations> <carte-formations>
<div id="carte" style="height: 500px; width: 600px;"></div> <div id="carte" style="height: 500px; width: 1000px;"></div>
@@ -8,8 +8,6 @@
import L from 'leaflet' import L from 'leaflet'
import 'leaflet/dist/leaflet.css' import 'leaflet/dist/leaflet.css'
import markerIcon from 'leaflet/dist/images/marker-icon.png'
import markerShadow from 'leaflet/dist/images/marker-shadow.png'
@@ -74,7 +72,8 @@
` `
<b>${f.fil_lib_voe_acc}</b><br> <b>${f.fil_lib_voe_acc}</b><br>
${f.g_ea_lib_vx}<br> ${f.g_ea_lib_vx}<br>
${f.ville_etab} ${f.ville_etab}<br>
<a href="#/formation/${f.cod_aff_form}">Voir le détail</a>
` `
) )
} }
@@ -1,18 +1,17 @@
<ligne-resultat> <ligne-resultat>
<div class="ligne-resultat"> <div class="ligne-resultat">
<h3>{ props.formation.fil_lib_voe_acc } — { props.formation.g_ea_lib_vx }</h3> <h3>{ props.formation.fil_lib_voe_acc } — { props.formation.g_ea_lib_vx }</h3>
<p>{ props.formation.ville_etab } ({ props.formation.dep_lib })</p> <p>{ props.formation.ville_etab } ({ props.formation.dep_lib })</p>
<p>Taux d'accès : { props.formation.taux_acces_ens }%</p> <p>Taux d'accès : { props.formation.taux_acces_ens }%</p>
<a href={ '#/formation/' + props.formation.cod_aff_form }>Voir le détail</a>
</div> </div>
<style> <style>
.ligne-resultat .ligne-resultat
@@ -22,8 +21,6 @@
margin: 5px 0; margin: 5px 0;
} }
</style> </style>
</ligne-resultat> </ligne-resultat>
+27 -2
View File
@@ -1,4 +1,29 @@
import { component } from 'riot' import { component, unmount } from 'riot'
import App from './components/app.riot' import App from './components/app.riot'
import PageDetail from './components/page-detail.riot'
component(App)(document.getElementById('app')) const app = document.getElementById('app')
let currentComponent = null
function navigate()
{
const hash = window.location.hash
if (currentComponent)
{
unmount(app, true)
}
if (hash.startsWith('#/formation/'))
{
const id = hash.replace('#/formation/', '')
currentComponent = component(PageDetail)(app, { id })
}
else
{
currentComponent = component(App)(app)
}
}
window.addEventListener('hashchange', navigate)
navigate()