hide reactivate button, when there's nothing to reactivate.

This commit is contained in:
nek0 2017-05-16 00:25:33 +02:00
parent daf9f838c8
commit 8980d99f7e
2 changed files with 5 additions and 3 deletions

View File

@ -31,6 +31,7 @@ getHomeR = do
beverages <- runDB $ selectList [BeverageAmount !=. 0] [Desc BeverageIdent] beverages <- runDB $ selectList [BeverageAmount !=. 0] [Desc BeverageIdent]
today <- liftIO $ utctDay <$> getCurrentTime today <- liftIO $ utctDay <$> getCurrentTime
users <- runDB $ selectList [UserTimestamp >=. addDays (-30) today] [Asc UserIdent] users <- runDB $ selectList [UserTimestamp >=. addDays (-30) today] [Asc UserIdent]
ousers <- runDB $ selectList [UserTimestamp <. addDays (-30) today] [Asc UserIdent]
defaultLayout $ do defaultLayout $ do
addScript $ StaticR js_barcode_js addScript $ StaticR js_barcode_js
$(widgetFile "home") $(widgetFile "home")

View File

@ -20,9 +20,10 @@ $forall (Entity uId user) <- users
<a href=@{NewUserR}> <a href=@{NewUserR}>
<p>_{MsgCreateUser} <p>_{MsgCreateUser}
<article .article #func> $if not (null ousers)
<a href=@{ReactivateR}> <article .article #func>
<p>_{MsgReactivateOldUser} <a href=@{ReactivateR}>
<p>_{MsgReactivateOldUser}
<form action=@{HomeBarcodeR} method=GET> <form action=@{HomeBarcodeR} method=GET>
<input type=hidden #barcodeInput name=barcode> <input type=hidden #barcodeInput name=barcode>