mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-18 10:07:02 +00:00
ui: Style error flash, add close link
This commit is contained in:
@@ -33,6 +33,7 @@ type alias FrameControls msg =
|
||||
, mailboxValue : String
|
||||
, recentOptions : List String
|
||||
, recentActive : String
|
||||
, clearFlash : msg
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +59,7 @@ frame controls session page content =
|
||||
]
|
||||
]
|
||||
]
|
||||
, div [] [ text ("Status: " ++ session.flash) ]
|
||||
, errorFlash controls session.flash
|
||||
]
|
||||
, div [ id "navbg" ] [ text "" ]
|
||||
, content
|
||||
@@ -73,6 +74,21 @@ frame controls session page content =
|
||||
]
|
||||
|
||||
|
||||
errorFlash : FrameControls msg -> String -> Html msg
|
||||
errorFlash controls message =
|
||||
if message == "" then
|
||||
text ""
|
||||
|
||||
else
|
||||
div [ class "error" ]
|
||||
[ div [ class "flash-header" ]
|
||||
[ h2 [] [ text "Error" ]
|
||||
, a [ href "#", Events.onClick controls.clearFlash ] [ text "Close" ]
|
||||
]
|
||||
, pre [] [ text message ]
|
||||
]
|
||||
|
||||
|
||||
externalLink : String -> String -> Html a
|
||||
externalLink url title =
|
||||
a [ href url, target "_blank", rel "noopener" ] [ text title ]
|
||||
|
||||
Reference in New Issue
Block a user