mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 09:23:13 +01:00
Clean up the prize AccordionList and fix merge bug
This commit is contained in:
parent
8927ccb847
commit
1091e76447
@ -89,7 +89,8 @@ let AccordionListItemPrize = React.createClass({
|
||||
rating={rating}
|
||||
ratingAmount={5} />
|
||||
</Link>
|
||||
</div>);
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
if (currentUser.is_judge) {
|
||||
return (
|
||||
@ -108,14 +109,13 @@ let AccordionListItemPrize = React.createClass({
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return this.getPrizeButtonsParticipant();
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
getPrizeButtonsParticipant() {
|
||||
return (
|
||||
<div>
|
||||
<AclProxy
|
||||
aclObject={this.props.content.acl}
|
||||
aclName="acl_wallet_submit">
|
||||
@ -124,7 +124,6 @@ let AccordionListItemPrize = React.createClass({
|
||||
piece={this.props.content}
|
||||
handleSuccess={this.handleSubmitPrizeSuccess} />
|
||||
</AclProxy>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
@ -149,6 +148,8 @@ let AccordionListItemPrize = React.createClass({
|
||||
},
|
||||
|
||||
getPrizeBadge() {
|
||||
const { currentUser } = this.props;
|
||||
|
||||
if (currentUser && currentUser.is_judge) {
|
||||
return (
|
||||
<span className="pull-right ascribe-checkbox-wrapper ascribe-checkbox-badge">
|
||||
@ -170,7 +171,6 @@ let AccordionListItemPrize = React.createClass({
|
||||
<span className="glyphicon glyphicon-eye-close" aria-hidden="true"/> : content.artist_name;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<AccordionListItemPiece
|
||||
className={className}
|
||||
piece={content}
|
||||
@ -184,7 +184,6 @@ let AccordionListItemPrize = React.createClass({
|
||||
badge={this.getPrizeBadge()}>
|
||||
{children}
|
||||
</AccordionListItemPiece>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
@ -58,6 +58,12 @@ let PrizePieceList = React.createClass({
|
||||
}
|
||||
},
|
||||
|
||||
shouldRedirect(pieceCount) {
|
||||
const { currentUser } = this.props;
|
||||
|
||||
return !currentUser.is_admin && !currentUser.is_jury && !currentUser.is_judge && !pieceCount;
|
||||
},
|
||||
|
||||
render() {
|
||||
const { currentUser, location } = this.props;
|
||||
|
||||
@ -79,7 +85,8 @@ let PrizePieceList = React.createClass({
|
||||
customSubmitButton={this.getButtonSubmit()}
|
||||
filterParams={[]}
|
||||
orderParams={orderParams}
|
||||
orderBy={currentUser.is_jury ? 'rating' : null} />
|
||||
orderBy={currentUser.is_jury ? 'rating' : null}
|
||||
shouldRedirect={this.shouldRedirect} />
|
||||
);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user