ui: Générer /vie-etudiante depuis ui/vie-etudiante-organismes.json
Déplacer ui/organismes.json -> ui/vie-etudiante-organismes.json Embed ui/vie-etudiante-organismes.json
This commit is contained in:
parent
c84c998d44
commit
0f28252a6c
4 changed files with 61 additions and 195 deletions
|
@ -2,6 +2,7 @@ package agecemorg
|
|||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
|
@ -11,6 +12,7 @@ import (
|
|||
|
||||
"codeberg.org/vlbeaudoin/pave/v2"
|
||||
"codeberg.org/vlbeaudoin/voki/v3"
|
||||
"git.agecem.com/agecem/agecem-org/v3/ui"
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/minio/minio-go/v7"
|
||||
)
|
||||
|
@ -590,7 +592,24 @@ func HandleActualiteArticle(c echo.Context) error {
|
|||
*/
|
||||
|
||||
func HandleVieEtudiante(c echo.Context) error {
|
||||
return c.Render(http.StatusOK, "vie-etudiante-html", nil)
|
||||
var data struct {
|
||||
Data struct {
|
||||
Organismes map[string][]struct {
|
||||
Nom string
|
||||
Local string
|
||||
Poste string
|
||||
Statut string
|
||||
}
|
||||
}
|
||||
Error string
|
||||
}
|
||||
|
||||
if err := json.Unmarshal([]byte(ui.OrganismesJSON()), &data.Data.Organismes); err != nil {
|
||||
data.Error = err.Error()
|
||||
log.Println("json error in vie-etudiante:", err)
|
||||
}
|
||||
|
||||
return c.Render(http.StatusOK, "vie-etudiante-html", data)
|
||||
}
|
||||
|
||||
func HandleVieEtudianteOrganisme(c echo.Context) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue