From ecf4203f3951ed4f7aea9ced0592cd2924d4de65 Mon Sep 17 00:00:00 2001 From: m15o Date: Sun, 28 Nov 2021 08:40:11 +0100 Subject: [PATCH] Fix routes and flash --- assets/style.css | 8 +- web/handler/common.go | 9 +- web/handler/handler.go | 11 +- web/handler/html.go | 178 ++++++++++++-------- web/handler/html/common/flash.html | 5 + web/handler/html/common/layout.html | 4 +- web/handler/html/confirm_remove_status.html | 14 +- web/handler/html/create_status.html | 13 +- web/handler/html/edit_status.html | 26 +-- web/handler/html/index.html | 11 +- web/handler/html/login.html | 34 ++-- web/handler/html/manage.html | 28 +++ web/handler/html/register.html | 42 ++--- web/handler/html/settings.html | 1 + web/handler/html/user.html | 3 - web/handler/status_edit.go | 7 +- web/handler/status_remove.go | 9 +- web/handler/status_update.go | 10 +- web/handler/user_show.go | 35 ++++ 19 files changed, 294 insertions(+), 154 deletions(-) create mode 100644 web/handler/html/common/flash.html create mode 100644 web/handler/html/manage.html diff --git a/assets/style.css b/assets/style.css index 7e7af0c..720262f 100644 --- a/assets/style.css +++ b/assets/style.css @@ -7,7 +7,13 @@ body { section { padding: 1em; - background-color: peachpuff; + background-color: lightblue; +} + +.flash { + background-color: lightgreen; + padding: 0.5em 1em; + color: darkgreen; } .cols { diff --git a/web/handler/common.go b/web/handler/common.go index 0aeb216..cdff09d 100644 --- a/web/handler/common.go +++ b/web/handler/common.go @@ -3,13 +3,18 @@ package handler var TplCommonMap = map[string]string{ + "flash": `{{ define "flash" }} +{{ if . }} +

{{ . }}

+{{ end }} +{{ end }}`, "layout": `{{ define "layout" }} - status ☕ + status.cafe {{ template "head" . }} @@ -17,7 +22,7 @@ var TplCommonMap = map[string]string{