feat: add minimal artist page
This commit is contained in:
parent
21617fac1f
commit
e7b47adf3a
31
src/modules/artist/artist.go
Normal file
31
src/modules/artist/artist.go
Normal 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())
|
||||
}
|
||||
}
|
11
src/modules/artist/artist.templ
Normal file
11
src/modules/artist/artist.templ
Normal file
@ -0,0 +1,11 @@
|
||||
package artist
|
||||
|
||||
import "acide/src/utils"
|
||||
|
||||
templ artistTempl() {
|
||||
@utils.SkeletonTempl() {
|
||||
<div>
|
||||
Artist page :D
|
||||
</div>
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ package src
|
||||
|
||||
import (
|
||||
"acide/src/modules/album"
|
||||
"acide/src/modules/artist"
|
||||
"acide/src/modules/auth"
|
||||
"acide/src/modules/covers"
|
||||
"acide/src/modules/index"
|
||||
@ -31,6 +32,7 @@ func (s *Server) RegisterRoutes() http.Handler {
|
||||
auth.SetupRoutes(e.Group("/auth"))
|
||||
covers.Setup(e.Group("/covers"))
|
||||
album.Setup(e.Group("/album"))
|
||||
artist.Setup(e.Group("/artist"))
|
||||
|
||||
return e
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user