diff --git a/main.go b/main.go index 4e318ff..900c561 100644 --- a/main.go +++ b/main.go @@ -18,31 +18,51 @@ func main() { navItems := []NavItem{ NewNavItem("Suche", "/search"), + NewNavItem("Verwaltung", "/admin"), } app.Get("/", func(c *fiber.Ctx) error { return c.Render("search", fiber.Map{ - "Title": "Suche", - "Stylenames": NewStyleItemList("colors", "main", "search"), - "NavItems": navItems, + "Title": "Suche", + "Stylenames": NewStyleItemList("colors", "main", "search"), + "NavItems": navItems, + "ActivePage": "/search", + "SearchResultCount": -1, }) }) app.Get("/search", func(c *fiber.Ctx) error { return c.Render("search", fiber.Map{ - "Title": "Suche", - "Stylenames": NewStyleItemList("colors", "main", "search"), - "NavItems": navItems, + "Title": "Suche", + "Stylenames": NewStyleItemList("colors", "main", "search"), + "NavItems": navItems, + "ActivePage": "/search", + "SearchResultCount": -1, }) }) app.Post("/search", func(c *fiber.Ctx) error { return c.Render("search", fiber.Map{ - "Title": "Suche", - "Stylenames": NewStyleItemList("colors", "main", "search"), - "NavItems": navItems, + "Title": "Suche", + "Stylenames": NewStyleItemList("colors", "main", "search"), + "NavItems": navItems, + "ActivePage": "/search", + "SearchResultCount": 0, }) }) + app.Get("/admin", func(c *fiber.Ctx) error { + return c.Render("admin/tables", fiber.Map{ + "Title": "Verwaltung", + "Stylenames": NewStyleItemList("colors", "main", "admin"), + "NavItems": navItems, + "ActivePage": "/admin", + }) + }) + + app.Get("/admin/locations/overview", func(c *fiber.Ctx) error { + return c.Render("admin/overview") + }) + log.Fatal(app.Listen(":3000")) } diff --git a/static/css/admin.css b/static/css/admin.css new file mode 100644 index 0000000..e69de29 diff --git a/static/css/main.css b/static/css/main.css index 877777e..60742c7 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -25,7 +25,11 @@ a:visited { header, footer { background-color: var(--bg-light); - height: 100px; + height: 150px; +} + +footer { + height: 50px; } header { @@ -38,11 +42,14 @@ header > h1 { padding: 0; margin: 0; text-align: center; + font-size: 4.5em; } -header > nav, footer > nav { +:is(header, footer) > nav { display: flex; justify-content: center; + gap: 20px; + font-size: 1.5em; } footer > nav { @@ -54,6 +61,26 @@ footer > nav > a { margin: auto; } +:is(header, footer) > nav > a::before { + content: '< '; +} + +:is(header, footer) > nav > a::after { + content: ' >'; +} + +:is(header, footer) > nav > a:is(:hover, .active)::before { + content: '\00a0>'; +} + +:is(header, footer) > nav > a:is(:hover, .active)::after { + content: '<\00a0'; +} + +:is(header, footer) > nav > a:visited { + color: var(--link); +} + main { min-height: calc(100vh - 200px); } \ No newline at end of file diff --git a/static/css/search.css b/static/css/search.css index e69de29..7f0efaa 100644 --- a/static/css/search.css +++ b/static/css/search.css @@ -0,0 +1,54 @@ +main { + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + gap: 50px; +} + +main > form { + display: flex; + margin-bottom: 50px; +} + +main > form > input { + width: 420px; + height: 50px; + border-radius: 0px; + border-bottom-left-radius: 25px; + border-top-left-radius: 25px; + border: none; + font-size: 24px; + padding: 0 10px 0 10px; + background-color: var(--bg-light); + color: var(--fg); + border-right: 2px solid var(--bg-border); +} + +main > form > input:focus { + outline: none; +} + +main > form > button { + width: 50px; + height: 50px; + border: none; + border-radius: 0px; + border-bottom-right-radius: 25px; + border-top-right-radius: 25px; + cursor: pointer; + background-color: var(--bg-light); + font-size: 24px; +} + +main > table { + width: 800px; + border-collapse: collapse; + background-color: var(--bg-light); +} + +main > table tr :is(td, th) { + border: 2px solid var(--bg-border); + padding: 5px; + text-align: center; +} \ No newline at end of file diff --git a/types.go b/types.go index 942f3bb..a5ba263 100644 --- a/types.go +++ b/types.go @@ -1,5 +1,7 @@ package main +// Web + type NavItem struct { Caption string Destination string @@ -14,3 +16,16 @@ type Stylename string func NewStyleItemList(stylenames ...Stylename) []Stylename { return stylenames } + +// Database + +type Location struct { + id int + parent int + Name string + Description string +} + +func (l *Location) GetParent() *Location { + return nil +} diff --git a/views/admin/edit.html b/views/admin/edit.html new file mode 100644 index 0000000..58fdbd8 --- /dev/null +++ b/views/admin/edit.html @@ -0,0 +1,16 @@ +{{template "partials/base-top" .}} + +
+ +{{template "partials/base-bottom" .}} \ No newline at end of file diff --git a/views/admin/overview.html b/views/admin/overview.html new file mode 100644 index 0000000..409ca63 --- /dev/null +++ b/views/admin/overview.html @@ -0,0 +1,28 @@ +{{template "partials/base-top" .}} + +{{ . }} | + {{ end }} +|
---|---|
{{ . }} | + {{ end }} ++ + + | +
Ort | +Kistenbezeichnung | +Möglicher Inhalt | +
---|---|---|
A | +A | +A | +
Keine Ergebnisse gefunden.
+ +{{ end }} + +{{ end }} + + {{template "partials/base-bottom" .}} \ No newline at end of file