1
0
Fork 0

Show instance icon on statuses

This commit is contained in:
Ryan Fox 2021-11-30 19:46:29 -08:00
parent c557d41acb
commit 122f22425e
Signed by: flewkey
GPG Key ID: 94F56ADFD848851E
2 changed files with 23 additions and 1 deletions

View File

@ -268,6 +268,17 @@ span.applink {
color: #a0a0a0;
}
.acct-instance-icon {
width: 14px;
height: 14px;
margin-left: 4px;
border-radius: 25%;
}
.acct-instance-icon:-moz-broken {
display: none;
}
.reblogger {
color: #ccc;
}

View File

@ -260,6 +260,17 @@ statusEntryView context className currentUser status =
]
statusAcctView : Account -> Html Msg
statusAcctView account =
let
acctText = text <| " @" ++ account.acct
instUrl = String.join "/" ( List.take 3 ( String.split "/" account.url ) )
instIcon = img [ class "acct-instance-icon", src ( instUrl ++ "/favicon.png" ), alt "" ] []
instIcon2 = img [ class "acct-instance-icon", src ( instUrl ++ "/favicon.ico" ), alt "" ] []
in
span [ class "acct" ] [ acctText, instIcon, instIcon2 ]
statusView : String -> Status -> Bool -> Html Msg
statusView context ({ account, content, media_attachments, reblog, mentions, pinned } as status) clickOpen =
let
@ -305,7 +316,7 @@ statusView context ({ account, content, media_attachments, reblog, mentions, pin
, div [ class "username" ]
[ a accountLinkAttributes
[ text (if account.display_name=="" then account.username else account.display_name)
, span [ class "acct" ] [ text <| " @" ++ account.acct ]
, statusAcctView <| account
]
]
, Lazy.lazy2 statusContentView context status