mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
Merge branch 'AD-499-whitelabel-prize-with-sluice-as-k' of bitbucket.org:ascribe/onion into AD-499-whitelabel-prize-with-sluice-as-k
This commit is contained in:
commit
62b0981cd7
@ -56,9 +56,11 @@ let Form = React.createClass({
|
|||||||
|
|
||||||
getFormData(){
|
getFormData(){
|
||||||
let data = {};
|
let data = {};
|
||||||
|
console.log(this.refs);
|
||||||
for (let ref in this.refs){
|
for (let ref in this.refs){
|
||||||
data[this.refs[ref].props.name] = this.refs[ref].state.value;
|
data[this.refs[ref].props.name] = this.refs[ref].state.value;
|
||||||
}
|
}
|
||||||
|
console.log(data);
|
||||||
if ('getFormData' in this.props){
|
if ('getFormData' in this.props){
|
||||||
data = mergeOptionsWithDuplicates(data, this.props.getFormData());
|
data = mergeOptionsWithDuplicates(data, this.props.getFormData());
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,14 @@ let SignupForm = React.createClass({
|
|||||||
name="terms"
|
name="terms"
|
||||||
className="ascribe-settings-property-collapsible-toggle"
|
className="ascribe-settings-property-collapsible-toggle"
|
||||||
style={{paddingBottom: 0}}>
|
style={{paddingBottom: 0}}>
|
||||||
<InputCheckbox/>
|
<InputCheckbox>
|
||||||
|
<span>
|
||||||
|
{' ' + getLangText('I agree to the Terms of Service') + ' '}
|
||||||
|
(<a href="/terms" target="_blank" style={{fontSize: '0.9em', color: 'rgba(0,0,0,0.7)'}}>
|
||||||
|
{getLangText('read')}
|
||||||
|
</a>)
|
||||||
|
</span>
|
||||||
|
</InputCheckbox>
|
||||||
</Property>
|
</Property>
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
|
@ -2,12 +2,13 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { getLangText } from '../../utils/lang_utils';
|
|
||||||
|
|
||||||
let InputCheckbox = React.createClass({
|
let InputCheckbox = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
required: React.PropTypes.string.isRequired,
|
required: React.PropTypes.string.isRequired,
|
||||||
label: React.PropTypes.string.isRequired
|
children: React.PropTypes.oneOfType([
|
||||||
|
React.PropTypes.arrayOf(React.PropTypes.element),
|
||||||
|
React.PropTypes.element
|
||||||
|
]).isRequired
|
||||||
},
|
},
|
||||||
|
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
@ -16,12 +17,22 @@ let InputCheckbox = React.createClass({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
handleFocus() {
|
handleFocus(event) {
|
||||||
this.refs.checkbox.getDOMNode().checked = !this.refs.checkbox.getDOMNode().checked;
|
this.refs.checkbox.getDOMNode().checked = !this.refs.checkbox.getDOMNode().checked;
|
||||||
|
|
||||||
|
// This is calling property.js's method handleChange which
|
||||||
|
// expects an event object
|
||||||
|
// Since we don't have a valid one, we'll just manipulate the one we get and send
|
||||||
|
// it to handleChange
|
||||||
|
event.target.value = this.refs.checkbox.getDOMNode().checked;
|
||||||
|
this.props.onChange(event);
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
show: this.refs.checkbox.getDOMNode().checked,
|
show: this.refs.checkbox.getDOMNode().checked,
|
||||||
value: this.refs.checkbox.getDOMNode().checked
|
value: this.refs.checkbox.getDOMNode().checked
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@ -31,12 +42,7 @@ let InputCheckbox = React.createClass({
|
|||||||
onFocus={this.handleFocus}>
|
onFocus={this.handleFocus}>
|
||||||
<input type="checkbox" ref="checkbox"/>
|
<input type="checkbox" ref="checkbox"/>
|
||||||
<span className="checkbox">
|
<span className="checkbox">
|
||||||
<span>
|
{this.props.children}
|
||||||
{' ' + getLangText('I agree to the Terms of Service') + ' '}
|
|
||||||
(<a href="/terms" target="_blank" style={{fontSize: '0.9em', color: 'rgba(0,0,0,0.7)'}}>
|
|
||||||
{getLangText('read')}
|
|
||||||
</a>)
|
|
||||||
</span>
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
@ -46,11 +46,20 @@ let Property = React.createClass({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
componentWillReceiveProps(){
|
componentWillReceiveProps() {
|
||||||
|
|
||||||
|
// In order to set this.state.value from another component
|
||||||
|
// the state of value should only be set if its not undefined and
|
||||||
|
// actually references something
|
||||||
|
if(typeof this.refs.input.getDOMNode().value !== 'undefined') {
|
||||||
this.setState({
|
this.setState({
|
||||||
initialValue: this.refs.input.getDOMNode().defaultValue,
|
|
||||||
value: this.refs.input.getDOMNode().value
|
value: this.refs.input.getDOMNode().value
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
initialValue: this.refs.input.getDOMNode().defaultValue
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
reset(){
|
reset(){
|
||||||
@ -67,11 +76,13 @@ let Property = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleChange(event) {
|
handleChange(event) {
|
||||||
|
|
||||||
this.props.handleChange(event);
|
this.props.handleChange(event);
|
||||||
if ('onChange' in this.props) {
|
if ('onChange' in this.props) {
|
||||||
this.props.onChange(event);
|
this.props.onChange(event);
|
||||||
}
|
}
|
||||||
this.setState({value: event.target.value});
|
|
||||||
|
this.setState({value: true});
|
||||||
},
|
},
|
||||||
|
|
||||||
handleFocus() {
|
handleFocus() {
|
||||||
|
@ -4,16 +4,17 @@ import React from 'react';
|
|||||||
|
|
||||||
import Input from 'react-bootstrap/lib/Input';
|
import Input from 'react-bootstrap/lib/Input';
|
||||||
import Glyphicon from 'react-bootstrap/lib/Glyphicon';
|
import Glyphicon from 'react-bootstrap/lib/Glyphicon';
|
||||||
import ButtonLink from 'react-router-bootstrap/lib/ButtonLink';
|
|
||||||
import Row from 'react-bootstrap/lib/Row';
|
|
||||||
import Col from 'react-bootstrap/lib/Col';
|
|
||||||
import { getLangText } from '../../utils/lang_utils';
|
import { getLangText } from '../../utils/lang_utils';
|
||||||
|
|
||||||
let PieceListToolbar = React.createClass({
|
let PieceListToolbar = React.createClass({
|
||||||
|
|
||||||
propTypes: {
|
propTypes: {
|
||||||
className: React.PropTypes.string,
|
className: React.PropTypes.string,
|
||||||
searchFor: React.PropTypes.func
|
searchFor: React.PropTypes.func,
|
||||||
|
children: React.PropTypes.oneOfType([
|
||||||
|
React.PropTypes.arrayOf(React.PropTypes.element),
|
||||||
|
React.PropTypes.element
|
||||||
|
])
|
||||||
},
|
},
|
||||||
|
|
||||||
searchFor() {
|
searchFor() {
|
||||||
@ -29,6 +30,9 @@ let PieceListToolbar = React.createClass({
|
|||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-xs-12 col-sm-10 col-md-8 col-lg-8 col-sm-offset-1 col-md-offset-2 col-lg-offset-2">
|
<div className="col-xs-12 col-sm-10 col-md-8 col-lg-8 col-sm-offset-1 col-md-offset-2 col-lg-offset-2">
|
||||||
<div className="row">
|
<div className="row">
|
||||||
|
<span className="pull-left">
|
||||||
|
{this.props.children}
|
||||||
|
</span>
|
||||||
<span className="pull-right search-bar">
|
<span className="pull-right search-bar">
|
||||||
<Input
|
<Input
|
||||||
type='text'
|
type='text'
|
||||||
|
@ -163,6 +163,13 @@ var ReactS3FineUploader = React.createClass({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
// Without this method, fineuploader will continue to try to upload artworks
|
||||||
|
// even though this component is not mounted any more.
|
||||||
|
// Therefore we cancel all uploads
|
||||||
|
this.state.uploader.cancelAll();
|
||||||
|
},
|
||||||
|
|
||||||
propsToConfig() {
|
propsToConfig() {
|
||||||
let objectProperties = this.props.objectProperties;
|
let objectProperties = this.props.objectProperties;
|
||||||
objectProperties.key = this.requestKey;
|
objectProperties.key = this.requestKey;
|
||||||
|
@ -27,8 +27,18 @@ import { getLangText } from '../utils/lang_utils';
|
|||||||
|
|
||||||
|
|
||||||
let Header = React.createClass({
|
let Header = React.createClass({
|
||||||
|
propTypes: {
|
||||||
|
showAddWork: React.PropTypes.bool
|
||||||
|
},
|
||||||
|
|
||||||
mixins: [Router.Navigation, Router.State],
|
mixins: [Router.Navigation, Router.State],
|
||||||
|
|
||||||
|
getDefaultProps() {
|
||||||
|
return {
|
||||||
|
showAddWork: true
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
return mergeOptions(WhitelabelStore.getState(), UserStore.getState());
|
return mergeOptions(WhitelabelStore.getState(), UserStore.getState());
|
||||||
},
|
},
|
||||||
@ -96,7 +106,7 @@ let Header = React.createClass({
|
|||||||
);
|
);
|
||||||
|
|
||||||
collection = <NavItemLink to="pieces" query={this.getQuery()}>{getLangText('COLLECTION')}</NavItemLink>;
|
collection = <NavItemLink to="pieces" query={this.getQuery()}>{getLangText('COLLECTION')}</NavItemLink>;
|
||||||
addNewWork = <NavItemLink to="register_piece">+ {getLangText('NEW WORK')}</NavItemLink>;
|
addNewWork = this.props.showAddWork ? <NavItemLink to="register_piece">+ {getLangText('NEW WORK')}</NavItemLink> : null;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
account = <NavItemLink to="login">{getLangText('LOGIN')}</NavItemLink>;
|
account = <NavItemLink to="login">{getLangText('LOGIN')}</NavItemLink>;
|
||||||
|
@ -20,7 +20,8 @@ import AppConstants from '../constants/application_constants';
|
|||||||
|
|
||||||
let PieceList = React.createClass({
|
let PieceList = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
redirectTo: React.PropTypes.string
|
redirectTo: React.PropTypes.string,
|
||||||
|
customSubmitButton: React.PropTypes.element
|
||||||
},
|
},
|
||||||
|
|
||||||
mixins: [Router.Navigation, Router.State],
|
mixins: [Router.Navigation, Router.State],
|
||||||
@ -93,7 +94,9 @@ let PieceList = React.createClass({
|
|||||||
<div>
|
<div>
|
||||||
<PieceListToolbar
|
<PieceListToolbar
|
||||||
className="ascribe-piece-list-toolbar"
|
className="ascribe-piece-list-toolbar"
|
||||||
searchFor={this.searchFor} />
|
searchFor={this.searchFor}>
|
||||||
|
{this.props.customSubmitButton}
|
||||||
|
</PieceListToolbar>
|
||||||
<PieceListBulkModal className="ascribe-piece-list-bulk-modal" />
|
<PieceListBulkModal className="ascribe-piece-list-bulk-modal" />
|
||||||
<AccordionList
|
<AccordionList
|
||||||
className="ascribe-accordion-list"
|
className="ascribe-accordion-list"
|
||||||
|
@ -9,7 +9,6 @@ import GlobalNotification from '../../global_notification';
|
|||||||
|
|
||||||
let RouteHandler = Router.RouteHandler;
|
let RouteHandler = Router.RouteHandler;
|
||||||
|
|
||||||
|
|
||||||
let PrizeApp = React.createClass({
|
let PrizeApp = React.createClass({
|
||||||
mixins: [Router.State],
|
mixins: [Router.State],
|
||||||
|
|
||||||
@ -18,7 +17,7 @@ let PrizeApp = React.createClass({
|
|||||||
if (this.isActive('landing') || this.isActive('login') || this.isActive('signup')) {
|
if (this.isActive('landing') || this.isActive('login') || this.isActive('signup')) {
|
||||||
header = <Hero />;
|
header = <Hero />;
|
||||||
} else {
|
} else {
|
||||||
header = <Header />;
|
header = <Header showAddWork={false} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -10,11 +10,13 @@ let PrizePieceList = React.createClass({
|
|||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
<PieceList
|
||||||
|
redirectTo="register_piece"
|
||||||
|
customSubmitButton={
|
||||||
<ButtonLink to="register_piece">
|
<ButtonLink to="register_piece">
|
||||||
Submit a new artwork to the prize
|
Submit a new artwork to the prize
|
||||||
</ButtonLink>
|
</ButtonLink>
|
||||||
|
}/>
|
||||||
<PieceList redirectTo="register_piece" />
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,14 @@ let PrizeRegisterPiece = React.createClass({
|
|||||||
name="terms"
|
name="terms"
|
||||||
className="ascribe-settings-property-collapsible-toggle"
|
className="ascribe-settings-property-collapsible-toggle"
|
||||||
style={{paddingBottom: 0}}>
|
style={{paddingBottom: 0}}>
|
||||||
<InputCheckbox/>
|
<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>
|
</Property>
|
||||||
</RegisterPiece>
|
</RegisterPiece>
|
||||||
);
|
);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
@import 'landing';
|
@import 'landing';
|
||||||
|
|
||||||
.ascribe-prize-app {
|
.ascribe-prize-app {
|
||||||
|
background-color: #FDFDFD;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
padding-top: 70px;
|
padding-top: 70px;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
.wp {
|
.wp {
|
||||||
background-color: #FDFDFD;
|
|
||||||
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
/* We need this, otherwise piece list will have a scrollbar */
|
/* We need this, otherwise piece list will have a scrollbar */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user