2015-06-20 16:43:18 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import Router from 'react-router';
|
|
|
|
|
2015-07-13 16:57:25 +02:00
|
|
|
import LoginForm from './ascribe_forms/form_login';
|
2015-06-20 16:43:18 +02:00
|
|
|
|
2015-07-01 18:58:13 +02:00
|
|
|
import { getLangText } from '../utils/lang_utils';
|
|
|
|
|
2015-06-30 14:46:28 +02:00
|
|
|
let Link = Router.Link;
|
2015-06-20 16:43:18 +02:00
|
|
|
|
2015-07-13 16:57:25 +02:00
|
|
|
|
2015-06-20 16:43:18 +02:00
|
|
|
let LoginContainer = React.createClass({
|
2015-07-02 15:40:54 +02:00
|
|
|
propTypes: {
|
2015-07-13 18:13:47 +02:00
|
|
|
message: React.PropTypes.string,
|
|
|
|
redirectOnLoggedIn: React.PropTypes.bool,
|
|
|
|
redirectOnLoginSuccess: React.PropTypes.bool
|
2015-07-02 15:40:54 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
getDefaultProps() {
|
|
|
|
return {
|
2015-07-13 18:13:47 +02:00
|
|
|
message: getLangText('Enter') + ' ascribe',
|
|
|
|
redirectOnLoggedIn: true,
|
|
|
|
redirectOnLoginSuccess: true
|
2015-07-02 15:40:54 +02:00
|
|
|
};
|
|
|
|
},
|
|
|
|
|
2015-06-20 16:43:18 +02:00
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div className="ascribe-login-wrapper">
|
2015-07-10 16:34:34 +02:00
|
|
|
<LoginForm
|
2015-07-13 18:13:47 +02:00
|
|
|
redirectOnLoggedIn={this.props.redirectOnLoggedIn}
|
|
|
|
redirectOnLoginSuccess={this.props.redirectOnLoginSuccess}
|
2015-07-10 16:34:34 +02:00
|
|
|
message={this.props.message} />
|
2015-07-07 10:28:39 +02:00
|
|
|
<div className="ascribe-login-text">
|
|
|
|
{getLangText('Not an ascribe user')}? <Link to="signup">{getLangText('Sign up')}...</Link><br/>
|
|
|
|
{getLangText('Forgot my password')}? <Link to="password_reset">{getLangText('Rescue me')}...</Link>
|
|
|
|
</div>
|
2015-06-20 16:43:18 +02:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-01 18:58:13 +02:00
|
|
|
export default LoginContainer;
|