mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 09:35:10 +01:00
77 lines
2.5 KiB
JavaScript
77 lines
2.5 KiB
JavaScript
'use strict';
|
|
|
|
import React from 'react';
|
|
|
|
import Form from './form';
|
|
import Property from './property';
|
|
import InputTextAreaToggable from './input_textarea_toggable';
|
|
|
|
import Button from 'react-bootstrap/lib/Button';
|
|
|
|
import AppConstants from '../../constants/application_constants';
|
|
import AclInformation from '../ascribe_buttons/acl_information';
|
|
import { getLangText } from '../../utils/lang_utils.js';
|
|
|
|
|
|
let ShareForm = 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;
|
|
},
|
|
|
|
render() {
|
|
|
|
return (
|
|
<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"
|
|
type="submit">
|
|
SHARE
|
|
</Button>
|
|
</p>
|
|
</div>}
|
|
spinner={
|
|
<div className="modal-footer">
|
|
<img src={AppConstants.baseUrl + 'static/img/ascribe_animated_small.gif'} />
|
|
</div>}>
|
|
<AclInformation aim={'form'} verbs={['acl_share']}/>
|
|
<Property
|
|
name='share_emails'
|
|
label={getLangText('Emails')}>
|
|
<input
|
|
type="text"
|
|
placeholder={getLangText('Comma separated emails')}
|
|
required/>
|
|
</Property>
|
|
<Property
|
|
name='share_message'
|
|
label='Personal Message'
|
|
editable={true}
|
|
overrideForm={true}>
|
|
<InputTextAreaToggable
|
|
rows={1}
|
|
defaultValue={this.props.message}
|
|
placeholder={getLangText('Enter a message...')}
|
|
required="required"/>
|
|
</Property>
|
|
</Form>
|
|
);
|
|
}
|
|
});
|
|
|
|
export default ShareForm; |