aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/View/Errors.elm
diff options
context:
space:
mode:
authorJoris2016-08-21 14:30:40 +0200
committerJoris2016-08-21 14:30:40 +0200
commit75804df1cb231033f94183e41cdf79d36d8f6710 (patch)
tree48b7932285091fdbdaba6d77586859c1e1750ce0 /src/client/elm/View/Errors.elm
parent3889d21ab58fbbc0134854b95013196a82e8d510 (diff)
downloadbudget-75804df1cb231033f94183e41cdf79d36d8f6710.tar.gz
budget-75804df1cb231033f94183e41cdf79d36d8f6710.tar.bz2
budget-75804df1cb231033f94183e41cdf79d36d8f6710.zip
Show a message if there is an error during a server request
Diffstat (limited to 'src/client/elm/View/Errors.elm')
-rw-r--r--src/client/elm/View/Errors.elm21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/client/elm/View/Errors.elm b/src/client/elm/View/Errors.elm
new file mode 100644
index 0000000..3e25c99
--- /dev/null
+++ b/src/client/elm/View/Errors.elm
@@ -0,0 +1,21 @@
+module View.Errors exposing
+ ( view
+ )
+
+import Html exposing (..)
+import Html.Attributes exposing (..)
+import Html.Events exposing (..)
+
+import Model.Translations exposing (Translations, getMessage)
+
+view : Translations -> List String -> Html msg
+view translations errors =
+ ul
+ [ class "errors" ]
+ ( List.map (errorView translations) errors)
+
+errorView : Translations -> String -> Html msg
+errorView translations error =
+ li
+ [ class "error" ]
+ [ text <| getMessage translations error ]