i18n support

This commit is contained in:
Astro 2015-04-10 00:40:58 +02:00
parent 1cc845215a
commit 0077e0b98a
30 changed files with 248 additions and 161 deletions

View file

@ -11,6 +11,32 @@ import Settings.StaticFiles
--snip
import qualified Data.Text as T
import Network.Wai as Wai
import Data.List (tail)
import Data.List.Split
import Text.Printf
prependZero :: Text -> Text
prependZero t0 = if T.null t1
then t1
else if T.head t1 == '.'
then '0' `T.cons` t1
else if "-." `T.isPrefixOf` t1
then "-0." `T.append` (T.drop 2 t1)
else t1
where t1 = T.dropWhile ((==) ' ') t0
formatFloat :: Double -> Text
formatFloat d = T.pack (t ++ c)
where
t = reverse (intercalate "." $ chunksOf 3 $ reverse $ fst sp)
c = "," ++ tail (snd sp)
sp = (break (== '.') (printf "%.2f" d))
-- T.pack . (splitEvery 3) . (printf "%,2f")
formatIntCurrency :: Int -> Text
formatIntCurrency x = formatFloat $ ((fromIntegral x) / 100)
-- | The foundation datatype for your application. This can be a good place to
-- keep settings and values requiring initialization before your application
@ -27,6 +53,13 @@ data App = App
instance HasHttpManager App where
getHttpManager = appHttpManager
mkMessage "App" "messages" "de"
renderMessage' e = do
m <- getYesod
l <- languages
return $ renderMessage m l e
-- This is where we define all of the routes in our application. For a full
-- explanation of the syntax, please see:
-- http://www.yesodweb.com/book/routing-and-handlers
@ -168,3 +201,4 @@ instance RenderMessage App FormMessage where
-- https://github.com/yesodweb/yesod/wiki/Sending-email
-- https://github.com/yesodweb/yesod/wiki/Serve-static-files-from-a-separate-domain
-- https://github.com/yesodweb/yesod/wiki/i18n-messages-in-the-scaffolding

View file

@ -16,7 +16,7 @@ getBuyR uId bId = do
defaultLayout $ do
$(widgetFile "buy")
Nothing -> do
setMessage "Benutzer oder Artikel unbekannt"
setMessageI MsgUserOrArticleUnknown
redirect $ HomeR
postBuyR :: UserId -> BeverageId -> Handler Html
@ -38,19 +38,19 @@ postBuyR uId bId = do
liftIO $ notifyUser user bev price master
case sw of
False -> do
setMessage "Viel Vergnügen"
setMessageI MsgPurchaseSuccess
redirect $ HomeR
True -> do
setMessage "Achtung: Guthaben im negativen Bereich"
setMessageI MsgPurchaseDebtful
redirect $ HomeR
True -> do
setMessage "So viele Artikel sind nicht vorhanden"
setMessageI MsgNotEnoughItems
redirect $ BuyR uId bId
_ -> do
setMessage "Etwas ist schief gelaufen"
setMessageI MsgErrorOccured
redirect $ HomeR
Nothing -> do
setMessage "Benutzer oder Artikel unbekannt"
setMessageI MsgUserUnknown
redirect $ HomeR
notifyUser :: User -> Beverage -> Int -> App -> IO ()
@ -84,7 +84,7 @@ getBuyCashR bId = do
defaultLayout $ do
$(widgetFile "buyCash")
Nothing -> do
setMessage "Getrank unbekannt"
setMessageI MsgItemUnknown
redirect $ HomeR
postBuyCashR :: BeverageId -> Handler Html
@ -102,20 +102,17 @@ postBuyCashR bId = do
runDB $ update bId [BeverageAmount -=. quant]
updateCashier price "Barzahlung"
checkAlert bId
setMessage $ Content $ Text $ "Viel Vergnügen. Bitte Zahle "
`T.append` (formatIntCurrency price)
`T.append` " "
`T.append` (appCurrency $ appSettings master)
`T.append` " in die Kasse ein"
redirect $ HomeR
let currency = appCurrency $ appSettings master
setMessageI $ MsgPurchaseSuccessCash price currency
redirect HomeR
True -> do
setMessage "So viele Artikel sind nicht vorhanden"
setMessageI MsgNotEnoughItems
redirect $ BuyCashR bId
_ -> do
setMessage "Etwas ist schief gelaufen"
setMessageI MsgItemDisappeared
redirect $ HomeR
Nothing -> do
setMessage "Artikel unbekannt"
setMessageI MsgItemUnknown
redirect $ HomeR
checkData :: UserId -> BeverageId -> Handler (Maybe (User, Beverage))
@ -131,4 +128,4 @@ checkData uId bId = do
buyForm :: Form Int
buyForm = renderDivs
$ areq amountField "Anzahl" (Just 1)
$ areq amountField (fieldSettingsLabel MsgAmount) (Just 1)

View file

@ -15,13 +15,13 @@ postCashCheckR = do
case res of
FormSuccess c -> do
runDB $ insert_ c
setMessage "Kassensturz durchgeführt. Kasse aktualisiert"
setMessageI MsgCashChecked
redirect $ HomeR
_ -> do
setMessage "Fehler im Kassensturz"
setMessageI MsgCashCheckError
redirect $ CashCheckR
createCashierForm :: Form Cashier
createCashierForm = renderDivs $ Cashier
<$> areq currencyField "Gezählter Betrag" Nothing
<$> areq currencyField (fieldSettingsLabel MsgCountedValue) Nothing
<*> lift (liftIO getCurrentTime)

View file

@ -5,12 +5,9 @@ import Data.FileEmbed (embedFile)
import qualified Data.Text as T
import qualified Data.Text.Lazy.Encoding as E
import qualified Data.Text.Read as R
import Data.List (tail)
import Data.List.Split
import Yesod.Form.Functions
import Text.Shakespeare.Text
import Network.Mail.Mime
import Text.Printf
import Import
-- These handlers embed files in the executable at compile time to avoid a
@ -113,25 +110,3 @@ sendMail to subject body =
, partContent = E.encodeUtf8 body
}]]
}
prependZero :: Text -> Text
prependZero t0 = if T.null t1
then t1
else if T.head t1 == '.'
then '0' `T.cons` t1
else if "-." `T.isPrefixOf` t1
then "-0." `T.append` (T.drop 2 t1)
else t1
where t1 = T.dropWhile ((==) ' ') t0
formatFloat :: Double -> Text
formatFloat d = T.pack (t ++ c)
where
t = reverse (intercalate "." $ chunksOf 3 $ reverse $ fst sp)
c = "," ++ tail (snd sp)
sp = (break (== '.') (printf "%.2f" d))
-- T.pack . (splitEvery 3) . (printf "%,2f")
formatIntCurrency :: Int -> Text
formatIntCurrency x = formatFloat $ ((fromIntegral x) / 100)

View file

@ -39,8 +39,8 @@ getUserReactivateR uId = do
time <- liftIO getCurrentTime
secs <- return $ R.read $ formatTime defaultTimeLocale "%s" time
runDB $ update uId [UserTimestamp =. secs]
setMessage "Nutzer reaktiviert"
setMessageI MsgUserReactivated
redirect $ HomeR
Nothing -> do
setMessage "Nutzer unbekannt"
setMessageI MsgUserUnknown
redirect $ HomeR

View file

@ -12,7 +12,7 @@ getModifyR bId = do
defaultLayout $ do
$(widgetFile "modify")
Nothing -> do
setMessage "Artikel unbekannt"
setMessageI MsgItemUnknown
redirect $ SummaryR
postModifyR :: BeverageId -> Handler Html
@ -29,21 +29,21 @@ postModifyR bId = do
, BeverageAmount =. beverageAmount nBev
, BeverageAlertAmount =. beverageAlertAmount nBev
]
setMessage "Bearbeitung erfolgreich"
setMessageI MsgEditSuccess
redirect $ SummaryR
_ -> do
setMessage "Bearbeitung nicht möglich"
setMessageI MsgEditFail
redirect $ SummaryR
Nothing -> do
setMessage "Artikel unbekannt"
setMessageI MsgItemUnknown
redirect $ SummaryR
modifyForm :: Beverage -> Form Beverage
modifyForm bev = renderDivs $ Beverage
<$> areq textField "Name" (Just $ beverageIdent bev)
<*> areq currencyField "Preis" (Just $ beveragePrice bev)
<*> areq amountField "aktueller Bestand" (Just $ beverageAmount bev)
<*> areq amountField "Meldebestand" (Just $ beverageAlertAmount bev)
<$> areq textField (fieldSettingsLabel MsgName) (Just $ beverageIdent bev)
<*> areq currencyField (fieldSettingsLabel MsgPrice) (Just $ beveragePrice bev)
<*> areq amountField (fieldSettingsLabel MsgCurrentStock) (Just $ beverageAmount bev)
<*> areq amountField (fieldSettingsLabel MsgAnnouncedStock) (Just $ beverageAlertAmount bev)
getDeleteBeverageR :: BeverageId -> Handler Html
getDeleteBeverageR bId = do
@ -51,8 +51,8 @@ getDeleteBeverageR bId = do
case mBev of
Just bev -> do
runDB $ delete bId
setMessage "Artikel gelöscht"
setMessageI MsgItemDeleted
redirect $ HomeR
Nothing -> do
setMessage "Artikel unbekannt"
setMessageI MsgItemUnknown
redirect $ HomeR

View file

@ -21,19 +21,19 @@ postNewUserR = do
case res of
FormSuccess user -> do
_ <- runDB $ insert user
setMessage "Benutzer angelegt"
setMessageI MsgUserCreated
redirect $ HomeR
_ -> do
setMessage "Benutzer konnte nicht angelegt werden"
setMessageI MsgUserNotCreated
redirect $ NewUserR
newUserForm :: Int -> Form User
newUserForm secs = renderDivs $ User
<$> areq textField "Nickname" Nothing
<$> areq textField (fieldSettingsLabel MsgName) Nothing
<*> pure 0
<*> pure secs
<*> aopt emailField "E-mail" Nothing
<*> areq boolField "Benachrichtigung bei Kauf" (Just False)
<*> aopt emailField (fieldSettingsLabel MsgEmail) Nothing
<*> areq boolField (fieldSettingsLabel MsgBuyNotification) (Just False)
data UserConf = UserConf
{ userConfEmail :: Maybe Text
@ -49,7 +49,7 @@ getModifyUserR uId = do
defaultLayout $ do
$(widgetFile "modifyUser")
Nothing -> do
setMessage "Benutzer unbekannt"
setMessageI MsgUserUnknown
redirect $ HomeR
postModifyUserR :: UserId -> Handler Html
@ -65,19 +65,19 @@ postModifyUserR uId = do
, UserNotify =. userConfNotify conf
]
liftIO $ notify user conf
setMessage "Nutzerdaten aktualisiert"
setMessageI MsgUserEdited
redirect $ SelectR uId
_ -> do
setMessage "Nutzerdatenaktualisierung nicht erfolgreich"
setMessageI MsgUserNotEdited
redirect $ SelectR uId
Nothing -> do
setMessage "Nutzer unbekannt"
setMessageI MsgUserUnknown
redirect $ HomeR
modifyUserForm :: User -> Form UserConf
modifyUserForm user = renderDivs $ UserConf
<$> aopt emailField "E-Mail" (Just $ userEmail user)
<*> areq boolField "Benachrichtigung bei Kauf" (Just $ userNotify user)
<$> aopt emailField (fieldSettingsLabel MsgEmail) (Just $ userEmail user)
<*> areq boolField (fieldSettingsLabel MsgBuyNotification) (Just $ userNotify user)
notify :: User -> UserConf -> IO ()
notify user conf

View file

@ -20,14 +20,15 @@ postPayoutR = do
((res, _), _) <- runFormPost payoutForm
case res of
FormSuccess payment -> do
updateCashier (- (paymentAmount payment)) ("Auszahlung: " `T.append` paymentDesc payment)
setMessage "Betrag ausgezahlt"
msg <- renderMessage' $ MsgPayout $ paymentDesc payment
updateCashier (- (paymentAmount payment)) msg
setMessageI MsgPaidOut
redirect $ HomeR
_ -> do
setMessage "Auszahlung nicht möglich"
setMessageI MsgNotPaidOut
redirect $ JournalR
payoutForm :: Form Payment
payoutForm = renderDivs $ Payment
<$> areq currencyField "Betrag" Nothing
<*> areq textField "Beschreibung" Nothing
<$> areq currencyField (fieldSettingsLabel MsgValue) Nothing
<*> areq textField (fieldSettingsLabel MsgDescription) Nothing

View file

@ -18,7 +18,7 @@ getUpstockR bId = do
defaultLayout $ do
$(widgetFile "upstock")
Nothing -> do
setMessage "Artikel unbekannt"
setMessageI MsgItemUnknown
redirect $ HomeR
postUpstockR :: BeverageId -> Handler Html
@ -32,21 +32,21 @@ postUpstockR bId = do
case c > 0 of
True -> do
runDB $ update bId [BeverageAmount +=. c]
setMessage "Bestand aufgefüllt"
setMessageI MsgStockedUp
redirect $ HomeR
False -> do
setMessage "Bestand kann nicht negativ aufgefüllt werden"
setMessageI MsgNotStockedUp
redirect $ UpstockR bId
_ -> do
setMessage "Fehler beim Auffüllen"
setMessageI MsgStockupError
redirect $ UpstockR bId
Nothing -> do
setMessage "Artikel unbekannt"
setMessageI MsgItemUnknown
redirect $ HomeR
upstockForm :: Form Int
upstockForm = renderDivs
$ areq amountField "Anzahl hinzugefügt" (Just 0)
$ areq amountField (fieldSettingsLabel MsgAmountAdded) (Just 0)
getNewArticleR :: Handler Html
getNewArticleR = do
@ -60,15 +60,15 @@ postNewArticleR = do
case result of
FormSuccess bev -> do
runDB $ insert_ bev
setMessage "Neuer Artikel hinzugefügt"
setMessageI MsgItemAdded
redirect $ HomeR
_ -> do
setMessage "Fehler beim Hinzufügen"
setMessageI MsgItemNotAdded
redirect $ HomeR
newArticleForm :: Form Beverage
newArticleForm = renderDivs $ Beverage
<$> areq textField "Name" Nothing
<*> areq currencyField "Preis" (Just 100)
<*> areq amountField "Anzahl Elemente" (Just 0)
<*> areq amountField "Warnung bei Anzahl" (Just 0)
<$> areq textField (fieldSettingsLabel MsgName) Nothing
<*> areq currencyField (fieldSettingsLabel MsgPrice) (Just 100)
<*> areq amountField (fieldSettingsLabel MsgAmount) (Just 0)
<*> areq amountField (fieldSettingsLabel MsgAmountWarning) (Just 0)

View file

@ -15,7 +15,7 @@ getSelectR uId = do
defaultLayout $ do
$(widgetFile "select")
Nothing -> do
setMessage "Benutzer unbekannt"
setMessageI MsgUserUnknown
redirect $ HomeR
getSelectCashR :: Handler Html
@ -30,10 +30,11 @@ getRechargeR uId = do
case mUser of
Just user -> do
(rechargeWidget, enctype) <- generateFormPost rechargeForm
currency <- appCurrency <$> appSettings <$> getYesod
defaultLayout $ do
$(widgetFile "recharge")
Nothing -> do
setMessage "Benutzer unbekannt"
setMessageI MsgUserUnknown
redirect $ HomeR
postRechargeR :: UserId -> Handler Html
@ -48,15 +49,15 @@ postRechargeR uId = do
time <- liftIO getCurrentTime
secs <- return $ R.read $ formatTime defaultTimeLocale "%s" time
runDB $ update uId [UserBalance +=. amount, UserTimestamp =. secs]
setMessage "Guthaben erfolgreich aufgeladen"
setMessageI MsgRecharged
redirect $ HomeR
_ -> do
setMessage "Fehler beim Aufladen"
setMessageI MsgRechargeError
redirect $ HomeR
Nothing -> do
setMessage "Benutzer unbekannt"
setMessageI MsgUserUnknown
redirect $ HomeR
rechargeForm :: Form Int
rechargeForm = renderDivs
$ areq currencyField "Betrag" (Just 0)
$ areq currencyField (fieldSettingsLabel MsgValue) (Just 0)

75
messages/de.msg Normal file
View file

@ -0,0 +1,75 @@
UserReactivated: Nutzer reaktiviert
UserUnknown: Nutzer unbekannt
UserOrArticleUnknown: Benutzer oder Artikel unbekannt
PurchaseSuccess: Viel Vergnügen
PurchaseDebtful: Achtung: Guthaben im negativen Bereich
NotEnoughItems: So viele Artikel sind nicht vorhanden
ErrorOccured: Etwas ist schief gelaufen
ItemUnknown: Artikel unbekannt
PurchaseSuccessCash price@Int currency@Text: Viel Vergnügen. Bitte Zahle #{formatIntCurrency price} #{currency} in die Kasse ein
ItemDisappeared: Artikel ist verschwunden o_0
Amount: Anzahl
EditSuccess: Bearbeitung erfolgreich
EditFail: Bearbeitung nicht möglich
Name: Name
Price: Preis
CurrentStock: Aktueller Bestand
AnnouncedStock: Meldebestand
DeleteItem: Artikel löschen
ItemDeleted: Artikel gelöscht
UserCreated: Benutzer angelegt
UserNotCreated: Benutzer konnte nicht angelegt werden
Email: E-Mail
BuyNotification: Benachrichtigung bei Kauf
UserEdited: Nutzerdaten aktualisiert
UserNotEdited: Nutzerdatenaktualisierung nicht erfolgreich
Payout desc@Text: Auszahlung: #{desc}
PaidOut: Betrag ausgezahlt
NotPaidOut: Auszahlung nicht möglich
Value: Betrag
Description: Beschreibung
StockedUp: Bestand aufgefüllt
NotStockedUp: Bestand kann nicht negativ aufgefüllt werden
StockupError: Fehler beim Auffüllen
AmountAdded: Anzahl hinzugefügt
ItemAdded: Neuer Artikel hinzugefügt
ItemNotAdded: Fehler beim Hinzufügen
AmountWarning: Warnung bei Anzahl
Recharged: Guthaben erfolgreich aufgeladen
RechargeError: Fehler beim Aufladen
CashCheck: Kassensturz
CashChecked: Kassensturz durchgeführt. Kasse aktualisiert
CashCheckError: Fehler im Kassensturz
CountedValue: Gezählter Betrag
PurchaseOf name@Text: Kauf von #{name}
PricePerUnit price@Int currency@Text: Preis pro Einheit: #{formatIntCurrency price} #{currency}
Purchase: Kaufen
PleaseCountAndCheck: Bitte Kasse zählen und gezählten Betrag in unten stehendes Feld eintragen.
Submit: Absenden
Home: Nachhause
Restock: Lager befüllen
Journal: Journal
Summary: Inventar
PayCash: Bar bezahlen
CreateUser: Neuen Nutzer anlegen
ReactivateOldUser: Alten Nutzer reaktivieren
Time: Zeit
ValueIn currency@Text: Betrag in #{currency}
TotalValue: Gesamtbetrag
CashStock: Kassenbestand
PayoutFromCash: Aus der Kasse auszahlen
NothingToShow: Noch keine Bewegungen zu verzeichnen
NewItem: Neuer Artikel
NewUser: Neuer Benutzer
DoPayout: Auszahlen
ReactivateUser: Nutzer reaktivieren
Recharge: Guthaben aufladen
CurrentCharge charge@Int currency@Text: aktuelles Guthaben: #{formatIntCurrency charge} #{currency}
AddItem: neuen Artikel hinzufügen
EditUser: Nutzerdaten akutalisieren
ChoosePrompt text@Text: Wähle deinen Artikel, #{text}
SelectItem: Wähle deinen Artikel
CurrentAmount: Aktuelle Anzahl
NoItems: keine Getränke vorhanden
StockUp name@Text: Bestand von #{name} auffüllen
Fillup: Auffüllen

View file

@ -1,11 +1,11 @@
$doctype 5
<h3>Kauf von #{beverageIdent bev}
<h3>_{MsgPurchaseOf $ beverageIdent bev}
<p>
Preis pro Einheit: #{formatIntCurrency (beveragePrice bev)} #{appCurrency $ appSettings master}
_{MsgPricePerUnit (beveragePrice bev) (appCurrency $ appSettings master)}
<form method=post enctype=#{enctype}>
^{buyWidget}
<div>
<input type=submit value="Kaufen">
<input type=submit value="_{MsgPurchase}">

View file

@ -1,11 +1,11 @@
$doctype 5
<h3>Kauf von #{beverageIdent bev}
<h3>_{MsgPurchaseOf $ beverageIdent bev}
<p>
Preis pro Einheit: #{formatIntCurrency (beveragePrice bev + 50)} #{appCurrency $ appSettings master}
_{MsgPricePerUnit (beveragePrice bev + 50) (appCurrency $ appSettings master)}
<form method=post enctype=#{enctype}>
^{buyCashWidget}
<div>
<input type=submit value="Kaufen">
<input type=submit value="_{MsgPurchase}">

View file

@ -1,11 +1,12 @@
$doctype 5
<h3>Kassensturz
<h3>_{MsgCashCheck}
<p>
Bitte Kasse zählen und gezählten Betrag in unten stehendes Feld eintragen.
_{MsgPleaseCountAndCheck}
<form method=post enctype=#{enctype}>
^{cashCheckWidget}
<div>
<input type=submit value="Absenden">
<input type=submit value="_{MsgSubmit}">

View file

@ -23,21 +23,7 @@ $newline never
<script>
document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/,'js');
<body>
<div class="container">
<header>
<nav>
<ul>
<li>
<a href=@{HomeR}>Home
<div id="main" role="main">
^{pageBody pc}
<footer>
<span>
<a href=@{RestockR}>Lager befüllen
<span>
<a href=@{JournalR}>Journal
<span>
<a href=@{SummaryR}>Inventar
$maybe analytics <- appAnalytics $ appSettings master
<script>

View file

@ -1,3 +1,19 @@
$maybe msg <- mmsg
<div class="container">
<header>
<nav>
<ul>
<li>
<a href=@{HomeR}>_{MsgHome}
<div id="main" role="main">
$maybe msg <- mmsg
<div #message>#{msg}
^{widget}
^{widget}
<footer>
<span>
<a href=@{RestockR}>_{MsgRestock}
<span>
<a href=@{JournalR}>_{MsgJournal}
<span>
<a href=@{SummaryR}>_{MsgSummary}

View file

@ -5,11 +5,11 @@ $if null beverages
<article .article #func>
<a href=@{SelectCashR}>
<p>Bar bezahlen
<p>_{MsgPayCash}
<article .article #func>
<a href=@{NewUserR}>
<p>Neuen Nutzer anlegen
<p>_{MsgCreateUser}
$forall (Entity uId user) <- users
<article .article>
@ -18,4 +18,4 @@ $forall (Entity uId user) <- users
<article .article #func>
<a href=@{ReactivateR}>
<p>Alten Nutzer reaktivieren
<p>_{MsgReactivateOldUser}

View file

@ -6,9 +6,9 @@ $if not $ L.null entries
<table>
<thead>
<tr>
<th>Zeit
<th>Beschreibung
<th>Betrag in #{appCurrency $ appSettings master}
<th>_{MsgTime}
<th>_{MsgDescription}
<th>_{MsgValueIn $ appCurrency $ appSettings master}
$forall (eTransCash) <- list
$case eTransCash
$of Left trans
@ -19,21 +19,22 @@ $if not $ L.null entries
$of Right cash
<tr #check>
<td colspan="2">
Kassensturz vom #{formatTime defaultTimeLocale "%A %F %H:%M" $ cashierCreated cash}:
_{MsgCashCheckOf $ formatTime defaultTimeLocale "%A %F %H:%M" $ cashierCreated cash}:
<td>#{formatIntCurrency (cashierBalance cash)} #{appCurrency $ appSettings master}
<tfoot>
<tr>
<td colspan="2">Gesamtbetrag:
<td>#{formatIntCurrency total} #{appCurrency $ appSettings master}
<td colspan="2">_{MsgTotalValue}:
<td>#{formatIntCurrency (fromIntegral total)} #{appCurrency $ appSettings master}
<p>
Kassenbestand: #{formatIntCurrency (fromIntegral cashBalance)} #{appCurrency $ appSettings master}
_{MsgCashStock}: #{formatIntCurrency (fromIntegral cashBalance)} #{appCurrency $ appSettings master}
<ul>
<li>
<a href=@{PayoutR}>
Aus der Kasse auszahlen
_{MsgPayoutFromCash}
<li>
<a href=@{CashCheckR}>
Kassensturz
_{MsgCashCheck}
$else
<p>Noch keine Bewegungen zu verzeichnen
<p>_{MsgNothingToShow}

View file

@ -8,4 +8,4 @@ $doctype 5
<input type=submit value="Absenden">
<a href=@{ModifyR bId}>
Artikel löschen
_{MsgDeleteItem}

View file

@ -1,8 +1,8 @@
$doctype 5
<h3>Benutzer bearbeiten
<h3>_{MsgEditUser}
<form method=post enctype=#{enctype}>
^{modifyUserWidget}
<div>
<input type=submit value="Absenden">
<input type=submit value="_{MsgSubmit}">

View file

@ -1,8 +1,8 @@
$doctype 5
<h3>Neuer Artikel
<h3>_{MsgNewItem}
<form method=post enctype=#{enctype}>
^{newArticleWidget}
<div>
<input type=submit value="Absenden">
<input type=submit value="_{MsgSubmit}">

View file

@ -1,8 +1,8 @@
$doctype 5
<h3>Neuer Benutzer
<h3>_{MsgNewUser}
<form method=post enctype=#{enctype}>
^{newUserWidget}
<div>
<input type=submit value="Absenden">
<input type=submit value="_{MsgSubmit}">

View file

@ -1,10 +1,10 @@
$doctype 5
<h3>Auszahlung aus der Kasse
<h3>_{MsgPayoutFromCash}
<p>Bitte gewünschten Betrag angeben
<form method=post enctype='{enctype}>
<form method=post enctype=#{enctype}>
^{payoutWidget}
<div>
<input type=submit value="Auszahlen">
<input type=submit value="_{MsgDoPayout}">

View file

@ -1,6 +1,6 @@
$doctype 5
<h3>Nutzer reaktivieren
<h3>_{MsgReactivateUser}
$forall (Entity uId user) <- users
<article .article>

View file

@ -1,12 +1,12 @@
$doctype 5
<h3>
Guthaben aufladen
_{MsgRecharge}
<p>
aktuelles Guthaben: #{formatIntCurrency (userBalance user)}
_{MsgCurrentCharge (userBalance user) currency}
<form method=post enctype=#{enctype}>
^{rechargeWidget}
<div>
<input type=submit value="Aufladen">
<input type=submit value="_{MsgRecharge}">

View file

@ -1,7 +1,7 @@
$doctype 5
<h3>
Bestände wieder auffüllen
_{MsgRestock}
$forall (Entity bId bev) <- beverages
<article .article>
@ -12,4 +12,4 @@ $forall (Entity bId bev) <- beverages
<article .article #func>
<a href=@{NewArticleR}>
<p>
neuen Artikel hinzufügen
_{MsgAddItem}

View file

@ -3,15 +3,15 @@ $doctype 5
<div .header>
<ul>
<li>
aktuelles Guthaben: #{formatIntCurrency (userBalance user)} #{appCurrency $ appSettings master}
_{MsgCurrentCharge (userBalance user) (appCurrency $ appSettings master)}
<li>
<a href=@{RechargeR uId}>
Guthaben aufladen
_{MsgRecharge}
<li>
<a href=@{ModifyUserR uId}>
Nutzerdaten akutalisieren
_{MsgEditUser}
<h3>Wähle deinen Artikel, #{userIdent user}
<h3>_{MsgChoosePrompt $ userIdent user}
$if null beverages
<h1>

View file

@ -1,6 +1,6 @@
$doctype 5
<h3>Wähle deinen Artikel
<h3>_{MsgSelectItem}
$forall (Entity bId bev) <- beverages
<article .article>

View file

@ -1,15 +1,15 @@
$doctype 5
<h3>Übersicht
<h3>_{MsgSummary}
$if not $ L.null bevs
<table>
<thead>
<tr>
<th>Name
<th>aktuelle Anzahl
<th>Meldebestand
<th>Preis in #{appCurrency $ appSettings master}
<th>_{MsgName}
<th>_{MsgCurrentAmount}
<th>_{MsgAnnouncedStock}
<th>_{MsgValueIn $ appCurrency $ appSettings master}
<th>
$forall (Entity bId bev) <- bevs
<tr>
@ -19,4 +19,4 @@ $if not $ L.null bevs
<td>#{formatIntCurrency (beveragePrice bev)} #{appCurrency $ appSettings master}
<td><a href=@{ModifyR bId}>bearbeiten
$else
<p>keine Getränke vorhanden
<p>_{MsgNoItems}

View file

@ -1,11 +1,11 @@
$doctype 5
<h3>Bestand von #{beverageIdent bev} auffüllen
<h3>_{MsgStockUp $ beverageIdent bev}
<p>
Aktueller Bestand: #{beverageAmount bev}
_{MsgCurrentStock}: #{beverageAmount bev}
<form method=post enctype=#{enctype}>
^{upstockWidget}
<div>
<input type=submit value="Auffüllen">
<input type=submit value="_{MsgFillup}">