aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/LoggedIn/Income/View.elm
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/elm/LoggedIn/Income/View.elm')
-rw-r--r--src/client/elm/LoggedIn/Income/View.elm15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/client/elm/LoggedIn/Income/View.elm b/src/client/elm/LoggedIn/Income/View.elm
index d5863ab..7970284 100644
--- a/src/client/elm/LoggedIn/Income/View.elm
+++ b/src/client/elm/LoggedIn/Income/View.elm
@@ -14,6 +14,7 @@ import Html.Events exposing (..)
import Html.Attributes exposing (..)
import Html.App as Html
import Form exposing (Form)
+import Dialog
import Msg exposing (Msg)
@@ -23,6 +24,7 @@ import Model.Income exposing (IncomeId, Income, userCumulativeIncomeSince)
import Model.Translations exposing (getMessage, getParamMessage)
import Model.Payer exposing (useIncomesFrom)
import Model.User exposing (UserId, User)
+import Model.View as View
import LoggedIn.Income.Model as IncomeModel
import LoggedIn.Msg as LoggedInMsg
@@ -108,7 +110,14 @@ incomeView loggedData (incomeId, income) =
[ text <| renderShortDate (Date.fromTime income.time) loggedData.translations
, text " − "
, text <| Format.price loggedData.conf income.amount
- , button
- [ onClick (Msg.UpdateLoggedIn <| LoggedInMsg.DeleteIncome incomeId) ]
- [ FontAwesome.remove Color.chestnutRose 14 ]
+ , let dialogConfig =
+ { title = getMessage "ConfirmDelete" loggedData.translations
+ , body = always <| text ""
+ , confirm = getMessage "Confirm" loggedData.translations
+ , confirmMsg = Msg.UpdateLoggedIn <| LoggedInMsg.DeleteIncome incomeId
+ , undo = getMessage "Undo" loggedData.translations
+ }
+ in button
+ [ onClick (Msg.Dialog <| Dialog.Open dialogConfig) ]
+ [ FontAwesome.remove Color.chestnutRose 14 ]
]