feat: add json db for timeline (WIP); update fontawesome.

main-old
Francesco Minnocci 3 years ago
parent 2e2f15874b
commit e3b71962e5
Signed by: BachoSeven
GPG Key ID: 2BE4AB7FDAD828A4

@ -0,0 +1,42 @@
package main
import (
"encoding/json"
"io/ioutil"
)
type Macchinista struct {
Name string `json:"username"`
Uid string `json:"password"`
Date string `json:"date"`
Type string `json:"type"`
}
type GenericEvent struct {
Title string `json:"title"`
Description string `json:"description"`
Date string `json:"date"`
Type string `json:"type"`
}
type EventsDB struct {
Macchinisti map[string]*Macchinista `json:"macchinisti"`
GenericEvent map[string]*GenericEvent `json:"eventi,omitempty"`
}
func GetEvents() ([]EventsDB, error) {
var events []EventsDB
eventsJsonData, err := ioutil.ReadFile("./storia.json")
if err != nil {
return nil, err
}
if err := json.Unmarshal(eventsJsonData, &events); err != nil {
return nil, err
}
return events, nil
}
// TODO: Logica per ordinare gli eventi

@ -0,0 +1,22 @@
[
"macchinisti":
{
"nome": "Francesco Minnocci",
"uid": "minnocci",
"date": "2022/02",
"type": "entry"
},
{
"nome": "Francesco Caporali",
"uid": "caporali",
"date": "201?/??",
"type": "exit"
}
},
"eventi":
{
"title": "Nuovo sito del PHC",
"description": "TBA",
"date": "2022/??"
}
]

@ -7,8 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ template "title" . }}</title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css"
integrity="sha384-DyZ88mC6Up2uqS4h/KRgHuoeGwBcD4Ng9SiP4dIRy0EXTlnuz47vAwmeGwVChigm" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css"
integrity="sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X" crossorigin="anonymous">

@ -12,10 +12,25 @@
<div class="history-container">
<div class="timeline-bar"></div>
<div class="events">
<!-- {{ range .Events }} -->
<!-- {{ if (.IsMacchinista) }} -->
<!-- {{ if (.IsEntry) }} -->
<!-- <i class="fa-solid fa-sign-in"></i> -->
<!-- {{ end }} -->
<!-- {{ if (.IsExit) }} -->
<!-- {{ end }} -->
<!-- {{ end }} -->
<!-- {{ if (.IsGeneric) }} -->
<!-- <div class="description">{{ .Description }}</div> -->
<!-- {{ if (.IsAnniversary) }} -->
<!-- {{ end }} -->
<!-- {{ end }} -->
<!-- {{ end }} -->
<div class="event">
<div class="title">Nuovo sito del PHC</div>
<div class="date">2022/??</div>
</div>
<div class="spacer"></div>
<div class="event">
<div class="title">Ingresso di <a href="#">Francesco Manicastri</a></div>
<div class="date">2022/05</div>
@ -27,14 +42,39 @@
<div class="spacer"></div>
<div class="event">
<div class="title">Ingresso di <a href="#">Antonio De Lucreziis</a></div>
<div class="date">20??/??</div>
<div class="date">201?/??</div>
</div>
<div class="spacer"></div>
<div class="event">
<div class="title">Ingresso di <a href="#">Francesco Caporali</a></div>
<div class="date">201?/??</div>
</div>
<div class="spacer"></div>
<div class="event">
<div class="title">Ingresso di <a href="#">Letizia D'Achille</a></div>
<div class="date">201?/??</div>
</div>
<div class="spacer"></div>
<div class="event">
<div class="title">Ingresso di <a href="#">Giorgio Mossa</a></div>
<div class="date">201?/??</div>
</div>
<div class="event">
<div class="title">Ingresso di <a href="#">Cristiano Ricci</a></div>
<div class="date">201?/??</div>
</div>
<div class="spacer"></div>
<div class="spacer"></div>
<div class="event">
<div class="title">Prima versione del sito "Poisson"</div>
<div class="date">~1996/06/17</div>
</div>
<div class="spacer"></div>
<div class="event">
<div class="title">Apertura del PHC</div>
<div class="date">1998/??/??</div>
<div class="date">~1994</div>
</div>
</div>
</div>
</section>
{{end}}
{{end}}

Loading…
Cancel
Save