diff --git a/src/Handler/Utils/Table/Pagination.hs b/src/Handler/Utils/Table/Pagination.hs index 428810362..2f67bf522 100644 --- a/src/Handler/Utils/Table/Pagination.hs +++ b/src/Handler/Utils/Table/Pagination.hs @@ -13,6 +13,7 @@ import Import import qualified Database.Esqueleto as E import qualified Database.Esqueleto.Internal.Sql as E (SqlSelect) import Text.Blaze (Attribute) +import qualified Text.Blaze.Html5.Attributes as Html5 import Control.Monad.RWS hiding ((<>), Foldable(..), mapM_) @@ -88,6 +89,9 @@ dbTable PSValidator{..} DBTable{ dbtIdent = (toPathPiece -> dbtIdent), .. } = do wIdent n | not $ null dbtIdent = dbtIdent <> "-" <> n | otherwise = n + dbtAttrs' + | not $ null dbtIdent = Html5.id (fromString $ unpack dbtIdent) <> dbtAttrs + | otherwise = dbtAttrs psResult <- runInputGetResult $ PaginationSettings <$> ireq sortingField (wIdent "sorting") @@ -115,7 +119,7 @@ dbTable PSValidator{..} DBTable{ dbtIdent = (toPathPiece -> dbtIdent), .. } = do rows <- runDB $ E.select sqlQuery' bool return (sendResponse <=< tblLayout) psShortcircuit $ do - encodeCellTable dbtAttrs dbtColonnade rows + encodeCellTable dbtAttrs' dbtColonnade rows where tblLayout :: Widget -> Handler Html tblLayout = widgetToPageContent >=> (\tbl -> withUrlRenderer $(hamletFile "templates/table-layout.hamlet"))