mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 18:35:09 +01:00
add functionality to make a forwarded process slide container
This commit is contained in:
parent
d3bf990ca5
commit
0cf5815f42
@ -140,7 +140,7 @@ let LoanForm = React.createClass({
|
|||||||
<div className="modal-footer">
|
<div className="modal-footer">
|
||||||
<img src={AppConstants.baseUrl + 'static/img/ascribe_animated_small.gif'} />
|
<img src={AppConstants.baseUrl + 'static/img/ascribe_animated_small.gif'} />
|
||||||
</div>}>
|
</div>}>
|
||||||
<div className={classnames({'ascribe-form-header': true, 'hidden': !!this.props.loanHeading})}>
|
<div className={classnames({'ascribe-form-header': true, 'hidden': !this.props.loanHeading})}>
|
||||||
<h3>{this.props.loanHeading}</h3>
|
<h3>{this.props.loanHeading}</h3>
|
||||||
</div>
|
</div>
|
||||||
<Property
|
<Property
|
||||||
|
@ -9,7 +9,8 @@ let Navigation = Router.Navigation;
|
|||||||
|
|
||||||
let SlidesContainer = React.createClass({
|
let SlidesContainer = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
children: React.PropTypes.arrayOf(React.PropTypes.element)
|
children: React.PropTypes.arrayOf(React.PropTypes.element),
|
||||||
|
forwardProcess: React.PropTypes.bool.isRequired
|
||||||
},
|
},
|
||||||
|
|
||||||
mixins: [State, Navigation],
|
mixins: [State, Navigation],
|
||||||
@ -108,13 +109,17 @@ let SlidesContainer = React.createClass({
|
|||||||
// we push a new state on it ONCE (ever).
|
// we push a new state on it ONCE (ever).
|
||||||
// Otherwise, we're able to use the browsers history.forward() method
|
// Otherwise, we're able to use the browsers history.forward() method
|
||||||
// to keep the stack clean
|
// to keep the stack clean
|
||||||
if(this.state.historyLength === window.history.length) {
|
|
||||||
|
if(this.props.forwardProcess) {
|
||||||
queryParams.slide_num = slideNum;
|
queryParams.slide_num = slideNum;
|
||||||
|
|
||||||
this.transitionTo(this.getPathname(), null, queryParams);
|
this.transitionTo(this.getPathname(), null, queryParams);
|
||||||
} else {
|
} else {
|
||||||
window.history.forward();
|
if(this.state.historyLength === window.history.length) {
|
||||||
|
queryParams.slide_num = slideNum;
|
||||||
|
this.transitionTo(this.getPathname(), null, queryParams);
|
||||||
|
} else {
|
||||||
|
window.history.forward();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ let Header = React.createClass({
|
|||||||
);
|
);
|
||||||
|
|
||||||
collection = <NavItemLink to="pieces" query={this.getQuery()}>{getLangText('COLLECTION')}</NavItemLink>;
|
collection = <NavItemLink to="pieces" query={this.getQuery()}>{getLangText('COLLECTION')}</NavItemLink>;
|
||||||
addNewWork = this.props.showAddWork ? <NavItemLink to="register_piece">+ {getLangText('NEW WORK')}</NavItemLink> : null;
|
addNewWork = this.props.showAddWork ? <NavItemLink to="register_piece" query={{'slide_num': 0}}>+ {getLangText('NEW WORK')}</NavItemLink> : null;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
account = <NavItemLink to="login">{getLangText('LOGIN')}</NavItemLink>;
|
account = <NavItemLink to="login">{getLangText('LOGIN')}</NavItemLink>;
|
||||||
|
@ -117,7 +117,8 @@ let RegisterPiece = React.createClass( {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
changeSlide() {
|
// basically redirects to the second slide (index: 1), when the user is not logged in
|
||||||
|
onLoggedOut() {
|
||||||
// only transition to the login store, if user is not logged in
|
// only transition to the login store, if user is not logged in
|
||||||
// ergo the currentUser object is not properly defined
|
// ergo the currentUser object is not properly defined
|
||||||
if(this.state.currentUser && !this.state.currentUser.email) {
|
if(this.state.currentUser && !this.state.currentUser.email) {
|
||||||
@ -125,11 +126,6 @@ let RegisterPiece = React.createClass( {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// basically redirects to the second slide (index: 1), when the user is not logged in
|
|
||||||
onLoggedOut() {
|
|
||||||
this.refs.slidesContainer.setSlideNum(1);
|
|
||||||
},
|
|
||||||
|
|
||||||
onLogin() {
|
onLogin() {
|
||||||
// once the currentUser object from UserStore is defined (eventually the user was transitioned
|
// once the currentUser object from UserStore is defined (eventually the user was transitioned
|
||||||
// to the login form via the slider and successfully logged in), we can direct him back to the
|
// to the login form via the slider and successfully logged in), we can direct him back to the
|
||||||
@ -141,10 +137,12 @@ let RegisterPiece = React.createClass( {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<SlidesContainer ref="slidesContainer">
|
<SlidesContainer
|
||||||
|
ref="slidesContainer"
|
||||||
|
forwardProcess={false}>
|
||||||
<div
|
<div
|
||||||
onClick={this.changeSlide}
|
onClick={this.onLoggedOut}
|
||||||
onFocus={this.changeSlide}>
|
onFocus={this.onLoggedOut}>
|
||||||
<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
|
||||||
|
@ -78,7 +78,7 @@ let CylandAdditionalDataForm = React.createClass({
|
|||||||
</div>
|
</div>
|
||||||
}>
|
}>
|
||||||
<div className="ascribe-form-header">
|
<div className="ascribe-form-header">
|
||||||
<h3>Additional Information</h3>
|
<h3>Provide supporting materials</h3>
|
||||||
</div>
|
</div>
|
||||||
<FurtherDetailsFileuploader
|
<FurtherDetailsFileuploader
|
||||||
submitKey={this.submitKey}
|
submitKey={this.submitKey}
|
||||||
|
@ -122,7 +122,9 @@ let CylandRegisterPiece = React.createClass({
|
|||||||
datetimeWhenWeAllWillBeFlyingCoolHoverboardsAndDinosaursWillLiveAgain.add(1000, 'years');
|
datetimeWhenWeAllWillBeFlyingCoolHoverboardsAndDinosaursWillLiveAgain.add(1000, 'years');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SlidesContainer ref="slidesContainer">
|
<SlidesContainer
|
||||||
|
ref="slidesContainer"
|
||||||
|
forwardProcess={true}>
|
||||||
<div>
|
<div>
|
||||||
<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}>
|
||||||
@ -139,7 +141,7 @@ let CylandRegisterPiece = React.createClass({
|
|||||||
style={{paddingBottom: 0}}>
|
style={{paddingBottom: 0}}>
|
||||||
<InputCheckbox>
|
<InputCheckbox>
|
||||||
<span>
|
<span>
|
||||||
{' ' + getLangText('I agree to the Terms of Service the art price') + ' '}
|
{' ' + getLangText('I agree to the Terms of Service of Cyland Archive') + ' '}
|
||||||
(<a href="https://s3-us-west-2.amazonaws.com/ascribe0/whitelabel/cyland/terms_and_contract.pdf" target="_blank" style={{fontSize: '0.9em', color: 'rgba(0,0,0,0.7)'}}>
|
(<a href="https://s3-us-west-2.amazonaws.com/ascribe0/whitelabel/cyland/terms_and_contract.pdf" target="_blank" style={{fontSize: '0.9em', color: 'rgba(0,0,0,0.7)'}}>
|
||||||
{getLangText('read')}
|
{getLangText('read')}
|
||||||
</a>)
|
</a>)
|
||||||
|
Loading…
Reference in New Issue
Block a user