Show note if table is empty

This commit is contained in:
Gregor Kleen 2018-06-27 11:41:53 +02:00
parent 936b808aaf
commit 0ab81d3fc1
2 changed files with 13 additions and 5 deletions

View File

@ -289,6 +289,9 @@ dbTable PSValidator{..} dbtable@(DBTable{ dbtIdent = (toPathPiece -> dbtIdent),
attrs = sortableContent ^. cellAttrs
return $(widgetFile "table/cell/header")
columnCount :: Int64
columnCount = olength64 $ getColonnade dbtColonnade
wHeaders <- maybe (return Nothing) (fmap Just . genHeaders) pSortable
wRows <- forM rows $ \row -> forM (oneColonnadeEncode <$> getColonnade dbtColonnade) $ \(($ row) -> cell) -> do

View File

@ -4,10 +4,15 @@ $newline never
<thead>
<tr .table__row.table__row--head>
$forall widget <- wHeaders'
^{widget}
^{widget} $# cell/header.hamlet
$nothing
<tbody>
$forall row <- wRows
<tr .table__row>
$forall widget <- row
^{widget}
$if null wRows
<tr>
<td colspan=#{show columnCount}>
Kein Inhalt.
$else
$forall row <- wRows
<tr .table__row>
$forall widget <- row
^{widget} $# cell/body.hamlet