Added link to external profile in account view (#125)
* Added link to external profile in account view * Used helpers * Added boolean parameter for accountLink / accountAvatarLink
This commit is contained in:
parent
3b67a20909
commit
ab5e7bfbaf
@ -77,7 +77,7 @@ followButton currentUser relationship account =
|
|||||||
followView : CurrentUser -> Maybe Relationship -> Account -> Html Msg
|
followView : CurrentUser -> Maybe Relationship -> Account -> Html Msg
|
||||||
followView currentUser relationship account =
|
followView currentUser relationship account =
|
||||||
div [ class "follow-entry" ]
|
div [ class "follow-entry" ]
|
||||||
[ Common.accountAvatarLink account
|
[ Common.accountAvatarLink False account
|
||||||
, div [ class "userinfo" ]
|
, div [ class "userinfo" ]
|
||||||
[ strong []
|
[ strong []
|
||||||
[ a
|
[ a
|
||||||
@ -152,9 +152,9 @@ accountView currentUser account relationship panelContent =
|
|||||||
]
|
]
|
||||||
[ div [ class "opacity-layer" ]
|
[ div [ class "opacity-layer" ]
|
||||||
[ followButton currentUser relationship account
|
[ followButton currentUser relationship account
|
||||||
, img [ src account.avatar ] []
|
, Common.accountAvatarLink True account
|
||||||
, span [ class "account-display-name" ] [ text account.display_name ]
|
, span [ class "account-display-name" ] [ text account.display_name ]
|
||||||
, span [ class "account-username" ] [ text ("@" ++ account.username) ]
|
, span [ class "account-username" ] [ Common.accountLink True account ]
|
||||||
, span [ class "account-note" ] (formatContent account.note [])
|
, span [ class "account-note" ] (formatContent account.note [])
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
@ -14,23 +14,43 @@ import Types exposing (..)
|
|||||||
import View.Events exposing (..)
|
import View.Events exposing (..)
|
||||||
|
|
||||||
|
|
||||||
accountLink : Account -> Html Msg
|
accountLink : Bool -> Account -> Html Msg
|
||||||
accountLink account =
|
accountLink external account =
|
||||||
|
let
|
||||||
|
accountHref =
|
||||||
|
if external then
|
||||||
|
target "_blank"
|
||||||
|
else
|
||||||
|
onClickWithPreventAndStop (LoadAccount account.id)
|
||||||
|
in
|
||||||
a
|
a
|
||||||
[ href account.url
|
[ href account.url
|
||||||
, onClickWithPreventAndStop (LoadAccount account.id)
|
, accountHref
|
||||||
]
|
]
|
||||||
[ text <| "@" ++ account.username ]
|
[ text <| "@" ++ account.username ]
|
||||||
|
|
||||||
|
|
||||||
accountAvatarLink : Account -> Html Msg
|
accountAvatarLink : Bool -> Account -> Html Msg
|
||||||
accountAvatarLink account =
|
accountAvatarLink external account =
|
||||||
|
let
|
||||||
|
accountHref =
|
||||||
|
if external then
|
||||||
|
target "_blank"
|
||||||
|
else
|
||||||
|
onClickWithPreventAndStop (LoadAccount account.id)
|
||||||
|
|
||||||
|
avatarClass =
|
||||||
|
if external then
|
||||||
|
""
|
||||||
|
else
|
||||||
|
"avatar"
|
||||||
|
in
|
||||||
a
|
a
|
||||||
[ href account.url
|
[ href account.url
|
||||||
, onClickWithPreventAndStop (LoadAccount account.id)
|
, accountHref
|
||||||
, title <| "@" ++ account.username
|
, title <| "@" ++ account.username
|
||||||
]
|
]
|
||||||
[ img [ class "avatar", src account.avatar ] [] ]
|
[ img [ class avatarClass, src account.avatar ] [] ]
|
||||||
|
|
||||||
|
|
||||||
closeablePanelheading : String -> String -> String -> Msg -> Html Msg
|
closeablePanelheading : String -> String -> String -> Msg -> Html Msg
|
||||||
|
@ -78,8 +78,8 @@ currentUserView currentUser =
|
|||||||
case currentUser of
|
case currentUser of
|
||||||
Just currentUser ->
|
Just currentUser ->
|
||||||
div [ class "current-user" ]
|
div [ class "current-user" ]
|
||||||
[ Common.accountAvatarLink currentUser
|
[ Common.accountAvatarLink False currentUser
|
||||||
, div [ class "username" ] [ Common.accountLink currentUser ]
|
, div [ class "username" ] [ Common.accountLink False currentUser ]
|
||||||
, p [ class "status-text" ] <| formatContent currentUser.note []
|
, p [ class "status-text" ] <| formatContent currentUser.note []
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -46,11 +46,11 @@ filterNotifications filter notifications =
|
|||||||
notificationHeading : List Account -> String -> String -> Html Msg
|
notificationHeading : List Account -> String -> String -> Html Msg
|
||||||
notificationHeading accounts str iconType =
|
notificationHeading accounts str iconType =
|
||||||
div [ class "status-info" ]
|
div [ class "status-info" ]
|
||||||
[ div [ class "avatars" ] <| List.map Common.accountAvatarLink accounts
|
[ div [ class "avatars" ] <| List.map (Common.accountAvatarLink False) accounts
|
||||||
, p [ class "status-info-text" ] <|
|
, p [ class "status-info-text" ] <|
|
||||||
List.intersperse (text " ")
|
List.intersperse (text " ")
|
||||||
[ Common.icon iconType
|
[ Common.icon iconType
|
||||||
, span [] <| List.intersperse (text ", ") (List.map Common.accountLink accounts)
|
, span [] <| List.intersperse (text ", ") (List.map (Common.accountLink False) accounts)
|
||||||
, text str
|
, text str
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@ -78,8 +78,8 @@ notificationFollowView currentUser { accounts } =
|
|||||||
let
|
let
|
||||||
profileView account =
|
profileView account =
|
||||||
div [ class "status follow-profile" ]
|
div [ class "status follow-profile" ]
|
||||||
[ Common.accountAvatarLink account
|
[ Common.accountAvatarLink False account
|
||||||
, div [ class "username" ] [ Common.accountLink account ]
|
, div [ class "username" ] [ Common.accountLink False account ]
|
||||||
, p
|
, p
|
||||||
[ class "status-text"
|
[ class "status-text"
|
||||||
, onClick <| LoadAccount account.id
|
, onClick <| LoadAccount account.id
|
||||||
|
@ -217,7 +217,7 @@ statusView context ({ account, content, media_attachments, reblog, mentions } as
|
|||||||
|
|
||||||
Nothing ->
|
Nothing ->
|
||||||
div [ class "status" ]
|
div [ class "status" ]
|
||||||
[ Common.accountAvatarLink account
|
[ Common.accountAvatarLink False account
|
||||||
, div [ class "username" ]
|
, div [ class "username" ]
|
||||||
[ a accountLinkAttributes
|
[ a accountLinkAttributes
|
||||||
[ text account.display_name
|
[ text account.display_name
|
||||||
|
Loading…
Reference in New Issue
Block a user