);
}
@@ -205,6 +209,15 @@ let EditionSummary = React.createClass({
);
}
+ let unconsignRequestButton = null;
+ if (this.props.edition.acl.acl_request_unconsign) {
+ unconsignRequestButton = (
+
+ );
+ }
actions = (
@@ -212,8 +225,9 @@ let EditionSummary = React.createClass({
className="text-center ascribe-button-list"
availableAcls={this.props.edition.acl}
editions={[this.props.edition]}
- handleSuccess={this.handleSuccess}>
+ handleSuccess={this.props.handleSuccess}>
{withdrawButton}
+ {unconsignRequestButton}
);
diff --git a/js/components/ascribe_forms/form_consign.js b/js/components/ascribe_forms/form_consign.js
index beb06917..5815efdd 100644
--- a/js/components/ascribe_forms/form_consign.js
+++ b/js/components/ascribe_forms/form_consign.js
@@ -1,151 +1,8 @@
-//'use strict';
-//
-//import React from 'react';
-//
-//import ApiUrls from '../../constants/api_urls';
-//import FormMixin from '../../mixins/form_mixin';
-//import InputText from './input_text';
-//import InputTextArea from './input_textarea';
-//import ButtonSubmitOrClose from '../ascribe_buttons/button_submit_close';
-//import { getLangText } from '../../utils/lang_utils.js'
-//
-//let ConsignForm = React.createClass({
-// mixins: [FormMixin],
-//
-//
-// url() {
-// return ApiUrls.ownership_consigns;
-// },
-//
-// getFormData() {
-// return {
-// bitcoin_id: this.getBitcoinIds().join(),
-// consignee: this.refs.consignee.state.value,
-// consign_message: this.refs.consign_message.state.value,
-// password: this.refs.password.state.value
-// };
-// },
-//
-// renderForm() {
-// let title = this.getTitlesString().join('');
-// let username = this.props.currentUser.username;
-// let message =
-//`${getLangText('Hi')},
-//
-//${getLangText('I consign')} :
-//${title}${getLangText('to you')}.
-//
-//${getLangText('Truly yours')},
-//${username}`;
-//
-// return (
-//
-// );
-// }
-//});
-////'use strict';
-////
-////import React from 'react';
-////
-////import ApiUrls from '../../constants/api_urls';
-////import FormMixin from '../../mixins/form_mixin';
-////import InputText from './input_text';
-////import InputTextArea from './input_textarea';
-////import ButtonSubmitOrClose from '../ascribe_buttons/button_submit_close';
-////import { getLangText } from '../../utils/lang_utils.js'
-////
-////let TransferForm = React.createClass({
-//// mixins: [FormMixin],
-////
-//// url() {
-//// return ApiUrls.ownership_transfers;
-//// },
-////
-//// getFormData() {
-//// return {
-//// bitcoin_id: this.getBitcoinIds().join(),
-//// transferee: this.refs.transferee.state.value,
-//// transfer_message: this.refs.transfer_message.state.value,
-//// password: this.refs.password.state.value
-//// };
-//// },
-////
-//// renderForm() {
-//// let title = this.getTitlesString().join('');
-//// let username = this.props.currentUser.username;
-//// let message =
-////`${getLangText('Hi')},
-////
-////${getLangText('I transfer ownership of')} :
-////${title}${getLangText('to you')}.
-////
-////${getLangText('Truly yours')},
-////${username}`;
-////
-//// return (
-////
-//// );
-//// }
-////});
-////
'use strict';
import React from 'react';
import Button from 'react-bootstrap/lib/Button';
-import Alert from 'react-bootstrap/lib/Alert';
import Form from './form';
import Property from './property';
@@ -161,8 +18,6 @@ let ConsignForm = React.createClass({
url: React.PropTypes.string,
id: React.PropTypes.object,
message: React.PropTypes.string,
- editions: React.PropTypes.array,
- currentUser: React.PropTypes.object,
onRequestHide: React.PropTypes.func,
handleSuccess: React.PropTypes.func
},
diff --git a/js/components/ascribe_forms/form_request_action.js b/js/components/ascribe_forms/form_request_action.js
index f76aa1d5..622aa02f 100644
--- a/js/components/ascribe_forms/form_request_action.js
+++ b/js/components/ascribe_forms/form_request_action.js
@@ -7,6 +7,8 @@ import Alert from 'react-bootstrap/lib/Alert';
import apiUrls from '../../constants/api_urls';
import FormMixin from '../../mixins/form_mixin';
+import AclButton from './../ascribe_buttons/acl_button';
+
import AppConstants from '../../constants/application_constants';
import { getLangText } from '../../utils/lang_utils.js';
@@ -52,15 +54,31 @@ let RequestActionForm = React.createClass({
renderForm() {
let edition = this.props.editions[0];
+ let buttonAccept = (
+ {getLangText('ACCEPT')}
+
);
+ if (edition.request_action === 'unconsign'){
+ console.log(this.props)
+ buttonAccept = (
+
+ );
+ }
let buttons = (
+
-
- {getLangText('ACCEPT')}
-
-
- {getLangText('REJECT')}
-
+ {buttonAccept}
+
+ {getLangText('REJECT')}
+
+
);
if (this.state.submitted){
buttons = (
diff --git a/js/components/ascribe_forms/form_transfer.js b/js/components/ascribe_forms/form_transfer.js
index 7bfdd605..07821475 100644
--- a/js/components/ascribe_forms/form_transfer.js
+++ b/js/components/ascribe_forms/form_transfer.js
@@ -1,76 +1,3 @@
-//'use strict';
-//
-//import React from 'react';
-//
-//import ApiUrls from '../../constants/api_urls';
-//import FormMixin from '../../mixins/form_mixin';
-//import InputText from './input_text';
-//import InputTextArea from './input_textarea';
-//import ButtonSubmitOrClose from '../ascribe_buttons/button_submit_close';
-//import { getLangText } from '../../utils/lang_utils.js'
-//
-//let TransferForm = React.createClass({
-// mixins: [FormMixin],
-//
-// url() {
-// return ApiUrls.ownership_transfers;
-// },
-//
-// getFormData() {
-// return {
-// bitcoin_id: this.getBitcoinIds().join(),
-// transferee: this.refs.transferee.state.value,
-// transfer_message: this.refs.transfer_message.state.value,
-// password: this.refs.password.state.value
-// };
-// },
-//
-// renderForm() {
-// let title = this.getTitlesString().join('');
-// let username = this.props.currentUser.username;
-// let message =
-//`${getLangText('Hi')},
-//
-//${getLangText('I transfer ownership of')} :
-//${title}${getLangText('to you')}.
-//
-//${getLangText('Truly yours')},
-//${username}`;
-//
-// return (
-//
-// );
-// }
-//});
-//
'use strict';
import React from 'react';
diff --git a/js/components/ascribe_forms/form_unconsign.js b/js/components/ascribe_forms/form_unconsign.js
index 80a1fa58..d33ccedf 100644
--- a/js/components/ascribe_forms/form_unconsign.js
+++ b/js/components/ascribe_forms/form_unconsign.js
@@ -2,59 +2,75 @@
import React from 'react';
-import ApiUrls from '../../constants/api_urls';
-import FormMixin from '../../mixins/form_mixin';
-import InputText from './input_text';
-import InputTextArea from './input_textarea';
-import ButtonSubmitOrClose from '../ascribe_buttons/button_submit_close';
-import { getLangText } from '../../utils/lang_utils.js'
+import Button from 'react-bootstrap/lib/Button';
+
+import Form from './form';
+import Property from './property';
+import InputTextAreaToggable from './input_textarea_toggable';
+
+import AppConstants from '../../constants/application_constants';
+import { getLangText } from '../../utils/lang_utils.js';
+
let UnConsignForm = React.createClass({
- mixins: [FormMixin],
-
- url() {
- return ApiUrls.ownership_unconsigns;
+ propTypes: {
+ url: React.PropTypes.string,
+ id: React.PropTypes.object,
+ message: React.PropTypes.string,
+ editions: React.PropTypes.array,
+ onRequestHide: React.PropTypes.func,
+ handleSuccess: React.PropTypes.func
},
- getFormData() {
- return {
- bitcoin_id: this.getBitcoinIds().join(),
- unconsign_message: this.refs.unconsign_message.state.value,
- password: this.refs.password.state.value
- };
+ getFormData(){
+ return this.props.id;
},
- renderForm() {
- let title = this.getTitlesString().join('');
- let username = this.props.currentUser.username;
- let message =
-`${getLangText('Hi')},
-
-${getLangText('I un-consign')}:
-${title}${getLangText('from you')}.
-
-${getLangText('Truly yours')},
-${username}`;
+ render() {
return (
-
+
);
}
});
diff --git a/js/components/ascribe_forms/form_unconsign_request.js b/js/components/ascribe_forms/form_unconsign_request.js
index e2a53513..1978e151 100644
--- a/js/components/ascribe_forms/form_unconsign_request.js
+++ b/js/components/ascribe_forms/form_unconsign_request.js
@@ -2,48 +2,68 @@
import React from 'react';
-import ApiUrls from '../../constants/api_urls';
-import FormMixin from '../../mixins/form_mixin';
-import InputTextArea from './input_textarea';
-import ButtonSubmitOrClose from '../ascribe_buttons/button_submit_close';
-import { getLangText } from '../../utils/lang_utils.js'
+import Button from 'react-bootstrap/lib/Button';
+import Alert from 'react-bootstrap/lib/Alert';
+
+import Form from './form';
+import Property from './property';
+import InputTextAreaToggable from './input_textarea_toggable';
+
+
+import AppConstants from '../../constants/application_constants';
+import { getLangText } from '../../utils/lang_utils.js';
+
let UnConsignRequestForm = React.createClass({
- mixins: [FormMixin],
-
- url() {
- return ApiUrls.ownership_unconsigns_request;
+ propTypes: {
+ url: React.PropTypes.string,
+ id: React.PropTypes.object,
+ message: React.PropTypes.string,
+ onRequestHide: React.PropTypes.func,
+ handleSuccess: React.PropTypes.func
},
- getFormData() {
- return {
- bitcoin_id: this.props.edition.bitcoin_id,
- unconsign_request_message: this.refs.unconsign_request_message.state.value
- };
+ getFormData(){
+ return this.props.id;
},
- renderForm() {
- let title = this.props.edition.title;
- let username = this.props.currentUser.username;
- let message =
-`${getLangText('Hi')},
-
-${getLangText('I request you to un-consign')} \" ${title} \".
-
-${getLangText('Truly yours')},
-${username}`;
+ render() {
return (
-
+
);
}
});