openidec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 5a237f7d817fa0503ba2f28d5369bb9fddfa11a4
parent 4659b51b47fdef5ec8fb4a0f33fa7a55bf8749dd
Author: Peter Kosyh <p.kosyh@gmail.com>
Date:   Sun,  6 Sep 2020 20:43:23 +0300

make today dates bold

Diffstat:
Mii-node/lib/style.css | 5+++++
Mii-node/web.go | 7+++++--
2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ii-node/lib/style.css b/ii-node/lib/style.css @@ -87,6 +87,11 @@ body { min-width: 16em; } +.today { + color: #555555; + font-weight: bold; +} + #echolist .subj { } diff --git a/ii-node/web.go b/ii-node/web.go @@ -609,8 +609,11 @@ func msg_access(www *WWW, m ii.Msg, u ii.User) bool { func WebInit(www *WWW) { funcMap := template.FuncMap{ - "fdate": func(date int64) string { - return time.Unix(date, 0).Format("2006-01-02 15:04:05") + "fdate": func(date int64) template.HTML { + if time.Now().Unix() - date < 60 * 60 * 24 { + return template.HTML("<span class='today'>"+time.Unix(date, 0).Format("2006-01-02 15:04:05") + "</span>") + } + return template.HTML(time.Unix(date, 0).Format("2006-01-02 15:04:05")) }, "msg_format": func(s string) template.HTML { return template.HTML(msg_format(s))