1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 01:25:17 +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';
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.state.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

@ -5,6 +5,9 @@ import React from 'react';
import Form from '../ascribe_forms/form';
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 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() {
return (
<Form
url={ApiUrls.ownership_contract_list}
getFormData={this.getFormData}
handleSuccess={this.handleCreateSuccess}
buttons={
<button
type="submit"
@ -94,7 +104,7 @@ let CreateContractForm = React.createClass({
isReadyForFormSubmission={formSubmissionValidation.atLeastOneUploadedFile}/>
</Property>
<Property
name='contract_name'
name='name'
label={getLangText('Contract name')}>
<input
type="text"

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