1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01:00

Clean up the prize AccordionList and fix merge bug

This commit is contained in:
Brett Sun 2016-02-05 10:39:46 +01:00
parent 8927ccb847
commit 1091e76447
2 changed files with 36 additions and 30 deletions

View File

@ -89,7 +89,8 @@ let AccordionListItemPrize = React.createClass({
rating={rating} rating={rating}
ratingAmount={5} /> ratingAmount={5} />
</Link> </Link>
</div>); </div>
);
} else { } else {
if (currentUser.is_judge) { if (currentUser.is_judge) {
return ( return (
@ -108,14 +109,13 @@ let AccordionListItemPrize = React.createClass({
); );
} }
} }
} } else {
return this.getPrizeButtonsParticipant(); return this.getPrizeButtonsParticipant();
}
}, },
getPrizeButtonsParticipant() { getPrizeButtonsParticipant() {
return ( return (
<div>
<AclProxy <AclProxy
aclObject={this.props.content.acl} aclObject={this.props.content.acl}
aclName="acl_wallet_submit"> aclName="acl_wallet_submit">
@ -124,7 +124,6 @@ let AccordionListItemPrize = React.createClass({
piece={this.props.content} piece={this.props.content}
handleSuccess={this.handleSubmitPrizeSuccess} /> handleSuccess={this.handleSubmitPrizeSuccess} />
</AclProxy> </AclProxy>
</div>
); );
}, },
@ -149,6 +148,8 @@ let AccordionListItemPrize = React.createClass({
}, },
getPrizeBadge() { getPrizeBadge() {
const { currentUser } = this.props;
if (currentUser && currentUser.is_judge) { if (currentUser && currentUser.is_judge) {
return ( return (
<span className="pull-right ascribe-checkbox-wrapper ascribe-checkbox-badge"> <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; <span className="glyphicon glyphicon-eye-close" aria-hidden="true"/> : content.artist_name;
return ( return (
<div>
<AccordionListItemPiece <AccordionListItemPiece
className={className} className={className}
piece={content} piece={content}
@ -184,7 +184,6 @@ let AccordionListItemPrize = React.createClass({
badge={this.getPrizeBadge()}> badge={this.getPrizeBadge()}>
{children} {children}
</AccordionListItemPiece> </AccordionListItemPiece>
</div>
); );
} }
}); });

View File

@ -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() { render() {
const { currentUser, location } = this.props; const { currentUser, location } = this.props;
@ -79,7 +85,8 @@ let PrizePieceList = React.createClass({
customSubmitButton={this.getButtonSubmit()} customSubmitButton={this.getButtonSubmit()}
filterParams={[]} filterParams={[]}
orderParams={orderParams} orderParams={orderParams}
orderBy={currentUser.is_jury ? 'rating' : null} /> orderBy={currentUser.is_jury ? 'rating' : null}
shouldRedirect={this.shouldRedirect} />
); );
} }
}); });