diff --git a/go.mod b/go.mod index 8a7bb82..fd064ec 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.13 require ( github.com/alecthomas/chroma v0.9.4 + github.com/alecthomas/repr v0.1.0 // indirect github.com/go-chi/chi/v5 v5.0.7 github.com/joho/godotenv v1.4.0 github.com/litao91/goldmark-mathjax v0.0.0-20210217064022-a43cf739a50f diff --git a/go.sum b/go.sum index 50a8bc9..2391490 100644 --- a/go.sum +++ b/go.sum @@ -5,6 +5,8 @@ github.com/alecthomas/chroma v0.9.4/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqN github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0= github.com/alecthomas/kong v0.2.1-0.20190708041108-0548c6b1afae/go.mod h1:+inYUSluD+p4L8KdviBSgzcqEjUQOfC5fQDRFuc36lI= github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= +github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE= +github.com/alecthomas/repr v0.1.0/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9hchkHSWYkEqJwUGisez3G1QY8Ryz0sdWrLPMGjLk= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= diff --git a/public/style.css b/public/style.css index 625570a..cc8300a 100644 --- a/public/style.css +++ b/public/style.css @@ -4,7 +4,7 @@ :root { --bg: #eaeaea; --fg: #333; - + --bg-lighter: #f0f0f0; --bg-dark: hsl(220, 5%, 93%); @@ -12,6 +12,7 @@ --bg-darker-2: #d5d5d5; --bg-darker-2-1: #c8c8c8; --bg-darker-3: #c0c0c0; + --bg-darker-4: #b8b8b8; --accent-1: #278542; --accent-1-fg: #154d24; @@ -40,7 +41,8 @@ box-sizing: border-box; } -html, body { +html, +body { margin: 0; } @@ -187,7 +189,8 @@ nav .nav-main .nav-item { z-index: 2; } -nav .nav-main .nav-element:hover, nav .nav-main .nav-button:hover { +nav .nav-main .nav-element:hover, +nav .nav-main .nav-button:hover { background: var(--bg-darker); } @@ -244,7 +247,8 @@ nav .nav-main .nav-item.dropdown .nav-items::before { background: var(--bg-darker); } */ -nav .nav-main .nav-item.dropdown .name:hover + .nav-items, nav .nav-main .nav-item.dropdown .name + .nav-items:hover { +nav .nav-main .nav-item.dropdown .name:hover + .nav-items, +nav .nav-main .nav-item.dropdown .name + .nav-items:hover { display: flex; flex-direction: column; } @@ -344,7 +348,7 @@ section { height: 1.5rem; border-radius: calc(1.5rem / 2); padding: 0 calc(1.5rem / 2); - + background: var(--bg-darker-2); color: var(--card-date); @@ -357,7 +361,10 @@ section { /* Typography */ -h1, h2, h3, h4 { +h1, +h2, +h3, +h4 { margin: 0; margin-top: 1rem; margin-bottom: 0.5rem; @@ -382,13 +389,17 @@ h4 { font-weight: var(--font-weight-bold); } -p, ul, ol, li { +p, +ul, +ol, +li { margin: 0.5rem 0; width: 70ch; max-width: 100%; } -ul, ol { +ul, +ol { padding: 0 0 0 1.5rem; } @@ -430,11 +441,12 @@ a:hover { /* Buttons */ -button, .button { +button, +.button { font-family: var(--font-sf); font-weight: var(--font-weight-medium); font-size: 17px; - + /* gray variant #b3b3b3 */ border: 1px solid var(--bg-darker-3); /* gray variant #bfbfbf */ @@ -449,13 +461,14 @@ button, .button { padding: 0 1rem; transition: all 100ms ease-in-out; - + box-shadow: 0 4px 8px 0 #00000022; cursor: pointer; } -button:hover, .button:hover { +button:hover, +.button:hover { background: var(--bg-darker-2-1); box-shadow: 0 4px 8px 0 #00000033; } @@ -479,7 +492,7 @@ select { font-family: var(--font-sf); font-weight: var(--font-weight-medium); font-size: 16px; - + /* gray variant #b3b3b3 */ border: 1px solid var(--bg-darker-3); /* gray variant #bfbfbf */ @@ -494,7 +507,7 @@ select { padding: 0 0.25rem; transition: all 100ms ease-in-out; - + box-shadow: 0 4px 8px 0 #00000022; cursor: pointer; @@ -502,7 +515,8 @@ select { /* Text Fields */ -input[type=text], input[type=password] { +input[type='text'], +input[type='password'] { border: none; background: none; @@ -523,7 +537,7 @@ input[type=text], input[type=password] { font-weight: var(--font-weight-normal); } -input[type=password] { +input[type='password'] { font-family: caption; } @@ -546,7 +560,7 @@ input[type=password] { height: 2rem; width: 1px; - background: var(--bg-darker-3); + background: var(--bg-darker-4); } .compound .icon { @@ -563,7 +577,10 @@ input[type=password] { margin-right: 0.25rem; } -.compound > button, .compound > .button, .compound > input, .compound > select { +.compound > button, +.compound > .button, +.compound > input, +.compound > select { border: none; box-shadow: none; } @@ -695,6 +712,12 @@ form .field-set input { width: 100%; } +.page-utenti .user-item .icon { + width: 1.5rem; + display: grid; + place-content: center; +} + .search { margin: 2rem 0; display: flex; @@ -703,7 +726,7 @@ form .field-set input { gap: 1rem; } -.search input[type=text] { +.search input[type='text'] { width: 50ch; height: 2.5rem; } @@ -741,7 +764,8 @@ form .field-set input { justify-content: center; } -.news-content .tags, .news-content .date { +.news-content .tags, +.news-content .date { justify-content: center; } @@ -762,11 +786,13 @@ table { border-collapse: collapse; } -table td, table th { +table td, +table th { padding: 0.5rem; } -table td:not(:first-child), table th:not(:first-child) { +table td:not(:first-child), +table th:not(:first-child) { border-left: 1px solid var(--bg-darker-3); } diff --git a/utenti.go b/utenti.go index a67260a..2b42548 100644 --- a/utenti.go +++ b/utenti.go @@ -6,9 +6,10 @@ import ( ) type UserInfo struct { - Uid string `string:"uid"` - Nome string `json:"nome"` - Cognome string `json:"cognome"` + Uid string `string:"uid"` + Nome string `json:"nome"` + Cognome string `json:"cognome"` + IsMacchinista bool `json:"macchinista,omitempty"` } func GetUtenti() ([]UserInfo, error) { diff --git a/views/utenti.html b/views/utenti.html index b86b6ea..e1b156d 100644 --- a/views/utenti.html +++ b/views/utenti.html @@ -1,15 +1,13 @@ -{{template "base" .}} - -{{define "title"}}Utenti • PHC{{end}} - -{{define "body"}} +{{template "base" .}} {{define "title"}}Utenti • PHC{{end}} {{define "body"}}

Lista degli Utenti

- Questa è la lista di tutti gli utenti con un account su Poisson. Scrivi nome, cognome o username di un utente per filtrare la lista in tempo reale. Altrimenti di base in cima compariranno gli utenti con più "follower". + Questa è la lista di tutti gli utenti con un account su Poisson. Scrivi nome, cognome o + username di un utente per filtrare la lista in tempo reale. Altrimenti di base in cima + compariranno gli utenti con più "follower".

- {{ $config := .Config }} {{ range .Utenti }}
- {{ .Nome }} {{ .Cognome }} + + {{ .Nome }} {{ .Cognome }} + + {{ if .IsMacchinista }} +
+ +
+ {{ end }}
{{ end }}