Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
mastodon
Commits
0f436de0
Commit
0f436de0
authored
6 years ago
by
Eugen Rochko
Browse files
Options
Download
Email Patches
Plain Diff
Add "Show thread" link to self-replies (#9228)
Fix #4716
parent
21fd335d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
app/javascript/mastodon/components/status.js
+8
-1
app/javascript/mastodon/components/status.js
app/javascript/mastodon/components/status_action_bar.js
+1
-4
app/javascript/mastodon/components/status_action_bar.js
app/javascript/mastodon/components/status_list.js
+2
-0
app/javascript/mastodon/components/status_list.js
app/javascript/mastodon/features/status/components/action_bar.js
+1
-1
...ascript/mastodon/features/status/components/action_bar.js
with
12 additions
and
6 deletions
+12
-6
app/javascript/mastodon/components/status.js
+
8
-
1
View file @
0f436de0
...
...
@@ -67,6 +67,7 @@ class Status extends ImmutablePureComponent {
unread
:
PropTypes
.
bool
,
onMoveUp
:
PropTypes
.
func
,
onMoveDown
:
PropTypes
.
func
,
showThread
:
PropTypes
.
bool
,
};
// Avoid checking props that are functions (and whose equality will always
...
...
@@ -168,7 +169,7 @@ class Status extends ImmutablePureComponent {
let
media
=
null
;
let
statusAvatar
,
prepend
,
rebloggedByText
;
const
{
intl
,
hidden
,
featured
,
otherAccounts
,
unread
}
=
this
.
props
;
const
{
intl
,
hidden
,
featured
,
otherAccounts
,
unread
,
showThread
}
=
this
.
props
;
let
{
status
,
account
,
...
other
}
=
this
.
props
;
...
...
@@ -309,6 +310,12 @@ class Status extends ImmutablePureComponent {
{
media
}
{
showThread
&&
status
.
get
(
'
in_reply_to_id
'
)
&&
status
.
get
(
'
in_reply_to_account_id
'
)
===
status
.
getIn
([
'
account
'
,
'
id
'
])
&&
(
<
button
className
=
'
status__content__read-more-button
'
onClick
=
{
this
.
handleClick
}
>
<
FormattedMessage
id
=
'
status.show_thread
'
defaultMessage
=
'
Show thread
'
/>
<
/button
>
)}
<
StatusActionBar
status
=
{
status
}
account
=
{
account
}
{...
other
}
/
>
<
/div
>
<
/div
>
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/status_action_bar.js
+
1
-
4
View file @
0f436de0
...
...
@@ -148,7 +148,6 @@ class StatusActionBar extends ImmutablePureComponent {
let
menu
=
[];
let
reblogIcon
=
'
retweet
'
;
let
replyIcon
;
let
replyTitle
;
menu
.
push
({
text
:
intl
.
formatMessage
(
messages
.
open
),
action
:
this
.
handleOpen
});
...
...
@@ -191,10 +190,8 @@ class StatusActionBar extends ImmutablePureComponent {
}
if
(
status
.
get
(
'
in_reply_to_id
'
,
null
)
===
null
)
{
replyIcon
=
'
reply
'
;
replyTitle
=
intl
.
formatMessage
(
messages
.
reply
);
}
else
{
replyIcon
=
'
reply-all
'
;
replyTitle
=
intl
.
formatMessage
(
messages
.
replyAll
);
}
...
...
@@ -204,7 +201,7 @@ class StatusActionBar extends ImmutablePureComponent {
return
(
<
div
className
=
'
status__action-bar
'
>
<
div
className
=
'
status__action-bar__counter
'
><
IconButton
className
=
'
status__action-bar-button
'
disabled
=
{
anonymousAccess
}
title
=
{
replyTitle
}
icon
=
{
reply
Icon
}
onClick
=
{
this
.
handleReplyClick
}
/><span className='status__action-bar__counter__label' >{obfuscatedCount
(
status.get
(
'replies_count'
))
}</
span
><
/div
>
<
div
className
=
'
status__action-bar__counter
'
><
IconButton
className
=
'
status__action-bar-button
'
disabled
=
{
anonymousAccess
}
title
=
{
replyTitle
}
icon
=
'
reply
'
onClick
=
{
this
.
handleReplyClick
}
/><span className='status__action-bar__counter__label' >{obfuscatedCount
(
status.get
(
'replies_count'
))
}</
span
><
/div
>
<
IconButton
className
=
'
status__action-bar-button
'
disabled
=
{
anonymousAccess
||
!
publicStatus
}
active
=
{
status
.
get
(
'
reblogged
'
)}
pressed
=
{
status
.
get
(
'
reblogged
'
)}
title
=
{
!
publicStatus
?
intl
.
formatMessage
(
messages
.
cannot_reblog
)
:
intl
.
formatMessage
(
messages
.
reblog
)}
icon
=
{
reblogIcon
}
onClick
=
{
this
.
handleReblogClick
}
/
>
<
IconButton
className
=
'
status__action-bar-button star-icon
'
disabled
=
{
anonymousAccess
}
animate
active
=
{
status
.
get
(
'
favourited
'
)}
pressed
=
{
status
.
get
(
'
favourited
'
)}
title
=
{
intl
.
formatMessage
(
messages
.
favourite
)}
icon
=
'
star
'
onClick
=
{
this
.
handleFavouriteClick
}
/
>
{
shareButton
}
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/components/status_list.js
+
2
-
0
View file @
0f436de0
...
...
@@ -104,6 +104,7 @@ export default class StatusList extends ImmutablePureComponent {
onMoveUp
=
{
this
.
handleMoveUp
}
onMoveDown
=
{
this
.
handleMoveDown
}
contextType
=
{
timelineId
}
showThread
/>
))
)
:
null
;
...
...
@@ -117,6 +118,7 @@ export default class StatusList extends ImmutablePureComponent {
onMoveUp
=
{
this
.
handleMoveUp
}
onMoveDown
=
{
this
.
handleMoveDown
}
contextType
=
{
timelineId
}
showThread
/>
)).
concat
(
scrollableContent
);
}
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/features/status/components/action_bar.js
+
1
-
1
View file @
0f436de0
...
...
@@ -159,7 +159,7 @@ class ActionBar extends React.PureComponent {
return
(
<
div
className
=
'
detailed-status__action-bar
'
>
<
div
className
=
'
detailed-status__button
'
><
IconButton
title
=
{
intl
.
formatMessage
(
messages
.
reply
)}
icon
=
{
status
.
get
(
'
in_reply_to_id
'
,
null
)
===
null
?
'
reply
'
:
'
reply-all
'
}
onClick
=
{
this
.
handleReplyClick
}
/></
div
>
<
div
className
=
'
detailed-status__button
'
><
IconButton
title
=
{
intl
.
formatMessage
(
messages
.
reply
)}
icon
=
'
reply
'
onClick
=
{
this
.
handleReplyClick
}
/></
div
>
<
div
className
=
'
detailed-status__button
'
><
IconButton
disabled
=
{
reblog_disabled
}
active
=
{
status
.
get
(
'
reblogged
'
)}
title
=
{
reblog_disabled
?
intl
.
formatMessage
(
messages
.
cannot_reblog
)
:
intl
.
formatMessage
(
messages
.
reblog
)}
icon
=
{
reblogIcon
}
onClick
=
{
this
.
handleReblogClick
}
/></
div
>
<
div
className
=
'
detailed-status__button
'
><
IconButton
className
=
'
star-icon
'
animate
active
=
{
status
.
get
(
'
favourited
'
)}
title
=
{
intl
.
formatMessage
(
messages
.
favourite
)}
icon
=
'
star
'
onClick
=
{
this
.
handleFavouriteClick
}
/></
div
>
{
shareButton
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment