Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
mastofe
Commits
4e170d46
Verified
Commit
4e170d46
authored
Jun 26, 2018
by
Haelwenn
Browse files
[mastofe] Adds deleting others notice if you have the rights(~moderator)
Closes:
#20
parent
2942716f
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/javascript/flavours/glitch/components/status_action_bar.js
View file @
4e170d46
...
...
@@ -5,7 +5,7 @@ import IconButton from './icon_button';
import
DropdownMenuContainer
from
'
flavours/glitch/containers/dropdown_menu_container
'
;
import
{
defineMessages
,
injectIntl
}
from
'
react-intl
'
;
import
ImmutablePureComponent
from
'
react-immutable-pure-component
'
;
import
{
me
,
isStaff
}
from
'
flavours/glitch/util/initial_state
'
;
import
{
me
,
isStaff
,
deleteOthersNotice
}
from
'
flavours/glitch/util/initial_state
'
;
import
RelativeTimestamp
from
'
./relative_timestamp
'
;
import
{
accountAdminLink
,
statusAdminLink
}
from
'
flavours/glitch/util/backend_links
'
;
...
...
@@ -255,6 +255,9 @@ class StatusActionBar extends ImmutablePureComponent {
});
}
}
if
(
deleteOthersNotice
)
{
menu
.
push
({
text
:
intl
.
formatMessage
(
messages
.
delete
),
action
:
this
.
handleDeleteClick
});
}
}
if
(
status
.
get
(
'
in_reply_to_id
'
,
null
)
===
null
)
{
...
...
app/javascript/flavours/glitch/util/initial_state.js
View file @
4e170d46
...
...
@@ -10,6 +10,7 @@ const initialState = element && function () {
}();
const
getMeta
=
(
prop
)
=>
initialState
&&
initialState
.
meta
&&
initialState
.
meta
[
prop
];
const
getRight
=
(
prop
)
=>
initialState
&&
initialState
.
rights
&&
initialState
.
rights
[
prop
];
export
const
reduceMotion
=
getMeta
(
'
reduce_motion
'
);
export
const
autoPlayGif
=
getMeta
(
'
auto_play_gif
'
);
...
...
@@ -35,4 +36,6 @@ export const usePendingItems = getMeta('use_pending_items');
export
const
useSystemEmojiFont
=
getMeta
(
'
system_emoji_font
'
);
export
const
showTrends
=
getMeta
(
'
trends
'
);
export
const
deleteOthersNotice
=
getRight
(
'
delete_others_notice
'
);
export
default
initialState
;
app/javascript/mastodon/components/status_action_bar.js
View file @
4e170d46
...
...
@@ -6,7 +6,7 @@ import IconButton from './icon_button';
import
DropdownMenuContainer
from
'
../containers/dropdown_menu_container
'
;
import
{
defineMessages
,
injectIntl
}
from
'
react-intl
'
;
import
ImmutablePureComponent
from
'
react-immutable-pure-component
'
;
import
{
me
,
isStaff
}
from
'
../initial_state
'
;
import
{
me
,
deleteOthersNotice
,
isStaff
}
from
'
../initial_state
'
;
const
messages
=
defineMessages
({
delete
:
{
id
:
'
status.delete
'
,
defaultMessage
:
'
Delete
'
},
...
...
@@ -303,6 +303,9 @@ class StatusActionBar extends ImmutablePureComponent {
menu
.
push
({
text
:
intl
.
formatMessage
(
messages
.
admin_account
,
{
name
:
account
.
get
(
'
username
'
)
}),
href
:
`/admin/accounts/
${
status
.
getIn
([
'
account
'
,
'
id
'
])}
`
});
menu
.
push
({
text
:
intl
.
formatMessage
(
messages
.
admin_status
),
href
:
`/admin/accounts/
${
status
.
getIn
([
'
account
'
,
'
id
'
])}
/statuses/
${
status
.
get
(
'
id
'
)}
`
});
}
if
(
deleteOthersNotice
)
{
menu
.
push
({
text
:
intl
.
formatMessage
(
messages
.
delete
),
action
:
this
.
handleDeleteClick
});
}
}
if
(
status
.
get
(
'
visibility
'
)
===
'
direct
'
)
{
...
...
app/javascript/mastodon/initial_state.js
View file @
4e170d46
...
...
@@ -2,6 +2,7 @@ const element = document.getElementById('initial-state');
const
initialState
=
element
&&
JSON
.
parse
(
element
.
textContent
);
const
getMeta
=
(
prop
)
=>
initialState
&&
initialState
.
meta
&&
initialState
.
meta
[
prop
];
const
getRight
=
(
prop
)
=>
initialState
&&
initialState
.
rights
&&
initialState
.
rights
[
prop
];
export
const
reduceMotion
=
getMeta
(
'
reduce_motion
'
);
export
const
autoPlayGif
=
getMeta
(
'
auto_play_gif
'
);
...
...
@@ -27,4 +28,6 @@ export const showTrends = getMeta('trends');
export
const
title
=
getMeta
(
'
title
'
);
export
const
cropImages
=
getMeta
(
'
crop_images
'
);
export
const
deleteOthersNotice
=
getRight
(
'
delete_others_notice
'
);
export
default
initialState
;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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