Fix page indicator
This commit is contained in:
parent
2cfd87de87
commit
170442cff0
@ -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
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<div .table>
|
||||
^{table}
|
||||
<p style="text-align:center">
|
||||
_{MsgPage (succ psPage) (succ $ div rowCount psLimit)}
|
||||
_{MsgPage (succ psPage) pageCount}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user