1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-30 13:41:57 +02:00

bitbucket test

This commit is contained in:
diminator 2015-09-02 14:39:32 +02:00
parent 07ce180ff7
commit 19726560ba
3 changed files with 16 additions and 17 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.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

@ -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/',