Fix page indicator

This commit is contained in:
Gregor Kleen 2018-03-16 14:22:33 +01:00
parent 2cfd87de87
commit 170442cff0
2 changed files with 4 additions and 1 deletions

View File

@ -25,6 +25,8 @@ import Yesod.Colonnade
import Text.Hamlet (hamletFile)
import Data.Ratio ((%))
data SortColumn = forall a. PersistField a => SortColumn { getSortColumn :: E.SqlExpr (E.Value a) }
data SortDirection = SortAsc | SortDesc
@ -121,6 +123,7 @@ dbTable PSValidator{..} DBTable{ dbtIdent = (toPathPiece -> dbtIdent), .. } = do
bool return (sendResponse <=< tblLayout) psShortcircuit $ do
let table = encodeCellTable dbtAttrs' dbtColonnade rows
pageCount = max 1 . ceiling $ rowCount % psLimit
$(widgetFile "table-layout")
where
tblLayout :: Widget -> Handler Html

View File

@ -1,4 +1,4 @@
<div .table>
^{table}
<p style="text-align:center">
_{MsgPage (succ psPage) (succ $ div rowCount psLimit)}
_{MsgPage (succ psPage) pageCount}