Show mentions in status
Soapbox does not seem to include mentions in the status text anymore. I wanted to add a "Replying to" option, but I have no clue how replies work.
This commit is contained in:
parent
592607835a
commit
6648fd840c
|
@ -283,6 +283,21 @@ span.applink {
|
|||
color: #ccc;
|
||||
}
|
||||
|
||||
.status-mentions {
|
||||
font-size: 14px;
|
||||
color: #a0a0a0;
|
||||
display: block;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.status-mentions .mention {
|
||||
margin: 0 2px;
|
||||
}
|
||||
|
||||
.status-mentions .mention:first-of-type {
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.status-text {
|
||||
margin-left: 60px;
|
||||
color: #efefef;
|
||||
|
|
|
@ -207,12 +207,35 @@ statusActionsView status currentUser showApp =
|
|||
]
|
||||
|
||||
|
||||
mentionView : Mention -> Html Msg
|
||||
mentionView mention =
|
||||
a
|
||||
[ href mention.url
|
||||
, class "mention" ]
|
||||
[ text <| "@" ++ mention.username
|
||||
]
|
||||
|
||||
|
||||
mentionsView : List Mention -> Html Msg
|
||||
mentionsView mentions =
|
||||
let
|
||||
mentionLinks =
|
||||
List.map mentionView mentions
|
||||
in
|
||||
if (List.isEmpty mentions) then
|
||||
text ""
|
||||
else
|
||||
div [ class "status-mentions" ]
|
||||
( List.append [ text "Mentioning" ] mentionLinks )
|
||||
|
||||
|
||||
statusContentView : String -> Status -> Html Msg
|
||||
statusContentView context status =
|
||||
case status.spoiler_text of
|
||||
"" ->
|
||||
div [ class "status-text" ]
|
||||
[ div [] <| formatContent status.content status.mentions
|
||||
[ mentionsView status.mentions
|
||||
, div [] <| formatContent status.content status.mentions
|
||||
, pollView status
|
||||
, attachmentListView context status
|
||||
]
|
||||
|
@ -229,7 +252,8 @@ statusContentView context status =
|
|||
, input [ onClickWithStop NoOp, type_ "checkbox", id statusId, class "spoiler-toggler" ] []
|
||||
, label [ onClickWithStop NoOp, for statusId ] [ text "Reveal content" ]
|
||||
, div [ class "spoiled-content" ]
|
||||
[ div [] <| formatContent status.content status.mentions
|
||||
[ mentionsView status.mentions
|
||||
, div [] <| formatContent status.content status.mentions
|
||||
, pollView status
|
||||
, attachmentListView context status
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue