From 33d5480f2f2be7a4287fb344cbd3f4e6b2e87c7b Mon Sep 17 00:00:00 2001 From: diminator Date: Thu, 27 Aug 2015 10:10:39 +0200 Subject: [PATCH] review comments --- .../ascribe_forms/form_loan_request_answer.js | 2 - .../accordion_list_item_prize.js | 40 ++++++++++--------- .../ascribe_detail/prize_piece_container.js | 37 ++++++++++------- 3 files changed, 44 insertions(+), 35 deletions(-) diff --git a/js/components/ascribe_forms/form_loan_request_answer.js b/js/components/ascribe_forms/form_loan_request_answer.js index cbff1a39..d2177a7b 100644 --- a/js/components/ascribe_forms/form_loan_request_answer.js +++ b/js/components/ascribe_forms/form_loan_request_answer.js @@ -85,8 +85,6 @@ let LoanRequestAnswerForm = React.createClass({ gallery={this.state.loanRequest ? this.state.loanRequest.gallery : null} startdate={startDate} enddate={endDate} - //showStartDate={false} - //showEndDate={false} showPassword={true} showPersonalMessage={false} handleSuccess={this.handleLoanSuccess}/> diff --git a/js/components/whitelabel/prize/components/ascribe_accordion_list/accordion_list_item_prize.js b/js/components/whitelabel/prize/components/ascribe_accordion_list/accordion_list_item_prize.js index 57a7a2ea..a2f34bba 100644 --- a/js/components/whitelabel/prize/components/ascribe_accordion_list/accordion_list_item_prize.js +++ b/js/components/whitelabel/prize/components/ascribe_accordion_list/accordion_list_item_prize.js @@ -69,18 +69,18 @@ let AccordionListItemPrize = React.createClass({ getPrizeButtons() { if (this.state.currentUser && this.state.currentUser.is_jury){ - if (this.props.content.ratings && + if ((this.props.content.ratings) && (this.props.content.ratings.rating || this.props.content.ratings.average)){ // jury and rating available let rating = null, caption = null; if (this.props.content.ratings.rating){ rating = parseInt(this.props.content.ratings.rating, 10); - caption = 'Your rating'; + caption = getLangText('Your rating'); } else if (this.props.content.ratings.average){ rating = this.props.content.ratings.average; - caption = 'Average of ' + this.props.content.ratings.num_ratings + ' rating(s)'; + caption = getLangText('Average of ' + this.props.content.ratings.num_ratings + ' rating(s)'); } return ( @@ -101,7 +101,7 @@ let AccordionListItemPrize = React.createClass({ if (this.state.currentUser.is_judge){ return (
- Not rated + {getLangText('Not rated')}
); } @@ -109,7 +109,7 @@ let AccordionListItemPrize = React.createClass({ return (
- Submit your rating + {getLangText('Submit your rating')}
); @@ -144,25 +144,28 @@ let AccordionListItemPrize = React.createClass({ this.state.orderBy, this.state.orderAsc, this.state.filterBy); }, + onSelectChange(){ + PrizeRatingActions.toggleShortlist(this.props.content.id) + .then( + (res) => { + this.refreshPieceData(); + return res; + }) + .then( + (res) => { + this.handleShortlistSuccess(res.notification); + } + ); + + }, + getPrizeBadge(){ if (this.state.currentUser && this.state.currentUser.is_judge) { return ( { - PrizeRatingActions.toggleShortlist(this.props.content.id) - .then( - (res) => { - this.refreshPieceData(); - return res; - }) - .then( - (res) => { - this.handleShortlistSuccess(res.notification); - } - ); - }}/> + onChange={this.onSelectChange}/> ); } @@ -170,6 +173,7 @@ let AccordionListItemPrize = React.createClass({ }, render() { + // Only show the artist name if you are the participant or if you are a judge and the piece is shortlisted let artistName = ((this.state.currentUser.is_jury && !this.state.currentUser.is_judge) || (this.state.currentUser.is_judge && !this.props.content.selected )) ?