Merge branch 'master' into 'live'

Fix accidental form nesting

See merge request !123
This commit is contained in:
Gregor Kleen 2018-12-29 15:20:10 +01:00
commit e17b7f2eca
3 changed files with 31 additions and 30 deletions

View File

@ -679,17 +679,18 @@ dbTable PSValidator{..} dbtable@DBTable{ dbtIdent = dbtIdent'@(toPathPiece -> db
let attrs = cell' ^. cellAttrs
return $(widgetFile "table/cell/body")
let table = $(widgetFile "table/colonnade")
pageCount
| PagesizeLimit l <- psLimit
= max 1 . ceiling $ rowCount % l
| otherwise
= 1
pageNumbers = [0..pred pageCount]
return $(widgetFile "table/colonnade")
return $(widgetFile "table/layout")
pageCount
| PagesizeLimit l <- psLimit
= max 1 . ceiling $ rowCount % l
| otherwise
= 1
pageNumbers = [0..pred pageCount]
bool (dbHandler (Proxy @m) (Proxy @x) $ (\table -> $(widgetFile "table/layout-wrapper")) . dbsFilterLayout filterWdgt filterEnc rawAction) (sendResponse <=< tblLayout . dbsFilterLayout filterWdgt filterEnc rawAction <=< dbWidget (Proxy @m) (Proxy @x)) psShortcircuit <=< runDBTable dbtable paginationInput currentKeys . fmap swap $ runWriterT table'
uiLayout table = dbsFilterLayout filterWdgt filterEnc rawAction $(widgetFile "table/layout")
bool (dbHandler (Proxy @m) (Proxy @x) $ (\table -> $(widgetFile "table/layout-wrapper")) . uiLayout) (sendResponse <=< tblLayout . uiLayout <=< dbWidget (Proxy @m) (Proxy @x)) psShortcircuit <=< runDBTable dbtable paginationInput currentKeys . fmap swap $ runWriterT table'
where
tblLayout :: forall m'. (MonadHandler m', HandlerSite m' ~ UniWorX) => Widget -> m' Html
tblLayout tbl' = do

View File

@ -1,20 +1,21 @@
$newline never
<table *{dbsAttrs'}>
$maybe wHeaders' <- wHeaders
<thead>
<tr .table__row.table__row--head>
$forall widget <- wHeaders'
$# cell/header.hamlet
^{widget}
$nothing
<tbody>
$if null wRows && (dbsEmptyStyle == DBESHeading)
<tr .table__row>
<td .table__td colspan=#{show columnCount}>
_{dbsEmptyMessage}
$else
$forall row <- wRows
<tr .table__row>
$forall widget <- row
$# cell/body.hamlet
<div .scrolltable>
<table *{dbsAttrs'}>
$maybe wHeaders' <- wHeaders
<thead>
<tr .table__row.table__row--head>
$forall widget <- wHeaders'
$# cell/header.hamlet
^{widget}
$nothing
<tbody>
$if null wRows && (dbsEmptyStyle == DBESHeading)
<tr .table__row>
<td .table__td colspan=#{show columnCount}>
_{dbsEmptyMessage}
$else
$forall row <- wRows
<tr .table__row>
$forall widget <- row
$# cell/body.hamlet
^{widget}

View File

@ -1,9 +1,8 @@
$newline never
$if null wRows && (dbsEmptyStyle == DBESNoHeading)
$if null rows && (dbsEmptyStyle == DBESNoHeading)
_{dbsEmptyMessage}
$else
<div .scrolltable>
^{table}
^{table}
$if pageCount > 1
<div .pagination>
<form .pagesize method=GET enctype=#{pagesizeEnc} action=#{rawAction}>