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,6 +20,7 @@ $forall (Entity uId user) <- users
<a href=@{NewUserR}>
<p>_{MsgCreateUser}
$if not (null ousers)
<article .article #func>
<a href=@{ReactivateR}>
<p>_{MsgReactivateOldUser}