Webviews for status threads

This commit is contained in:
f0x 2021-09-10 22:00:57 +02:00
commit d553b445f5
6 changed files with 241 additions and 13 deletions

View file

@ -59,11 +59,7 @@ func (m *Module) baseHandler(c *gin.Context) {
// FIXME: fill in more variables?
c.HTML(http.StatusOK, "index.tmpl", gin.H{
"instance": instance,
"countUsers": 3,
"countStatuses": 42069,
"version": "1.0.0",
"adminUsername": "@admin",
"instance": instance,
})
}
@ -101,6 +97,9 @@ func (m *Module) Route(s router.Router) error {
// serve front-page
s.AttachHandler(http.MethodGet, "/", m.baseHandler)
// serve statuses
s.AttachHandler(http.MethodGet, "/:user/statuses/:id", m.statusTemplateHandler)
// 404 handler
s.AttachNoRouteHandler(m.NotFoundHandler)