mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +01:00
Merge remote-tracking branch 'origin/master' into AD-499-whitelabel-prize-with-sluice-as-k
This commit is contained in:
commit
e833dbf61a
@ -22,9 +22,9 @@ let AclProxy = React.createClass({
|
||||
render() {
|
||||
if(this.props.aclObject[this.props.aclName]) {
|
||||
return (
|
||||
<div>
|
||||
<span>
|
||||
{this.props.children}
|
||||
</div>
|
||||
</span>
|
||||
);
|
||||
} else {
|
||||
if(typeof this.props.aclObject[this.props.aclName] === 'undefined') {
|
||||
|
@ -51,7 +51,12 @@ let AclButton = React.createClass({
|
||||
return {
|
||||
title: getLangText('Unconsign artwork'),
|
||||
tooltip: getLangText('Have the owner manage his sales again'),
|
||||
form: <UnConsignForm currentUser={ this.props.currentUser } editions={ this.props.pieceOrEditions }/>,
|
||||
form: (
|
||||
<UnConsignForm
|
||||
message={this.getUnConsignMessage()}
|
||||
id={this.getFormDataId()}
|
||||
url={apiUrls.ownership_unconsigns}/>
|
||||
),
|
||||
handleSuccess: this.showNotification
|
||||
};
|
||||
}else if (this.props.action === 'acl_transfer') {
|
||||
@ -144,6 +149,20 @@ ${this.props.currentUser.username}
|
||||
${getLangText('I consign')}:
|
||||
${this.getTitlesString()} ${getLangText('to you')}.
|
||||
|
||||
${getLangText('Truly yours')},
|
||||
${this.props.currentUser.username}
|
||||
`
|
||||
);
|
||||
},
|
||||
|
||||
// plz move to consign form
|
||||
getUnConsignMessage(){
|
||||
return (
|
||||
`${getLangText('Hi')},
|
||||
|
||||
${getLangText('I un-consign')}:
|
||||
${this.getTitlesString()} ${getLangText('from you')}.
|
||||
|
||||
${getLangText('Truly yours')},
|
||||
${this.props.currentUser.username}
|
||||
`
|
||||
|
47
js/components/ascribe_buttons/unconsign_request_button.js
Normal file
47
js/components/ascribe_buttons/unconsign_request_button.js
Normal file
@ -0,0 +1,47 @@
|
||||
'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';
|
||||
import apiUrls from '../../constants/api_urls';
|
||||
|
||||
|
||||
let UnConsignRequestButton = React.createClass({
|
||||
propTypes: {
|
||||
currentUser: React.PropTypes.object.isRequired,
|
||||
edition: React.PropTypes.object.isRequired,
|
||||
handleSuccess: React.PropTypes.func.isRequired
|
||||
},
|
||||
|
||||
render: function () {
|
||||
return (
|
||||
<ModalWrapper
|
||||
button={
|
||||
<Button bsStyle="danger" className="btn-delete pull-center" bsSize="small" type="submit">
|
||||
REQUEST UNCONSIGN
|
||||
</Button>
|
||||
}
|
||||
handleSuccess={this.props.handleSuccess}
|
||||
title='Request to Un-Consign'
|
||||
tooltip='Ask the consignee to return the ownership of the work back to you'>
|
||||
<UnConsignRequestForm
|
||||
url={apiUrls.ownership_unconsigns_request}
|
||||
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;
|
||||
|
@ -31,6 +31,7 @@ import EditionFurtherDetails from './further_details';
|
||||
import RequestActionForm from './../ascribe_forms/form_request_action';
|
||||
import EditionActions from '../../actions/edition_actions';
|
||||
import AclButtonList from './../ascribe_buttons/acl_button_list';
|
||||
import UnConsignRequestButton from './../ascribe_buttons/unconsign_request_button';
|
||||
import DeleteButton from '../ascribe_buttons/delete_button';
|
||||
|
||||
import GlobalNotificationModel from '../../models/global_notification_model';
|
||||
@ -105,13 +106,14 @@ let Edition = React.createClass({
|
||||
<hr/>
|
||||
</div>
|
||||
<EditionSummary
|
||||
handleSuccess={this.props.loadEdition}
|
||||
currentUser={this.state.currentUser}
|
||||
edition={this.props.edition}
|
||||
handleDeleteSuccess={this.handleDeleteSuccess}/>
|
||||
|
||||
<CollapsibleParagraph
|
||||
title={getLangText('Certificate of Authenticity')}
|
||||
show={this.props.edition.acl.acl_coa}>
|
||||
show={this.props.edition.acl.acl_coa === true}>
|
||||
<CoaDetails
|
||||
edition={this.props.edition}/>
|
||||
</CollapsibleParagraph>
|
||||
@ -178,19 +180,20 @@ let Edition = React.createClass({
|
||||
let EditionSummary = React.createClass({
|
||||
propTypes: {
|
||||
edition: React.PropTypes.object,
|
||||
handleSuccess: React.PropTypes.func,
|
||||
currentUser: React.PropTypes.object,
|
||||
handleDeleteSuccess: React.PropTypes.func
|
||||
},
|
||||
|
||||
getTransferWithdrawData(){
|
||||
return {'bitcoin_id': this.props.edition.bitcoin_id};
|
||||
},
|
||||
handleSuccess(){
|
||||
EditionActions.fetchOne(this.props.edition.id);
|
||||
},
|
||||
showNotification(response){
|
||||
this.handleSuccess();
|
||||
let notification = new GlobalNotificationModel(response.notification, 'success');
|
||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||
this.props.handleSuccess();
|
||||
if (response){
|
||||
let notification = new GlobalNotificationModel(response.notification, 'success');
|
||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||
}
|
||||
},
|
||||
getStatus(){
|
||||
let status = null;
|
||||
@ -211,6 +214,7 @@ let EditionSummary = React.createClass({
|
||||
if (this.props.edition.request_action && this.props.edition.request_action.length > 0){
|
||||
actions = (
|
||||
<RequestActionForm
|
||||
currentUser={this.props.currentUser}
|
||||
editions={ [this.props.edition] }
|
||||
handleSuccess={this.showNotification}/>);
|
||||
}
|
||||
@ -230,6 +234,15 @@ let EditionSummary = React.createClass({
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
let unconsignRequestButton = null;
|
||||
if (this.props.edition.acl.acl_request_unconsign) {
|
||||
unconsignRequestButton = (
|
||||
<UnConsignRequestButton
|
||||
currentUser={this.props.currentUser}
|
||||
edition={this.props.edition}
|
||||
handleSuccess={this.props.handleSuccess} />
|
||||
);
|
||||
}
|
||||
actions = (
|
||||
<Row>
|
||||
<Col md={12}>
|
||||
@ -237,11 +250,12 @@ 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}
|
||||
<DeleteButton
|
||||
handleSuccess={this.props.handleDeleteSuccess}
|
||||
editions={[this.props.edition]}/>
|
||||
{unconsignRequestButton}
|
||||
</AclButtonList>
|
||||
</Col>
|
||||
</Row>);
|
||||
|
@ -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 (
|
||||
// <form id="consign_modal_content" role="form" onSubmit={this.submit}>
|
||||
// <input className="invisible" type="email" name="fake_consignee"/>
|
||||
// <input className="invisible" type="password" name="fake_password"/>
|
||||
// <InputText
|
||||
// ref="consignee"
|
||||
// placeHolder={getLangText('Consignee email')}
|
||||
// required="required"
|
||||
// type="email"
|
||||
// submitted={this.state.submitted}/>
|
||||
// <InputTextArea
|
||||
// ref="consign_message"
|
||||
// defaultValue={message}
|
||||
// required=""
|
||||
// />
|
||||
// <InputText
|
||||
// ref="password"
|
||||
// placeHolder={getLangText('Password')}
|
||||
// required="required"
|
||||
// type="password"
|
||||
// submitted={this.state.submitted}/>
|
||||
// <ButtonSubmitOrClose
|
||||
// text={getLangText('CONSIGN')}
|
||||
// onClose={this.props.onRequestHide}
|
||||
// submitted={this.state.submitted} />
|
||||
// </form>
|
||||
// );
|
||||
// }
|
||||
//});
|
||||
////'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 (
|
||||
//// <form id="transfer_modal_content" role="form" onSubmit={this.submit}>
|
||||
//// <input className="invisible" type="email" name="fake_transferee"/>
|
||||
//// <input className="invisible" type="password" name="fake_password"/>
|
||||
//// <InputText
|
||||
//// ref="transferee"
|
||||
//// placeHolder={getLangText('Transferee email')}
|
||||
//// required="required"
|
||||
//// type="email"
|
||||
//// submitted={this.state.submitted}/>
|
||||
//// <InputTextArea
|
||||
//// ref="transfer_message"
|
||||
//// defaultValue={message}
|
||||
//// required=""
|
||||
//// />
|
||||
//// <InputText
|
||||
//// ref="password"
|
||||
//// placeHolder={getLangText('Password')}
|
||||
//// required="required"
|
||||
//// type="password"
|
||||
//// submitted={this.state.submitted}/>
|
||||
//// <div>
|
||||
//// Make sure that display instructions and technology details are correct.
|
||||
//// They cannot be edited after the transfer.
|
||||
//// </div>
|
||||
//// <ButtonSubmitOrClose
|
||||
//// text={getLangText('TRANSFER')}
|
||||
//// onClose={this.props.onRequestHide}
|
||||
//// submitted={this.state.submitted} />
|
||||
//// </form>
|
||||
//// );
|
||||
//// }
|
||||
////});
|
||||
////
|
||||
'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
|
||||
},
|
||||
|
@ -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 = (
|
||||
<div id="request_accept"
|
||||
onClick={this.handleRequest}
|
||||
className='btn btn-default btn-sm ascribe-margin-1px'>{getLangText('ACCEPT')}
|
||||
</div>);
|
||||
if (edition.request_action === 'unconsign'){
|
||||
console.log(this.props)
|
||||
buttonAccept = (
|
||||
<AclButton
|
||||
availableAcls={{'acl_unconsign': true}}
|
||||
action="acl_unconsign"
|
||||
pieceOrEditions={this.props.editions}
|
||||
currentUser={this.props.currentUser}
|
||||
handleSuccess={this.props.handleSuccess} />
|
||||
);
|
||||
}
|
||||
let buttons = (
|
||||
<span>
|
||||
<span>
|
||||
<span>
|
||||
<div id="request_accept" onClick={this.handleRequest} className='btn btn-default btn-sm ascribe-margin-1px'>{getLangText('ACCEPT')}</div>
|
||||
</span>
|
||||
<span>
|
||||
<div id="request_deny" onClick={this.handleRequest} className='btn btn-danger btn-delete btn-sm ascribe-margin-1px'>{getLangText('REJECT')}</div>
|
||||
</span>
|
||||
{buttonAccept}
|
||||
</span>
|
||||
<span>
|
||||
<div id="request_deny" onClick={this.handleRequest} className='btn btn-danger btn-delete btn-sm ascribe-margin-1px'>{getLangText('REJECT')}</div>
|
||||
</span>
|
||||
</span>
|
||||
);
|
||||
if (this.state.submitted){
|
||||
buttons = (
|
||||
|
@ -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 (
|
||||
// <form id="transfer_modal_content" role="form" onSubmit={this.submit}>
|
||||
// <input className="invisible" type="email" name="fake_transferee"/>
|
||||
// <input className="invisible" type="password" name="fake_password"/>
|
||||
// <InputText
|
||||
// ref="transferee"
|
||||
// placeHolder={getLangText('Transferee email')}
|
||||
// required="required"
|
||||
// type="email"
|
||||
// submitted={this.state.submitted}/>
|
||||
// <InputTextArea
|
||||
// ref="transfer_message"
|
||||
// defaultValue={message}
|
||||
// required=""
|
||||
// />
|
||||
// <InputText
|
||||
// ref="password"
|
||||
// placeHolder={getLangText('Password')}
|
||||
// required="required"
|
||||
// type="password"
|
||||
// submitted={this.state.submitted}/>
|
||||
// <div>
|
||||
// Make sure that display instructions and technology details are correct.
|
||||
// They cannot be edited after the transfer.
|
||||
// </div>
|
||||
// <ButtonSubmitOrClose
|
||||
// text={getLangText('TRANSFER')}
|
||||
// onClose={this.props.onRequestHide}
|
||||
// submitted={this.state.submitted} />
|
||||
// </form>
|
||||
// );
|
||||
// }
|
||||
//});
|
||||
//
|
||||
'use strict';
|
||||
|
||||
import React from 'react';
|
||||
|
@ -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 (
|
||||
<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={getLangText('Password')}
|
||||
required="required"
|
||||
type="password"
|
||||
submitted={this.state.submitted} />
|
||||
<ButtonSubmitOrClose
|
||||
text={getLangText('UNCONSIGN')}
|
||||
onClose={this.props.onRequestHide}
|
||||
submitted={this.state.submitted} />
|
||||
</form>
|
||||
<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">{getLangText('UNCONSIGN')}</Button>
|
||||
<Button
|
||||
className="btn btn-danger btn-delete btn-sm ascribe-margin-1px"
|
||||
style={{marginLeft: '0'}}
|
||||
onClick={this.props.onRequestHide}>{getLangText('CLOSE')}</Button>
|
||||
</p>
|
||||
</div>}
|
||||
spinner={
|
||||
<div className="modal-footer">
|
||||
<img src={AppConstants.baseUrl + 'static/img/ascribe_animated_small.gif'} />
|
||||
</div>}>
|
||||
<Property
|
||||
name='unconsign_message'
|
||||
label={getLangText('Personal Message')}
|
||||
editable={true}>
|
||||
<InputTextAreaToggable
|
||||
rows={1}
|
||||
editable={true}
|
||||
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 />
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
@ -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 (
|
||||
<form id="unconsign_request_modal_content" role="form" onSubmit={this.submit}>
|
||||
<InputTextArea
|
||||
ref="unconsign_request_message"
|
||||
defaultValue={message}
|
||||
required="" />
|
||||
<ButtonSubmitOrClose
|
||||
text={getLangText('UNCONSIGN REQUEST')}
|
||||
onClose={this.props.onRequestHide}
|
||||
submitted={this.state.submitted} />
|
||||
</form>
|
||||
<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">{getLangText('REQUEST UNCONSIGN')}</Button>
|
||||
<Button
|
||||
className="btn btn-danger btn-delete btn-sm ascribe-margin-1px"
|
||||
style={{marginLeft: '0'}}
|
||||
onClick={this.props.onRequestHide}>{getLangText('CLOSE')}</Button>
|
||||
</p>
|
||||
</div>}
|
||||
spinner={
|
||||
<div className="modal-footer">
|
||||
<img src={AppConstants.baseUrl + 'static/img/ascribe_animated_small.gif'} />
|
||||
</div>}>
|
||||
<Property
|
||||
name='unconsign_request_message'
|
||||
label={getLangText('Personal Message')}
|
||||
editable={true}>
|
||||
<InputTextAreaToggable
|
||||
rows={1}
|
||||
editable={true}
|
||||
defaultValue={this.props.message}
|
||||
placeholder={getLangText('Enter a message...')}
|
||||
required="required"/>
|
||||
</Property>
|
||||
<hr />
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
@ -62,16 +62,6 @@ let PieceList = React.createClass({
|
||||
this.state.orderAsc);
|
||||
},
|
||||
|
||||
getPieceListToolbar() {
|
||||
if(this.state.pieceListCount > 10) {
|
||||
return (
|
||||
<PieceListToolbar
|
||||
className="ascribe-piece-list-toolbar"
|
||||
searchFor={this.searchFor} />
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
getPagination() {
|
||||
let currentPage = parseInt(this.getQuery().page, 10) || 1;
|
||||
let totalPages = Math.ceil(this.state.pieceListCount / this.state.pageSize);
|
||||
@ -101,7 +91,9 @@ let PieceList = React.createClass({
|
||||
|
||||
return (
|
||||
<div>
|
||||
{this.getPieceListToolbar()}
|
||||
<PieceListToolbar
|
||||
className="ascribe-piece-list-toolbar"
|
||||
searchFor={this.searchFor} />
|
||||
<PieceListBulkModal className="ascribe-piece-list-bulk-modal" />
|
||||
<AccordionList
|
||||
className="ascribe-accordion-list"
|
||||
|
@ -23,7 +23,7 @@ let baseUrl = AppConstants.baseUrl;
|
||||
function getRoutes(commonRoutes) {
|
||||
return (
|
||||
<Route name="app" path={baseUrl} handler={App}>
|
||||
<Route name="landing" path="/" handler={Landing} />
|
||||
<Route name="landing" path={baseUrl} handler={Landing} />
|
||||
<Route name="login" path="login" handler={LoginContainer} />
|
||||
<Route name="signup" path="signup" handler={SignupContainer} />
|
||||
<Route name="password_reset" path="password_reset" handler={PasswordResetContainer} />
|
||||
|
Loading…
Reference in New Issue
Block a user