diff --git a/src/modules/artist/artist.go b/src/modules/artist/artist.go new file mode 100644 index 0000000..bbdcdb6 --- /dev/null +++ b/src/modules/artist/artist.go @@ -0,0 +1,31 @@ +package artist + +import ( + "acide/src/utils" + "log" + "net/http" + + "github.com/labstack/echo" +) + +func Setup(g *echo.Group) { + log.Print("Setting up the artist module") + g.Use(utils.Authed) + + // g.GET("/", allArtistPage) + g.GET("/:id", artistPage) +} + +func artistPage(c echo.Context) error { + // token, server := utils.Credentials(c) + isHtmxRequest := c.Request().Header.Get("HX-Request") == "true" + // artistId := c.Param("id") + + // load artist info + + if isHtmxRequest { + return utils.RenderTempl(c, http.StatusOK, artistTempl()) + } else { + return utils.RenderTempl(c, http.StatusOK, artistTempl()) + } +} diff --git a/src/modules/artist/artist.templ b/src/modules/artist/artist.templ new file mode 100644 index 0000000..ebfd041 --- /dev/null +++ b/src/modules/artist/artist.templ @@ -0,0 +1,11 @@ +package artist + +import "acide/src/utils" + +templ artistTempl() { + @utils.SkeletonTempl() { +