mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 10:25:08 +01:00
Implement static feedback for submitted pieces
This commit is contained in:
parent
66aef4886f
commit
0438f461c2
@ -67,8 +67,6 @@ const PRRegisterPieceForm = React.createClass({
|
|||||||
registerPieceFormData.thumbnail_file = thumbnailKey.state.value;
|
registerPieceFormData.thumbnail_file = thumbnailKey.state.value;
|
||||||
registerPieceFormData.terms = true;
|
registerPieceFormData.terms = true;
|
||||||
|
|
||||||
console.log(registerPieceFormData);
|
|
||||||
|
|
||||||
// submitting the piece
|
// submitting the piece
|
||||||
requests
|
requests
|
||||||
.post(ApiUrls.pieces_list, { body: registerPieceFormData })
|
.post(ApiUrls.pieces_list, { body: registerPieceFormData })
|
||||||
@ -81,7 +79,7 @@ const PRRegisterPieceForm = React.createClass({
|
|||||||
proofOfPayment.refs.input.createBlobRoutine();
|
proofOfPayment.refs.input.createBlobRoutine();
|
||||||
});
|
});
|
||||||
|
|
||||||
//setCookie(currentUser.email, piece.id);
|
setCookie(currentUser.email, piece.id);
|
||||||
|
|
||||||
return requests.post(ApiUrls.piece_extradata, {
|
return requests.post(ApiUrls.piece_extradata, {
|
||||||
body: {
|
body: {
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import Glyphicon from 'react-bootstrap/lib/Glyphicon';
|
||||||
|
|
||||||
|
|
||||||
|
const PRHero = React.createClass({
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<div className="piece--hero">
|
||||||
|
<h2><Glyphicon glyph="ok" /> Congratulations!</h2>
|
||||||
|
<h1>You have successfully submitted to Portfolio Review 2016</h1>
|
||||||
|
<p>See below, your uploaded portfolio:</p>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export default PRHero;
|
@ -87,13 +87,13 @@ const PRLanding = React.createClass({
|
|||||||
if (this.state.prize && this.state.prize.active){
|
if (this.state.prize && this.state.prize.active){
|
||||||
return (
|
return (
|
||||||
<p>
|
<p>
|
||||||
{getLangText('This is the submission page for Portfolio Review 2015.')}
|
{getLangText('This is the submission page for Portfolio Review 2016.')}
|
||||||
</p>
|
</p>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<p>
|
<p>
|
||||||
{getLangText('Submissions for Portfolio Review 2015 are now closed.')}
|
{getLangText('Submissions for Portfolio Review 2016 are now closed.')}
|
||||||
</p>
|
</p>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -103,7 +103,7 @@ const PRLanding = React.createClass({
|
|||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-xs-12 wp-landing-wrapper">
|
<div className="col-xs-12 wp-landing-wrapper">
|
||||||
<h1>
|
<h1>
|
||||||
{getLangText('Welcome to Portfolio Review 2015')}
|
{getLangText('Welcome to Portfolio Review 2016')}
|
||||||
</h1>
|
</h1>
|
||||||
{this.getTitle()}
|
{this.getTitle()}
|
||||||
{this.getButtons()}
|
{this.getButtons()}
|
||||||
|
@ -60,7 +60,7 @@ const PRRegisterPiece = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={6}>
|
<Col xs={6}>
|
||||||
<div className="register-piece--hero">
|
<div className="register-piece--info">
|
||||||
<h1>Portfolio Review</h1>
|
<h1>Portfolio Review</h1>
|
||||||
<h2>{getLangText('Submission closing on %s', ' 21 Dec 2015')}</h2>
|
<h2>{getLangText('Submission closing on %s', ' 21 Dec 2015')}</h2>
|
||||||
<p>
|
<p>
|
||||||
|
@ -3,10 +3,16 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import GlobalNotification from '../../../global_notification';
|
import GlobalNotification from '../../../global_notification';
|
||||||
|
|
||||||
|
import Hero from './components/pr_hero';
|
||||||
|
|
||||||
|
import UserStore from '../../../../stores/user_store';
|
||||||
|
import UserActions from '../../../../actions/user_actions';
|
||||||
|
|
||||||
import { getSubdomain } from '../../../../utils/general_utils';
|
import { getSubdomain } from '../../../../utils/general_utils';
|
||||||
|
import { getCookie } from '../../../../utils/fetch_api_utils';
|
||||||
|
|
||||||
|
|
||||||
let PrizeApp = React.createClass({
|
let PRApp = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
children: React.PropTypes.oneOfType([
|
children: React.PropTypes.oneOfType([
|
||||||
React.PropTypes.arrayOf(React.PropTypes.element),
|
React.PropTypes.arrayOf(React.PropTypes.element),
|
||||||
@ -16,18 +22,44 @@ let PrizeApp = React.createClass({
|
|||||||
routes: React.PropTypes.arrayOf(React.PropTypes.object)
|
routes: React.PropTypes.arrayOf(React.PropTypes.object)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getInitialState() {
|
||||||
|
return UserStore.getState();
|
||||||
|
},
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
UserStore.listen(this.onChange);
|
||||||
|
UserActions.fetchCurrentUser();
|
||||||
|
},
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
UserStore.unlisten(this.onChange);
|
||||||
|
},
|
||||||
|
|
||||||
|
onChange(state) {
|
||||||
|
this.setState(state);
|
||||||
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { children } = this.props;
|
const { history, children } = this.props;
|
||||||
|
const { currentUser } = this.state;
|
||||||
let subdomain = getSubdomain();
|
let subdomain = getSubdomain();
|
||||||
|
let header;
|
||||||
|
|
||||||
|
if (currentUser && currentUser.email && history.isActive(`/pieces/${getCookie(currentUser.email)}`)) {
|
||||||
|
header = <Hero />;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={'container ascribe-prize-app client--' + subdomain}>
|
<div>
|
||||||
{children}
|
{header}
|
||||||
<GlobalNotification />
|
<div className={'container ascribe-prize-app client--' + subdomain}>
|
||||||
<div id="modal" className="container"></div>
|
{children}
|
||||||
|
<GlobalNotification />
|
||||||
|
<div id="modal" className="container"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default PrizeApp;
|
export default PRApp;
|
||||||
|
@ -16,6 +16,7 @@ import PrizeRatingActions from '../../actions/prize_rating_actions';
|
|||||||
import PrizeRatingStore from '../../stores/prize_rating_store';
|
import PrizeRatingStore from '../../stores/prize_rating_store';
|
||||||
|
|
||||||
import UserStore from '../../../../../../stores/user_store';
|
import UserStore from '../../../../../../stores/user_store';
|
||||||
|
import UserActions from '../../../../../../actions/user_actions';
|
||||||
|
|
||||||
import Piece from '../../../../../../components/ascribe_detail/piece';
|
import Piece from '../../../../../../components/ascribe_detail/piece';
|
||||||
import Note from '../../../../../../components/ascribe_detail/note';
|
import Note from '../../../../../../components/ascribe_detail/note';
|
||||||
@ -27,6 +28,8 @@ import Property from '../../../../../../components/ascribe_forms/property';
|
|||||||
import InputTextAreaToggable from '../../../../../../components/ascribe_forms/input_textarea_toggable';
|
import InputTextAreaToggable from '../../../../../../components/ascribe_forms/input_textarea_toggable';
|
||||||
import CollapsibleParagraph from '../../../../../../components/ascribe_collapsible/collapsible_paragraph';
|
import CollapsibleParagraph from '../../../../../../components/ascribe_collapsible/collapsible_paragraph';
|
||||||
|
|
||||||
|
import FurtherDetailsFileuploader from '../../../../../ascribe_detail/further_details_fileuploader';
|
||||||
|
|
||||||
import InputCheckbox from '../../../../../ascribe_forms/input_checkbox';
|
import InputCheckbox from '../../../../../ascribe_forms/input_checkbox';
|
||||||
import LoanForm from '../../../../../ascribe_forms/form_loan';
|
import LoanForm from '../../../../../ascribe_forms/form_loan';
|
||||||
import ListRequestActions from '../../../../../ascribe_forms/list_form_request_actions';
|
import ListRequestActions from '../../../../../ascribe_forms/list_form_request_actions';
|
||||||
@ -48,7 +51,8 @@ import { setDocumentTitle } from '../../../../../../utils/dom_utils';
|
|||||||
*/
|
*/
|
||||||
let PieceContainer = React.createClass({
|
let PieceContainer = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
params: React.PropTypes.object
|
params: React.PropTypes.object,
|
||||||
|
location: React.PropTypes.object
|
||||||
},
|
},
|
||||||
|
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
@ -62,6 +66,7 @@ let PieceContainer = React.createClass({
|
|||||||
PieceStore.listen(this.onChange);
|
PieceStore.listen(this.onChange);
|
||||||
PieceActions.fetchOne(this.props.params.pieceId);
|
PieceActions.fetchOne(this.props.params.pieceId);
|
||||||
UserStore.listen(this.onChange);
|
UserStore.listen(this.onChange);
|
||||||
|
UserActions.fetchCurrentUser();
|
||||||
|
|
||||||
// Every time we enter the piece detail page, just reset the piece
|
// Every time we enter the piece detail page, just reset the piece
|
||||||
// store as it will otherwise display wrong/old data once the user loads
|
// store as it will otherwise display wrong/old data once the user loads
|
||||||
@ -142,7 +147,7 @@ let PieceContainer = React.createClass({
|
|||||||
<NavigationHeader
|
<NavigationHeader
|
||||||
piece={this.state.piece}
|
piece={this.state.piece}
|
||||||
currentUser={this.state.currentUser}/>
|
currentUser={this.state.currentUser}/>
|
||||||
<hr/>
|
|
||||||
<h1 className="ascribe-detail-title">{this.state.piece.title}</h1>
|
<h1 className="ascribe-detail-title">{this.state.piece.title}</h1>
|
||||||
<DetailProperty label={getLangText('BY')} value={artistName} />
|
<DetailProperty label={getLangText('BY')} value={artistName} />
|
||||||
<DetailProperty label={getLangText('DATE')} value={new Date(this.state.piece.date_created).getFullYear()} />
|
<DetailProperty label={getLangText('DATE')} value={new Date(this.state.piece.date_created).getFullYear()} />
|
||||||
@ -157,7 +162,7 @@ let PieceContainer = React.createClass({
|
|||||||
piece={this.state.piece}
|
piece={this.state.piece}
|
||||||
currentUser={this.state.currentUser}/>
|
currentUser={this.state.currentUser}/>
|
||||||
}>
|
}>
|
||||||
<PrizePieceDetails piece={this.state.piece}/>
|
<PrizePieceDetails piece={this.state.piece} location={this.props.location}/>
|
||||||
</Piece>
|
</Piece>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@ -177,24 +182,28 @@ let NavigationHeader = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.props.currentUser && this.props.currentUser.email && this.props.piece && this.props.piece.navigation) {
|
const { currentUser, piece } = this.props;
|
||||||
let nav = this.props.piece.navigation;
|
|
||||||
|
if (currentUser && currentUser.email && currentUser.is_judge && currentUser.is_jury &&
|
||||||
|
!currentUser.is_admin && piece && piece.navigation) {
|
||||||
|
let nav = piece.navigation;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{marginBottom: '1em'}}>
|
<div style={{marginBottom: '1em'}}>
|
||||||
<div className="row no-margin">
|
<div className="row no-margin">
|
||||||
<Link className="disable-select" to={`/pieces/${ nav.prev_index || this.props.piece.id }`}>
|
<Link className="disable-select" to={`/pieces/${ nav.prev_index || piece.id }`}>
|
||||||
<span className="glyphicon glyphicon-chevron-left pull-left link-ascribe" aria-hidden="true">
|
<span className="glyphicon glyphicon-chevron-left pull-left link-ascribe" aria-hidden="true">
|
||||||
{getLangText('Previous')}
|
{getLangText('Previous')}
|
||||||
</span>
|
</span>
|
||||||
</Link>
|
</Link>
|
||||||
<Link className="disable-select" to={`/pieces/${ nav.next_index || this.props.piece.id }`}>
|
<Link className="disable-select" to={`/pieces/${ nav.next_index || piece.id }`}>
|
||||||
<span className="pull-right link-ascribe">
|
<span className="pull-right link-ascribe">
|
||||||
{getLangText('Next')}
|
{getLangText('Next')}
|
||||||
<span className="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
|
<span className="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
|
||||||
</span>
|
</span>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
<hr/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -417,7 +426,8 @@ let PrizePieceRatings = React.createClass({
|
|||||||
|
|
||||||
let PrizePieceDetails = React.createClass({
|
let PrizePieceDetails = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
piece: React.PropTypes.object
|
piece: React.PropTypes.object,
|
||||||
|
location: React.PropTypes.object
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@ -432,6 +442,8 @@ let PrizePieceDetails = React.createClass({
|
|||||||
<Form ref='form'>
|
<Form ref='form'>
|
||||||
{Object.keys(this.props.piece.extra_data).map((data) => {
|
{Object.keys(this.props.piece.extra_data).map((data) => {
|
||||||
let label = data.replace('_', ' ');
|
let label = data.replace('_', ' ');
|
||||||
|
const value = this.props.piece.extra_data[data] || 'N/A';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Property
|
<Property
|
||||||
name={data}
|
name={data}
|
||||||
@ -440,11 +452,20 @@ let PrizePieceDetails = React.createClass({
|
|||||||
overrideForm={true}>
|
overrideForm={true}>
|
||||||
<InputTextAreaToggable
|
<InputTextAreaToggable
|
||||||
rows={1}
|
rows={1}
|
||||||
defaultValue={this.props.piece.extra_data[data]}/>
|
defaultValue={value}/>
|
||||||
</Property>);
|
</Property>
|
||||||
}
|
);
|
||||||
)}
|
})}
|
||||||
<hr />
|
<FurtherDetailsFileuploader
|
||||||
|
submitFile={() => {}}
|
||||||
|
setIsUploadReady={() => {}}
|
||||||
|
isReadyForFormSubmission={() => {}}
|
||||||
|
editable={false}
|
||||||
|
overrideForm={true}
|
||||||
|
pieceId={this.props.piece.id}
|
||||||
|
otherData={this.props.piece.other_data}
|
||||||
|
multiple={true}
|
||||||
|
location={location}/>
|
||||||
</Form>
|
</Form>
|
||||||
</CollapsibleParagraph>
|
</CollapsibleParagraph>
|
||||||
);
|
);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
.client--portfolioreview {
|
.client--portfolioreview {
|
||||||
padding-top: 20px !important;
|
padding-top: 0 !important;
|
||||||
|
|
||||||
.register-piece--hero {
|
.register-piece--info {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
h1, h2 {
|
h1, h2 {
|
||||||
@ -38,4 +38,25 @@
|
|||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.piece--hero {
|
||||||
|
text-align: center;
|
||||||
|
padding: 1em 0 1em 0;
|
||||||
|
margin-bottom: 3em;
|
||||||
|
border-bottom: 1px solid rgba(0, 0, 0, .1);
|
||||||
|
|
||||||
|
background-color: white;
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ascribe-property {
|
||||||
|
> p {
|
||||||
|
> span {
|
||||||
|
text-transform: capitalize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user