diff --git a/src/modules/album/album.go b/src/modules/album/album.go index 13d42fa..9ebca26 100644 --- a/src/modules/album/album.go +++ b/src/modules/album/album.go @@ -43,10 +43,10 @@ func allAlbumsPage(c echo.Context) error { if isHtmxRequest { // return just a fragment - return utils.RenderTempl(c, http.StatusOK, albumsFragment(albums)) + return utils.RenderTempl(c, http.StatusOK, albumsFragment(albums, searchQuery)) } else { // return a full-blown html page - return utils.RenderTempl(c, http.StatusOK, allAlbumsTempl(albums)) + return utils.RenderTempl(c, http.StatusOK, allAlbumsTempl(albums, searchQuery)) } } diff --git a/src/modules/album/album.templ b/src/modules/album/album.templ index 29f680d..fa83a91 100644 --- a/src/modules/album/album.templ +++ b/src/modules/album/album.templ @@ -8,30 +8,41 @@ import ( ) // Renders a page with all albums passed to it -templ allAlbumsTempl(albums []utils.Album) { +templ allAlbumsTempl(albums []utils.Album, query string) { @utils.SkeletonTempl() { -
+ No albums found +
+ } else { for _, album := range albums { @index.AlbumCard(album) } @@ -40,20 +51,9 @@ templ allAlbumsTempl(albums []utils.Album) { No albums found } -- No albums found -
- } +