From 36a90770ebeb9bd99e136bfe035fdda5dfabc304 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 19 Jun 2016 21:18:56 +0200 Subject: Add a dialog to confirm income deletion --- src/server/Design/Global.hs | 18 ++++++++++++------ src/server/Model/Message/Key.hs | 7 ++++++- src/server/Model/Message/Translations.hs | 18 +++++++++++++++--- 3 files changed, 33 insertions(+), 10 deletions(-) (limited to 'src/server') diff --git a/src/server/Design/Global.hs b/src/server/Design/Global.hs index 68cff68..7d4a1bb 100644 --- a/src/server/Design/Global.hs +++ b/src/server/Design/Global.hs @@ -8,14 +8,16 @@ import Clay import Data.Text.Lazy (Text) -import qualified Design.Header as HeaderDesign -import qualified Design.SignIn as SignInDesign -import qualified Design.LoggedIn as LoggedInDesign +import qualified Design.Header as Header +import qualified Design.SignIn as SignIn +import qualified Design.LoggedIn as LoggedIn import qualified Design.Form as Form import Design.Animation.Keyframes import Design.Color as Color +import Design.Helper as Helper +import Design.Constants as Constants globalDesign :: Text globalDesign = renderWith compact [] global @@ -23,9 +25,9 @@ globalDesign = renderWith compact [] global global :: Css global = do - header ? HeaderDesign.design - ".signIn" ? SignInDesign.design - ".loggedIn" ? LoggedInDesign.design + header ? Header.design + ".signIn" ? SignIn.design + ".loggedIn" ? LoggedIn.design Form.design allKeyframes @@ -54,4 +56,8 @@ global = do "margin-left" -: "3vh" "margin-top" -: "2vh" + ".dialog" ? ".content" ? button ? do + ".confirm" & Helper.defaultButton Color.chestnutRose Color.white (px Constants.inputHeight) Constants.focusLighten + ".undo" & Helper.defaultButton Color.silver Color.white (px Constants.inputHeight) Constants.focusLighten + svg ? height (pct 100) diff --git a/src/server/Model/Message/Key.hs b/src/server/Model/Message/Key.hs index 27a93dd..1653ea7 100644 --- a/src/server/Model/Message/Key.hs +++ b/src/server/Model/Message/Key.hs @@ -83,7 +83,7 @@ data Key = | IncomeNotDeleted | Creation | Amount - | Delete + | ConfirmDelete -- Form @@ -94,6 +94,11 @@ data Key = | SmallerIntThan | GreaterIntThan + -- Dialog + + | Confirm + | Undo + -- Http error | Timeout diff --git a/src/server/Model/Message/Translations.hs b/src/server/Model/Message/Translations.hs index 55ef97b..8a640d1 100644 --- a/src/server/Model/Message/Translations.hs +++ b/src/server/Model/Message/Translations.hs @@ -319,10 +319,10 @@ m l Amount = English -> "Amount" French -> "Montant" -m l Delete = +m l ConfirmDelete = case l of - English -> "Delete" - French -> "Supprimer" + English -> "Are you sure to delete this income ?" + French -> "Voulez-vous vraiment supprimer ce revenu ?" -- Form error @@ -356,6 +356,18 @@ m l GreaterIntThan = English -> "Integer smaller than {1} required" French -> "Entier inférieur à {1} requis" +-- Dialog + +m l Confirm = + case l of + English -> "Confirm" + French -> "Confirmer" + +m l Undo = + case l of + English -> "Undo" + French -> "Annuler" + -- Http error m l Timeout = -- cgit v1.2.3