Skip to content

Commit

Permalink
redo stats' tables' header and body alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
krustowski committed Aug 31, 2024
1 parent 7aba48c commit 780a9a1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
#

APP_NAME=litter-go
APP_VERSION=0.39.10
APP_VERSION=0.39.11
GOLANG_VERSION=1.23
2 changes: 1 addition & 1 deletion api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"name": "MIT",
"url": "https://github.com/krustowski/litter-go/blob/master/LICENSE"
},
"version": "0.39.10"
"version": "0.39.11"
},
"host": "littr.eu",
"basePath": "/api/v1",
Expand Down
2 changes: 1 addition & 1 deletion pkg/backend/router.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @title litter-go
// @version 0.39.10
// @version 0.39.11
// @description nanoblogging platform as PWA built on go-app framework
// @termsOfService https://littr.eu/tos

Expand Down
34 changes: 17 additions & 17 deletions pkg/frontend/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,26 +223,26 @@ func (c *statsContent) Render() app.UI {
app.Input().ID("search").Type("text").OnChange(c.onSearch).OnSearch(c.onSearch),
),

app.Table().Class("border left-align").ID("table-stats-flow").Body(
app.Table().Class("border right-align").ID("table-stats-flow").Body(
// table header
app.THead().Body(
app.Tr().Body(
app.Th().Class("align-left").Body(
app.Th().Class("left-align").Body(
app.Span().Style("writing-mode", "vertical-lr").Text("nickname"),
),
app.Th().Class("align-left").Body(
app.Th().Class("right-align no-padding").Body(
app.Span().Style("writing-mode", "vertical-lr").Text("posts"),
),
app.Th().Class("align-left").Body(
app.Th().Class("right-align no-padding").Body(
app.Span().Style("writing-mode", "vertical-lr").Text("stars"),
),
app.Th().Class("align-left").Body(
app.Th().Class("right-align no-padding").Body(
app.Span().Style("writing-mode", "vertical-lr").Text("flowers"),
),
app.Th().Class("align-left").Body(
app.Th().Class("right-align no-padding").Body(
app.Span().Style("writing-mode", "vertical-lr").Text("shades"),
),
app.Th().Class("align-left").Body(
app.Th().Class("right-align no-padding").Body(
app.Span().Style("writing-mode", "vertical-lr").Text("ratio"),
),
),
Expand Down Expand Up @@ -280,7 +280,7 @@ func (c *statsContent) Render() app.UI {
}

return app.Tr().Body(
app.Td().Class("align-left").Body(
app.Td().Class("left-align").Body(
app.P().Body(
app.P().Body(
//app.B().Text(key).Class("deep-orange-text"),
Expand All @@ -289,27 +289,27 @@ func (c *statsContent) Render() app.UI {
),
),
),
app.Td().Class("align-left").Body(
app.Td().Class("right-align").Body(
app.P().Body(
app.Text(strconv.FormatInt(int64(users[key].PostCount), 10)),
),
),
app.Td().Class("align-left").Body(
app.Td().Class("right-align").Body(
app.P().Body(
app.Text(strconv.FormatInt(int64(users[key].ReactionCount), 10)),
),
),
app.Td().Class("align-left").Body(
app.Td().Class("right-align").Body(
app.P().Body(
app.Text(strconv.FormatInt(int64(users[key].FlowerCount), 10)),
),
),
app.Td().Class("align-left").Body(
app.Td().Class("right-align").Body(
app.P().Body(
app.Text(strconv.FormatInt(int64(users[key].ShadeCount), 10)),
),
),
app.Td().Class("align-left").Body(
app.Td().Class("right-align").Body(
app.P().Body(
app.Text(strconv.FormatFloat(ratio, 'f', 2, 64)),
),
Expand Down Expand Up @@ -340,22 +340,22 @@ func (c *statsContent) Render() app.UI {
// table header
app.THead().Body(
app.Tr().Body(
app.Th().Class("align-left").Text("property"),
app.Th().Class("align-left").Text("value"),
app.Th().Class("left align").Text("property"),
app.Th().Class("right-align").Text("value"),
),
),
// table body
app.TBody().Body(
app.Range(flowStats).Map(func(key string) app.UI {
return app.Tr().Body(
app.Td().Class("align-left").Body(
app.Td().Class("left-align").Body(
app.P().Body(
app.P().Body(
app.B().Text(key).Class("deep-orange-text"),
),
),
),
app.Td().Class("align-left").Body(
app.Td().Class("right-align").Body(
app.P().Body(
app.Text(strconv.FormatInt(int64(flowStats[key]), 10)),
),
Expand Down

0 comments on commit 780a9a1

Please sign in to comment.