From 739c53aa92159ddd84602346aca7a7525f0660d8 Mon Sep 17 00:00:00 2001 From: Odyssium Date: Sun, 2 Apr 2023 19:28:20 +0200 Subject: [PATCH] Add setup notice, please see #92 Signed-off-by: Odyssium --- pages/index.go | 2 ++ public/css/global.css | 20 ++++++++++++++++++++ views/index.html | 5 +++++ 3 files changed, 27 insertions(+) diff --git a/pages/index.go b/pages/index.go index 5ed4f0e..d3c5fab 100644 --- a/pages/index.go +++ b/pages/index.go @@ -1,6 +1,7 @@ package pages import ( + "os" "runtime" "codeberg.org/gothub/gothub/utils" @@ -13,5 +14,6 @@ func HandleIndex(c *fiber.Ctx) error { "version": utils.Version(), "fiberversion": fiber.Version, "goversion": runtime.Version(), + "setupstatus": os.Getenv("GOTHUB_SETUP_COMPLETE"), }) } diff --git a/public/css/global.css b/public/css/global.css index c6627a9..b01effb 100644 --- a/public/css/global.css +++ b/public/css/global.css @@ -6,6 +6,7 @@ --secondary-background: #353535; --background-darker: #151515; --accent: #00b7c3; + --yellow: #8B8000; color-scheme: dark; } @@ -90,6 +91,24 @@ a:hover { color: var(--accent); } +.setup-notice { + background-color: var(--yellow); + padding: 8px; + border-radius: 4px; + font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif; + color: var(--text); +} + +.setup-notice > a { + text-decoration: underline; + text-underline-offset: 5px; +} + +.setup-notice > a:hover { + color: var(--text); + opacity: 1; +} + /* URI: /explore */ .explore-card, .user-repo-card { @@ -254,6 +273,7 @@ a:hover { --secondary-background: #f5f5f5; --background-darker: #dddddd; --accent: #005ec3; + --yellow: #f5f5a5; color-scheme: light; } a { diff --git a/views/index.html b/views/index.html index b9a947b..6e4e512 100644 --- a/views/index.html +++ b/views/index.html @@ -2,6 +2,11 @@

GotHub is an alternative front-end for GitHub.

+ {{ if not .setupstatus }} +
+ GotHub is not set up! Please look at this issue to see how to set up GotHub, or set the GOTHUB_SETUP_COMPLETE environment variable to true to suppress this message. If you are a user of this instance, please contact the instance maintainer. +
+ {{ end}}

Features

  • Lightweight - for both you and the instance host