Jobs & Workflows https://armen.surge.sh
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

69 lines
1.7 KiB

/*
------------------------------------------------------------------------------------------------------------------------
####### gui ####### Copyright (c) 2021 mls-361 ##################################################### MIT License #######
------------------------------------------------------------------------------------------------------------------------
*/
package gui
import (
"fmt"
g "github.com/maragudk/gomponents"
c "github.com/maragudk/gomponents/components"
. "github.com/maragudk/gomponents/html"
"forge.chapril.org/armen/armen/internal/components"
)
func container(node g.Node) g.Node {
return Div(
Class("container"),
node,
)
}
func navbarLink(name, href, page string) g.Node {
active := name == page
return A(
c.Classes{
"item": true,
"active": active,
},
g.Text(name),
Href(href),
)
}
func buildPage(app components.Application, name string, content g.Node) g.Node {
return Doctype(
HTML(
Lang("en"),
Head(
Meta(Charset("utf-8")),
Meta(Name("viewport"), Content("width=device-width, initial-scale=1")),
TitleEl(g.Textf("%s - %s", app.Name(), name)),
Link(Rel("stylesheet"), Href(fmt.Sprintf("/static/css/%s.css", name)), Type("text/css")),
),
Body(
Header(
container(
Div(
Class("navbar"),
navbarLink(app.Name(), "/", name),
navbarLink("dashboard", "/dashboard", name),
navbarLink("jobs", "/dashboard", name),
navbarLink("workflows", "/dashboard", name),
),
),
),
container(Main(content)),
),
),
)
}
/*
######################################################################################################## @(°_°)@ #######
*/