From 1f73811950a736c4db08b78c4b9ee131a0ba988b Mon Sep 17 00:00:00 2001 From: diminator Date: Mon, 13 Jul 2015 18:13:47 +0200 Subject: [PATCH] register form separate spinner => spans --- .../accordion_list_item_create_editions.js | 4 +- js/components/ascribe_forms/form_login.js | 8 +- .../ascribe_forms/form_register_piece.js | 165 ++++++++++++++++++ js/components/ascribe_forms/form_signup.js | 4 +- js/components/coa_verify_container.js | 4 +- js/components/login_container.js | 10 +- js/components/password_reset_container.js | 8 +- js/components/register_piece.js | 147 +--------------- 8 files changed, 193 insertions(+), 157 deletions(-) create mode 100644 js/components/ascribe_forms/form_register_piece.js diff --git a/js/components/ascribe_accordion_list/accordion_list_item_create_editions.js b/js/components/ascribe_accordion_list/accordion_list_item_create_editions.js index 30a6efbc..66fadd8d 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item_create_editions.js +++ b/js/components/ascribe_accordion_list/accordion_list_item_create_editions.js @@ -30,9 +30,9 @@ let AccordionListItemCreateEditions = React.createClass({ getFormData={this.getFormData} handleSuccess={this.props.handleSuccess} spinner={ - + }> } spinner={ - + }> file.status !== 'deleted' && file.status !== 'canceled'); + if (files.length > 0 && files[0].status === 'upload successful') { + return true; + } else { + return false; + } + }, + + render() { + return ( +
+ {getLangText('Register work')} + } + spinner={ + + + + }> + +

{getLangText('Register your work')}

+
+ + + + + + + + + + + + + {this.props.children} +
+ ); + } +}); + +let FileUploader = React.createClass({ + propTypes: { + setIsUploadReady: React.PropTypes.func, + submitKey: React.PropTypes.func, + isReadyForFormSubmission: React.PropTypes.func, + onClick: React.PropTypes.func, + // editable is used to lock react fine uploader in case + // a user is actually not logged in already to prevent him from droping files + // before login in + editable: React.PropTypes.bool + }, + + render() { + return ( + + ); + } +}); + +export default RegisterPieceForm; \ No newline at end of file diff --git a/js/components/ascribe_forms/form_signup.js b/js/components/ascribe_forms/form_signup.js index 258a3923..3c50c7fd 100644 --- a/js/components/ascribe_forms/form_signup.js +++ b/js/components/ascribe_forms/form_signup.js @@ -75,9 +75,9 @@ let SignupForm = React.createClass({ {getLangText('Sign up to ascribe')} } spinner={ - + }>

{getLangText('Welcome to ascribe')}

diff --git a/js/components/coa_verify_container.js b/js/components/coa_verify_container.js index 6afbdfa5..8c2f2e77 100644 --- a/js/components/coa_verify_container.js +++ b/js/components/coa_verify_container.js @@ -68,9 +68,9 @@ let CoaVerifyForm = React.createClass({ {getLangText('Verify your Certificate of Authenticity')} } spinner={ - + }>
{getLangText('Not an ascribe user')}? {getLangText('Sign up')}...
diff --git a/js/components/password_reset_container.js b/js/components/password_reset_container.js index 5ab258b0..b149d45d 100644 --- a/js/components/password_reset_container.js +++ b/js/components/password_reset_container.js @@ -82,9 +82,9 @@ let PasswordRequestResetForm = React.createClass({ {getLangText('Reset your password')} } spinner={ - + }> } spinner={ - + }> file.status !== 'deleted' && file.status !== 'canceled'); - if (files.length > 0 && files[0].status === 'upload successful') { - return true; - } else { - return false; - } - }, onLicenseChange(event){ //console.log(this.state.licenses[event.target.selectedIndex].url); this.setState({selectedLicense: event.target.selectedIndex}); @@ -170,59 +135,9 @@ let RegisterPiece = React.createClass( { onFocus={this.changeSlide}> -
- {getLangText('Register work')} - } - spinner={ - - }> - -

{getLangText('Register your work')}

-
- - - - - - - - - - - - + {getLangText('Editions')} @@ -232,7 +147,7 @@ let RegisterPiece = React.createClass( { min={0}/> {this.getLicenses()} - +
@@ -248,54 +163,4 @@ let RegisterPiece = React.createClass( { }); -let FileUploader = React.createClass({ - propTypes: { - setIsUploadReady: React.PropTypes.func, - submitKey: React.PropTypes.func, - isReadyForFormSubmission: React.PropTypes.func, - onClick: React.PropTypes.func, - // editable is used to lock react fine uploader in case - // a user is actually not logged in already to prevent him from droping files - // before login in - editable: React.PropTypes.bool - }, - - render() { - return ( - - ); - } -}); - export default RegisterPiece;