1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 01:25:17 +01:00

Fix minor bugs for simple_prize app

This commit is contained in:
Tim Daubenschütz 2015-11-06 15:47:55 +01:00
parent f5a5e045a6
commit b78bc66fe9
5 changed files with 70 additions and 61 deletions

12
c Normal file
View File

@ -0,0 +1,12 @@
commit 22fd8656e9e93a5d8d2a412dbed33fce0db57af8
Author: Tim Daubenschütz <tim@ascribe.io>
Date: Fri Nov 6 12:09:31 2015 +0100
Finalize boilerplate for portfolioreview subdomain
commit d1dd33c094194bb6271e2ae11817837b4c39caa5
Author: Tim Daubenschütz <tim@ascribe.io>
Date: Thu Nov 5 16:45:12 2015 +0100
Move and rename sluice prize app to 'simple_prize'

View File

@ -40,12 +40,6 @@ let RegisterPiece = React.createClass( {
mixins: [History],
getDefaultProps() {
return {
canSpecifyEditions: true
};
},
getInitialState(){
return mergeOptions(
UserStore.getState(),

View File

@ -67,16 +67,16 @@ const ROUTES = {
headerTitle='+ NEW WORK'/>
<Route
path='login'
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(SPLoginContainer)} />
component={AuthProxyHandler({to: '/register_piece', when: 'loggedIn'})(SPLoginContainer)} />
<Route
path='logout'
component={AuthProxyHandler({to: '/', when: 'loggedOut'})(LogoutContainer)}/>
<Route
path='signup'
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(SPSignupContainer)} />
component={AuthProxyHandler({to: '/register_piece', when: 'loggedIn'})(SPSignupContainer)} />
<Route
path='password_reset'
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(PasswordResetContainer)} />
component={AuthProxyHandler({to: '/register_piece', when: 'loggedIn'})(PasswordResetContainer)} />
<Route path='*' component={ErrorNotFoundPage} />
</Route>
)

View File

@ -1,7 +1,6 @@
'use strict';
import { alt } from '../../../../../alt';
import Q from 'q';
import PrizeFetcher from '../fetchers/prize_fetcher';
@ -13,19 +12,15 @@ class PrizeActions {
}
fetchPrize() {
return Q.Promise((resolve, reject) => {
PrizeFetcher
.fetch()
.then((res) => {
this.actions.updatePrize({
prize: res.prize
});
resolve(res);
})
.catch((err) => {
console.logGlobal(err);
reject(err);
});
});
}
}

View File

@ -15,6 +15,10 @@ import { setDocumentTitle } from '../../../../../utils/dom_utils';
let PrizeRegisterPiece = React.createClass({
propTypes: {
location: React.PropTypes.object
},
getInitialState() {
return PrizeStore.getState();
},
@ -33,6 +37,8 @@ let PrizeRegisterPiece = React.createClass({
},
render() {
const { location } = this.props;
setDocumentTitle(getLangText('Submit to the prize'));
if(this.state.prize && this.state.prize.active){
@ -40,7 +46,8 @@ let PrizeRegisterPiece = React.createClass({
<RegisterPiece
enableLocalHashing={false}
headerMessage={getLangText('Submit to the prize')}
submitMessage={getLangText('Submit')}>
submitMessage={getLangText('Submit')}
location={location}>
<Property
name='artist_statement'
label={getLangText('Artist statement')}
@ -74,7 +81,8 @@ let PrizeRegisterPiece = React.createClass({
</span>
</InputCheckbox>
</Property>
</RegisterPiece>);
</RegisterPiece>
);
}
else {
return (