diff --git a/frontend/src/utenti.js b/frontend/src/utenti.js index 7d2e2a5..1c3647d 100644 --- a/frontend/src/utenti.js +++ b/frontend/src/utenti.js @@ -7,6 +7,7 @@ const FUSE_OPTIONS = { keys: [ 'nome', 'cognome', + 'tags', { name: 'nomeCompleto', getFn: user => `${user.nome} ${user.cognome}` }, ], } diff --git a/storia.json b/storia.json index 50123a8..b873da7 100644 --- a/storia.json +++ b/storia.json @@ -38,7 +38,7 @@ { "type": "simple", "title": "Apertura del PHC", - "date": "1992" + "date": "1994" } ] } diff --git a/utenti.go b/utenti.go index 992aa6e..11692f7 100644 --- a/utenti.go +++ b/utenti.go @@ -6,13 +6,26 @@ import ( ) type UserInfo struct { - Uid string `json:"uid"` - Nome string `json:"nome"` - Cognome string `json:"cognome"` - IsMacchinista bool `json:"macchinista,omitempty"` + Uid string `json:"uid"` + Nome string `json:"nome"` + Cognome string `json:"cognome"` + + Tags []string `json:"tags"` + IsMacchinista bool `json:"macchinista,omitempty"` } func GetUtenti() ([]UserInfo, error) { + history, err := GetRawHistory() + if err != nil { + return nil, err + } + + // Creo un set per velocizzare l'utilizzo dopo + macchinisti := map[string]bool{} + for _, m := range history.Macchinisti { + macchinisti[m.Uid] = true + } + var users []UserInfo usersJsonData, err := ioutil.ReadFile("./utenti-poisson-2022.local.json") diff --git a/views/partials/navbar.html b/views/partials/navbar.html index ed6d6c9..d1c7490 100644 --- a/views/partials/navbar.html +++ b/views/partials/navbar.html @@ -62,9 +62,9 @@ -