mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 17:47:03 +00:00
ui: Fix external links
This commit is contained in:
@@ -127,8 +127,8 @@ update msg model =
|
|||||||
Browser.Internal url ->
|
Browser.Internal url ->
|
||||||
( model, Nav.pushUrl model.session.key (Url.toString url), Session.none )
|
( model, Nav.pushUrl model.session.key (Url.toString url), Session.none )
|
||||||
|
|
||||||
_ ->
|
Browser.External url ->
|
||||||
Debug.todo "implement external links"
|
( model, Nav.load url, Session.none )
|
||||||
|
|
||||||
UrlChanged url ->
|
UrlChanged url ->
|
||||||
-- Responds to new browser URL.
|
-- Responds to new browser URL.
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ import Html.Attributes
|
|||||||
, href
|
, href
|
||||||
, id
|
, id
|
||||||
, placeholder
|
, placeholder
|
||||||
|
, rel
|
||||||
, selected
|
, selected
|
||||||
|
, target
|
||||||
, type_
|
, type_
|
||||||
, value
|
, value
|
||||||
)
|
)
|
||||||
@@ -62,15 +64,20 @@ frame controls session page content =
|
|||||||
, content
|
, content
|
||||||
, footer []
|
, footer []
|
||||||
[ div [ id "footer" ]
|
[ div [ id "footer" ]
|
||||||
[ a [ href "https://www.inbucket.org" ] [ text "Inbucket" ]
|
[ externalLink "https://www.inbucket.org" "Inbucket"
|
||||||
, text " is an open source projected hosted at "
|
, text " is an open source projected hosted at "
|
||||||
, a [ href "https://github.com/jhillyerd/inbucket" ] [ text "GitHub" ]
|
, externalLink "https://github.com/jhillyerd/inbucket" "GitHub"
|
||||||
, text "."
|
, text "."
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
externalLink : String -> String -> Html a
|
||||||
|
externalLink url title =
|
||||||
|
a [ href url, target "_blank", rel "noopener" ] [ text title ]
|
||||||
|
|
||||||
|
|
||||||
navbarLink : Session -> ActivePage -> Route -> List (Html a) -> Html a
|
navbarLink : Session -> ActivePage -> Route -> List (Html a) -> Html a
|
||||||
navbarLink session page route linkContent =
|
navbarLink session page route linkContent =
|
||||||
li [ classList [ ( "navbar-active", isActive page route ) ] ]
|
li [ classList [ ( "navbar-active", isActive page route ) ] ]
|
||||||
|
|||||||
Reference in New Issue
Block a user