2015-06-05 11:06:36 +02:00
|
|
|
'use strict';
|
2015-05-29 16:53:30 +02:00
|
|
|
|
|
|
|
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';
|
2015-06-03 10:27:11 +02:00
|
|
|
import ButtonSubmitOrClose from '../ascribe_buttons/button_submit_close';
|
2015-05-29 16:53:30 +02:00
|
|
|
|
|
|
|
let UnConsignForm = React.createClass({
|
|
|
|
mixins: [FormMixin],
|
|
|
|
|
|
|
|
url() {
|
2015-06-05 11:06:36 +02:00
|
|
|
return ApiUrls.ownership_unconsigns;
|
2015-05-29 16:53:30 +02:00
|
|
|
},
|
2015-06-05 11:06:36 +02:00
|
|
|
|
2015-05-29 16:53:30 +02:00
|
|
|
getFormData() {
|
|
|
|
return {
|
|
|
|
bitcoin_id: this.props.edition.bitcoin_id,
|
|
|
|
unconsign_message: this.refs.unconsign_message.state.value,
|
|
|
|
password: this.refs.password.state.value
|
2015-06-05 11:06:36 +02:00
|
|
|
};
|
2015-05-29 16:53:30 +02:00
|
|
|
},
|
2015-06-05 11:06:36 +02:00
|
|
|
|
2015-05-29 16:53:30 +02:00
|
|
|
renderForm() {
|
|
|
|
let title = this.props.edition.title;
|
|
|
|
let username = this.props.currentUser.username;
|
|
|
|
let message =
|
|
|
|
`Hi,
|
|
|
|
|
|
|
|
I un-consign \" ${title} \" from you.
|
|
|
|
|
|
|
|
Truly yours,
|
|
|
|
${username}`;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<form id="unconsign_modal_content" role="form" onSubmit={this.submit}>
|
|
|
|
<input className="invisible" type="email" name="fake_unconsignee"/>
|
|
|
|
<input className="invisible" type="password" name="fake_password"/>
|
|
|
|
<InputTextArea
|
|
|
|
ref="unconsign_message"
|
|
|
|
defaultValue={message}
|
|
|
|
required="" />
|
|
|
|
<InputText
|
|
|
|
ref="password"
|
|
|
|
placeHolder="Password"
|
|
|
|
required="required"
|
|
|
|
type="password"
|
|
|
|
submitted={this.state.submitted} />
|
|
|
|
<ButtonSubmitOrClose
|
|
|
|
text="UNCONSIGN"
|
|
|
|
onClose={this.props.onRequestHide}
|
|
|
|
submitted={this.state.submitted} />
|
|
|
|
</form>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default UnConsignForm;
|