1
0
mirror of https://github.com/ascribe/onion.git synced 2025-02-14 21:10:27 +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], mixins: [History],
getDefaultProps() {
return {
canSpecifyEditions: true
};
},
getInitialState(){ getInitialState(){
return mergeOptions( return mergeOptions(
UserStore.getState(), UserStore.getState(),

View File

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

View File

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

View File

@ -15,6 +15,10 @@ import { setDocumentTitle } from '../../../../../utils/dom_utils';
let PrizeRegisterPiece = React.createClass({ let PrizeRegisterPiece = React.createClass({
propTypes: {
location: React.PropTypes.object
},
getInitialState() { getInitialState() {
return PrizeStore.getState(); return PrizeStore.getState();
}, },
@ -33,48 +37,52 @@ let PrizeRegisterPiece = React.createClass({
}, },
render() { render() {
const { location } = this.props;
setDocumentTitle(getLangText('Submit to the prize')); setDocumentTitle(getLangText('Submit to the prize'));
if(this.state.prize && this.state.prize.active){ if(this.state.prize && this.state.prize.active){
return ( return (
<RegisterPiece <RegisterPiece
enableLocalHashing={false} enableLocalHashing={false}
headerMessage={getLangText('Submit to the prize')} headerMessage={getLangText('Submit to the prize')}
submitMessage={getLangText('Submit')}> submitMessage={getLangText('Submit')}
<Property location={location}>
name='artist_statement' <Property
label={getLangText('Artist statement')} name='artist_statement'
editable={true} label={getLangText('Artist statement')}
overrideForm={true}> editable={true}
<InputTextAreaToggable overrideForm={true}>
rows={1} <InputTextAreaToggable
placeholder={getLangText('Enter your statement')} rows={1}
required /> placeholder={getLangText('Enter your statement')}
</Property> required />
<Property </Property>
name='work_description' <Property
label={getLangText('Work description')} name='work_description'
editable={true} label={getLangText('Work description')}
overrideForm={true}> editable={true}
<InputTextAreaToggable overrideForm={true}>
rows={1} <InputTextAreaToggable
placeholder={getLangText('Enter the description for your work')} rows={1}
required /> placeholder={getLangText('Enter the description for your work')}
</Property> required />
<Property </Property>
name="terms" <Property
className="ascribe-property-collapsible-toggle" name="terms"
style={{paddingBottom: 0}}> className="ascribe-property-collapsible-toggle"
<InputCheckbox> style={{paddingBottom: 0}}>
<span> <InputCheckbox>
{' ' + getLangText('I agree to the Terms of Service the art price') + ' '} <span>
(<a href="https://s3-us-west-2.amazonaws.com/ascribe0/whitelabel/sluice/terms.pdf" target="_blank" style={{fontSize: '0.9em', color: 'rgba(0,0,0,0.7)'}}> {' ' + getLangText('I agree to the Terms of Service the art price') + ' '}
{getLangText('read')} (<a href="https://s3-us-west-2.amazonaws.com/ascribe0/whitelabel/sluice/terms.pdf" target="_blank" style={{fontSize: '0.9em', color: 'rgba(0,0,0,0.7)'}}>
</a>) {getLangText('read')}
</span> </a>)
</InputCheckbox> </span>
</Property> </InputCheckbox>
</RegisterPiece>); </Property>
</RegisterPiece>
);
} }
else { else {
return ( return (