diff options
author | Joris | 2017-03-26 23:16:28 +0200 |
---|---|---|
committer | Joris | 2017-03-27 00:17:41 +0200 |
commit | 902acfbdbcc1d59941399753e887479e586e2748 (patch) | |
tree | 0ad90ead3f8bdf0ea7c94462d1577c8e188df469 /src/server | |
parent | 8062f1c9c34e9b25d76b22bd6ba2a1a99666279b (diff) |
Improve form validation
- Trim names
- Income amount accepted from 0
- Validate colors
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/Model/Message/Key.hs | 2 | ||||
-rw-r--r-- | src/server/Model/Message/Translations.hs | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/server/Model/Message/Key.hs b/src/server/Model/Message/Key.hs index 79ccf39..efe8aaa 100644 --- a/src/server/Model/Message/Key.hs +++ b/src/server/Model/Message/Key.hs @@ -130,6 +130,8 @@ data Key = | CostMustNotBeNull | InvalidInt | InvalidCategory + | InvalidColor + | AlreadyExists | SmallerIntThan | GreaterIntThan diff --git a/src/server/Model/Message/Translations.hs b/src/server/Model/Message/Translations.hs index 16fc3fd..90f509a 100644 --- a/src/server/Model/Message/Translations.hs +++ b/src/server/Model/Message/Translations.hs @@ -350,7 +350,7 @@ m l Color = m l UsedCategory = case l of English -> "This category is currently being used" - French -> "Cette catégorie est utilisée actuellement" + French -> "Cette catégorie est actuellement utilisée" -- Statistics @@ -513,6 +513,16 @@ m l InvalidCategory = English -> "Invalid category" French -> "Catégorie invalide" +m l InvalidColor = + case l of + English -> "Invalid color" + French -> "Couleur invalide" + +m l AlreadyExists = + case l of + English -> "Dupplicate field" + French -> "Doublon" + m l SmallerIntThan = case l of English -> "Integer bigger than {1} or equal required" |