diff --git a/src/App/Container.purs b/src/App/Container.purs index ac36161..7c2a93e 100644 --- a/src/App/Container.purs +++ b/src/App/Container.purs @@ -291,7 +291,7 @@ render state reconnection_bar = if (state.are_we_connected_to_authd && state.are_we_connected_to_dnsmanagerd) then HH.div_ [] - else Bulma.btn_ (C.is_large <> C.is_danger) "You have been disconnected. Click here to reconnect." Reconnection + else Bulma.btn_ [C.is_large, C.is_danger] "You have been disconnected. Click here to reconnect." Reconnection render_auth_WS :: forall monad. MonadAff monad => H.ComponentHTML Action ChildSlots monad render_auth_WS = HH.slot _ws_auth unit WS.component (Tuple "ws://127.0.0.1:8080" "authd") AuthenticationDaemonEvent @@ -326,7 +326,7 @@ render state render_legal_notice :: forall monad. MonadAff monad => H.ComponentHTML Action ChildSlots monad render_legal_notice = Bulma.section_small [ Explanations.legal_notice - , Bulma.btn_ (C.is_large <> C.margin_top 3 <> C.is_info) "Home page" (Routing Home) + , Bulma.btn_ [C.is_large, C.margin_top 3, C.is_info] "Home page" (Routing Home) ] render_nav :: forall monad. MonadAff monad => H.ComponentHTML Action ChildSlots monad @@ -334,10 +334,10 @@ render state render_header :: forall monad. MonadAff monad => H.ComponentHTML Action ChildSlots monad render_header = - HH.section [ HP.classes (C.hero <> C.is_info <> C.is_small) ] - [ HH.div [ HP.classes C.hero_body ] - [ HH.div [ HP.classes $ C.container <> C.has_text_centered ] - [ HH.p [ HP.classes C.subtitle ] + HH.section [ HP.classes [C.hero, C.is_info, C.is_small] ] + [ HH.div [ HP.classes [C.hero_body] ] + [ HH.div [ HP.classes [C.container, C.has_text_centered] ] + [ HH.p [ HP.classes [C.subtitle] ] [ HH.strong_ [ HH.u_ [ HH.text "net libre" ]] , HH.text ": providing free domains since 2015!" ] diff --git a/src/App/Page/Administration.purs b/src/App/Page/Administration.purs index 8e8db96..26bfd0e 100644 --- a/src/App/Page/Administration.purs +++ b/src/App/Page/Administration.purs @@ -133,13 +133,13 @@ render { addUserForm, searchUserForm, matching_users, current_tab, orphan_domain , case current_tab of Home -> Bulma.h3 "Select an action" Search -> Bulma.columns_ - [ Bulma.column (C.is 3) [Bulma.article (Bulma.p "Search users") render_searchuser_form] + [ Bulma.column [C.is 3] [Bulma.article (Bulma.p "Search users") render_searchuser_form] , Bulma.column_ [ Bulma.h3 "Result", show_found_users ] ] Add -> Bulma.columns_ - [ Bulma.column (C.is 5) [Bulma.article (Bulma.p "Add a new user") render_adduser_form] ] + [ Bulma.column [C.is 5] [Bulma.article (Bulma.p "Add a new user") render_adduser_form] ] OrphanDomains -> HH.div_ - [ Bulma.btn_ (C.is_small) "Get orphan domains" ShowOrphanDomains + [ Bulma.btn_ [C.is_small] "Get orphan domains" ShowOrphanDomains , show_orphan_domains ] ] @@ -155,11 +155,11 @@ render { addUserForm, searchUserForm, matching_users, current_tab, orphan_domain show_found_users = Bulma.box [ HH.ul_ $ map user_card matching_users ] user_card user = HH.li_ [ Bulma.btn_delete (RemoveUser user.uid) - , Bulma.btn_ (C.is_small) user.login (ShowUser user.uid) + , Bulma.btn_ [C.is_small] user.login (ShowUser user.uid) ] show_orphan_domains = Bulma.box [ HH.ul_ $ map domain_entry orphan_domains ] domain_entry domain = HH.li_ [ Bulma.btn_delete (RemoveDomain domain) - , Bulma.btn_ (C.is_small) domain (ShowDomain domain) + , Bulma.btn_ [C.is_small] domain (ShowDomain domain) ] up x = HandleAddUserInput <<< x diff --git a/src/App/Page/DomainList.purs b/src/App/Page/DomainList.purs index b379f44..8651470 100644 --- a/src/App/Page/DomainList.purs +++ b/src/App/Page/DomainList.purs @@ -277,7 +277,7 @@ render { accepted_domains, my_domains, newDomainForm, askDomainTransferForm, del , HH.td_ [ HH.text $ fromMaybe "" domain.share_key ] , if A.length domain.owners == 1 then HH.td_ [ Bulma.alert_btn_abbr "Unshare the domain by removing the \"share\" token." "Unshare" (UnShareDomain domain.name) ] - else HH.td_ [ Bulma.btn_ro (C.is_warning) "Cannot unshare it" ] + else HH.td_ [ Bulma.btn_ro [C.is_warning] "Cannot unshare it" ] , HH.td_ [ Bulma.alert_btn_abbr "Delete the domain from your list of owned domains. In case you are the only owner, this will also remove all zone data and the domain won't be served anymore." "Delete" (DeleteDomainModal domain.name) ] ] diff --git a/src/App/Page/Home.purs b/src/App/Page/Home.purs index d35e684..0f6d04a 100644 --- a/src/App/Page/Home.purs +++ b/src/App/Page/Home.purs @@ -1,7 +1,7 @@ -- | `App.HomeInterface` presents the website and its features. module App.Page.Home where -import Prelude (Unit, pure, unit, ($), (<>)) +import Prelude (Unit, pure, unit, ($)) -- import Data.Either (Either(..)) -- import Data.Maybe (Maybe(..), maybe) @@ -51,8 +51,8 @@ render _ = HH.div_ Les comptes migrés sont conservés 6 mois, puis supprimés si aucune connexion n'est faite, afin de purger un certain nombre de vieux comptes de robots. """ - , HH.p [ HP.classes (C.margin_top 3) ] - [ Bulma.outside_link (C.button <> C.is_info) url_linuxfr "Cliquez ici pour en savoir plus." ] + , HH.p [ HP.classes [C.margin_top 3] ] + [ Bulma.outside_link [C.button, C.is_info] url_linuxfr "Cliquez ici pour en savoir plus." ] ] , Bulma.section_small [ Bulma.h1 "Welcome to netlib.re" diff --git a/src/App/Page/Navigation.purs b/src/App/Page/Navigation.purs index 6031570..32624e1 100644 --- a/src/App/Page/Navigation.purs +++ b/src/App/Page/Navigation.purs @@ -129,17 +129,17 @@ render { logged, active, admin, login } = navbar_color = C.is_success main_nav = - HH.nav [ HP.classes $ C.navbar <> navbar_color + HH.nav [ HP.classes [C.navbar, navbar_color] , ARIA.label "main navigation" , ARIA.role "navigation" ] - logo = HH.strong [HP.classes $ C.navbar_item <> (C.is_size 4)] [HH.text "🍉"] - -- HH.a [HP.classes C.navbar_item, HP.href "/"] + logo = HH.strong [HP.classes [C.navbar_item, (C.is_size 4)]] [HH.text "🍉"] + -- HH.a [HP.classes [C.navbar_item], HP.href "/"] -- [HH.img [HP.src "/logo.jpeg", HP.width 112, HP.height 28]] burger_menu = - HH.a [ HP.classes $ C.navbar_burger <> if active then C.is_active else [] + HH.a [ HP.classes $ [C.navbar_burger] <> if active then [C.is_active] else [] , ARIA.label "menu" , ARIA.expanded "false" , Bulma.data_target "navbar-netlibre" @@ -149,14 +149,14 @@ render { logged, active, admin, login } = , HH.span [ARIA.hidden "true"] [] ] - nav_brand = HH.div [HP.classes C.navbar_brand] + nav_brand = HH.div [HP.classes [C.navbar_brand]] nav_menu = HH.div [ HP.id "navbar-netlibre" - , HP.classes $ C.navbar_menu <> C.is_spaced <> if active then C.is_active else [] + , HP.classes $ [C.navbar_menu, C.is_spaced] <> if active then [C.is_active] else [] ] - navbar_start = HH.div [HP.classes C.navbar_start] - navbar_end = HH.div [HP.classes C.navbar_end] + navbar_start = HH.div [HP.classes [C.navbar_start]] + navbar_end = HH.div [HP.classes [C.navbar_end]] link_home = nav_link "Home" (Navigate Home) link_domains = nav_link "Domains" (Navigate DomainList) @@ -168,38 +168,38 @@ render { logged, active, admin, login } = render_login Nothing = [] render_login (Just l)= [nav_link ("logged as " <> l) (Navigate Setup)] link_disconnection = - nav_link_ (C.has_text_light <> C.has_background_danger) "Disconnection" UnLog + nav_link_ [C.has_text_light, C.has_background_danger] "Disconnection" UnLog dropdown title dropdown_elements - = HH.div [HP.classes $ C.navbar_item <> C.has_dropdown <> C.is_hoverable] - [ dropdown_title title, HH.div [HP.classes C.navbar_dropdown] dropdown_elements ] - dropdown_title str = HH.a [HP.classes C.navbar_link] [HH.text str] - dropdown_separator = HH.hr [HP.classes C.navbar_divider] + = HH.div [HP.classes [C.navbar_item, C.has_dropdown, C.is_hoverable]] + [ dropdown_title title, HH.div [HP.classes [C.navbar_dropdown]] dropdown_elements ] + dropdown_title str = HH.a [HP.classes [C.navbar_link]] [HH.text str] + dropdown_separator = HH.hr [HP.classes [C.navbar_divider]] - --nav_button_strong str action = btn C.is_primary action (HH.strong [] [ HH.text str ]) + --nav_button_strong str action = btn [C.is_primary] action (HH.strong [] [ HH.text str ]) --nav_button classes str action = btn classes action (HH.text str) nav_link_strong str action = - HH.a [ HP.classes (C.navbar_item <> C.is_danger <> C.has_background_success_dark) + HH.a [ HP.classes [C.navbar_item, C.is_danger, C.has_background_success_dark] , HE.onClick (\_ -> action) ] [ (HH.strong [] [ HH.text str ]) ] - nav_link str action = nav_link_ navbar_color str action - nav_link_warn str action = nav_link_ (C.has_background_warning <> C.has_text_dark) str action + nav_link str action = nav_link_ [navbar_color] str action + nav_link_warn str action = nav_link_ [C.has_background_warning, C.has_text_dark] str action nav_link_ classes str action = - HH.a [ HP.classes (C.navbar_item <> classes) + HH.a [ HP.classes ([C.navbar_item] <> classes) , HE.onClick (\_ -> action) ] [ (HH.text str) ] - dropdown_element classes link str = Bulma.outside_link (C.navbar_item <> classes) link str - dropdown_element_primary link str = dropdown_element C.has_background_info_light link str - dropdown_element_secondary link str = dropdown_element C.has_background_warning_light link str + dropdown_element classes link str = Bulma.outside_link ([C.navbar_item] <> classes) link str + dropdown_element_primary link str = dropdown_element [C.has_background_info_light] link str + dropdown_element_secondary link str = dropdown_element [C.has_background_warning_light] link str dropdown_section_primary t - = HH.p [HP.classes $ C.has_background_info <> C.has_text_light <> C.navbar_item] [HH.text t] + = HH.p [HP.classes [C.has_background_info, C.has_text_light, C.navbar_item]] [HH.text t] dropdown_section_secondary t - = HH.p [HP.classes $ C.has_background_warning <> C.navbar_item] [HH.text t] + = HH.p [HP.classes [C.has_background_warning, C.navbar_item]] [HH.text t] code_dropdown = dropdown "Source code" [ dropdown_section_primary "Main parts of this service" @@ -211,8 +211,3 @@ render { logged, active, admin, login } = , dropdown_element_secondary "https://git.baguette.netlib.re/Baguette/libipc" "libIPC: communication library" , dropdown_element_secondary "https://git.baguette.netlib.re/Baguette/dodb.cr" "DoDB: document-oriented database" ] - - --btn c action str - -- = HH.a [ HP.classes (C.navbar_item <> C.button <> c) - -- , HE.onClick (\_ -> action) - -- ] [ str ] diff --git a/src/App/Page/Registration.purs b/src/App/Page/Registration.purs index 4ac2030..fe4a20d 100644 --- a/src/App/Page/Registration.purs +++ b/src/App/Page/Registration.purs @@ -146,9 +146,9 @@ render { registrationForm } _, Right _ -> [] legal_mentions = [ Explanations.legal_notice - , HH.div [HP.classes (C.margin_top 3 <> C.margin_bottom 3)] + , HH.div [HP.classes [C.margin_top 3, C.margin_bottom 3]] [ Bulma.checkbox - [HH.span [HP.classes (C.margin_left 3)] [HH.text "I have read and accept the terms of service and privacy policy."]] + [HH.span [HP.classes [C.margin_left 3]] [HH.text "I have read and accept the terms of service and privacy policy."]] LegalCheckboxToggle ] ] diff --git a/src/App/Page/Setup.purs b/src/App/Page/Setup.purs index 6eeb23b..a3eab26 100644 --- a/src/App/Page/Setup.purs +++ b/src/App/Page/Setup.purs @@ -112,11 +112,11 @@ render { modal, newPasswordForm, new_email_address, emails } = render_emails (Tuple current pending) = HH.div [] $ render_current current <> render_pending pending where render_current (Just (Email.Email e)) = [ Bulma.p $ "Current email address: " ] <> - [ Bulma.btn_ro (C.is_small <> C.is_warning) e] + [ Bulma.btn_ro [C.is_small, C.is_warning] e] render_current Nothing = [ Bulma.p "You do not currently have a validated email address." ] render_pending (Just (Email.Email e)) = [ Bulma.p $ "Pending email address: " ] <> - [ Bulma.btn_ro (C.is_small <> C.is_warning) e] + [ Bulma.btn_ro [C.is_small, C.is_warning] e] render_pending Nothing = [] render_delete_account = Bulma.alert_btn "Delete my account" DeleteAccountPopup diff --git a/src/App/Page/Zone.purs b/src/App/Page/Zone.purs index 776b670..1914201 100644 --- a/src/App/Page/Zone.purs +++ b/src/App/Page/Zone.purs @@ -357,7 +357,7 @@ render state NewRRModal _ -> render_current_rr_modal UpdateRRModal -> render_current_rr_modal NoModal -> HH.div_ - [ Bulma.level [ Bulma.btn_ (C.is_large <> C.is_info) "Back to the domain list" ReturnToDomainList + [ Bulma.level [ Bulma.btn_ [C.is_large, C.is_info] "Back to the domain list" ReturnToDomainList , Bulma.h1 state._domain ] [] , Bulma.hr @@ -522,7 +522,7 @@ render state -- Nothing -> Bulma.p "default value for the version (spf1)" -- Just v -> Bulma.box_input "vSPF" "Version" "spf1" (updateForm Field_SPF_v) v , Bulma.hr - , Bulma.box_with_tag C.has_background_info_light tag_mechanisms + , Bulma.box_with_tag [C.has_background_info_light] tag_mechanisms [ Bulma.div_content [] [Bulma.explanation [Bulma.p "Mechanisms specify which mail servers are allowed to send mail for the domain and how to evaluate the sending mail server’s IP address."] ] , maybe (Bulma.p "You don't have any mechanism.") display_mechanisms state._currentRR.mechanisms , Bulma.hr @@ -535,7 +535,7 @@ render state , Bulma.btn "Add a mechanism" SPF_Mechanism_Add ] , Bulma.hr - , Bulma.box_with_tag C.has_background_success_light tag_modifiers + , Bulma.box_with_tag [C.has_background_success_light] tag_modifiers [ Bulma.div_content [] [Bulma.explanation [Bulma.p "Modifiers provide additional instructions, such as explanations for SPF failures or redirecting SPF checks to another domain."] ] , maybe (Bulma.p "You don't have any modifier.") display_modifiers state._currentRR.modifiers , Bulma.hr @@ -626,12 +626,12 @@ render state , Bulma.hr , Bulma.div_content [] [Bulma.explanation Explanations.dmarc_contact] - , Bulma.box_with_tag C.has_background_info_light tag_aggregated_reports + , Bulma.box_with_tag [C.has_background_info_light] tag_aggregated_reports [ maybe (Bulma.p "There is no address to send aggregated reports to.") (display_dmarc_mail_addresses DMARC_remove_rua) state.dmarc.rua ] - , Bulma.box_with_tag C.has_background_success_light tag_detailed_reports + , Bulma.box_with_tag [C.has_background_success_light] tag_detailed_reports [ maybe (Bulma.p "There is no address to send detailed reports to.") (display_dmarc_mail_addresses DMARC_remove_ruf) state.dmarc.ruf @@ -641,8 +641,8 @@ render state , render_dmarc_mail_errors , Bulma.box_input "idDMARCmail" "Address to contact" "admin@example.com" DMARC_mail state.dmarc_mail , Bulma.box_input "idDMARCmaillimit" "Report size limit (in KB)" "2000" DMARC_mail_limit (maybe "0" show state.dmarc_mail_limit) - , Bulma.level [ Bulma.btn_ C.has_background_info_light "New address for aggregated report" DMARC_rua_Add - , Bulma.btn_ C.has_background_success_light "New address for specific report" DMARC_ruf_Add + , Bulma.level [ Bulma.btn_ [C.has_background_info_light] "New address for aggregated report" DMARC_rua_Add + , Bulma.btn_ [C.has_background_success_light] "New address for specific report" DMARC_ruf_Add ] [] , Bulma.hr @@ -1041,31 +1041,31 @@ handleQuery = case _ of add_RR state new_rr = state { _resources = (state._resources <> [ new_rr ]) } -- Rendering -bg_color_ro = C.has_background_warning_light :: Array HH.ClassName +bg_color_ro = C.has_background_warning_light :: HH.ClassName tag :: forall w i. String -> HH.HTML w i -tag str = HH.span [HP.classes (C.tag <> C.is_dark)] [HH.text str] +tag str = HH.span [HP.classes [C.tag, C.is_dark]] [HH.text str] tag_ro :: forall w i. String -> HH.HTML w i -tag_ro str = HH.span [HP.classes (C.tag <> C.is_warning)] [HH.text str] +tag_ro str = HH.span [HP.classes [C.tag, C.is_warning]] [HH.text str] tags :: forall w i. Array (HH.HTML w i) -> HH.HTML w i -tags xs = HH.span [HP.classes (C.tags <> C.no_margin_bottom <> C.no_padding_bottom)] xs +tags xs = HH.span [HP.classes [C.tags, C.no_margin_bottom, C.no_padding_bottom]] xs -- | Render all Resource Records. render_resources :: forall w. Array ResourceRecord -> HH.HTML w Action render_resources [] = Bulma.box [Bulma.zone_rr_title "Resource records", Bulma.subtitle "No records for now"] render_resources records = HH.div_ $ - (rr_box bg_color_ro tag_soa Bulma.soa_table_header table_content all_soa_rr) - <> (rr_box [] tag_basic Bulma.simple_table_header table_content_w_seps all_basic_rr) - <> (rr_box [] tag_mx Bulma.mx_table_header table_content all_mx_rr) - <> (rr_box [] tag_caa Bulma.caa_table_header table_content all_caa_rr) - <> (rr_box [] tag_srv Bulma.srv_table_header table_content all_srv_rr) - <> (rr_box [] tag_spf Bulma.spf_table_header table_content all_spf_rr) - <> (rr_box [] tag_dkim Bulma.dkim_table_header table_content all_dkim_rr) - <> (rr_box [] tag_dmarc Bulma.dmarc_table_header table_content all_dmarc_rr) - <> (rr_box bg_color_ro tag_basic_ro Bulma.simple_table_header_ro table_content_w_seps all_basic_ro_rr) + (rr_box [bg_color_ro] tag_soa Bulma.soa_table_header table_content all_soa_rr) + <> (rr_box [] tag_basic Bulma.simple_table_header table_content_w_seps all_basic_rr) + <> (rr_box [] tag_mx Bulma.mx_table_header table_content all_mx_rr) + <> (rr_box [] tag_caa Bulma.caa_table_header table_content all_caa_rr) + <> (rr_box [] tag_srv Bulma.srv_table_header table_content all_srv_rr) + <> (rr_box [] tag_spf Bulma.spf_table_header table_content all_spf_rr) + <> (rr_box [] tag_dkim Bulma.dkim_table_header table_content all_dkim_rr) + <> (rr_box [] tag_dmarc Bulma.dmarc_table_header table_content all_dmarc_rr) + <> (rr_box [bg_color_ro] tag_basic_ro Bulma.simple_table_header_ro table_content_w_seps all_basic_ro_rr) where all_basic_rr = A.filter (\rr -> A.elem rr.rrtype baseRecords && not rr.readonly) records all_basic_ro_rr = A.filter (\rr -> A.elem rr.rrtype baseRecords && rr.readonly) records @@ -1096,7 +1096,7 @@ render_resources records -> Array (HH.HTML w Action) rr_box colors title header dp rrs = if A.length rrs > 0 - then [ Bulma.box_with_tag colors title [Bulma.table_ (C.margin_left 3) [] [header, dp rrs]] ] + then [ Bulma.box_with_tag colors title [Bulma.table_ [C.margin_left 3] [] [header, dp rrs]] ] else [] --title_col_props = C.is 1 @@ -1111,7 +1111,7 @@ render_resources records table_content records_ = HH.tbody_ $ map rows records_ rows rr = if rr.readonly - then HH.tr [ HP.classes C.has_background_warning_light ] $ render_row rr + then HH.tr [ HP.classes [C.has_background_warning_light] ] $ render_row rr else HH.tr_ $ render_row rr render_row :: ResourceRecord -> Array (HH.HTML w Action) @@ -1223,8 +1223,8 @@ render_resources records show_token_or_btn rr = case rr.rrtype of - "A" -> Bulma.btn_ (C.is_small) "🏁​ Ask for a token" (NewToken rr.rrid) - "AAAA" -> Bulma.btn_ (C.is_small) "🏁​ Ask for a token" (NewToken rr.rrid) + "A" -> Bulma.btn_ [C.is_small] "🏁​ Ask for a token" (NewToken rr.rrid) + "AAAA" -> Bulma.btn_ [C.is_small] "🏁​ Ask for a token" (NewToken rr.rrid) _ -> HH.text "" fancy_qualifier_display :: RR.Qualifier -> String diff --git a/src/App/Text/Explanations.purs b/src/App/Text/Explanations.purs index 6a01a0b..b92003e 100644 --- a/src/App/Text/Explanations.purs +++ b/src/App/Text/Explanations.purs @@ -355,7 +355,7 @@ dmarc_aspf = In relaxed mode, they can be different, but in the same Organizational Domain. """ , HH.p_ [ HH.text "From RFC7489:" - , HH.div [HP.classes C.is_italic] + , HH.div [HP.classes [C.is_italic]] [ HH.text """For example, if a message passes an SPF check with an RFC5321.MailFrom domain of "cbg.bounces.example.com", and the address portion of the RFC5322.From field contains "payments@example.com", diff --git a/src/App/WS.purs b/src/App/WS.purs index 6332fb8..e1b7136 100644 --- a/src/App/WS.purs +++ b/src/App/WS.purs @@ -166,7 +166,7 @@ render { wsInfo } ] reconnection_btn = HH.button [ HP.type_ HP.ButtonButton , HE.onClick \_ -> ConnectWebSocket - , HP.classes (C.has_background_danger_light <> C.is_large) + , HP.classes [C.has_background_danger_light, C.is_large] ] handleAction :: forall m. MonadAff m => Action -> H.HalogenM State Action () Output m Unit diff --git a/src/Bulma.purs b/src/Bulma.purs index 97b7462..8c3d5d9 100644 --- a/src/Bulma.purs +++ b/src/Bulma.purs @@ -19,7 +19,7 @@ import Halogen.HTML.Core (AttrName(..)) checkbox :: forall w i. Array (HH.HTML w i) -> i -> HH.HTML w i checkbox content_ action = HH.label - [ HP.classes C.label ] $ [ HH.input [ HE.onValueInput \ _ -> action, MissingProperties.ty "checkbox" ] ] <> content_ + [ HP.classes [C.label] ] $ [ HH.input [ HE.onValueInput \ _ -> action, MissingProperties.ty "checkbox" ] ] <> content_ --