dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit 06a3f074c513a0a2174f3a4658dc571a4f37b515
parent 33b351ed9a12aadbee346d7eade15138da039594
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Sat,  3 Dec 2022 21:52:39 -0500

switch wallpaper only for month of December

Diffstat:
Mpkg/template/templates.go | 7+++++++
Mpkg/web/public/views/pages/chat-password.gohtml | 2+-
Mpkg/web/public/views/pages/first-use.gohtml | 2+-
Mpkg/web/public/views/pages/forgot-password.gohtml | 2+-
Mpkg/web/public/views/pages/login.gohtml | 2+-
Mpkg/web/public/views/pages/signup-invite.gohtml | 2+-
Mpkg/web/public/views/pages/signup-wait.gohtml | 2+-
Mpkg/web/public/views/pages/signup.gohtml | 2+-
8 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/pkg/template/templates.go b/pkg/template/templates.go @@ -64,6 +64,7 @@ type templateDataStruct struct { TmplName string AuthUser *database.User InboxCount int64 + WallpaperImg string } // Render render a template @@ -89,6 +90,12 @@ func (t *Templates) Render(w io.Writer, name string, data interface{}, c echo.Co d.Development = config.Development.Load() d.AuthUser = c.Get("authUser").(*database.User) + d.WallpaperImg = "/public/img/login_bg.jpg" + _, month, _ := time.Now().UTC().Date() + if month == time.December { + d.WallpaperImg = "/public/img/login_bg_1.jpg" + } + if d.AuthUser != nil { d.SSETopics = strings.Join(GetBaseSSETopics(c), ",") var sessionToken string diff --git a/pkg/web/public/views/pages/chat-password.gohtml b/pkg/web/public/views/pages/chat-password.gohtml @@ -32,7 +32,7 @@ } .bg { /* The image used */ - background-image: url("/public/img/login_bg_1.jpg"); + background-image: url({{ .WallpaperImg }}); /* Full height */ height: 100%; diff --git a/pkg/web/public/views/pages/first-use.gohtml b/pkg/web/public/views/pages/first-use.gohtml @@ -30,7 +30,7 @@ } .bg { /* The image used */ - background-image: url("/public/img/login_bg_1.jpg"); + background-image: url({{ .WallpaperImg }}); /* Full height */ height: 100%; diff --git a/pkg/web/public/views/pages/forgot-password.gohtml b/pkg/web/public/views/pages/forgot-password.gohtml @@ -32,7 +32,7 @@ } .bg { /* The image used */ - background-image: url("/public/img/login_bg_1.jpg"); + background-image: url({{ .WallpaperImg }}); /* Full height */ height: 100%; diff --git a/pkg/web/public/views/pages/login.gohtml b/pkg/web/public/views/pages/login.gohtml @@ -32,7 +32,7 @@ } .bg { /* The image used */ - background-image: url("/public/img/login_bg_1.jpg"); + background-image: url({{ .WallpaperImg }}); /* Full height */ height: 100%; diff --git a/pkg/web/public/views/pages/signup-invite.gohtml b/pkg/web/public/views/pages/signup-invite.gohtml @@ -32,7 +32,7 @@ } .bg { /* The image used */ - background-image: url("/public/img/login_bg_1.jpg"); + background-image: url({{ .WallpaperImg }}); /* Full height */ height: 100%; diff --git a/pkg/web/public/views/pages/signup-wait.gohtml b/pkg/web/public/views/pages/signup-wait.gohtml @@ -34,7 +34,7 @@ } .bg { /* The image used */ - background-image: url("/public/img/login_bg_1.jpg"); + background-image: url({{ .WallpaperImg }}); /* Full height */ height: 100%; diff --git a/pkg/web/public/views/pages/signup.gohtml b/pkg/web/public/views/pages/signup.gohtml @@ -32,7 +32,7 @@ } .bg { /* The image used */ - background-image: url("/public/img/login_bg_1.jpg"); + background-image: url({{ .WallpaperImg }}); /* Full height */ height: 100%;