refactor(letter): i18n renewal letter templating
This commit is contained in:
parent
a6782d8637
commit
d078257a70
@ -133,7 +133,7 @@ MenuLmsUpload: Hochladen
|
||||
MenuLmsDirect: Direkter Upload
|
||||
|
||||
MenuAvs: Schnittstelle AVS
|
||||
MenuApc: Schnittstelle Druckerei
|
||||
MenuApc: Druckerei
|
||||
MenuPrintSend: Manueller Briefversand
|
||||
|
||||
MenuApiDocs: API-Dokumentation (Englisch)
|
||||
|
||||
@ -134,7 +134,7 @@ MenuLmsUpload: Upload
|
||||
MenuLmsDirect: Direct Upload
|
||||
|
||||
MenuAvs: AVS Interface
|
||||
MenuApc: Print Center Interface
|
||||
MenuApc: Printing
|
||||
MenuPrintSend: Send Letter
|
||||
|
||||
MenuApiDocs: API documentation
|
||||
|
||||
@ -286,8 +286,8 @@ getAdminTestPdfR = do
|
||||
now <- getCurrentTime
|
||||
return (now, letter_tp, din5008)
|
||||
case templates of
|
||||
(_,Left err,_) -> sendResponseStatus internalServerError500 $ tshow err
|
||||
(_,_,Left err) -> sendResponseStatus internalServerError500 $ tshow err
|
||||
(_,Left err,_) -> sendResponseStatus internalServerError500 $ "Markdown template error: \n" <> err
|
||||
(_,_,Left err) -> sendResponseStatus internalServerError500 $ "LaTeX template error: \n" <> err
|
||||
(now, Right templ, Right latex) -> do
|
||||
content <- liftIO . P.runIO $ do
|
||||
let texopts = []
|
||||
@ -305,5 +305,5 @@ getAdminTestPdfR = do
|
||||
Right (Right bs) -> do
|
||||
liftIO $ L.writeFile "/tmp/generated.pdf" bs
|
||||
sendByteStringAsFile "demoPDF.pdf" (L.toStrict bs) now
|
||||
Right (Left err) -> sendResponseStatus internalServerError500 $ tshow err
|
||||
Left err -> sendResponseStatus internalServerError500 $ P.renderError err
|
||||
Right (Left err) -> sendResponseStatus internalServerError500 $ decodeUtf8 $ L.toStrict $ "LaTeX compile error: \n" <> err
|
||||
Left err -> sendResponseStatus internalServerError500 $ "Pandoc error: \n" <> P.renderError err
|
||||
|
||||
@ -21,9 +21,7 @@ import qualified Control.Monad.State.Class as State
|
||||
import Handler.Utils
|
||||
|
||||
data MetaPinRenewal = MetaPinRenewal
|
||||
{ mppOpening :: Maybe Text
|
||||
, mppClosing :: Maybe Text
|
||||
, mppDate :: Maybe Text
|
||||
{ mppDate :: Maybe Text
|
||||
, mppURL :: Maybe Text
|
||||
, mppLogin :: Text
|
||||
, mppPin :: Text
|
||||
@ -35,9 +33,7 @@ data MetaPinRenewal = MetaPinRenewal
|
||||
|
||||
formToMetaValues :: MetaPinRenewal -> P.Meta
|
||||
formToMetaValues MetaPinRenewal{..} = P.Meta $ mconcat
|
||||
[ mbMeta "opening" mppOpening
|
||||
, mbMeta "closing" mppClosing
|
||||
, mbMeta "date" mppDate
|
||||
[ mbMeta "date" mppDate
|
||||
, mbMeta "url" mppURL
|
||||
, toMeta "login" mppLogin
|
||||
, toMeta "pin" mppPin
|
||||
@ -51,13 +47,10 @@ formToMetaValues MetaPinRenewal{..} = P.Meta $ mconcat
|
||||
html2textlines :: StoredMarkup -> [Text]
|
||||
html2textlines sm = T.lines . LT.toStrict $ markupInput sm
|
||||
|
||||
|
||||
makeRenewalForm :: Maybe MetaPinRenewal -> Form MetaPinRenewal
|
||||
makeRenewalForm tmpl = identifyForm FIDLmsLetter . validateForm validateMetaPinRenewal $ \html ->
|
||||
flip (renderAForm FormStandard) html $ MetaPinRenewal
|
||||
<$> aopt textField (fslI MsgMppOpening) (mppOpening <$> tmpl)
|
||||
<*> aopt textField (fslI MsgMppClosing) (mppClosing <$> tmpl)
|
||||
<*> aopt textField (fslI MsgMppDate) (mppDate <$> tmpl)
|
||||
<$> aopt textField (fslI MsgMppDate) (mppDate <$> tmpl)
|
||||
<*> aopt textField (fslI MsgMppURL) (mppURL <$> tmpl)
|
||||
<*> areq textField (fslI MsgMppLogin) (mppLogin <$> tmpl)
|
||||
<*> areq textField (fslI MsgMppPin) (mppPin <$> tmpl)
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
fromlogo=false, % don't show logo in letter head
|
||||
version=last, % latest version of KOMA letter
|
||||
pagenumber=botright, % show pagenumbers on bottom right
|
||||
firstfoot=true % first-page footer
|
||||
firstfoot=false % first-page footer
|
||||
]{scrlttr2}
|
||||
|
||||
\PassOptionsToPackage{hyphens}{url}
|
||||
@ -76,6 +76,7 @@ $endif$
|
||||
\usepackage{parskip}
|
||||
|
||||
\usepackage{graphics}
|
||||
\usepackage{xcolor}
|
||||
|
||||
\usepackage{booktabs}
|
||||
\usepackage{longtable}
|
||||
@ -123,16 +124,28 @@ $endif$
|
||||
$endfor$
|
||||
}
|
||||
|
||||
\opening{$opening$}
|
||||
$if(is-de)$
|
||||
\opening{$de-opening$}
|
||||
$else$
|
||||
\opening{$en-opening$}
|
||||
$endif$
|
||||
|
||||
\begin{textblock}{13}(15,45)
|
||||
$pin$
|
||||
\textcolor{gray}{
|
||||
\begin{labeling}{Login:x}
|
||||
\item[Login:] $login$
|
||||
\item[Pin:] $pin$
|
||||
\end{labeling}
|
||||
~}
|
||||
\end{textblock}
|
||||
|
||||
$body$
|
||||
|
||||
\vspace{1.2cm}
|
||||
\closing{$closing$}
|
||||
$if(is-de)$
|
||||
\closing{$de-closing$}
|
||||
$else$
|
||||
\closing{$en-closing$}
|
||||
$endif$
|
||||
|
||||
%\ps $postskriptum$
|
||||
|
||||
|
||||
@ -5,13 +5,18 @@ subject: Verlängerung Vorfeldführerschein
|
||||
author: Fraport AG - Fahrerausbildung (AVN-AR)
|
||||
phone: +49 69 690-30306
|
||||
email: fahrerausbildung@fraport.de
|
||||
url: <http://www.fraport.de/fahrerausbildung>
|
||||
place: Frankfurt/Main
|
||||
return-address:
|
||||
- 60547 Frankfurt
|
||||
opening: Sehr geehrte Damen und Herren,
|
||||
closing: |
|
||||
de-opening: Sehr geehrte Damen und Herren,
|
||||
en-opening: Dear driver,
|
||||
de-closing: |
|
||||
Mit freundlichen Grüßen,
|
||||
Ihre Fahrerausbildung.
|
||||
en-closing: |
|
||||
Best wishes,
|
||||
Your fraport driving instructors from "Fahrerausbildung".
|
||||
encludes:
|
||||
hyperrefoptions: hidelinks
|
||||
|
||||
@ -36,21 +41,13 @@ Durch die erfolgreiche Teilnahme an einem E-Lernen können Sie
|
||||
die Gültigkeit um 2 Jahre verlängern. Verwenden Sie dazu folgende
|
||||
Login-Daten.
|
||||
|
||||
URL
|
||||
|
||||
: <http://www.fraport.de/fahrerausbildung>
|
||||
|
||||
Name:
|
||||
Name
|
||||
|
||||
: $recipient$
|
||||
|
||||
Login
|
||||
URL
|
||||
|
||||
: $login$
|
||||
|
||||
Pin
|
||||
|
||||
: $pin$
|
||||
: $url$
|
||||
|
||||
|
||||
Sobald die Frist abgelaufen ist, muss zur Wiedererlangung des Vorfeldführerscheins
|
||||
@ -66,21 +63,13 @@ your apron diving licence is about to expire soon.
|
||||
You may renew your apron driving licence by two years through successfully
|
||||
completing an e-learning course. Please use the following login data.
|
||||
|
||||
URL
|
||||
|
||||
: <http://www.fraport.de/fahrerausbildung>
|
||||
|
||||
Name:
|
||||
Name
|
||||
|
||||
: $recipient$
|
||||
|
||||
Login
|
||||
URL
|
||||
|
||||
: $login$
|
||||
|
||||
Pin
|
||||
|
||||
: $pin$
|
||||
: $url$
|
||||
|
||||
|
||||
Should your apron driving licence expire before completing this
|
||||
|
||||
Reference in New Issue
Block a user