Skip to content

Commit

Permalink
Hide full post due to low ratings. Also prevents spidering of the mat…
Browse files Browse the repository at this point in the history
…erial.
  • Loading branch information
James Calfee committed Sep 2, 2016
1 parent bf20319 commit 5fb6153
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion app/components/pages/Post.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,37 @@ class Post extends React.Component {
this.setState({commentHidden: true})
}

showAnywayClick = () => {
this.setState({showAnyway: true})
}

render() {
const {showSignUp} = this
const {current_user, following, signup_bonus} = this.props
const {showNegativeComments, commentHidden} = this.state
const {showNegativeComments, commentHidden, showAnyway} = this.state
const rout_params = this.props.routeParams;
let g = this.props.global;
let post = rout_params.username + '/' + rout_params.slug;
const dis = g.get('content').get(post);
if (!dis) return null;

if(!showAnyway) {
const {authorRepLog10, netVoteSign} = dis.get('stats').toJS()
if(authorRepLog10 < 1 || netVoteSign < 0) {
return (
<div className="Post">
<div className="row">
<div className="column">
<div>
<p onClick={this.showAnywayClick}>This post was hidden due to low ratings. <button style={{marginBottom: 0}} className="button hollow tiny float-right" onClick={this.showAnywayClick}>Show</button></p>
</div>
</div>
</div>
</div>
)
}
}

const replies = dis.get('replies').toJS();

let sort_order = 'trending';
Expand Down

0 comments on commit 5fb6153

Please sign in to comment.