add titles to pages
This commit is contained in:
parent
9bb10c88c9
commit
c23ac47ae4
17 changed files with 60 additions and 22 deletions
|
@ -30,14 +30,16 @@ import Codec.Picture.ScaleDCT
|
||||||
getAvatarR :: Handler Html
|
getAvatarR :: Handler Html
|
||||||
getAvatarR = do
|
getAvatarR = do
|
||||||
avatars <- runDB $ selectList [] [Asc AvatarIdent]
|
avatars <- runDB $ selectList [] [Asc AvatarIdent]
|
||||||
defaultLayout $
|
defaultLayout $ do
|
||||||
|
setTitleI MsgAvatars
|
||||||
$(widgetFile "avatars")
|
$(widgetFile "avatars")
|
||||||
|
|
||||||
getNewAvatarR :: Handler Html
|
getNewAvatarR :: Handler Html
|
||||||
getNewAvatarR = do
|
getNewAvatarR = do
|
||||||
(newAvatarWidget, enctype) <- generateFormPost
|
(newAvatarWidget, enctype) <- generateFormPost
|
||||||
$ renderBootstrap3 BootstrapBasicForm $ avatarNewForm
|
$ renderBootstrap3 BootstrapBasicForm $ avatarNewForm
|
||||||
defaultLayout $
|
defaultLayout $ do
|
||||||
|
setTitleI MsgNewAvatar
|
||||||
$(widgetFile "newAvatar")
|
$(widgetFile "newAvatar")
|
||||||
|
|
||||||
postNewAvatarR :: Handler Html
|
postNewAvatarR :: Handler Html
|
||||||
|
@ -77,7 +79,8 @@ getModifyAvatarR aId = do
|
||||||
(avatarModifyWidget, enctype) <- generateFormPost
|
(avatarModifyWidget, enctype) <- generateFormPost
|
||||||
$ renderBootstrap3 BootstrapBasicForm
|
$ renderBootstrap3 BootstrapBasicForm
|
||||||
$ avatarModForm avatar
|
$ avatarModForm avatar
|
||||||
defaultLayout $
|
defaultLayout $ do
|
||||||
|
setTitleI MsgModifyAvatar
|
||||||
$(widgetFile "modifyAvatar")
|
$(widgetFile "modifyAvatar")
|
||||||
Nothing -> do
|
Nothing -> do
|
||||||
setMessageI MsgAvatarUnknown
|
setMessageI MsgAvatarUnknown
|
||||||
|
|
|
@ -21,12 +21,13 @@ import Text.Shakespeare.Text
|
||||||
|
|
||||||
getBuyR :: UserId -> BeverageId -> Handler Html
|
getBuyR :: UserId -> BeverageId -> Handler Html
|
||||||
getBuyR uId bId = do
|
getBuyR uId bId = do
|
||||||
(_, bev) <- checkData uId bId
|
(user, bev) <- checkData uId bId
|
||||||
master <- getYesod
|
master <- getYesod
|
||||||
(buyWidget, enctype) <- generateFormPost
|
(buyWidget, enctype) <- generateFormPost
|
||||||
$ renderBootstrap3 BootstrapBasicForm
|
$ renderBootstrap3 BootstrapBasicForm
|
||||||
$ buyForm
|
$ buyForm
|
||||||
defaultLayout $
|
defaultLayout $ do
|
||||||
|
setTitleI (MsgPurchaseOf (beverageIdent bev))
|
||||||
$(widgetFile "buy")
|
$(widgetFile "buy")
|
||||||
|
|
||||||
postBuyR :: UserId -> BeverageId -> Handler Html
|
postBuyR :: UserId -> BeverageId -> Handler Html
|
||||||
|
@ -105,7 +106,8 @@ getBuyCashR bId = do
|
||||||
(buyCashWidget, enctype) <- generateFormPost
|
(buyCashWidget, enctype) <- generateFormPost
|
||||||
$ renderBootstrap3 BootstrapBasicForm
|
$ renderBootstrap3 BootstrapBasicForm
|
||||||
$ buyForm
|
$ buyForm
|
||||||
defaultLayout $
|
defaultLayout $ do
|
||||||
|
setTitleI (MsgPurchaseOf (beverageIdent bev))
|
||||||
$(widgetFile "buyCash")
|
$(widgetFile "buyCash")
|
||||||
Nothing -> do
|
Nothing -> do
|
||||||
setMessageI MsgItemUnknown
|
setMessageI MsgItemUnknown
|
||||||
|
|
|
@ -22,7 +22,8 @@ getCashCheckR :: Handler Html
|
||||||
getCashCheckR = do
|
getCashCheckR = do
|
||||||
(cashCheckWidget, enctype) <- generateFormPost
|
(cashCheckWidget, enctype) <- generateFormPost
|
||||||
$ renderBootstrap3 BootstrapBasicForm createCashCheckForm
|
$ renderBootstrap3 BootstrapBasicForm createCashCheckForm
|
||||||
defaultLayout $
|
defaultLayout $ do
|
||||||
|
setTitleI MsgCashCheck
|
||||||
$(widgetFile "cashCheck")
|
$(widgetFile "cashCheck")
|
||||||
|
|
||||||
postCashCheckR :: Handler Html
|
postCashCheckR :: Handler Html
|
||||||
|
|
|
@ -35,6 +35,7 @@ getHomeR = do
|
||||||
ousers <- 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
|
||||||
|
setTitleI MsgMainPage
|
||||||
$(widgetFile "home")
|
$(widgetFile "home")
|
||||||
|
|
||||||
getReactivateR :: Handler Html
|
getReactivateR :: Handler Html
|
||||||
|
@ -43,6 +44,7 @@ getReactivateR = do
|
||||||
users <- runDB $ selectList [UserTimestamp <. addDays (-30) today] [Asc UserIdent]
|
users <- runDB $ selectList [UserTimestamp <. addDays (-30) today] [Asc UserIdent]
|
||||||
defaultLayout $ do
|
defaultLayout $ do
|
||||||
addScript $ StaticR js_barcode_js
|
addScript $ StaticR js_barcode_js
|
||||||
|
setTitleI MsgUserReactivate
|
||||||
$(widgetFile "reactivate")
|
$(widgetFile "reactivate")
|
||||||
|
|
||||||
getUserReactivateR :: UserId -> Handler Html
|
getUserReactivateR :: UserId -> Handler Html
|
||||||
|
|
|
@ -32,7 +32,8 @@ getJournalR = do
|
||||||
cashChecks <- runDB $ selectList [CashCheckTime >=. timeLimit] [Asc CashCheckId]
|
cashChecks <- runDB $ selectList [CashCheckTime >=. timeLimit] [Asc CashCheckId]
|
||||||
let list = merge entries cashChecks
|
let list = merge entries cashChecks
|
||||||
cashBalance <- getCashierBalance
|
cashBalance <- getCashierBalance
|
||||||
defaultLayout $
|
defaultLayout $ do
|
||||||
|
setTitleI MsgJournal
|
||||||
$(widgetFile "journal")
|
$(widgetFile "journal")
|
||||||
|
|
||||||
merge :: [Entity Transaction] -> [Entity CashCheck] -> [Either Transaction CashCheck]
|
merge :: [Entity Transaction] -> [Entity CashCheck] -> [Either Transaction CashCheck]
|
||||||
|
@ -57,5 +58,6 @@ getJournalPageR p = do
|
||||||
else return $ transactionTime $ entityVal $ L.last entries
|
else return $ transactionTime $ entityVal $ L.last entries
|
||||||
cashChecks <- runDB $ selectList [CashCheckTime >=. lTimeLimit, CashCheckTime <. uTimeLimit] [Asc CashCheckId]
|
cashChecks <- runDB $ selectList [CashCheckTime >=. lTimeLimit, CashCheckTime <. uTimeLimit] [Asc CashCheckId]
|
||||||
let list = merge entries cashChecks
|
let list = merge entries cashChecks
|
||||||
defaultLayout $
|
defaultLayout $ do
|
||||||
|
setTitleI MsgJournal
|
||||||
$(widgetFile "journalPage")
|
$(widgetFile "journalPage")
|
||||||
|
|
|
@ -28,7 +28,8 @@ getModifyR bId =
|
||||||
(modifyWidget, enctype) <- generateFormPost
|
(modifyWidget, enctype) <- generateFormPost
|
||||||
$ renderBootstrap3 BootstrapBasicForm
|
$ renderBootstrap3 BootstrapBasicForm
|
||||||
$ modifyForm (Just bev) bs
|
$ modifyForm (Just bev) bs
|
||||||
defaultLayout $
|
defaultLayout $ do
|
||||||
|
setTitleI (MsgModifyBeverage (beverageIdent bev))
|
||||||
$(widgetFile "modify")
|
$(widgetFile "modify")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,8 @@ getNewUserR = do
|
||||||
(newUserWidget, enctype) <- generateFormPost
|
(newUserWidget, enctype) <- generateFormPost
|
||||||
$ renderBootstrap3 BootstrapBasicForm
|
$ renderBootstrap3 BootstrapBasicForm
|
||||||
$ newUserForm today
|
$ newUserForm today
|
||||||
defaultLayout $
|
defaultLayout $ do
|
||||||
|
setTitleI MsgNewUser
|
||||||
$(widgetFile "newUser")
|
$(widgetFile "newUser")
|
||||||
|
|
||||||
postNewUserR :: Handler Html
|
postNewUserR :: Handler Html
|
||||||
|
@ -92,7 +93,8 @@ getModifyUserR uId =
|
||||||
(modifyUserWidget, enctype) <- generateFormPost
|
(modifyUserWidget, enctype) <- generateFormPost
|
||||||
$ renderBootstrap3 BootstrapBasicForm
|
$ renderBootstrap3 BootstrapBasicForm
|
||||||
$ modifyUserForm user bs
|
$ modifyUserForm user bs
|
||||||
defaultLayout $
|
defaultLayout $ do
|
||||||
|
setTitleI (ModifyUser (userIdent user))
|
||||||
$(widgetFile "modifyUser")
|
$(widgetFile "modifyUser")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,8 @@ getPayoutR :: Handler Html
|
||||||
getPayoutR = do
|
getPayoutR = do
|
||||||
(payoutWidget, enctype) <- generateFormPost
|
(payoutWidget, enctype) <- generateFormPost
|
||||||
$ renderBootstrap3 BootstrapBasicForm payoutForm
|
$ renderBootstrap3 BootstrapBasicForm payoutForm
|
||||||
defaultLayout $
|
defaultLayout $ do
|
||||||
|
setTitleI MsgPayoutFromCash
|
||||||
$(widgetFile "payout")
|
$(widgetFile "payout")
|
||||||
|
|
||||||
postPayoutR :: Handler Html
|
postPayoutR :: Handler Html
|
||||||
|
|
|
@ -23,7 +23,8 @@ import Data.Maybe (fromJust)
|
||||||
getRestockR :: Handler Html
|
getRestockR :: Handler Html
|
||||||
getRestockR = do
|
getRestockR = do
|
||||||
beverages <- runDB $ selectList [] [Asc BeverageIdent]
|
beverages <- runDB $ selectList [] [Asc BeverageIdent]
|
||||||
defaultLayout $
|
defaultLayout $ do
|
||||||
|
setTitleI MsgRestock
|
||||||
$(widgetFile "restock")
|
$(widgetFile "restock")
|
||||||
|
|
||||||
getUpstockR :: BeverageId -> Handler Html
|
getUpstockR :: BeverageId -> Handler Html
|
||||||
|
@ -31,7 +32,8 @@ getUpstockR bId =
|
||||||
isBeverage bId RestockR >>= (\bev -> do
|
isBeverage bId RestockR >>= (\bev -> do
|
||||||
(upstockWidget, enctype) <- generateFormPost
|
(upstockWidget, enctype) <- generateFormPost
|
||||||
$ renderBootstrap3 BootstrapBasicForm upstockForm
|
$ renderBootstrap3 BootstrapBasicForm upstockForm
|
||||||
defaultLayout $
|
defaultLayout $ do
|
||||||
|
setTitleI (MsgStockUp (beverageIdent bev))
|
||||||
$(widgetFile "upstock")
|
$(widgetFile "upstock")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ getSelectR uId =
|
||||||
beverages <- runDB $ selectList [BeverageAmount >. 0] [Asc BeverageIdent]
|
beverages <- runDB $ selectList [BeverageAmount >. 0] [Asc BeverageIdent]
|
||||||
defaultLayout $ do
|
defaultLayout $ do
|
||||||
addScript $ StaticR js_barcode_js
|
addScript $ StaticR js_barcode_js
|
||||||
|
setTitleI MsgSelectItem
|
||||||
$(widgetFile "select")
|
$(widgetFile "select")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -35,6 +36,7 @@ getSelectCashR = do
|
||||||
beverages <- runDB $ selectList [BeverageAmount >. 0] [Asc BeverageIdent]
|
beverages <- runDB $ selectList [BeverageAmount >. 0] [Asc BeverageIdent]
|
||||||
defaultLayout $ do
|
defaultLayout $ do
|
||||||
addScript $ StaticR js_barcode_js
|
addScript $ StaticR js_barcode_js
|
||||||
|
setTitleI MsgSelectItem
|
||||||
$(widgetFile "selectCash")
|
$(widgetFile "selectCash")
|
||||||
|
|
||||||
getRechargeR :: UserId -> Handler Html
|
getRechargeR :: UserId -> Handler Html
|
||||||
|
@ -43,7 +45,8 @@ getRechargeR uId =
|
||||||
(rechargeWidget, enctype) <- generateFormPost
|
(rechargeWidget, enctype) <- generateFormPost
|
||||||
$ renderBootstrap3 BootstrapBasicForm rechargeForm
|
$ renderBootstrap3 BootstrapBasicForm rechargeForm
|
||||||
currency <- appCurrency <$> appSettings <$> getYesod
|
currency <- appCurrency <$> appSettings <$> getYesod
|
||||||
defaultLayout $
|
defaultLayout $ do
|
||||||
|
setTitleI MsgRecharge
|
||||||
$(widgetFile "recharge")
|
$(widgetFile "recharge")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,8 @@ getSummaryR :: Handler Html
|
||||||
getSummaryR = do
|
getSummaryR = do
|
||||||
master <- getYesod
|
master <- getYesod
|
||||||
bevs <- runDB $ selectList [] [Asc BeverageIdent]
|
bevs <- runDB $ selectList [] [Asc BeverageIdent]
|
||||||
defaultLayout $
|
defaultLayout $ do
|
||||||
|
setTitleI MsgSummary
|
||||||
$(widgetFile "summary")
|
$(widgetFile "summary")
|
||||||
|
|
||||||
getSummaryJsonR :: Handler RepJson
|
getSummaryJsonR :: Handler RepJson
|
||||||
|
|
|
@ -7,7 +7,8 @@ import Data.Maybe
|
||||||
getSupplierR :: Handler Html
|
getSupplierR :: Handler Html
|
||||||
getSupplierR = do
|
getSupplierR = do
|
||||||
sups <- runDB $ selectList [] [Asc SupplierIdent]
|
sups <- runDB $ selectList [] [Asc SupplierIdent]
|
||||||
defaultLayout $
|
defaultLayout $ do
|
||||||
|
setTitleI MsgSuppliers
|
||||||
$(widgetFile "supplier")
|
$(widgetFile "supplier")
|
||||||
|
|
||||||
getNewSupplierR :: Handler Html
|
getNewSupplierR :: Handler Html
|
||||||
|
@ -15,6 +16,7 @@ getNewSupplierR = do
|
||||||
(newSupplierWidget, enctype) <- generateFormPost
|
(newSupplierWidget, enctype) <- generateFormPost
|
||||||
$ renderBootstrap3 BootstrapBasicForm newSupplierForm
|
$ renderBootstrap3 BootstrapBasicForm newSupplierForm
|
||||||
defaultLayout $
|
defaultLayout $
|
||||||
|
setTitleI MsgNewSupplier
|
||||||
$(widgetFile "newSupplier")
|
$(widgetFile "newSupplier")
|
||||||
|
|
||||||
postNewSupplierR :: Handler Html
|
postNewSupplierR :: Handler Html
|
||||||
|
@ -61,7 +63,8 @@ getModifySupplierR sId = do
|
||||||
(modifySupplierWidget, enctype) <- generateFormPost
|
(modifySupplierWidget, enctype) <- generateFormPost
|
||||||
$ renderBootstrap3 BootstrapBasicForm
|
$ renderBootstrap3 BootstrapBasicForm
|
||||||
$ modifySupplierForm sup
|
$ modifySupplierForm sup
|
||||||
defaultLayout $
|
defaultLayout $ do
|
||||||
|
setTitleI MsgEditSupplier
|
||||||
$(widgetFile "modifySupplier")
|
$(widgetFile "modifySupplier")
|
||||||
Nothing -> do
|
Nothing -> do
|
||||||
setMessageI MsgSupplierUnknown
|
setMessageI MsgSupplierUnknown
|
||||||
|
|
|
@ -10,7 +10,8 @@ getSupplierActionsR sId = do
|
||||||
mSup <- runDB $ get sId
|
mSup <- runDB $ get sId
|
||||||
case mSup of
|
case mSup of
|
||||||
Just sup ->
|
Just sup ->
|
||||||
defaultLayout $
|
defaultLayout $ do
|
||||||
|
setTitleI (MsgSupplieractions (supplierIdent sup))
|
||||||
$(widgetFile "supplierActions")
|
$(widgetFile "supplierActions")
|
||||||
Nothing -> do
|
Nothing -> do
|
||||||
setMessageI MsgSupplierUnknown
|
setMessageI MsgSupplierUnknown
|
||||||
|
|
|
@ -24,7 +24,8 @@ getTransferSelectR :: UserId -> Handler Html
|
||||||
getTransferSelectR from =
|
getTransferSelectR from =
|
||||||
isUser from HomeR >>= (\_ -> do
|
isUser from HomeR >>= (\_ -> do
|
||||||
users <- runDB $ selectList [UserId !=. from] [Asc UserIdent]
|
users <- runDB $ selectList [UserId !=. from] [Asc UserIdent]
|
||||||
defaultLayout $
|
defaultLayout $ do
|
||||||
|
setTitleI MsgTransfer
|
||||||
$(widgetFile "transferSelect")
|
$(widgetFile "transferSelect")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -36,6 +37,7 @@ getTransferR from to =
|
||||||
$ renderBootstrap3 BootstrapBasicForm transferForm
|
$ renderBootstrap3 BootstrapBasicForm transferForm
|
||||||
currency <- appCurrency <$> appSettings <$> getYesod
|
currency <- appCurrency <$> appSettings <$> getYesod
|
||||||
defaultLayout $ do
|
defaultLayout $ do
|
||||||
|
setTitleI MsgTransfer
|
||||||
$(widgetFile "transfer")
|
$(widgetFile "transfer")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -147,3 +147,7 @@ Login: Přihlásit
|
||||||
Logout: Odhlásit
|
Logout: Odhlásit
|
||||||
CreationBlocked: Nelze vytvořit nové uživatele.
|
CreationBlocked: Nelze vytvořit nové uživatele.
|
||||||
NotEnoughFunds: Nedostatek kreditu
|
NotEnoughFunds: Nedostatek kreditu
|
||||||
|
MainPage: Hlavní stránka
|
||||||
|
ModifyBeverage ident@Text: Změnit zboží #{ident}
|
||||||
|
ModifyUser ident@Text: Změnit uživatele #{ident}
|
||||||
|
SupplierActions ident@Text: Akce pro dodavatele #{ident}
|
||||||
|
|
|
@ -109,7 +109,7 @@ BarcodeUnknown: Dieser Barcode ist unbekannt
|
||||||
BarcodeField: Barcodes
|
BarcodeField: Barcodes
|
||||||
BarcodeAdded: Barcode erfolgreich hinzugefügt
|
BarcodeAdded: Barcode erfolgreich hinzugefügt
|
||||||
BarcodeDuplicate: Dieser barcode wird schon verwendet
|
BarcodeDuplicate: Dieser barcode wird schon verwendet
|
||||||
Transfer: Transferieren
|
Transfer: Guthaben Transferieren
|
||||||
TransferTo: Guthaben transferieren an
|
TransferTo: Guthaben transferieren an
|
||||||
NegativeTransfer: Keine negativen Beträge transferieren
|
NegativeTransfer: Keine negativen Beträge transferieren
|
||||||
TransferComplete: Transfer abgeschlossen
|
TransferComplete: Transfer abgeschlossen
|
||||||
|
@ -147,3 +147,7 @@ Login: Login
|
||||||
Logout: Logout
|
Logout: Logout
|
||||||
CreationBlocked: Es können keine neuen Nutzer angelegt werden.
|
CreationBlocked: Es können keine neuen Nutzer angelegt werden.
|
||||||
NotEnoughFunds: Nicht genügen Guthaben
|
NotEnoughFunds: Nicht genügen Guthaben
|
||||||
|
MainPage: Hauptseite
|
||||||
|
ModifyBeverage ident@Text: Artikel #{ident} bearbeiten
|
||||||
|
ModifyUser ident@Text: Benutzer #{ident} bearbeiten
|
||||||
|
SupplierActions ident@Text: Aktionen für Lieferant #{ident}
|
||||||
|
|
|
@ -147,3 +147,7 @@ Login: Login
|
||||||
Logout: Logout
|
Logout: Logout
|
||||||
CreationBlocked: New users can not be created.
|
CreationBlocked: New users can not be created.
|
||||||
NotEnoughFunds: Not enough funds!
|
NotEnoughFunds: Not enough funds!
|
||||||
|
MainPage: Main page
|
||||||
|
ModifyBeverage ident@Text: Modify beverage #{ident}
|
||||||
|
ModifyUser ident@Text: Modify user #{ident}
|
||||||
|
SupplierActions ident@Text: Actions for supplier #{ident}
|
||||||
|
|
Loading…
Reference in a new issue