1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01: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';
let ContractForm = React.createClass({
let ContractAgreementForm = React.createClass({
propTypes: {
handleSuccess: React.PropTypes.func
},
@ -55,8 +55,13 @@ let ContractForm = React.createClass({
GlobalNotificationActions.appendGlobalNotification(notification);
},
getFormData(){
return {'appendix': {'default': this.refs.form.refs.appendix.value}}
},
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 (
<Property
name='contract'
@ -65,13 +70,13 @@ let ContractForm = React.createClass({
footer={
<a
className="pull-right"
href={this.state.contractList[this.state.selectedContract].s3UrlSafe}
href={contractList[this.state.selectedContract].blob}
target="_blank">
{getLangText('Learn more')}
</a>
}>
<select name="contract">
{this.state.contractList.map((contract, i) => {
{contractList.map((contract, i) => {
return (
<option
name={i}
@ -92,7 +97,8 @@ let ContractForm = React.createClass({
<Form
className="ascribe-form-bordered ascribe-form-wrapper"
ref='form'
url={ApiUrls.blob_contracts}
url={ApiUrls.ownership_contract_agreements}
getFormData={this.getFormData}
handleSuccess={this.props.handleSuccess}
buttons={<button
type="submit"
@ -108,15 +114,7 @@ let ContractForm = React.createClass({
<h3>{getLangText('Contract form')}</h3>
</div>
<Property
name='artist_name'
label={getLangText('Artist Name')}>
<input
type="text"
placeholder={getLangText('(e.g. Andy Warhol)')}
required/>
</Property>
<Property
name='artist_email'
name='signee'
label={getLangText('Artist Email')}>
<input
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 ContractForm from '../../../../../components/ascribe_forms/form_contract';
import ContractAgreementForm from '../../../../ascribe_forms/form_contract_agreement';
let IkonotvRequestLoan = React.createClass({
render() {
return (
<ContractForm />
<ContractAgreementForm />
);
}
});

View File

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