feat: add minimal artist page

This commit is contained in:
Araozu 2024-12-08 19:05:40 -05:00
parent 21617fac1f
commit e7b47adf3a
3 changed files with 44 additions and 0 deletions

View File

@ -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())
}
}

View File

@ -0,0 +1,11 @@
package artist
import "acide/src/utils"
templ artistTempl() {
@utils.SkeletonTempl() {
<div>
Artist page :D
</div>
}
}

View File

@ -2,6 +2,7 @@ package src
import ( import (
"acide/src/modules/album" "acide/src/modules/album"
"acide/src/modules/artist"
"acide/src/modules/auth" "acide/src/modules/auth"
"acide/src/modules/covers" "acide/src/modules/covers"
"acide/src/modules/index" "acide/src/modules/index"
@ -31,6 +32,7 @@ func (s *Server) RegisterRoutes() http.Handler {
auth.SetupRoutes(e.Group("/auth")) auth.SetupRoutes(e.Group("/auth"))
covers.Setup(e.Group("/covers")) covers.Setup(e.Group("/covers"))
album.Setup(e.Group("/album")) album.Setup(e.Group("/album"))
artist.Setup(e.Group("/artist"))
return e return e
} }