2015-07-14 17:42:15 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import Button from 'react-bootstrap/lib/Button';
|
|
|
|
|
|
|
|
import ModalWrapper from '../ascribe_modal/modal_wrapper';
|
|
|
|
import UnConsignRequestForm from './../ascribe_forms/form_unconsign_request';
|
|
|
|
|
|
|
|
import { getLangText } from '../../utils/lang_utils.js';
|
2015-08-07 15:08:02 +02:00
|
|
|
import ApiUrls from '../../constants/api_urls';
|
2015-07-14 17:42:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
let UnConsignRequestButton = React.createClass({
|
|
|
|
propTypes: {
|
|
|
|
currentUser: React.PropTypes.object.isRequired,
|
|
|
|
edition: React.PropTypes.object.isRequired,
|
|
|
|
handleSuccess: React.PropTypes.func.isRequired
|
|
|
|
},
|
|
|
|
|
|
|
|
render: function () {
|
|
|
|
return (
|
|
|
|
<ModalWrapper
|
2015-08-05 17:32:35 +02:00
|
|
|
trigger={
|
2015-07-14 17:42:15 +02:00
|
|
|
<Button bsStyle="danger" className="btn-delete pull-center" bsSize="small" type="submit">
|
|
|
|
REQUEST UNCONSIGN
|
|
|
|
</Button>
|
|
|
|
}
|
|
|
|
handleSuccess={this.props.handleSuccess}
|
2015-08-05 17:32:35 +02:00
|
|
|
title='Request to Un-Consign'>
|
2015-07-14 17:42:15 +02:00
|
|
|
<UnConsignRequestForm
|
2015-08-07 15:08:02 +02:00
|
|
|
url={ApiUrls.ownership_unconsigns_request}
|
2015-07-14 17:42:15 +02:00
|
|
|
id={{'bitcoin_id': this.props.edition.bitcoin_id}}
|
|
|
|
message={`${getLangText('Hi')},
|
|
|
|
|
|
|
|
${getLangText('I request you to un-consign')} \" ${this.props.edition.title} \".
|
|
|
|
|
|
|
|
${getLangText('Truly yours')},
|
|
|
|
${this.props.currentUser.username}`}/>
|
|
|
|
</ModalWrapper>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default UnConsignRequestButton;
|
|
|
|
|