added autocensor-specific banner message

This commit is contained in:
Ben Wheeler 2019-01-22 16:36:19 -05:00
parent ddf6793362
commit 971b3dc2d1
3 changed files with 37 additions and 22 deletions

View file

@ -29,6 +29,8 @@
"project.credit": "Thanks to {userLink} for the original project {projectLink}.", "project.credit": "Thanks to {userLink} for the original project {projectLink}.",
"project.deletedBanner": "Note: This project is in the trash folder", "project.deletedBanner": "Note: This project is in the trash folder",
"project.defaultCensoredMessage": "This project was removed by the Scratch Team because it was disrespectful, inappropriate for all ages, or otherwise breaks the Scratch community guidelines.", "project.defaultCensoredMessage": "This project was removed by the Scratch Team because it was disrespectful, inappropriate for all ages, or otherwise breaks the Scratch community guidelines.",
"project.communityCensoredMessage": "Your project has been temporarily un-shared because multiple people reported it as inappropriate.",
"project.willReviewCensoredMessage": "The Scratch Team will review the project based on the {communityGuidelinesLink}, and either restore the project or confirm the censorship.",
"project.tempCensoredMessage": "Please read the {communityGuidelinesLink} and be sure to edit the project to make sure it's respectful before resharing it.", "project.tempCensoredMessage": "Please read the {communityGuidelinesLink} and be sure to edit the project to make sure it's respectful before resharing it.",
"project.permCensoredMessage": "It cannot be reshared at any time in the future.", "project.permCensoredMessage": "It cannot be reshared at any time in the future.",
"project.communityGuidelines": "community guidelines", "project.communityGuidelines": "community guidelines",

View file

@ -148,6 +148,24 @@ const PreviewPresentation = ({
if (visibilityInfo.message) { // if message is present, set innerHTML with it if (visibilityInfo.message) { // if message is present, set innerHTML with it
censoredMessage = embedCensorMessage(visibilityInfo.message); censoredMessage = embedCensorMessage(visibilityInfo.message);
} else { // if message is blank or missing, use default } else { // if message is blank or missing, use default
const communityGuidelinesLink = (
<a href="/community_guidelines/">
<FormattedMessage id="project.communityGuidelines" />
</a>
);
if (visibilityInfo.censoredByCommunity) {
censoredMessage = (
<React.Fragment>
<FormattedMessage id="project.communityCensoredMessage" />
<br />
<br />
<FormattedMessage
id="project.willReviewCensoredMessage"
values={{communityGuidelinesLink: communityGuidelinesLink}}
/>
</React.Fragment>
);
} else {
censoredMessage = ( censoredMessage = (
<React.Fragment> <React.Fragment>
<FormattedMessage id="project.defaultCensoredMessage" /> <FormattedMessage id="project.defaultCensoredMessage" />
@ -156,13 +174,7 @@ const PreviewPresentation = ({
{visibilityInfo.reshareable ? ( {visibilityInfo.reshareable ? (
<FormattedMessage <FormattedMessage
id="project.tempCensoredMessage" id="project.tempCensoredMessage"
values={{ values={{communityGuidelinesLink: communityGuidelinesLink}}
communityGuidelinesLink: (
<a href="/community_guidelines/">
<FormattedMessage id="project.communityGuidelines" />
</a>
)
}}
/> />
) : ( ) : (
<FormattedMessage id="project.permCensoredMessage" /> <FormattedMessage id="project.permCensoredMessage" />
@ -170,6 +182,7 @@ const PreviewPresentation = ({
</React.Fragment> </React.Fragment>
); );
} }
}
banner = (<Banner banner = (<Banner
className="banner-danger" className="banner-danger"
message={censoredMessage} message={censoredMessage}