mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
fix PR issues
This commit is contained in:
parent
4dcd66c05b
commit
d05662b879
@ -32,7 +32,7 @@ let FurtherDetailsFileuploader = React.createClass({
|
|||||||
render() {
|
render() {
|
||||||
// Essentially there a three cases important to the fileuploader
|
// Essentially there a three cases important to the fileuploader
|
||||||
//
|
//
|
||||||
// 1. there is no other_data => do not show the fileuploader at all
|
// 1. there is no other_data => do not show the fileuploader at all (where otherData is now an array)
|
||||||
// 2. there is other_data, but user has no edit rights => show fileuploader but without action buttons
|
// 2. there is other_data, but user has no edit rights => show fileuploader but without action buttons
|
||||||
// 3. both other_data and editable are defined or true => show fileuploader with all action buttons
|
// 3. both other_data and editable are defined or true => show fileuploader with all action buttons
|
||||||
if (!this.props.editable && (!this.props.otherData || this.props.otherData.length === 0)) {
|
if (!this.props.editable && (!this.props.otherData || this.props.otherData.length === 0)) {
|
||||||
|
@ -18,6 +18,9 @@ let InputDate = React.createClass({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// InputDate needs to support setting a defaultValue from outside.
|
||||||
|
// If this is the case, we need to call handleChange to propagate this
|
||||||
|
// to the outer Property
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
if(!this.state.value && !this.state.value_moment && nextProps.defaultValue) {
|
if(!this.state.value && !this.state.value_moment && nextProps.defaultValue) {
|
||||||
this.handleChange(this.props.defaultValue);
|
this.handleChange(this.props.defaultValue);
|
||||||
|
@ -167,6 +167,8 @@ let SlidesContainer = React.createClass({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// breadcrumbs are defined as attributes of the slides.
|
||||||
|
// To extract them we have to read the DOM element's attributes
|
||||||
extractBreadcrumbs() {
|
extractBreadcrumbs() {
|
||||||
let breadcrumbs = [];
|
let breadcrumbs = [];
|
||||||
|
|
||||||
@ -179,6 +181,10 @@ let SlidesContainer = React.createClass({
|
|||||||
return breadcrumbs;
|
return breadcrumbs;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// If startFrom is defined as a URL parameter, this can manipulate
|
||||||
|
// the number of children that are injected into the DOM.
|
||||||
|
// Therefore React.Children.count does not work anymore and we
|
||||||
|
// need to implement our own method.
|
||||||
customChildrenCount() {
|
customChildrenCount() {
|
||||||
let count = 0;
|
let count = 0;
|
||||||
React.Children.forEach(this.props.children, (child, i) => {
|
React.Children.forEach(this.props.children, (child, i) => {
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
import classnames from 'classnames';
|
||||||
|
|
||||||
import Col from 'react-bootstrap/lib/Col';
|
import Col from 'react-bootstrap/lib/Col';
|
||||||
|
|
||||||
|
|
||||||
@ -59,9 +61,14 @@ let SlidesContainerBreadcrumbs = React.createClass({
|
|||||||
sm={columnWidth}
|
sm={columnWidth}
|
||||||
key={i}>
|
key={i}>
|
||||||
<div className="ascribe-breadcrumb">
|
<div className="ascribe-breadcrumb">
|
||||||
<a className={this.props.slideNum === i ? 'active' : ''}>
|
<a className={classnames({'active': this.props.slideNum === i})}>
|
||||||
{breadcrumb}
|
{breadcrumb}
|
||||||
<span className={i === numSlides - 1 ? 'invisible' : '' + 'pull-right ' + glyphiconClassName}>
|
<span
|
||||||
|
className={classnames({
|
||||||
|
'invisible': i === numSlides - 1,
|
||||||
|
'pull-right': true,
|
||||||
|
[glyphiconClassName]: true
|
||||||
|
})}>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -63,6 +63,8 @@ let PieceContainer = React.createClass({
|
|||||||
UserStore.unlisten(this.onChange);
|
UserStore.unlisten(this.onChange);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// This is done to update the container when the user clicks on the prev or next
|
||||||
|
// button to update the URL parameter (and therefore to switch pieces)
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
if(this.props.params.pieceId !== nextProps.params.pieceId) {
|
if(this.props.params.pieceId !== nextProps.params.pieceId) {
|
||||||
PieceActions.updatePiece({});
|
PieceActions.updatePiece({});
|
||||||
@ -123,19 +125,20 @@ let NavigationHeader = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.props.currentUser && this.props.piece.navigation) {
|
if (this.props.currentUser && this.props.currentUser.email && this.props.piece && this.props.piece.navigation) {
|
||||||
let nav = this.props.piece.navigation;
|
let nav = this.props.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='piece' params={{pieceId: nav.prev_index ? nav.prev_index : this.props.piece.id}}>
|
<Link className="disable-select" to='piece' params={{pieceId: nav.prev_index ? nav.prev_index : this.props.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">
|
||||||
Previous
|
{getLangText('Previous')}
|
||||||
</span>
|
</span>
|
||||||
</Link>
|
</Link>
|
||||||
<Link className="disable-select" to='piece' params={{pieceId: nav.next_index ? nav.next_index : this.props.piece.id}}>
|
<Link className="disable-select" to='piece' params={{pieceId: nav.next_index ? nav.next_index : this.props.piece.id}}>
|
||||||
<span className="pull-right link-ascribe">
|
<span className="pull-right link-ascribe">
|
||||||
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>
|
||||||
@ -177,6 +180,10 @@ let PrizePieceRatings = React.createClass({
|
|||||||
PieceListStore.unlisten(this.onChange);
|
PieceListStore.unlisten(this.onChange);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// The StarRating component does not have a property that lets us set
|
||||||
|
// a default value at initialization. Since the ratingCache would otherwise on
|
||||||
|
// every mouseover be overridden, we need to set it ourselves initially to deal
|
||||||
|
// with the problem.
|
||||||
onChange(state) {
|
onChange(state) {
|
||||||
this.setState(state);
|
this.setState(state);
|
||||||
if (this.refs.rating) {
|
if (this.refs.rating) {
|
||||||
@ -196,6 +203,7 @@ let PrizePieceRatings = React.createClass({
|
|||||||
this.state.orderBy, this.state.orderAsc, this.state.filterBy)
|
this.state.orderBy, this.state.orderAsc, this.state.filterBy)
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
render(){
|
render(){
|
||||||
if (this.props.currentUser && this.props.currentUser.is_jury) {
|
if (this.props.currentUser && this.props.currentUser.is_jury) {
|
||||||
return (
|
return (
|
||||||
@ -234,7 +242,7 @@ let PersonalNote = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.props.currentUser.username && true || false) {
|
if (this.props.currentUser && this.props.currentUser.username) {
|
||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
url={ApiUrls.notes}
|
url={ApiUrls.notes}
|
||||||
@ -246,7 +254,7 @@ let PersonalNote = React.createClass({
|
|||||||
<InputTextAreaToggable
|
<InputTextAreaToggable
|
||||||
rows={1}
|
rows={1}
|
||||||
editable={true}
|
editable={true}
|
||||||
defaultValue={this.props.piece.note_from_user ? this.props.piece.note_from_user.note : null}
|
defaultValue={this.props.piece && this.props.piece.note_from_user ? this.props.piece.note_from_user.note : null}
|
||||||
placeholder={getLangText('Enter your comments...')}/>
|
placeholder={getLangText('Enter your comments...')}/>
|
||||||
</Property>
|
</Property>
|
||||||
<Property hidden={true} name='piece_id'>
|
<Property hidden={true} name='piece_id'>
|
||||||
@ -267,12 +275,13 @@ let PrizePieceDetails = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.props.piece.prize
|
if (this.props.piece
|
||||||
|
&& this.props.piece.prize
|
||||||
&& this.props.piece.prize.name
|
&& this.props.piece.prize.name
|
||||||
&& Object.keys(this.props.piece.extra_data).length !== 0){
|
&& Object.keys(this.props.piece.extra_data).length !== 0){
|
||||||
return (
|
return (
|
||||||
<CollapsibleParagraph
|
<CollapsibleParagraph
|
||||||
title="Prize Details"
|
title={getLangText('Prize Details')}
|
||||||
show={true}
|
show={true}
|
||||||
defaultExpanded={true}>
|
defaultExpanded={true}>
|
||||||
<Form ref='form'>
|
<Form ref='form'>
|
||||||
|
@ -13,7 +13,7 @@ import UserStore from '../../../../stores/user_store';
|
|||||||
import UserActions from '../../../../actions/user_actions';
|
import UserActions from '../../../../actions/user_actions';
|
||||||
|
|
||||||
import { mergeOptions } from '../../../../utils/general_utils';
|
import { mergeOptions } from '../../../../utils/general_utils';
|
||||||
|
import { getLangText } from '../../../../utils/lang_utils';
|
||||||
|
|
||||||
let Landing = React.createClass({
|
let Landing = React.createClass({
|
||||||
|
|
||||||
@ -53,14 +53,14 @@ let Landing = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<ButtonGroup className="enter" bsSize="large" vertical>
|
<ButtonGroup className="enter" bsSize="large" vertical>
|
||||||
<ButtonLink to="signup">
|
<ButtonLink to="signup">
|
||||||
Sign up to submit
|
{getLangText('Sign up to submit')}
|
||||||
</ButtonLink>
|
</ButtonLink>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
or, already an ascribe user?
|
{getLangText('or, already an ascribe user?')}
|
||||||
</p>
|
</p>
|
||||||
<ButtonLink to="login">
|
<ButtonLink to="login">
|
||||||
Log in to submit
|
{getLangText('Log in to submit')}
|
||||||
</ButtonLink>
|
</ButtonLink>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
);
|
);
|
||||||
@ -68,14 +68,14 @@ let Landing = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<ButtonGroup className="enter" bsSize="large" vertical>
|
<ButtonGroup className="enter" bsSize="large" vertical>
|
||||||
<a className="btn btn-default" href="https://www.ascribe.io/app/signup">
|
<a className="btn btn-default" href="https://www.ascribe.io/app/signup">
|
||||||
Sign up to ascribe
|
{getLangText('Sign up to ascribe')}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
or, already an ascribe user?
|
{getLangText('or, already an ascribe user?')}
|
||||||
</p>
|
</p>
|
||||||
<ButtonLink to="login">
|
<ButtonLink to="login">
|
||||||
Log in
|
{getLangText('Log in')}
|
||||||
</ButtonLink>
|
</ButtonLink>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
);
|
);
|
||||||
@ -85,13 +85,13 @@ let Landing = React.createClass({
|
|||||||
if (this.state.prize && this.state.prize.active){
|
if (this.state.prize && this.state.prize.active){
|
||||||
return (
|
return (
|
||||||
<p>
|
<p>
|
||||||
This is the submission page for Sluice_screens ↄc Prize 2015.
|
{getLangText('This is the submission page for Sluice_screens ↄc Prize 2015.')}
|
||||||
</p>
|
</p>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<p>
|
<p>
|
||||||
Submissions for Sluice_screens ↄc Prize 2015 are now closed.
|
{getLangText('Submissions for Sluice_screens ↄc Prize 2015 are now closed.')}
|
||||||
</p>
|
</p>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -100,7 +100,9 @@ let Landing = React.createClass({
|
|||||||
<div className="container">
|
<div className="container">
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-xs-12 wp-landing-wrapper">
|
<div className="col-xs-12 wp-landing-wrapper">
|
||||||
<h1>Sluice_screens ↄc Prize 2015</h1>
|
<h1>
|
||||||
|
{getLangText('Sluice_screens ↄc Prize 2015')}
|
||||||
|
</h1>
|
||||||
{this.getTitle()}
|
{this.getTitle()}
|
||||||
{this.getButtons()}
|
{this.getButtons()}
|
||||||
</div>
|
</div>
|
||||||
|
@ -5,6 +5,8 @@ import Router from 'react-router';
|
|||||||
|
|
||||||
import LoginForm from '../../../ascribe_forms/form_login';
|
import LoginForm from '../../../ascribe_forms/form_login';
|
||||||
|
|
||||||
|
import { getLangText } from '../../../../utils/lang_utils';
|
||||||
|
|
||||||
let Link = Router.Link;
|
let Link = Router.Link;
|
||||||
|
|
||||||
|
|
||||||
@ -12,10 +14,16 @@ let LoginContainer = React.createClass({
|
|||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="ascribe-login-wrapper">
|
<div className="ascribe-login-wrapper">
|
||||||
<LoginForm headerMessage="Log in with ascribe" />
|
<LoginForm
|
||||||
<div className="ascribe-login-text">
|
headerMessage={getLangText('Log in with ascribe')} />
|
||||||
I'm not a user <Link to="signup">Sign up...</Link><br/>
|
<div
|
||||||
I forgot my password <Link to="password_reset">Rescue me...</Link>
|
className="ascribe-login-text">
|
||||||
|
{getLangText('I\'m not a user') + ' '}
|
||||||
|
<Link to="signup">{getLangText('Sign up...')}</Link>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
{getLangText('I forgot my password') + ' '}
|
||||||
|
<Link to="password_reset">{getLangText('Rescue me...')}</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -13,6 +13,7 @@ import ButtonLink from 'react-router-bootstrap/lib/ButtonLink';
|
|||||||
import AccordionListItemPrize from './ascribe_accordion_list/accordion_list_item_prize';
|
import AccordionListItemPrize from './ascribe_accordion_list/accordion_list_item_prize';
|
||||||
|
|
||||||
import { mergeOptions } from '../../../../utils/general_utils';
|
import { mergeOptions } from '../../../../utils/general_utils';
|
||||||
|
import { getLangText } from '../../../../utils/lang_utils';
|
||||||
|
|
||||||
let PrizePieceList = React.createClass({
|
let PrizePieceList = React.createClass({
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
@ -37,11 +38,12 @@ let PrizePieceList = React.createClass({
|
|||||||
onChange(state) {
|
onChange(state) {
|
||||||
this.setState(state);
|
this.setState(state);
|
||||||
},
|
},
|
||||||
|
|
||||||
getButtonSubmit() {
|
getButtonSubmit() {
|
||||||
if (this.state.prize && this.state.prize.active){
|
if (this.state.prize && this.state.prize.active){
|
||||||
return (
|
return (
|
||||||
<ButtonLink to="register_piece">
|
<ButtonLink to="register_piece">
|
||||||
Submit to prize
|
{getLangText('Submit to prize')}
|
||||||
</ButtonLink>
|
</ButtonLink>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ let PrizeRegisterPiece = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.state.prize.active){
|
if(this.state.prize && this.state.prize.active){
|
||||||
return (
|
return (
|
||||||
<RegisterPiece
|
<RegisterPiece
|
||||||
enableLocalHashing={false}
|
enableLocalHashing={false}
|
||||||
@ -77,7 +77,7 @@ let PrizeRegisterPiece = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<div className='row'>
|
<div className='row'>
|
||||||
<div style={{textAlign: 'center'}}>
|
<div style={{textAlign: 'center'}}>
|
||||||
The prize is no longer active
|
{getLangText('The prize is no longer active')}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -142,25 +142,27 @@ let PrizeJurySettings = React.createClass({
|
|||||||
let email = event.target.getAttribute('data-id');
|
let email = event.target.getAttribute('data-id');
|
||||||
PrizeJuryActions.activateJury(email).then((response) => {
|
PrizeJuryActions.activateJury(email).then((response) => {
|
||||||
PrizeJuryActions.fetchJury();
|
PrizeJuryActions.fetchJury();
|
||||||
let notification = new GlobalNotificationModel(response.notification, 'success', 5000);
|
this.displayNotification(response);
|
||||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
handleRevoke(event) {
|
handleRevoke(event) {
|
||||||
let email = event.target.getAttribute('data-id');
|
let email = event.target.getAttribute('data-id');
|
||||||
PrizeJuryActions.revokeJury(email).then((response) => {
|
PrizeJuryActions
|
||||||
let notification = new GlobalNotificationModel(response.notification, 'success', 5000);
|
.revokeJury(email)
|
||||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
.then(this.displayNotification);
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
handleResend(event) {
|
handleResend(event) {
|
||||||
let email = event.target.getAttribute('data-id');
|
let email = event.target.getAttribute('data-id');
|
||||||
PrizeJuryActions.resendJuryInvitation(email).then((response) => {
|
PrizeJuryActions
|
||||||
let notification = new GlobalNotificationModel(response.notification, 'success', 5000);
|
.resendJuryInvitation(email)
|
||||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
.then(this.displayNotification);
|
||||||
});
|
},
|
||||||
|
|
||||||
|
displayNotification(response) {
|
||||||
|
let notification = new GlobalNotificationModel(response.notification, 'success', 5000);
|
||||||
|
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||||
},
|
},
|
||||||
|
|
||||||
getMembersPending() {
|
getMembersPending() {
|
||||||
@ -254,6 +256,7 @@ let PrizeJurySettings = React.createClass({
|
|||||||
|
|
||||||
}, this);
|
}, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
getMembers() {
|
getMembers() {
|
||||||
let content = (
|
let content = (
|
||||||
<div style={{textAlign: 'center'}}>
|
<div style={{textAlign: 'center'}}>
|
||||||
@ -264,19 +267,19 @@ let PrizeJurySettings = React.createClass({
|
|||||||
content = (
|
content = (
|
||||||
<div style={{padding: '1em'}}>
|
<div style={{padding: '1em'}}>
|
||||||
<CollapsibleParagraph
|
<CollapsibleParagraph
|
||||||
title={'Active Jury Members'}
|
title={getLangText('Active Jury Members')}
|
||||||
show={true}
|
show={true}
|
||||||
defaultExpanded={true}>
|
defaultExpanded={true}>
|
||||||
{this.getMembersActive()}
|
{this.getMembersActive()}
|
||||||
</CollapsibleParagraph>
|
</CollapsibleParagraph>
|
||||||
<CollapsibleParagraph
|
<CollapsibleParagraph
|
||||||
title={'Pending Jury Invitations'}
|
title={getLangText('Pending Jury Invitations')}
|
||||||
show={true}
|
show={true}
|
||||||
defaultExpanded={true}>
|
defaultExpanded={true}>
|
||||||
{this.getMembersPending()}
|
{this.getMembersPending()}
|
||||||
</CollapsibleParagraph>
|
</CollapsibleParagraph>
|
||||||
<CollapsibleParagraph
|
<CollapsibleParagraph
|
||||||
title={'Deactivated Jury Members'}
|
title={getLangText('Deactivated Jury Members')}
|
||||||
show={true}
|
show={true}
|
||||||
defaultExpanded={false}>
|
defaultExpanded={false}>
|
||||||
{this.getMembersInactive()}
|
{this.getMembersInactive()}
|
||||||
@ -292,9 +295,11 @@ let PrizeJurySettings = React.createClass({
|
|||||||
url={ApiUrls.jurys}
|
url={ApiUrls.jurys}
|
||||||
handleSuccess={this.handleCreateSuccess}
|
handleSuccess={this.handleCreateSuccess}
|
||||||
ref='form'
|
ref='form'
|
||||||
buttonSubmitText='INVITE'>
|
buttonSubmitText={getLangText('INVITE')}>
|
||||||
<div className="ascribe-form-header">
|
<div className="ascribe-form-header">
|
||||||
<h4 style={{margin: '30px 0px 10px 10px'}}>Jury Members</h4>
|
<h4 style={{margin: '30px 0px 10px 10px'}}>
|
||||||
|
{getLangText('Jury Members')}
|
||||||
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<Property
|
<Property
|
||||||
name='email'
|
name='email'
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import SignupForm from '../../../ascribe_forms/form_signup';
|
import SignupForm from '../../../ascribe_forms/form_signup';
|
||||||
|
|
||||||
|
import { getLangText } from '../../../../utils/lang_utils';
|
||||||
|
|
||||||
let SignupContainer = React.createClass({
|
let SignupContainer = React.createClass({
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
@ -32,8 +33,8 @@ let SignupContainer = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<div className="ascribe-login-wrapper">
|
<div className="ascribe-login-wrapper">
|
||||||
<SignupForm
|
<SignupForm
|
||||||
headerMessage="Create account for submission"
|
headerMessage={getLangText('Create account for submission')}
|
||||||
submitMessage="Sign up"
|
submitMessage={getLangText('Sign up')}
|
||||||
handleSuccess={this.handleSuccess} />
|
handleSuccess={this.handleSuccess} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -39,6 +39,11 @@ let CylandSubmitButton = React.createClass({
|
|||||||
let piece = this.props.piece;
|
let piece = this.props.piece;
|
||||||
let startFrom = 1;
|
let startFrom = 1;
|
||||||
|
|
||||||
|
// In the Cyland register page a user has to complete three steps.
|
||||||
|
// Since every one of those steps is atomic a user should always be able to continue
|
||||||
|
// where he left of.
|
||||||
|
// This is why we start the process form slide 1/2 if the user has already finished
|
||||||
|
// it in another session.
|
||||||
if(piece && piece.extra_data && Object.keys(piece.extra_data).length > 0) {
|
if(piece && piece.extra_data && Object.keys(piece.extra_data).length > 0) {
|
||||||
startFrom = 2;
|
startFrom = 2;
|
||||||
}
|
}
|
||||||
|
@ -114,10 +114,10 @@ let CylandPieceDetails = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (Object.keys(this.props.piece.extra_data).length !== 0){
|
if (this.props.piece && Object.keys(this.props.piece.extra_data).length !== 0){
|
||||||
return (
|
return (
|
||||||
<CollapsibleParagraph
|
<CollapsibleParagraph
|
||||||
title="Further Details"
|
title={getLangText('Further Details')}
|
||||||
show={true}
|
show={true}
|
||||||
defaultExpanded={true}>
|
defaultExpanded={true}>
|
||||||
<Form ref='form'>
|
<Form ref='form'>
|
||||||
|
@ -95,7 +95,9 @@ let CylandAdditionalDataForm = React.createClass({
|
|||||||
</div>
|
</div>
|
||||||
}>
|
}>
|
||||||
<div className="ascribe-form-header">
|
<div className="ascribe-form-header">
|
||||||
<h3>Provide supporting materials</h3>
|
<h3>
|
||||||
|
{getLangText('Provide supporting materials')}
|
||||||
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<Property
|
<Property
|
||||||
name='artist_bio'
|
name='artist_bio'
|
||||||
|
@ -8,13 +8,12 @@ import WhitelabelActions from '../../../../../actions/whitelabel_actions';
|
|||||||
import WhitelabelStore from '../../../../../stores/whitelabel_store';
|
import WhitelabelStore from '../../../../../stores/whitelabel_store';
|
||||||
|
|
||||||
import ButtonLink from 'react-router-bootstrap/lib/ButtonLink';
|
import ButtonLink from 'react-router-bootstrap/lib/ButtonLink';
|
||||||
import ButtonGroup from 'react-bootstrap/lib/ButtonGroup';
|
|
||||||
|
|
||||||
import UserStore from '../../../../../stores/user_store';
|
import UserStore from '../../../../../stores/user_store';
|
||||||
import UserActions from '../../../../../actions/user_actions';
|
import UserActions from '../../../../../actions/user_actions';
|
||||||
|
|
||||||
import { mergeOptions } from '../../../../../utils/general_utils';
|
import { mergeOptions } from '../../../../../utils/general_utils';
|
||||||
|
import { getLangText } from '../../../../../utils/lang_utils';
|
||||||
|
|
||||||
let CylandLanding = React.createClass({
|
let CylandLanding = React.createClass({
|
||||||
|
|
||||||
@ -57,7 +56,7 @@ let CylandLanding = React.createClass({
|
|||||||
<div className="row" style={{border: '1px solid #CCC', padding: '2em'}}>
|
<div className="row" style={{border: '1px solid #CCC', padding: '2em'}}>
|
||||||
<img src={this.state.whitelabel.logo} width="400px"/>
|
<img src={this.state.whitelabel.logo} width="400px"/>
|
||||||
<div style={{marginTop: '1em'}}>
|
<div style={{marginTop: '1em'}}>
|
||||||
Submissions to Cyland Archive are powered by
|
{getLangText('Submissions to Cyland Archive are powered by')}
|
||||||
<span>
|
<span>
|
||||||
<span> ascribe </span>
|
<span> ascribe </span>
|
||||||
<span className="glyph-ascribe-spool-chunked ascribe-color"></span>
|
<span className="glyph-ascribe-spool-chunked ascribe-color"></span>
|
||||||
@ -67,18 +66,18 @@ let CylandLanding = React.createClass({
|
|||||||
<div className="row" style={{border: '1px solid #CCC', borderTop: 'none', padding: '2em'}}>
|
<div className="row" style={{border: '1px solid #CCC', borderTop: 'none', padding: '2em'}}>
|
||||||
<div className="col-sm-6">
|
<div className="col-sm-6">
|
||||||
<p>
|
<p>
|
||||||
Existing ascribe user?
|
{getLangText('Existing ascribe user?')}
|
||||||
</p>
|
</p>
|
||||||
<ButtonLink to="login">
|
<ButtonLink to="login">
|
||||||
Log in
|
{getLangText('Log in')}
|
||||||
</ButtonLink>
|
</ButtonLink>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-sm-6">
|
<div className="col-sm-6">
|
||||||
<p>
|
<p>
|
||||||
Do you need an account?
|
{getLangText('Do you need an account?')}
|
||||||
</p>
|
</p>
|
||||||
<ButtonLink to="signup">
|
<ButtonLink to="signup">
|
||||||
Sign up
|
{getLangText('Sign up')}
|
||||||
</ButtonLink>
|
</ButtonLink>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -68,6 +68,10 @@ let CylandRegisterPiece = React.createClass({
|
|||||||
|
|
||||||
let queryParams = this.getQuery();
|
let queryParams = this.getQuery();
|
||||||
|
|
||||||
|
// Since every step of this register process is atomic,
|
||||||
|
// we may need to enter the process at step 1 or 2.
|
||||||
|
// If this is the case, we'll need the piece number to complete submission.
|
||||||
|
// It is encoded in the URL as a queryParam and we're checking for it here.
|
||||||
if(queryParams && 'piece_id' in queryParams) {
|
if(queryParams && 'piece_id' in queryParams) {
|
||||||
PieceActions.fetchOne(queryParams.piece_id);
|
PieceActions.fetchOne(queryParams.piece_id);
|
||||||
}
|
}
|
||||||
@ -176,7 +180,7 @@ let CylandRegisterPiece = React.createClass({
|
|||||||
pending: 'glyphicon glyphicon-chevron-right',
|
pending: 'glyphicon glyphicon-chevron-right',
|
||||||
completed: 'glyphicon glyphicon-lock'
|
completed: 'glyphicon glyphicon-lock'
|
||||||
}}>
|
}}>
|
||||||
<div data-slide-title="Register work">
|
<div data-slide-title={getLangText('Register work')}>
|
||||||
<Row className="no-margin">
|
<Row className="no-margin">
|
||||||
<Col xs={12} sm={10} md={8} smOffset={1} mdOffset={2}>
|
<Col xs={12} sm={10} md={8} smOffset={1} mdOffset={2}>
|
||||||
<RegisterPieceForm
|
<RegisterPieceForm
|
||||||
@ -190,7 +194,7 @@ let CylandRegisterPiece = React.createClass({
|
|||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</div>
|
</div>
|
||||||
<div data-slide-title="Additional details">
|
<div data-slide-title={getLangText('Additional details')}>
|
||||||
<Row className="no-margin">
|
<Row className="no-margin">
|
||||||
<Col xs={12} sm={10} md={8} smOffset={1} mdOffset={2}>
|
<Col xs={12} sm={10} md={8} smOffset={1} mdOffset={2}>
|
||||||
<CylandAdditionalDataForm
|
<CylandAdditionalDataForm
|
||||||
@ -200,11 +204,11 @@ let CylandRegisterPiece = React.createClass({
|
|||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</div>
|
</div>
|
||||||
<div data-slide-title="Loan">
|
<div data-slide-title={getLangText('Loan')}>
|
||||||
<Row className="no-margin">
|
<Row className="no-margin">
|
||||||
<Col xs={12} sm={10} md={8} smOffset={1} mdOffset={2}>
|
<Col xs={12} sm={10} md={8} smOffset={1} mdOffset={2}>
|
||||||
<LoanForm
|
<LoanForm
|
||||||
loanHeading="Loan to Cyland archive"
|
loanHeading={getLangText('Loan to Cyland archive')}
|
||||||
message={getAclFormMessage('acl_loan', '\"' + this.state.piece.title + '\"', this.state.currentUser.username)}
|
message={getAclFormMessage('acl_loan', '\"' + this.state.piece.title + '\"', this.state.currentUser.username)}
|
||||||
id={{piece_id: this.state.piece.id}}
|
id={{piece_id: this.state.piece.id}}
|
||||||
url={ApiUrls.ownership_loans_pieces}
|
url={ApiUrls.ownership_loans_pieces}
|
||||||
|
@ -75,18 +75,22 @@ let IkonotvAccordionListItem = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
if(this.props.content) {
|
||||||
<AccordionListItemPiece
|
return (
|
||||||
className={this.props.className}
|
<AccordionListItemPiece
|
||||||
piece={this.props.content}
|
className={this.props.className}
|
||||||
subsubheading={
|
piece={this.props.content}
|
||||||
<div className="pull-left">
|
subsubheading={
|
||||||
<span>{this.props.content.date_created.split('-')[0]}</span>
|
<div className="pull-left">
|
||||||
</div>}
|
<span>{this.props.content.date_created.split('-')[0]}</span>
|
||||||
buttons={this.getSubmitButtons()}>
|
</div>}
|
||||||
{this.props.children}
|
buttons={this.getSubmitButtons()}>
|
||||||
</AccordionListItemPiece>
|
{this.props.children}
|
||||||
);
|
</AccordionListItemPiece>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -19,6 +19,10 @@ import { mergeOptions } from '../../../../../../utils/general_utils';
|
|||||||
|
|
||||||
|
|
||||||
let ContractForm = React.createClass({
|
let ContractForm = React.createClass({
|
||||||
|
propTypes: {
|
||||||
|
handleSuccess: React.PropTypes.func
|
||||||
|
},
|
||||||
|
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
return mergeOptions(
|
return mergeOptions(
|
||||||
LoanContractListStore.getState(),
|
LoanContractListStore.getState(),
|
||||||
@ -92,7 +96,7 @@ let ContractForm = React.createClass({
|
|||||||
buttons={<button
|
buttons={<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="btn ascribe-btn ascribe-btn-login">
|
className="btn ascribe-btn ascribe-btn-login">
|
||||||
SEND LOAN REQUEST
|
{getLangText('SEND LOAN REQUEST')}
|
||||||
</button>}
|
</button>}
|
||||||
spinner={
|
spinner={
|
||||||
<span className="btn ascribe-btn ascribe-btn-login ascribe-btn-login-spinner">
|
<span className="btn ascribe-btn ascribe-btn-login ascribe-btn-login-spinner">
|
||||||
@ -100,14 +104,14 @@ let ContractForm = React.createClass({
|
|||||||
</span>
|
</span>
|
||||||
}>
|
}>
|
||||||
<div className="ascribe-form-header">
|
<div className="ascribe-form-header">
|
||||||
<h3>CONTRACT FORM</h3>
|
<h3>{getLangText('CONTRACT FORM')}</h3>
|
||||||
</div>
|
</div>
|
||||||
<Property
|
<Property
|
||||||
name='artist_name'
|
name='artist_name'
|
||||||
label={getLangText('Artist Name')}>
|
label={getLangText('Artist Name')}>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="(e.g. Andy Warhol)"
|
placeholder={getLangText('(e.g. Andy Warhol)')}
|
||||||
required/>
|
required/>
|
||||||
</Property>
|
</Property>
|
||||||
<Property
|
<Property
|
||||||
@ -115,7 +119,7 @@ let ContractForm = React.createClass({
|
|||||||
label={getLangText('Artist Email')}>
|
label={getLangText('Artist Email')}>
|
||||||
<input
|
<input
|
||||||
type="email"
|
type="email"
|
||||||
placeholder="(e.g. andy@warhol.co.uk)"
|
placeholder={getLangText('(e.g. andy@warhol.co.uk)')}
|
||||||
required/>
|
required/>
|
||||||
</Property>
|
</Property>
|
||||||
{this.getContracts()}
|
{this.getContracts()}
|
||||||
@ -124,7 +128,7 @@ let ContractForm = React.createClass({
|
|||||||
label={getLangText('Appendix')}>
|
label={getLangText('Appendix')}>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Add an appendix to the contract"
|
placeholder={getLangText('Add an appendix to the contract')}
|
||||||
required/>
|
required/>
|
||||||
</Property>
|
</Property>
|
||||||
</Form>
|
</Form>
|
||||||
|
Loading…
Reference in New Issue
Block a user