mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +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() {
|
render() {
|
||||||
if(this.props.aclObject[this.props.aclName]) {
|
if(this.props.aclObject[this.props.aclName]) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<span>
|
||||||
{this.props.children}
|
{this.props.children}
|
||||||
</div>
|
</span>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
if(typeof this.props.aclObject[this.props.aclName] === 'undefined') {
|
if(typeof this.props.aclObject[this.props.aclName] === 'undefined') {
|
||||||
|
@ -51,7 +51,12 @@ let AclButton = React.createClass({
|
|||||||
return {
|
return {
|
||||||
title: getLangText('Unconsign artwork'),
|
title: getLangText('Unconsign artwork'),
|
||||||
tooltip: getLangText('Have the owner manage his sales again'),
|
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
|
handleSuccess: this.showNotification
|
||||||
};
|
};
|
||||||
}else if (this.props.action === 'acl_transfer') {
|
}else if (this.props.action === 'acl_transfer') {
|
||||||
@ -144,6 +149,20 @@ ${this.props.currentUser.username}
|
|||||||
${getLangText('I consign')}:
|
${getLangText('I consign')}:
|
||||||
${this.getTitlesString()} ${getLangText('to you')}.
|
${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')},
|
${getLangText('Truly yours')},
|
||||||
${this.props.currentUser.username}
|
${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 RequestActionForm from './../ascribe_forms/form_request_action';
|
||||||
import EditionActions from '../../actions/edition_actions';
|
import EditionActions from '../../actions/edition_actions';
|
||||||
import AclButtonList from './../ascribe_buttons/acl_button_list';
|
import AclButtonList from './../ascribe_buttons/acl_button_list';
|
||||||
|
import UnConsignRequestButton from './../ascribe_buttons/unconsign_request_button';
|
||||||
import DeleteButton from '../ascribe_buttons/delete_button';
|
import DeleteButton from '../ascribe_buttons/delete_button';
|
||||||
|
|
||||||
import GlobalNotificationModel from '../../models/global_notification_model';
|
import GlobalNotificationModel from '../../models/global_notification_model';
|
||||||
@ -105,13 +106,14 @@ let Edition = React.createClass({
|
|||||||
<hr/>
|
<hr/>
|
||||||
</div>
|
</div>
|
||||||
<EditionSummary
|
<EditionSummary
|
||||||
|
handleSuccess={this.props.loadEdition}
|
||||||
currentUser={this.state.currentUser}
|
currentUser={this.state.currentUser}
|
||||||
edition={this.props.edition}
|
edition={this.props.edition}
|
||||||
handleDeleteSuccess={this.handleDeleteSuccess}/>
|
handleDeleteSuccess={this.handleDeleteSuccess}/>
|
||||||
|
|
||||||
<CollapsibleParagraph
|
<CollapsibleParagraph
|
||||||
title={getLangText('Certificate of Authenticity')}
|
title={getLangText('Certificate of Authenticity')}
|
||||||
show={this.props.edition.acl.acl_coa}>
|
show={this.props.edition.acl.acl_coa === true}>
|
||||||
<CoaDetails
|
<CoaDetails
|
||||||
edition={this.props.edition}/>
|
edition={this.props.edition}/>
|
||||||
</CollapsibleParagraph>
|
</CollapsibleParagraph>
|
||||||
@ -178,19 +180,20 @@ let Edition = React.createClass({
|
|||||||
let EditionSummary = React.createClass({
|
let EditionSummary = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
edition: React.PropTypes.object,
|
edition: React.PropTypes.object,
|
||||||
|
handleSuccess: React.PropTypes.func,
|
||||||
|
currentUser: React.PropTypes.object,
|
||||||
handleDeleteSuccess: React.PropTypes.func
|
handleDeleteSuccess: React.PropTypes.func
|
||||||
},
|
},
|
||||||
|
|
||||||
getTransferWithdrawData(){
|
getTransferWithdrawData(){
|
||||||
return {'bitcoin_id': this.props.edition.bitcoin_id};
|
return {'bitcoin_id': this.props.edition.bitcoin_id};
|
||||||
},
|
},
|
||||||
handleSuccess(){
|
|
||||||
EditionActions.fetchOne(this.props.edition.id);
|
|
||||||
},
|
|
||||||
showNotification(response){
|
showNotification(response){
|
||||||
this.handleSuccess();
|
this.props.handleSuccess();
|
||||||
let notification = new GlobalNotificationModel(response.notification, 'success');
|
if (response){
|
||||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
let notification = new GlobalNotificationModel(response.notification, 'success');
|
||||||
|
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
getStatus(){
|
getStatus(){
|
||||||
let status = null;
|
let status = null;
|
||||||
@ -211,6 +214,7 @@ let EditionSummary = React.createClass({
|
|||||||
if (this.props.edition.request_action && this.props.edition.request_action.length > 0){
|
if (this.props.edition.request_action && this.props.edition.request_action.length > 0){
|
||||||
actions = (
|
actions = (
|
||||||
<RequestActionForm
|
<RequestActionForm
|
||||||
|
currentUser={this.props.currentUser}
|
||||||
editions={ [this.props.edition] }
|
editions={ [this.props.edition] }
|
||||||
handleSuccess={this.showNotification}/>);
|
handleSuccess={this.showNotification}/>);
|
||||||
}
|
}
|
||||||
@ -230,6 +234,15 @@ let EditionSummary = React.createClass({
|
|||||||
</Form>
|
</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 = (
|
actions = (
|
||||||
<Row>
|
<Row>
|
||||||
<Col md={12}>
|
<Col md={12}>
|
||||||
@ -237,11 +250,12 @@ let EditionSummary = React.createClass({
|
|||||||
className="text-center ascribe-button-list"
|
className="text-center ascribe-button-list"
|
||||||
availableAcls={this.props.edition.acl}
|
availableAcls={this.props.edition.acl}
|
||||||
editions={[this.props.edition]}
|
editions={[this.props.edition]}
|
||||||
handleSuccess={this.handleSuccess}>
|
handleSuccess={this.props.handleSuccess}>
|
||||||
{withdrawButton}
|
{withdrawButton}
|
||||||
<DeleteButton
|
<DeleteButton
|
||||||
handleSuccess={this.props.handleDeleteSuccess}
|
handleSuccess={this.props.handleDeleteSuccess}
|
||||||
editions={[this.props.edition]}/>
|
editions={[this.props.edition]}/>
|
||||||
|
{unconsignRequestButton}
|
||||||
</AclButtonList>
|
</AclButtonList>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>);
|
</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';
|
'use strict';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import Button from 'react-bootstrap/lib/Button';
|
import Button from 'react-bootstrap/lib/Button';
|
||||||
import Alert from 'react-bootstrap/lib/Alert';
|
|
||||||
|
|
||||||
import Form from './form';
|
import Form from './form';
|
||||||
import Property from './property';
|
import Property from './property';
|
||||||
@ -161,8 +18,6 @@ let ConsignForm = React.createClass({
|
|||||||
url: React.PropTypes.string,
|
url: React.PropTypes.string,
|
||||||
id: React.PropTypes.object,
|
id: React.PropTypes.object,
|
||||||
message: React.PropTypes.string,
|
message: React.PropTypes.string,
|
||||||
editions: React.PropTypes.array,
|
|
||||||
currentUser: React.PropTypes.object,
|
|
||||||
onRequestHide: React.PropTypes.func,
|
onRequestHide: React.PropTypes.func,
|
||||||
handleSuccess: 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 apiUrls from '../../constants/api_urls';
|
||||||
import FormMixin from '../../mixins/form_mixin';
|
import FormMixin from '../../mixins/form_mixin';
|
||||||
|
|
||||||
|
import AclButton from './../ascribe_buttons/acl_button';
|
||||||
|
|
||||||
import AppConstants from '../../constants/application_constants';
|
import AppConstants from '../../constants/application_constants';
|
||||||
import { getLangText } from '../../utils/lang_utils.js';
|
import { getLangText } from '../../utils/lang_utils.js';
|
||||||
|
|
||||||
@ -52,15 +54,31 @@ let RequestActionForm = React.createClass({
|
|||||||
|
|
||||||
renderForm() {
|
renderForm() {
|
||||||
let edition = this.props.editions[0];
|
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 = (
|
let buttons = (
|
||||||
|
<span>
|
||||||
<span>
|
<span>
|
||||||
<span>
|
{buttonAccept}
|
||||||
<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>
|
|
||||||
</span>
|
</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){
|
if (this.state.submitted){
|
||||||
buttons = (
|
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';
|
'use strict';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
@ -2,59 +2,75 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import ApiUrls from '../../constants/api_urls';
|
import Button from 'react-bootstrap/lib/Button';
|
||||||
import FormMixin from '../../mixins/form_mixin';
|
|
||||||
import InputText from './input_text';
|
import Form from './form';
|
||||||
import InputTextArea from './input_textarea';
|
import Property from './property';
|
||||||
import ButtonSubmitOrClose from '../ascribe_buttons/button_submit_close';
|
import InputTextAreaToggable from './input_textarea_toggable';
|
||||||
import { getLangText } from '../../utils/lang_utils.js'
|
|
||||||
|
import AppConstants from '../../constants/application_constants';
|
||||||
|
import { getLangText } from '../../utils/lang_utils.js';
|
||||||
|
|
||||||
|
|
||||||
let UnConsignForm = React.createClass({
|
let UnConsignForm = React.createClass({
|
||||||
mixins: [FormMixin],
|
propTypes: {
|
||||||
|
url: React.PropTypes.string,
|
||||||
url() {
|
id: React.PropTypes.object,
|
||||||
return ApiUrls.ownership_unconsigns;
|
message: React.PropTypes.string,
|
||||||
|
editions: React.PropTypes.array,
|
||||||
|
onRequestHide: React.PropTypes.func,
|
||||||
|
handleSuccess: React.PropTypes.func
|
||||||
},
|
},
|
||||||
|
|
||||||
getFormData() {
|
getFormData(){
|
||||||
return {
|
return this.props.id;
|
||||||
bitcoin_id: this.getBitcoinIds().join(),
|
|
||||||
unconsign_message: this.refs.unconsign_message.state.value,
|
|
||||||
password: this.refs.password.state.value
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
|
||||||
renderForm() {
|
render() {
|
||||||
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}`;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<form id="unconsign_modal_content" role="form" onSubmit={this.submit}>
|
<Form
|
||||||
<input className="invisible" type="email" name="fake_unconsignee"/>
|
ref='form'
|
||||||
<input className="invisible" type="password" name="fake_password"/>
|
url={this.props.url}
|
||||||
<InputTextArea
|
getFormData={this.getFormData}
|
||||||
ref="unconsign_message"
|
handleSuccess={this.props.handleSuccess}
|
||||||
defaultValue={message}
|
buttons={
|
||||||
required="" />
|
<div className="modal-footer">
|
||||||
<InputText
|
<p className="pull-right">
|
||||||
ref="password"
|
<Button
|
||||||
placeHolder={getLangText('Password')}
|
className="btn btn-default btn-sm ascribe-margin-1px"
|
||||||
required="required"
|
type="submit">{getLangText('UNCONSIGN')}</Button>
|
||||||
type="password"
|
<Button
|
||||||
submitted={this.state.submitted} />
|
className="btn btn-danger btn-delete btn-sm ascribe-margin-1px"
|
||||||
<ButtonSubmitOrClose
|
style={{marginLeft: '0'}}
|
||||||
text={getLangText('UNCONSIGN')}
|
onClick={this.props.onRequestHide}>{getLangText('CLOSE')}</Button>
|
||||||
onClose={this.props.onRequestHide}
|
</p>
|
||||||
submitted={this.state.submitted} />
|
</div>}
|
||||||
</form>
|
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 React from 'react';
|
||||||
|
|
||||||
import ApiUrls from '../../constants/api_urls';
|
import Button from 'react-bootstrap/lib/Button';
|
||||||
import FormMixin from '../../mixins/form_mixin';
|
import Alert from 'react-bootstrap/lib/Alert';
|
||||||
import InputTextArea from './input_textarea';
|
|
||||||
import ButtonSubmitOrClose from '../ascribe_buttons/button_submit_close';
|
import Form from './form';
|
||||||
import { getLangText } from '../../utils/lang_utils.js'
|
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({
|
let UnConsignRequestForm = React.createClass({
|
||||||
mixins: [FormMixin],
|
propTypes: {
|
||||||
|
url: React.PropTypes.string,
|
||||||
url() {
|
id: React.PropTypes.object,
|
||||||
return ApiUrls.ownership_unconsigns_request;
|
message: React.PropTypes.string,
|
||||||
|
onRequestHide: React.PropTypes.func,
|
||||||
|
handleSuccess: React.PropTypes.func
|
||||||
},
|
},
|
||||||
|
|
||||||
getFormData() {
|
getFormData(){
|
||||||
return {
|
return this.props.id;
|
||||||
bitcoin_id: this.props.edition.bitcoin_id,
|
|
||||||
unconsign_request_message: this.refs.unconsign_request_message.state.value
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
|
||||||
renderForm() {
|
render() {
|
||||||
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}`;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<form id="unconsign_request_modal_content" role="form" onSubmit={this.submit}>
|
<Form
|
||||||
<InputTextArea
|
ref='form'
|
||||||
ref="unconsign_request_message"
|
url={this.props.url}
|
||||||
defaultValue={message}
|
getFormData={this.getFormData}
|
||||||
required="" />
|
handleSuccess={this.props.handleSuccess}
|
||||||
<ButtonSubmitOrClose
|
buttons={
|
||||||
text={getLangText('UNCONSIGN REQUEST')}
|
<div className="modal-footer">
|
||||||
onClose={this.props.onRequestHide}
|
<p className="pull-right">
|
||||||
submitted={this.state.submitted} />
|
<Button
|
||||||
</form>
|
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);
|
this.state.orderAsc);
|
||||||
},
|
},
|
||||||
|
|
||||||
getPieceListToolbar() {
|
|
||||||
if(this.state.pieceListCount > 10) {
|
|
||||||
return (
|
|
||||||
<PieceListToolbar
|
|
||||||
className="ascribe-piece-list-toolbar"
|
|
||||||
searchFor={this.searchFor} />
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
getPagination() {
|
getPagination() {
|
||||||
let currentPage = parseInt(this.getQuery().page, 10) || 1;
|
let currentPage = parseInt(this.getQuery().page, 10) || 1;
|
||||||
let totalPages = Math.ceil(this.state.pieceListCount / this.state.pageSize);
|
let totalPages = Math.ceil(this.state.pieceListCount / this.state.pageSize);
|
||||||
@ -101,7 +91,9 @@ let PieceList = React.createClass({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{this.getPieceListToolbar()}
|
<PieceListToolbar
|
||||||
|
className="ascribe-piece-list-toolbar"
|
||||||
|
searchFor={this.searchFor} />
|
||||||
<PieceListBulkModal className="ascribe-piece-list-bulk-modal" />
|
<PieceListBulkModal className="ascribe-piece-list-bulk-modal" />
|
||||||
<AccordionList
|
<AccordionList
|
||||||
className="ascribe-accordion-list"
|
className="ascribe-accordion-list"
|
||||||
|
@ -23,7 +23,7 @@ let baseUrl = AppConstants.baseUrl;
|
|||||||
function getRoutes(commonRoutes) {
|
function getRoutes(commonRoutes) {
|
||||||
return (
|
return (
|
||||||
<Route name="app" path={baseUrl} handler={App}>
|
<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="login" path="login" handler={LoginContainer} />
|
||||||
<Route name="signup" path="signup" handler={SignupContainer} />
|
<Route name="signup" path="signup" handler={SignupContainer} />
|
||||||
<Route name="password_reset" path="password_reset" handler={PasswordResetContainer} />
|
<Route name="password_reset" path="password_reset" handler={PasswordResetContainer} />
|
||||||
|
Loading…
Reference in New Issue
Block a user