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]
today <- liftIO $ utctDay <$> getCurrentTime
users <- runDB $ selectList [UserTimestamp >=. addDays (-30) today] [Asc UserIdent]
ousers <- runDB $ selectList [UserTimestamp <. addDays (-30) today] [Asc UserIdent]
defaultLayout $ do
addScript $ StaticR js_barcode_js
$(widgetFile "home")

View File

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