2015-06-05 11:06:36 +02:00
|
|
|
'use strict';
|
2015-05-29 01:54:56 +02:00
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
|
2015-07-14 11:42:09 +02:00
|
|
|
import Button from 'react-bootstrap/lib/Button';
|
|
|
|
import Alert from 'react-bootstrap/lib/Alert';
|
2015-05-29 01:54:56 +02:00
|
|
|
|
2015-07-14 11:42:09 +02:00
|
|
|
import Form from './form';
|
|
|
|
import Property from './property';
|
|
|
|
import InputTextAreaToggable from './input_textarea_toggable';
|
2015-05-29 01:54:56 +02:00
|
|
|
|
2015-10-15 11:17:16 +02:00
|
|
|
import AclInformation from '../ascribe_buttons/acl_information';
|
2015-10-22 13:38:49 +02:00
|
|
|
|
2015-10-12 15:25:21 +02:00
|
|
|
import AscribeSpinner from '../ascribe_spinner';
|
2015-06-05 11:06:36 +02:00
|
|
|
|
2015-07-14 11:42:09 +02:00
|
|
|
import { getLangText } from '../../utils/lang_utils.js';
|
|
|
|
|
2015-06-02 11:38:18 +02:00
|
|
|
|
2015-07-14 11:42:09 +02:00
|
|
|
let TransferForm = React.createClass({
|
|
|
|
propTypes: {
|
|
|
|
url: React.PropTypes.string,
|
|
|
|
id: React.PropTypes.object,
|
|
|
|
message: React.PropTypes.string,
|
|
|
|
editions: React.PropTypes.array,
|
|
|
|
currentUser: React.PropTypes.object,
|
|
|
|
handleSuccess: React.PropTypes.func
|
|
|
|
},
|
|
|
|
|
|
|
|
getFormData(){
|
|
|
|
return this.props.id;
|
|
|
|
},
|
2015-06-02 11:38:18 +02:00
|
|
|
|
2015-07-14 11:42:09 +02:00
|
|
|
render() {
|
2015-06-02 11:38:18 +02:00
|
|
|
|
2015-05-29 01:54:56 +02:00
|
|
|
return (
|
2015-07-14 11:42:09 +02:00
|
|
|
<Form
|
|
|
|
ref='form'
|
|
|
|
url={this.props.url}
|
|
|
|
getFormData={this.getFormData}
|
|
|
|
handleSuccess={this.props.handleSuccess}
|
|
|
|
buttons={
|
|
|
|
<div className="modal-footer">
|
|
|
|
<p className="pull-right">
|
|
|
|
<Button
|
|
|
|
className="btn btn-default btn-sm ascribe-margin-1px"
|
2015-08-05 18:00:44 +02:00
|
|
|
type="submit">
|
|
|
|
{getLangText('TRANSFER')}
|
|
|
|
</Button>
|
2015-07-14 11:42:09 +02:00
|
|
|
</p>
|
|
|
|
</div>}
|
|
|
|
spinner={
|
|
|
|
<div className="modal-footer">
|
2015-10-12 15:25:21 +02:00
|
|
|
<p className="pull-right">
|
|
|
|
<AscribeSpinner color='dark-blue' size='md'/>
|
|
|
|
</p>
|
2015-07-14 11:42:09 +02:00
|
|
|
</div>}>
|
2015-10-15 11:17:16 +02:00
|
|
|
<AclInformation aim={'form'} verbs={['acl_transfer']}/>
|
2015-07-14 11:42:09 +02:00
|
|
|
<Property
|
|
|
|
name='transferee'
|
|
|
|
label={getLangText('Email')}>
|
|
|
|
<input
|
|
|
|
type="email"
|
|
|
|
placeholder={getLangText('Email of the transferee')}
|
|
|
|
required/>
|
|
|
|
</Property>
|
|
|
|
<Property
|
|
|
|
name='transfer_message'
|
2015-07-14 14:16:51 +02:00
|
|
|
label={getLangText('Personal Message')}
|
2015-09-21 12:05:42 +02:00
|
|
|
editable={true}
|
|
|
|
overrideForm={true}>
|
2015-07-14 11:42:09 +02:00
|
|
|
<InputTextAreaToggable
|
|
|
|
rows={1}
|
|
|
|
defaultValue={this.props.message}
|
|
|
|
placeholder={getLangText('Enter a message...')}
|
|
|
|
required="required"/>
|
|
|
|
</Property>
|
|
|
|
<Property
|
|
|
|
name='password'
|
|
|
|
label={getLangText('Password')}>
|
|
|
|
<input
|
|
|
|
type="password"
|
|
|
|
placeholder={getLangText('Enter your password')}
|
|
|
|
required/>
|
|
|
|
</Property>
|
|
|
|
<hr />
|
|
|
|
<br />
|
|
|
|
<Alert bsStyle='warning'>
|
|
|
|
Make sure that display instructions and technology details are correct.<br/>
|
2015-05-29 01:54:56 +02:00
|
|
|
They cannot be edited after the transfer.
|
2015-07-14 11:42:09 +02:00
|
|
|
</Alert>
|
|
|
|
</Form>
|
2015-05-29 01:54:56 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default TransferForm;
|