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,20 +12,16 @@ 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);
PrizeFetcher
.fetch()
.then((res) => {
this.actions.updatePrize({
prize: res.prize
});
});
})
.catch((err) => {
console.logGlobal(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,48 +37,52 @@ let PrizeRegisterPiece = React.createClass({
},
render() {
const { location } = this.props;
setDocumentTitle(getLangText('Submit to the prize'));
if(this.state.prize && this.state.prize.active){
return (
<RegisterPiece
enableLocalHashing={false}
headerMessage={getLangText('Submit to the prize')}
submitMessage={getLangText('Submit')}>
<Property
name='artist_statement'
label={getLangText('Artist statement')}
editable={true}
overrideForm={true}>
<InputTextAreaToggable
rows={1}
placeholder={getLangText('Enter your statement')}
required />
</Property>
<Property
name='work_description'
label={getLangText('Work description')}
editable={true}
overrideForm={true}>
<InputTextAreaToggable
rows={1}
placeholder={getLangText('Enter the description for your work')}
required />
</Property>
<Property
name="terms"
className="ascribe-property-collapsible-toggle"
style={{paddingBottom: 0}}>
<InputCheckbox>
<span>
{' ' + getLangText('I agree to the Terms of Service the art price') + ' '}
(<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('read')}
</a>)
</span>
</InputCheckbox>
</Property>
</RegisterPiece>);
<RegisterPiece
enableLocalHashing={false}
headerMessage={getLangText('Submit to the prize')}
submitMessage={getLangText('Submit')}
location={location}>
<Property
name='artist_statement'
label={getLangText('Artist statement')}
editable={true}
overrideForm={true}>
<InputTextAreaToggable
rows={1}
placeholder={getLangText('Enter your statement')}
required />
</Property>
<Property
name='work_description'
label={getLangText('Work description')}
editable={true}
overrideForm={true}>
<InputTextAreaToggable
rows={1}
placeholder={getLangText('Enter the description for your work')}
required />
</Property>
<Property
name="terms"
className="ascribe-property-collapsible-toggle"
style={{paddingBottom: 0}}>
<InputCheckbox>
<span>
{' ' + getLangText('I agree to the Terms of Service the art price') + ' '}
(<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('read')}
</a>)
</span>
</InputCheckbox>
</Property>
</RegisterPiece>
);
}
else {
return (