aboutsummaryrefslogtreecommitdiff
path: root/src/client/View
diff options
context:
space:
mode:
authorJoris2015-09-06 16:23:48 +0200
committerJoris2015-09-06 16:23:48 +0200
commit0b6f0fa29075178b45cb17d2932003ab4b342280 (patch)
tree8fcdf55131683978b5593a07078d8002df4540d9 /src/client/View
parent0ae7d068263dffbc1cc2dc92c7829dd0037c97e7 (diff)
Use buttons or links when elements are clickable
Diffstat (limited to 'src/client/View')
-rw-r--r--src/client/View/Payments/Add.elm11
-rw-r--r--src/client/View/Payments/Paging.elm12
2 files changed, 12 insertions, 11 deletions
diff --git a/src/client/View/Payments/Add.elm b/src/client/View/Payments/Add.elm
index deffb95..f352f1f 100644
--- a/src/client/View/Payments/Add.elm
+++ b/src/client/View/Payments/Add.elm
@@ -28,8 +28,7 @@ import Utils.Either exposing (toMaybeError)
addPayment : Model -> LoggedView -> Html
addPayment model loggedView =
H.form
- [ class "add"
- , case (validateName loggedView.add.name model.translations, validateCost loggedView.add.cost model.translations) of
+ [ case (validateName loggedView.add.name model.translations, validateCost loggedView.add.cost model.translations) of
(Ok name, Ok cost) ->
let action =
case loggedView.add.frequency of
@@ -43,7 +42,8 @@ addPayment model loggedView =
, addPaymentCost model loggedView.add
, paymentFrequency model loggedView.add
, button
- [ type' "submit" ]
+ [ type' "submit"
+ , class "add" ]
[ text (getMessage "Add" model.translations)]
]
@@ -91,8 +91,9 @@ addPaymentCost model addPayment =
paymentFrequency : Model -> AddPayment -> Html
paymentFrequency model addPayment =
- div
- [ class "frequency"
+ button
+ [ type' "button"
+ , class "frequency"
, onClick actions.address (UpdateLoggedView << UpdateAdd <| ToggleFrequency)
]
[ div
diff --git a/src/client/View/Payments/Paging.elm b/src/client/View/Payments/Paging.elm
index 53df3b3..b9a0109 100644
--- a/src/client/View/Payments/Paging.elm
+++ b/src/client/View/Payments/Paging.elm
@@ -27,7 +27,7 @@ paymentsPaging loggedView =
then
text ""
else
- ul
+ div
[ class "pages" ]
( ( if loggedView.currentPage > 1
then [ firstPage, previousPage loggedView ]
@@ -56,7 +56,7 @@ truncatePages currentPage pages =
firstPage : Html
firstPage =
- li
+ button
[ class "page"
, onClick serverCommunications.address (SC.UpdatePage 1)
]
@@ -64,7 +64,7 @@ firstPage =
previousPage : LoggedView -> Html
previousPage loggedView =
- li
+ button
[ class "page"
, onClick serverCommunications.address (SC.UpdatePage (loggedView.currentPage - 1))
]
@@ -72,7 +72,7 @@ previousPage loggedView =
nextPage : LoggedView -> Html
nextPage loggedView =
- li
+ button
[ class "page"
, onClick serverCommunications.address (SC.UpdatePage (loggedView.currentPage + 1))
]
@@ -80,7 +80,7 @@ nextPage loggedView =
lastPage : Int -> Html
lastPage maxPage =
- li
+ button
[ class "page"
, onClick serverCommunications.address (SC.UpdatePage maxPage)
]
@@ -89,7 +89,7 @@ lastPage maxPage =
paymentsPage : LoggedView -> Int -> Html
paymentsPage loggedView page =
let onCurrentPage = page == loggedView.currentPage
- in li
+ in button
[ class ("page" ++ (if onCurrentPage then " current" else ""))
, onClick serverCommunications.address <|
if onCurrentPage then SC.NoCommunication else SC.UpdatePage page