2015-08-19 13:54:45 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import Router from 'react-router';
|
|
|
|
|
2015-08-19 14:48:22 +02:00
|
|
|
|
|
|
|
import WhitelabelActions from '../../../../../actions/whitelabel_actions';
|
|
|
|
import WhitelabelStore from '../../../../../stores/whitelabel_store';
|
|
|
|
|
2015-08-19 13:54:45 +02:00
|
|
|
import ButtonLink from 'react-router-bootstrap/lib/ButtonLink';
|
|
|
|
import ButtonGroup from 'react-bootstrap/lib/ButtonGroup';
|
|
|
|
|
|
|
|
import UserStore from '../../../../../stores/user_store';
|
|
|
|
import UserActions from '../../../../../actions/user_actions';
|
|
|
|
|
|
|
|
import { mergeOptions } from '../../../../../utils/general_utils';
|
|
|
|
|
|
|
|
|
|
|
|
let CylandLanding = React.createClass({
|
|
|
|
|
|
|
|
mixins: [Router.Navigation],
|
|
|
|
|
|
|
|
getInitialState() {
|
|
|
|
return mergeOptions(
|
2015-08-19 14:48:22 +02:00
|
|
|
UserStore.getState(),
|
|
|
|
WhitelabelStore.getState()
|
2015-08-19 13:54:45 +02:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
UserStore.listen(this.onChange);
|
|
|
|
UserActions.fetchCurrentUser();
|
2015-08-19 14:48:22 +02:00
|
|
|
WhitelabelStore.listen(this.onChange);
|
|
|
|
WhitelabelActions.fetchWhitelabel();
|
2015-08-19 13:54:45 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
componentWillUnmount() {
|
|
|
|
UserStore.unlisten(this.onChange);
|
2015-08-19 14:48:22 +02:00
|
|
|
WhitelabelStore.unlisten(this.onChange);
|
2015-08-19 13:54:45 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
onChange(state) {
|
|
|
|
this.setState(state);
|
|
|
|
|
|
|
|
// if user is already logged in, redirect him to piece list
|
|
|
|
if(this.state.currentUser && this.state.currentUser.email) {
|
|
|
|
// FIXME: hack to redirect out of the dispatch cycle
|
|
|
|
window.setTimeout(() => this.replaceWith('pieces'), 0);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div className="container ascribe-form-wrapper">
|
|
|
|
<div className="row">
|
|
|
|
<div className="col-xs-12 wp-landing-wrapper">
|
2015-08-19 14:48:22 +02:00
|
|
|
<div className="row" style={{border: '1px solid #CCC', padding: '2em'}}>
|
|
|
|
<img src={this.state.whitelabel.logo} width="400px"/>
|
|
|
|
<div style={{marginTop: '1em'}}>
|
|
|
|
Submissions to Cyland Archive are powered by
|
|
|
|
<span>
|
|
|
|
<span> ascribe </span>
|
|
|
|
<span className="glyph-ascribe-spool-chunked ascribe-color"></span>
|
|
|
|
</span>
|
|
|
|
</div>
|
2015-08-19 13:54:45 +02:00
|
|
|
</div>
|
2015-08-19 14:48:22 +02:00
|
|
|
<div className="row" style={{border: '1px solid #CCC', borderTop: 'none', padding: '2em'}}>
|
2015-08-19 13:54:45 +02:00
|
|
|
<div className="col-sm-6">
|
2015-08-19 14:48:22 +02:00
|
|
|
<p>
|
2015-08-19 13:54:45 +02:00
|
|
|
Existing ascribe user?
|
2015-08-19 14:48:22 +02:00
|
|
|
</p>
|
2015-08-19 13:54:45 +02:00
|
|
|
<ButtonLink to="login">
|
|
|
|
Log in
|
|
|
|
</ButtonLink>
|
|
|
|
</div>
|
|
|
|
<div className="col-sm-6">
|
2015-08-19 14:48:22 +02:00
|
|
|
<p>
|
2015-08-19 13:54:45 +02:00
|
|
|
Do you need an account?
|
2015-08-19 14:48:22 +02:00
|
|
|
</p>
|
2015-08-19 13:54:45 +02:00
|
|
|
<ButtonLink to="signup">
|
|
|
|
Sign up
|
|
|
|
</ButtonLink>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default CylandLanding;
|