1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +01:00

Finalize boilerplate for portfolioreview subdomain

This commit is contained in:
Tim Daubenschütz 2015-11-06 12:09:31 +01:00
parent 5adc34faeb
commit f5a5e045a6
5 changed files with 187 additions and 1 deletions

View File

@ -29,6 +29,8 @@ Additionally, to work on the white labeling functionality, you need to edit your
127.0.0.1 cyland.localhost.com 127.0.0.1 cyland.localhost.com
127.0.0.1 ikonotv.localhost.com 127.0.0.1 ikonotv.localhost.com
127.0.0.1 sluice.localhost.com 127.0.0.1 sluice.localhost.com
127.0.0.1 lumenus.localhost.com
127.0.0.1 portfolioreview.localhost.com
``` ```

View File

@ -0,0 +1,117 @@
'use strict';
import React from 'react';
import { History } from 'react-router';
import PrizeActions from '../../simple_prize/actions/prize_actions';
import PrizeStore from '../../simple_prize/stores/prize_store';
import Button from 'react-bootstrap/lib/Button';
import ButtonGroup from 'react-bootstrap/lib/ButtonGroup';
import LinkContainer from 'react-router-bootstrap/lib/LinkContainer';
import UserStore from '../../../../../stores/user_store';
import UserActions from '../../../../../actions/user_actions';
import { mergeOptions } from '../../../../../utils/general_utils';
import { getLangText } from '../../../../../utils/lang_utils';
const PRLanding = React.createClass({
mixins: [History],
getInitialState() {
return mergeOptions(
PrizeStore.getState(),
UserStore.getState()
);
},
componentDidMount() {
UserStore.listen(this.onChange);
UserActions.fetchCurrentUser();
PrizeStore.listen(this.onChange);
PrizeActions.fetchPrize();
},
componentWillUnmount() {
UserStore.unlisten(this.onChange);
PrizeStore.unlisten(this.onChange);
},
onChange(state) {
this.setState(state);
},
getButtons() {
if (this.state.prize && this.state.prize.active){
return (
<ButtonGroup className="enter" bsSize="large" vertical>
<LinkContainer to="/signup">
<Button>
{getLangText('Sign up to submit')}
</Button>
</LinkContainer>
<p>
{getLangText('or, already an ascribe user?')}
</p>
<LinkContainer to="/login">
<Button>
{getLangText('Log in to submit')}
</Button>
</LinkContainer>
</ButtonGroup>
);
}
return (
<ButtonGroup className="enter" bsSize="large" vertical>
<a className="btn btn-default" href="https://www.ascribe.io/app/signup">
{getLangText('Sign up to ascribe')}
</a>
<p>
{getLangText('or, already an ascribe user?')}
</p>
<LinkContainer to="/login">
<Button>
{getLangText('Log in')}
</Button>
</LinkContainer>
</ButtonGroup>
);
},
getTitle() {
if (this.state.prize && this.state.prize.active){
return (
<p>
{getLangText('This is the submission page for Portfolio Review 2015.')}
</p>
);
}
return (
<p>
{getLangText('Submissions for Portfolio Review 2015 are now closed.')}
</p>
);
},
render() {
return (
<div className="container">
<div className="row">
<div className="col-xs-12 wp-landing-wrapper">
<h1>
{getLangText('Welcome to Portfolio Review 2015')}
</h1>
{this.getTitle()}
{this.getButtons()}
</div>
</div>
</div>
);
}
});
export default PRLanding;

View File

@ -0,0 +1,35 @@
'use strict';
import React from 'react';
import Footer from '../../../footer';
import GlobalNotification from '../../../global_notification';
import { getSubdomain } from '../../../../utils/general_utils';
let PrizeApp = React.createClass({
propTypes: {
children: React.PropTypes.oneOfType([
React.PropTypes.arrayOf(React.PropTypes.element),
React.PropTypes.element
]),
history: React.PropTypes.object,
routes: React.PropTypes.arrayOf(React.PropTypes.object)
},
render() {
const { children } = this.props;
let subdomain = getSubdomain();
return (
<div className={'container ascribe-prize-app client--' + subdomain}>
{children}
<GlobalNotification />
<div id="modal" className="container"></div>
<Footer />
</div>
);
}
});
export default PrizeApp;

View File

@ -12,6 +12,9 @@ import SPPieceContainer from './simple_prize/components/ascribe_detail/prize_pie
import SPSettingsContainer from './simple_prize/components/prize_settings_container'; import SPSettingsContainer from './simple_prize/components/prize_settings_container';
import SPApp from './simple_prize/prize_app'; import SPApp from './simple_prize/prize_app';
import PRApp from './portfolioreview/pr_app';
import PRLanding from './portfolioreview/components/pr_landing';
import EditionContainer from '../../ascribe_detail/edition_container'; import EditionContainer from '../../ascribe_detail/edition_container';
import LogoutContainer from '../../logout_container'; import LogoutContainer from '../../logout_container';
import PasswordResetContainer from '../../password_reset_container'; import PasswordResetContainer from '../../password_reset_container';
@ -22,7 +25,7 @@ import AuthProxyHandler from '../../../components/ascribe_routes/proxy_routes/au
const ROUTES = { const ROUTES = {
'sluice': ( sluice: (
<Route path='/' component={SPApp}> <Route path='/' component={SPApp}>
<IndexRoute component={SPLanding} /> <IndexRoute component={SPLanding} />
<Route <Route
@ -54,6 +57,28 @@ const ROUTES = {
<Route path='verify' component={CoaVerifyContainer} /> <Route path='verify' component={CoaVerifyContainer} />
<Route path='*' component={ErrorNotFoundPage} /> <Route path='*' component={ErrorNotFoundPage} />
</Route> </Route>
),
portfolioreview: (
<Route path='/' component={PRApp}>
<IndexRoute component={PRLanding} />
<Route
path='register_piece'
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(SPRegisterPiece)}
headerTitle='+ NEW WORK'/>
<Route
path='login'
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(SPLoginContainer)} />
<Route
path='logout'
component={AuthProxyHandler({to: '/', when: 'loggedOut'})(LogoutContainer)}/>
<Route
path='signup'
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(SPSignupContainer)} />
<Route
path='password_reset'
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(PasswordResetContainer)} />
<Route path='*' component={ErrorNotFoundPage} />
</Route>
) )
}; };

View File

@ -46,6 +46,13 @@ let constants = {
'logo': 'https://s3-us-west-2.amazonaws.com/ascribe0/whitelabel/ikonotv/ikono-logo-black.png', 'logo': 'https://s3-us-west-2.amazonaws.com/ascribe0/whitelabel/ikonotv/ikono-logo-black.png',
'permissions': ['register', 'edit', 'share', 'del_from_collection'], 'permissions': ['register', 'edit', 'share', 'del_from_collection'],
'type': 'wallet' 'type': 'wallet'
},
{
'subdomain': 'portfolioreview',
'name': 'Portfolio Review',
'logo': 'http://notfoundlogo.de',
'permissions': ['register', 'edit', 'share', 'del_from_collection'],
'type': 'prize'
} }
], ],
'defaultDomain': { 'defaultDomain': {