add combos list to menu
Ted Unangst tedu@tedunangst.com
Tue, 24 Sep 2019 13:52:06 -0400
3 files changed,
14 insertions(+),
5 deletions(-)
M
views/header.html
→
views/header.html
@@ -22,7 +22,12 @@ <p>
<ul> <li><a href="/{{ .UserSep }}/{{ .UserInfo.Username }}">{{ .UserInfo.Username }}</a> <li><a href="/honkers">honkers</a> -<li><a href="/c">combos</a> +<li>combos +<ul> +{{ range .Combos }} +<li><a href="/c/{{ . }}">{{ . }}</a> +{{ end }} +</ul> <li><a href="/o">tags</a> <li><a href="/about">about</a> <li><a href="/front">front</a>
M
views/style.css
→
views/style.css
@@ -51,18 +51,18 @@ }
body > header span { margin-left: 2em; } -header details { +header > details { background: $bg-page; padding: 1em; position: fixed; top: 0; display: inline; } -header details[open] { +header > details[open] { background: $bg-dark; border: 1px solid $fg; } -header details li { +header > details li { margin: 1em 0em 1em 0em; } main {
M
web.go
→
web.go
@@ -70,6 +70,11 @@ templinfo["ServerName"] = serverName
templinfo["IconName"] = iconName templinfo["UserInfo"] = u templinfo["UserSep"] = userSep + if u != nil { + var combos []string + combocache.Get(u.UserID, &combos) + templinfo["Combos"] = combos + } return templinfo }@@ -1101,7 +1106,6 @@ userinfo := login.GetUserInfo(r)
var combos []string combocache.Get(userinfo.UserID, &combos) templinfo := getInfo(r) - templinfo["Combos"] = combos err := readviews.Execute(w, "combos.html", templinfo) if err != nil { log.Print(err)