Domain list: change the order of the elements.

This commit is contained in:
Philippe PITTOLI 2024-04-28 13:25:51 +02:00
parent e1c069c497
commit 06a52e6480

View file

@ -181,36 +181,33 @@ render :: forall m. State -> H.ComponentHTML Action () m
render { accepted_domains, my_domains, newDomainForm, askDomainTransferForm, deletion_modal } render { accepted_domains, my_domains, newDomainForm, askDomainTransferForm, deletion_modal }
= Bulma.section_small = Bulma.section_small
[ case deletion_modal of [ case deletion_modal of
Nothing -> Bulma.columns_ Nothing -> HH.div_ [ Bulma.columns_ domain_line
[ Bulma.column_ [ Bulma.h3 "New domain", render_add_domain_form
, Bulma.hr , Bulma.hr
, Bulma.h3 "Get the ownership of a domain" , Bulma.columns_ new_domain_line
, Bulma.simple_quote """
Someone wants to give you (or share with you) the ownership of a domain.
Please enter the UUID of the transfer.
"""
, render_ask_domain_transfer_form
, Bulma.hr , Bulma.hr
, Bulma.h3 "Share the ownership of a domain" , Bulma.columns_ explanations_line
, Bulma.simple_quote """
Ask for a "share token" for your domain and give it to other users.
All the owners be able to make modifications to the domain.
"""
, Bulma.hr
, Bulma.h3 "Transfer the ownership of a domain"
, Bulma.simple_quote """
Ask for a transfer token for your domain and give it to the new owner.
"""
] ]
, Bulma.column_ [ Bulma.h3 "My domains" Just domain -> Bulma.modal "Deleting a domain"
[warning_message domain] [modal_delete_button domain, modal_cancel_button]
]
where
c = Bulma.column_
domain_line = [ c render_my_domains, c render_my_shared_domains ]
new_domain_line = [ c render_new_domain, c render_gain_ownership ]
explanations_line = [ c render_share_ownership_explanation, c render_transfer_ownership_explanation ]
render_my_domains =
[ Bulma.h3 "My domains"
, Bulma.simple_quote "You are the exclusive owner of the following domains." , Bulma.simple_quote "You are the exclusive owner of the following domains."
, if A.length domains_i_exclusively_own > 0 , if A.length domains_i_exclusively_own > 0
then Bulma.table [] [ Bulma.table_header_owned_domains then Bulma.table [] [ Bulma.table_header_owned_domains
, HH.tbody_ $ map owned_domain_row domains_i_exclusively_own , HH.tbody_ $ map owned_domain_row domains_i_exclusively_own
] ]
else Bulma.p "No domain yet." else Bulma.p "No domain yet."
, Bulma.hr ]
, Bulma.h3 "Shared domains" render_my_shared_domains =
[ Bulma.h3 "Shared domains"
, Bulma.simple_quote """ , Bulma.simple_quote """
The following domains are shared with other users. The following domains are shared with other users.
In case you are the last owner, you can "unshare" it and gain exclusive ownership. In case you are the last owner, you can "unshare" it and gain exclusive ownership.
@ -221,11 +218,31 @@ render { accepted_domains, my_domains, newDomainForm, askDomainTransferForm, del
] ]
else Bulma.p "No domain yet." else Bulma.p "No domain yet."
] ]
render_new_domain = [ Bulma.h3 "New domain", render_add_domain_form ]
render_gain_ownership =
[ Bulma.h3 "Get the ownership of a domain"
, Bulma.simple_quote """
Someone wants to give you (or share with you) the ownership of a domain.
Please enter the UUID of the transfer.
"""
, render_ask_domain_transfer_form
] ]
Just domain -> Bulma.modal "Deleting a domain" render_share_ownership_explanation =
[warning_message domain] [modal_delete_button domain, modal_cancel_button] [ Bulma.h3 "Share the ownership of a domain"
, Bulma.simple_quote """
Ask for a "share token" for your domain and give it to other users.
All the owners be able to make modifications to the domain.
"""
] ]
where
render_transfer_ownership_explanation =
[ Bulma.h3 "Transfer the ownership of a domain"
, Bulma.simple_quote """
Ask for a transfer token for your domain and give it to the new owner.
"""
]
modal_delete_button domain = Bulma.alert_btn "Delete the domain" (RemoveDomain domain) modal_delete_button domain = Bulma.alert_btn "Delete the domain" (RemoveDomain domain)
modal_cancel_button = Bulma.cancel_button CancelModal modal_cancel_button = Bulma.cancel_button CancelModal
@ -278,7 +295,7 @@ render { accepted_domains, my_domains, newDomainForm, askDomainTransferForm, del
render_ask_domain_transfer_form = HH.form render_ask_domain_transfer_form = HH.form
[ HE.onSubmit AskDomainTransferAttempt ] [ HE.onSubmit AskDomainTransferAttempt ]
[ Bulma.box_input "idTransferToken" "Transfer Token" "UUID of the domain" [ Bulma.box_input "idTransferToken" "Token" "UUID of the domain"
AskDomainTransferUUIDInput AskDomainTransferUUIDInput
askDomainTransferForm.uuid askDomainTransferForm.uuid
, Bulma.btn_validation_ "ask for a domain transfer" , Bulma.btn_validation_ "ask for a domain transfer"