2015-08-19 13:54:45 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import React from 'react';
|
2015-10-01 11:16:38 +02:00
|
|
|
import { History } from 'react-router';
|
2015-08-19 13:54:45 +02:00
|
|
|
|
|
|
|
|
2015-08-19 14:48:22 +02:00
|
|
|
import WhitelabelActions from '../../../../../actions/whitelabel_actions';
|
|
|
|
import WhitelabelStore from '../../../../../stores/whitelabel_store';
|
|
|
|
|
2015-10-01 14:00:56 +02:00
|
|
|
import Button from 'react-bootstrap/lib/Button';
|
|
|
|
|
|
|
|
import LinkContainer from 'react-router-bootstrap/lib/LinkContainer';
|
2015-08-19 13:54:45 +02:00
|
|
|
|
|
|
|
import UserStore from '../../../../../stores/user_store';
|
|
|
|
import UserActions from '../../../../../actions/user_actions';
|
|
|
|
|
|
|
|
import { mergeOptions } from '../../../../../utils/general_utils';
|
2015-08-24 11:22:44 +02:00
|
|
|
import { getLangText } from '../../../../../utils/lang_utils';
|
2015-10-13 17:29:53 +02:00
|
|
|
import { setDocumentTitle } from '../../../../../utils/dom_utils';
|
2015-08-19 13:54:45 +02:00
|
|
|
|
|
|
|
let CylandLanding = React.createClass({
|
|
|
|
|
2015-10-01 11:16:38 +02:00
|
|
|
mixins: [History],
|
2015-08-19 13:54:45 +02:00
|
|
|
|
|
|
|
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
|
2015-10-01 14:30:11 +02:00
|
|
|
window.setTimeout(() => this.history.replaceState(null, '/collection'), 0);
|
2015-08-19 13:54:45 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
render() {
|
2015-10-13 17:29:53 +02:00
|
|
|
setDocumentTitle('CYLAND MediaArtLab');
|
|
|
|
|
2015-08-19 13:54:45 +02:00
|
|
|
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'}}>
|
2015-08-24 11:22:44 +02:00
|
|
|
{getLangText('Submissions to Cyland Archive are powered by')}
|
2015-08-19 14:48:22 +02:00
|
|
|
<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-24 11:22:44 +02:00
|
|
|
{getLangText('Existing ascribe user?')}
|
2015-08-19 14:48:22 +02:00
|
|
|
</p>
|
2015-10-01 14:00:56 +02:00
|
|
|
<LinkContainer to="/login">
|
|
|
|
<Button>
|
|
|
|
{getLangText('Log in')}
|
|
|
|
</Button>
|
|
|
|
</LinkContainer>
|
2015-08-19 13:54:45 +02:00
|
|
|
</div>
|
|
|
|
<div className="col-sm-6">
|
2015-08-19 14:48:22 +02:00
|
|
|
<p>
|
2015-08-24 11:22:44 +02:00
|
|
|
{getLangText('Do you need an account?')}
|
2015-08-19 14:48:22 +02:00
|
|
|
</p>
|
2015-10-01 14:00:56 +02:00
|
|
|
<LinkContainer to="/signup">
|
|
|
|
<Button>
|
|
|
|
{getLangText('Sign up')}
|
|
|
|
</Button>
|
|
|
|
</LinkContainer>
|
2015-08-19 13:54:45 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default CylandLanding;
|