2015-05-18 13:43:42 +02:00
|
|
|
import React from 'react';
|
2016-06-06 14:54:29 +02:00
|
|
|
import Route from 'react-router/es6/Route';
|
2015-05-18 09:56:16 +02:00
|
|
|
|
2016-02-01 14:48:44 +01:00
|
|
|
import AscribeApp from './components/ascribe_app';
|
2015-07-10 16:43:35 +02:00
|
|
|
|
2015-05-19 17:13:09 +02:00
|
|
|
import PieceList from './components/piece_list';
|
2015-07-08 22:54:07 +02:00
|
|
|
import PieceContainer from './components/ascribe_detail/piece_container';
|
|
|
|
import EditionContainer from './components/ascribe_detail/edition_container';
|
2015-06-20 16:43:18 +02:00
|
|
|
|
|
|
|
import LoginContainer from './components/login_container';
|
2015-07-17 15:02:44 +02:00
|
|
|
import LogoutContainer from './components/logout_container';
|
2015-06-20 16:43:18 +02:00
|
|
|
import SignupContainer from './components/signup_container';
|
2015-06-15 16:56:17 +02:00
|
|
|
import PasswordResetContainer from './components/password_reset_container';
|
2015-06-20 16:43:18 +02:00
|
|
|
|
2015-09-23 15:16:46 +02:00
|
|
|
import ContractSettings from './components/ascribe_settings/contract_settings';
|
2015-08-31 16:36:24 +02:00
|
|
|
import SettingsContainer from './components/ascribe_settings/settings_container';
|
2015-06-25 14:39:39 +02:00
|
|
|
import CoaVerifyContainer from './components/coa_verify_container';
|
|
|
|
|
2015-09-29 16:00:58 +02:00
|
|
|
import ErrorNotFoundPage from './components/error_not_found_page';
|
|
|
|
|
2015-06-17 17:48:52 +02:00
|
|
|
import RegisterPiece from './components/register_piece';
|
2015-07-29 18:03:49 +02:00
|
|
|
|
2016-03-04 15:53:55 +01:00
|
|
|
import Footer from './components/footer';
|
|
|
|
|
2015-12-08 11:17:04 +01:00
|
|
|
import { ProxyHandler, AuthRedirect } from './components/ascribe_routes/proxy_handler';
|
2015-10-06 10:20:36 +02:00
|
|
|
|
2016-06-13 14:35:02 +02:00
|
|
|
import { getLangText } from './utils/lang';
|
2016-02-08 14:50:24 +01:00
|
|
|
|
2015-07-10 16:43:35 +02:00
|
|
|
|
2016-06-03 17:52:38 +02:00
|
|
|
const Routes = (
|
|
|
|
<Route path="/" component={AscribeApp}>
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
2016-06-03 17:52:38 +02:00
|
|
|
path="login"
|
|
|
|
component={ProxyHandler(AuthRedirect({ to: '/collection', when: 'loggedIn' }))(LoginContainer)}
|
2016-03-04 15:53:55 +01:00
|
|
|
footer={Footer} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
2016-06-03 17:52:38 +02:00
|
|
|
path="register_piece"
|
|
|
|
component={ProxyHandler(AuthRedirect({ to: '/login', when: 'loggedOut' }))(RegisterPiece)}
|
2016-03-04 15:53:55 +01:00
|
|
|
headerTitle={getLangText('+ NEW WORK')}
|
|
|
|
footer={Footer} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
2016-06-03 17:52:38 +02:00
|
|
|
path="collection"
|
|
|
|
component={ProxyHandler(AuthRedirect({ to: '/login', when: 'loggedOut' }))(PieceList)}
|
2016-02-08 14:50:24 +01:00
|
|
|
headerTitle={getLangText('COLLECTION')}
|
2016-06-03 17:52:38 +02:00
|
|
|
disableOn="noPieces"
|
2016-03-04 15:53:55 +01:00
|
|
|
footer={Footer} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
2016-06-03 17:52:38 +02:00
|
|
|
path="signup"
|
|
|
|
component={ProxyHandler(AuthRedirect({ to: '/collection', when: 'loggedIn' }))(SignupContainer)}
|
2016-03-04 15:53:55 +01:00
|
|
|
footer={Footer} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
2016-06-03 17:52:38 +02:00
|
|
|
path="logout"
|
|
|
|
component={ProxyHandler(AuthRedirect({ to: '/login', when: 'loggedOut' }))(LogoutContainer)}
|
2016-03-04 15:53:55 +01:00
|
|
|
footer={Footer} />
|
2016-06-03 17:52:38 +02:00
|
|
|
<Route path="pieces/:pieceId" component={PieceContainer}
|
2016-03-04 15:53:55 +01:00
|
|
|
footer={Footer} />
|
2016-06-03 17:52:38 +02:00
|
|
|
<Route path="editions/:editionId" component={EditionContainer}
|
2016-03-04 15:53:55 +01:00
|
|
|
footer={Footer} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
2016-06-03 17:52:38 +02:00
|
|
|
path="password_reset"
|
|
|
|
component={ProxyHandler(AuthRedirect({ to: '/collection', when: 'loggedIn' }))(PasswordResetContainer)}
|
2016-03-04 15:53:55 +01:00
|
|
|
footer={Footer} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
2016-06-03 17:52:38 +02:00
|
|
|
path="settings"
|
|
|
|
component={ProxyHandler(AuthRedirect({ to: '/login', when: 'loggedOut' }))(SettingsContainer)}
|
2016-03-04 15:53:55 +01:00
|
|
|
footer={Footer} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
2016-06-03 17:52:38 +02:00
|
|
|
path="contract_settings"
|
|
|
|
component={ProxyHandler(AuthRedirect({ to: '/login', when: 'loggedOut' }))(ContractSettings)}
|
2016-03-04 15:53:55 +01:00
|
|
|
footer={Footer} />
|
2016-06-03 17:52:38 +02:00
|
|
|
<Route
|
|
|
|
path="coa_verify"
|
|
|
|
component={CoaVerifyContainer}
|
2016-03-04 15:53:55 +01:00
|
|
|
footer={Footer} />
|
2016-06-03 17:52:38 +02:00
|
|
|
<Route
|
|
|
|
path="*"
|
|
|
|
component={ErrorNotFoundPage}
|
2016-03-04 15:53:55 +01:00
|
|
|
footer={Footer} />
|
2015-05-18 18:00:12 +02:00
|
|
|
</Route>
|
2015-05-18 13:43:42 +02:00
|
|
|
);
|
|
|
|
|
2016-06-03 17:52:38 +02:00
|
|
|
export default Routes;
|