loading script only when needed
This commit is contained in:
parent
db8e561704
commit
3a53ab0f24
3 changed files with 9 additions and 5 deletions
|
@ -130,7 +130,7 @@ instance Yesod App where
|
|||
]
|
||||
mapM_ addScript $ map StaticR
|
||||
[ js_crementing_js
|
||||
, js_barcode_js
|
||||
-- , js_barcode_js
|
||||
]
|
||||
$(widgetFile "default-layout")
|
||||
withUrlRenderer $(hamletFile "templates/default-layout-wrapper.hamlet")
|
||||
|
|
|
@ -31,14 +31,16 @@ getHomeR = do
|
|||
beverages <- runDB $ selectList [BeverageAmount !=. 0] [Desc BeverageIdent]
|
||||
today <- liftIO $ utctDay <$> getCurrentTime
|
||||
users <- runDB $ selectList [UserTimestamp >=. addDays (-30) today] [Asc UserIdent]
|
||||
defaultLayout $
|
||||
defaultLayout $ do
|
||||
addScript $ StaticR js_barcode_js
|
||||
$(widgetFile "home")
|
||||
|
||||
getReactivateR :: Handler Html
|
||||
getReactivateR = do
|
||||
today <- liftIO $ return . utctDay =<< getCurrentTime
|
||||
users <- runDB $ selectList [UserTimestamp <. addDays (-30) today] [Asc UserIdent]
|
||||
defaultLayout $
|
||||
defaultLayout $ do
|
||||
addScript $ StaticR js_barcode_js
|
||||
$(widgetFile "reactivate")
|
||||
|
||||
getUserReactivateR :: UserId -> Handler Html
|
||||
|
|
|
@ -25,14 +25,16 @@ getSelectR uId =
|
|||
isUser uId HomeR >>= (\user -> do
|
||||
master <- getYesod
|
||||
beverages <- runDB $ selectList [BeverageAmount >. 0] [Asc BeverageIdent]
|
||||
defaultLayout $
|
||||
defaultLayout $ do
|
||||
addScript $ StaticR js_barcode_js
|
||||
$(widgetFile "select")
|
||||
)
|
||||
|
||||
getSelectCashR :: Handler Html
|
||||
getSelectCashR = do
|
||||
beverages <- runDB $ selectList [BeverageAmount >. 0] [Asc BeverageIdent]
|
||||
defaultLayout $
|
||||
defaultLayout $ do
|
||||
addScript $ StaticR js_barcode_js
|
||||
$(widgetFile "selectCash")
|
||||
|
||||
getRechargeR :: UserId -> Handler Html
|
||||
|
|
Loading…
Reference in a new issue