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

@ -2,7 +2,7 @@
$navigation-height: 50px;
.banner-outer{
.banner-outer {
display: flex;
background-color: $ui-orange-25percent;
width: 100%;
@ -32,7 +32,7 @@ $navigation-height: 50px;
flex-wrap: nowrap;
}
.banner-text{
.banner-text {
padding: .625rem 0;
max-width: 50rem;
line-height: 1.25rem;

View file

@ -29,6 +29,8 @@
"project.credit": "Thanks to {userLink} for the original project {projectLink}.",
"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.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.permCensoredMessage": "It cannot be reshared at any time in the future.",
"project.communityGuidelines": "community guidelines",

View file

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