Layout and refactoring

This commit is contained in:
DutchEllie 2022-03-15 13:22:59 +01:00
parent 03a09fc452
commit 0ca691e3ae
Signed by: DutchEllie
SSH Key Fingerprint: SHA256:dKq6ZSgN5E3Viqrw/+xAdf2VdR6hdRGNyrYqXXwfjTY
7 changed files with 65 additions and 36 deletions

View File

@ -16,11 +16,15 @@ func (a *AboutPage) Render() app.UI {
return newPage().
Title("About me").
LeftBar(
&bannerPanel{},
newHTMLBlock().
Class("left").
Class("leftbarblock").
Src("/web/blocks/snippets/bannerpanel.html"),
).
Main(
newHTMLBlock().
Class("right").
Class("contentblock").
Src("/web/blocks/pages/about.html"),
)
}

View File

@ -14,11 +14,15 @@ func (f *GalaxiesPage) Render() app.UI {
return newPage().
Title("Galaxies").
LeftBar(
&bannerPanel{},
newHTMLBlock().
Class("left").
Class("leftbarblock").
Src("/web/blocks/snippets/bannerpanel.html"),
).
Main(
newHTMLBlock().
Class("right").
Class("contentblock").
Src("/web/blocks/pages/galaxies.html"),
)
}

View File

@ -64,7 +64,7 @@ func (g *guestbookForm) Render() app.UI {
},
},
),
).Class("content")
)
}
func (g *guestbookForm) clear() {

View File

@ -35,14 +35,11 @@ func newGuestbookPanel() *guestbookPanel {
}
func (g *guestbookPanel) Render() app.UI {
return newUIBlock().
Class("right").
UI(
app.Range(g.comments).Slice(func(i int) app.UI {
return app.Range(g.comments).Slice(func(i int) app.UI {
return &guestbookComment{
Comment: g.comments[i],
}
}),
},
)
}

View File

@ -27,12 +27,20 @@ func (p *Homepage) Render() app.UI {
return newPage().
Title("Homepage").
LeftBar(
&bannerPanel{},
newHTMLBlock().
Class("left").
Class("leftbarblock").
Src("/web/blocks/snippets/bannerpanel.html"),
).
Main(
newHTMLBlock().
Class("right").
Class("contentblock").
Src("/web/blocks/pages/intro.html"),
newUIBlock().
Class("right").
Class("contentblock").
UI(
&guestbookForm{
OnSubmit: func(name, message string) {
var comment entity.Comment
@ -57,6 +65,12 @@ func (p *Homepage) Render() app.UI {
defer req.Body.Close()
},
},
),
newUIBlock().
Class("right").
Class("contentblock").
UI(
gbp.Render(),
),
)
}

View File

View File

@ -74,6 +74,16 @@ body {
background-color: rgb(54, 39, 48);
margin-bottom: 5px;
position: relative;
}
.leftbarblock {
float:left;
width: 250px;
padding: 5px 0px;
}
.contentblock {
float:right;
width: 614px;
padding: 10px;
}