A lot of small details.

This commit is contained in:
Philippe Pittoli 2024-03-24 00:42:23 +01:00
parent b23b507f98
commit c4f5f81b63
4 changed files with 15 additions and 15 deletions

View File

@ -241,7 +241,7 @@ render state
, render_nav , render_nav
, case state.notif of , case state.notif of
NoNotification -> HH.div_ [] NoNotification -> HH.div_ []
GoodNotification v -> Bulma.box [Bulma.notification_primary v CloseNotif] GoodNotification v -> Bulma.box [Bulma.notification_success v CloseNotif]
BadNotification v -> Bulma.box [Bulma.notification_danger v CloseNotif] BadNotification v -> Bulma.box [Bulma.notification_danger v CloseNotif]
, case state.current_page of , case state.current_page of
Home -> render_home Home -> render_home

View File

@ -84,14 +84,16 @@ initialState token =
render :: forall m. State -> H.ComponentHTML Action () m render :: forall m. State -> H.ComponentHTML Action () m
render { modal, wsUp, newPasswordForm } = render { modal, wsUp, newPasswordForm } =
case modal of Bulma.section_small
DeleteAccountModal -> render_delete_account_modal [ case modal of
NoModal -> Bulma.columns_ [ b [ Bulma.h3 "Change password", render_new_password_form ] DeleteAccountModal -> render_delete_account_modal
, b [ Bulma.h3 "Delete account", render_delete_account ] NoModal -> Bulma.columns_ [ b [ Bulma.h3 "Change password", render_new_password_form ]
] , b [ Bulma.h3 "Delete account", render_delete_account ]
]
]
where where
b e = Bulma.column_ [ Bulma.box e ] b e = Bulma.column_ e
should_be_disabled = (if wsUp then (HP.enabled true) else (HP.disabled true)) should_be_disabled = (if wsUp then (HP.enabled true) else (HP.disabled true))
render_delete_account = Bulma.alert_btn "Delete my account" DeleteAccountPopup render_delete_account = Bulma.alert_btn "Delete my account" DeleteAccountPopup
@ -105,12 +107,7 @@ render { modal, wsUp, newPasswordForm } =
(HandleNewPassword <<< NEWPASS_INP_confirmation) (HandleNewPassword <<< NEWPASS_INP_confirmation)
newPasswordForm.confirmation newPasswordForm.confirmation
should_be_disabled should_be_disabled
, HH.button , Bulma.btn_validation
[ HP.style "padding: 0.5rem 1.25rem;"
, HP.type_ HP.ButtonSubmit
, (if wsUp then (HP.enabled true) else (HP.disabled true))
]
[ HH.text "Send Message to Server" ]
] ]
render_delete_account_modal = Bulma.modal "Delete your account" render_delete_account_modal = Bulma.modal "Delete your account"

View File

@ -341,7 +341,7 @@ render state
modal_rr_delete rr_id = Bulma.modal "Deleting a resource record" modal_rr_delete rr_id = Bulma.modal "Deleting a resource record"
[warning_message] [modal_delete_button, Bulma.cancel_button CancelModal] [warning_message] [modal_delete_button, Bulma.cancel_button CancelModal]
where where
modal_delete_button = Bulma.alert_btn "Delete the resource record." (RemoveRR rr_id) modal_delete_button = Bulma.alert_btn "Delete the resource record" (RemoveRR rr_id)
warning_message warning_message
= HH.p [] [ HH.text "You are about to delete a resource record, this actions is " = HH.p [] [ HH.text "You are about to delete a resource record, this actions is "
, Bulma.strong "irreversible" , Bulma.strong "irreversible"
@ -1009,7 +1009,7 @@ render_new_records _
] [] ] []
, Bulma.hr , Bulma.hr
, Bulma.level [ , Bulma.level [
Bulma.btn "Get the final zone file." AskZoneFile Bulma.btn "Get the final zone file" AskZoneFile
] [HH.text "For debug purposes. ⚠"] ] [HH.text "For debug purposes. ⚠"]
] ]

View File

@ -520,6 +520,9 @@ notification classes value deleteaction =
notification_primary :: forall w i. String -> i -> HH.HTML w i notification_primary :: forall w i. String -> i -> HH.HTML w i
notification_primary value deleteaction = notification C.is_primary value deleteaction notification_primary value deleteaction = notification C.is_primary value deleteaction
notification_success :: forall w i. String -> i -> HH.HTML w i
notification_success value deleteaction = notification C.is_success value deleteaction
notification_danger :: forall w i. String -> i -> HH.HTML w i notification_danger :: forall w i. String -> i -> HH.HTML w i
notification_danger value deleteaction = notification C.is_danger value deleteaction notification_danger value deleteaction = notification C.is_danger value deleteaction