1
0
mirror of https://github.com/ascribe/onion.git synced 2025-02-14 21:10:27 +01:00

Merge branch 'AD-456-ikonotv-branded-page-for-registra' of bitbucket.org:ascribe/onion into AD-456-ikonotv-branded-page-for-registra

This commit is contained in:
Cevo 2015-09-03 15:53:22 +02:00
commit 5265332901
4 changed files with 27 additions and 18 deletions

View File

@ -19,7 +19,7 @@ import { getLangText } from '../../utils/lang_utils';
import { mergeOptions } from '../../utils/general_utils'; import { mergeOptions } from '../../utils/general_utils';
let ContractForm = React.createClass({ let ContractAgreementForm = React.createClass({
propTypes: { propTypes: {
handleSuccess: React.PropTypes.func handleSuccess: React.PropTypes.func
}, },
@ -55,8 +55,13 @@ let ContractForm = React.createClass({
GlobalNotificationActions.appendGlobalNotification(notification); GlobalNotificationActions.appendGlobalNotification(notification);
}, },
getFormData(){
return {'appendix': {'default': this.refs.form.refs.appendix.state.value}};
},
getContracts() { getContracts() {
if (this.state.contractList && this.state.contractList.length > 0) { if (this.state.contractList && this.state.contractList.count > 0) {
let contractList = this.state.contractList.results;
return ( return (
<Property <Property
name='contract' name='contract'
@ -65,13 +70,13 @@ let ContractForm = React.createClass({
footer={ footer={
<a <a
className="pull-right" className="pull-right"
href={this.state.contractList[this.state.selectedContract].s3UrlSafe} href={contractList[this.state.selectedContract].blob}
target="_blank"> target="_blank">
{getLangText('Learn more')} {getLangText('Learn more')}
</a> </a>
}> }>
<select name="contract"> <select name="contract">
{this.state.contractList.map((contract, i) => { {contractList.map((contract, i) => {
return ( return (
<option <option
name={i} name={i}
@ -92,7 +97,8 @@ let ContractForm = React.createClass({
<Form <Form
className="ascribe-form-bordered ascribe-form-wrapper" className="ascribe-form-bordered ascribe-form-wrapper"
ref='form' ref='form'
url={ApiUrls.blob_contracts} url={ApiUrls.ownership_contract_agreements}
getFormData={this.getFormData}
handleSuccess={this.props.handleSuccess} handleSuccess={this.props.handleSuccess}
buttons={<button buttons={<button
type="submit" type="submit"
@ -108,15 +114,7 @@ let ContractForm = React.createClass({
<h3>{getLangText('Contract form')}</h3> <h3>{getLangText('Contract form')}</h3>
</div> </div>
<Property <Property
name='artist_name' name='signee'
label={getLangText('Artist Name')}>
<input
type="text"
placeholder={getLangText('(e.g. Andy Warhol)')}
required/>
</Property>
<Property
name='artist_email'
label={getLangText('Artist Email')}> label={getLangText('Artist Email')}>
<input <input
type="email" type="email"
@ -138,4 +136,4 @@ let ContractForm = React.createClass({
} }
}); });
export default ContractForm; export default ContractAgreementForm;

View File

@ -5,6 +5,9 @@ import React from 'react';
import Form from '../ascribe_forms/form'; import Form from '../ascribe_forms/form';
import Property from '../ascribe_forms/property'; import Property from '../ascribe_forms/property';
import GlobalNotificationModel from '../../models/global_notification_model';
import GlobalNotificationActions from '../../actions/global_notification_actions';
import ReactS3FineUploader from '../ascribe_uploader/react_s3_fine_uploader'; import ReactS3FineUploader from '../ascribe_uploader/react_s3_fine_uploader';
import AppConstants from '../../constants/application_constants'; import AppConstants from '../../constants/application_constants';
@ -41,11 +44,18 @@ let CreateContractForm = React.createClass({
}); });
}, },
handleCreateSuccess(response) {
let notification = new GlobalNotificationModel(getLangText('Contract %s successfully created', response.name), 'success', 5000);
GlobalNotificationActions.appendGlobalNotification(notification);
},
render() { render() {
return ( return (
<Form <Form
url={ApiUrls.ownership_contract_list} url={ApiUrls.ownership_contract_list}
getFormData={this.getFormData} getFormData={this.getFormData}
handleSuccess={this.handleCreateSuccess}
buttons={ buttons={
<button <button
type="submit" type="submit"
@ -94,7 +104,7 @@ let CreateContractForm = React.createClass({
isReadyForFormSubmission={formSubmissionValidation.atLeastOneUploadedFile}/> isReadyForFormSubmission={formSubmissionValidation.atLeastOneUploadedFile}/>
</Property> </Property>
<Property <Property
name='contract_name' name='name'
label={getLangText('Contract name')}> label={getLangText('Contract name')}>
<input <input
type="text" type="text"

View File

@ -2,13 +2,13 @@
import React from 'react'; import React from 'react';
import ContractForm from '../../../../../components/ascribe_forms/form_contract'; import ContractAgreementForm from '../../../../ascribe_forms/form_contract_agreement';
let IkonotvRequestLoan = React.createClass({ let IkonotvRequestLoan = React.createClass({
render() { render() {
return ( return (
<ContractForm /> <ContractAgreementForm />
); );
} }
}); });

View File

@ -27,6 +27,7 @@ let ApiUrls = {
'note_private_piece': AppConstants.apiEndpoint + 'note/private/pieces/', 'note_private_piece': AppConstants.apiEndpoint + 'note/private/pieces/',
'note_public_edition': AppConstants.apiEndpoint + 'note/public/editions/', 'note_public_edition': AppConstants.apiEndpoint + 'note/public/editions/',
'note_public_piece': AppConstants.apiEndpoint + 'note/public/pieces/', 'note_public_piece': AppConstants.apiEndpoint + 'note/public/pieces/',
'ownership_contract_agreements': AppConstants.apiEndpoint + 'ownership/contract_agreements/',
'ownership_consigns': AppConstants.apiEndpoint + 'ownership/consigns/', 'ownership_consigns': AppConstants.apiEndpoint + 'ownership/consigns/',
'ownership_consigns_confirm': AppConstants.apiEndpoint + 'ownership/consigns/confirm/', 'ownership_consigns_confirm': AppConstants.apiEndpoint + 'ownership/consigns/confirm/',
'ownership_consigns_deny': AppConstants.apiEndpoint + 'ownership/consigns/deny/', 'ownership_consigns_deny': AppConstants.apiEndpoint + 'ownership/consigns/deny/',