1
0
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:
James Hillyerd
2018-11-18 11:36:49 -08:00
parent eaf41949d4
commit 74e7fd1179
2 changed files with 11 additions and 4 deletions

View File

@@ -127,8 +127,8 @@ update msg model =
Browser.Internal url ->
( model, Nav.pushUrl model.session.key (Url.toString url), Session.none )
_ ->
Debug.todo "implement external links"
Browser.External url ->
( model, Nav.load url, Session.none )
UrlChanged url ->
-- Responds to new browser URL.

View File

@@ -10,7 +10,9 @@ import Html.Attributes
, href
, id
, placeholder
, rel
, selected
, target
, type_
, value
)
@@ -62,15 +64,20 @@ frame controls session page content =
, content
, 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 "
, a [ href "https://github.com/jhillyerd/inbucket" ] [ text "GitHub" ]
, externalLink "https://github.com/jhillyerd/inbucket" "GitHub"
, 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 page route linkContent =
li [ classList [ ( "navbar-active", isActive page route ) ] ]