aboutsummaryrefslogtreecommitdiffstats
path: root/web/command/html/home.go
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.net>2025-07-14 01:55:10 +0100
committerLeonardo Bishop <me@leonardobishop.net>2025-07-14 01:55:10 +0100
commit4c3e5c256930249798768b0195c42efca1428586 (patch)
tree0492551ddbfdfbaa192804b95d0ce11e6cbdb406 /web/command/html/home.go
parent08a3fb8a2b0281c3c329b33215ec7f8866add606 (diff)
Add site deletion
Diffstat (limited to 'web/command/html/home.go')
-rw-r--r--web/command/html/home.go19
1 files changed, 16 insertions, 3 deletions
diff --git a/web/command/html/home.go b/web/command/html/home.go
index b9d585c..5dc236a 100644
--- a/web/command/html/home.go
+++ b/web/command/html/home.go
@@ -33,7 +33,13 @@ func HomePage(siteIndex *index.SiteIndex) Node {
Text("Actions"),
),
},
+
Map(siteIndex.GetSites(), func(site *site.Site) Node {
+ status := site.EvaluateSiteStatus()
+ good := false
+ if status == "live" {
+ good = true
+ }
return Group{
Span(
Class("name"),
@@ -42,8 +48,9 @@ func HomePage(siteIndex *index.SiteIndex) Node {
If(site.SiteConfig.Host != "", Span(Text(fmt.Sprintf("on %s", site.SiteConfig.Host)))),
),
Span(
- Class("status"),
- Text(site.EvaluateSiteStatus()),
+ If(good, Class("status text-good")),
+ If(!good, Class("status text-bad")),
+ Text(status),
),
Span(
Class("flags"),
@@ -57,6 +64,12 @@ func HomePage(siteIndex *index.SiteIndex) Node {
}),
),
- navButton("Create new", "/create"),
+ If(len(siteIndex.GetSites()) == 0, alert("There are no sites to display", "")),
+
+ Div(
+ Class("control-group group-right"),
+
+ navButton("Create new", "/create"),
+ ),
)
}