mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 10:25:08 +01:00
unconsign
This commit is contained in:
parent
4fdf0ecc5c
commit
2c7535a73a
@ -34,7 +34,7 @@ Truly yours,
|
||||
${username}`;
|
||||
|
||||
return (
|
||||
<form id="transfer_modal_content" role="form" onSubmit={this.submit}>
|
||||
<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
|
||||
|
66
js/components/ascribe_forms/form_loan.js
Normal file
66
js/components/ascribe_forms/form_loan.js
Normal file
@ -0,0 +1,66 @@
|
||||
import fetch from 'isomorphic-fetch';
|
||||
|
||||
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 './button_submit_close';
|
||||
|
||||
let ConsignForm = React.createClass({
|
||||
mixins: [FormMixin],
|
||||
|
||||
url() {
|
||||
return ApiUrls.ownership_consigns
|
||||
},
|
||||
getFormData() {
|
||||
return {
|
||||
bitcoin_id: this.props.edition.bitcoin_id,
|
||||
consignee: this.refs.consignee.state.value,
|
||||
consign_message: this.refs.consign_message.state.value,
|
||||
password: this.refs.password.state.value
|
||||
}
|
||||
},
|
||||
renderForm() {
|
||||
let title = this.props.edition.title;
|
||||
let username = this.props.currentUser.username;
|
||||
let message =
|
||||
`Hi,
|
||||
|
||||
I consign \" ${title} \" to you.
|
||||
|
||||
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="Consignee email"
|
||||
required="required"
|
||||
type="email"
|
||||
submitted={this.state.submitted}/>
|
||||
<InputTextArea
|
||||
ref="consign_message"
|
||||
defaultValue={message}
|
||||
required=""
|
||||
/>
|
||||
<InputText
|
||||
ref="password"
|
||||
placeHolder="Password"
|
||||
required="required"
|
||||
type="password"
|
||||
submitted={this.state.submitted}/>
|
||||
<ButtonSubmitOrClose
|
||||
text="CONSIGN"
|
||||
onClose={this.props.onRequestHide}
|
||||
submitted={this.state.submitted} />
|
||||
</form>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
export default ConsignForm;
|
58
js/components/ascribe_forms/form_unconsign.js
Normal file
58
js/components/ascribe_forms/form_unconsign.js
Normal file
@ -0,0 +1,58 @@
|
||||
import fetch from 'isomorphic-fetch';
|
||||
|
||||
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 './button_submit_close';
|
||||
|
||||
let UnConsignForm = React.createClass({
|
||||
mixins: [FormMixin],
|
||||
|
||||
url() {
|
||||
return ApiUrls.ownership_unconsigns
|
||||
},
|
||||
getFormData() {
|
||||
return {
|
||||
bitcoin_id: this.props.edition.bitcoin_id,
|
||||
unconsign_message: this.refs.unconsign_message.state.value,
|
||||
password: this.refs.password.state.value
|
||||
}
|
||||
},
|
||||
renderForm() {
|
||||
let title = this.props.edition.title;
|
||||
let username = this.props.currentUser.username;
|
||||
let message =
|
||||
`Hi,
|
||||
|
||||
I un-consign \" ${title} \" from you.
|
||||
|
||||
Truly yours,
|
||||
${username}`;
|
||||
|
||||
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="Password"
|
||||
required="required"
|
||||
type="password"
|
||||
submitted={this.state.submitted} />
|
||||
<ButtonSubmitOrClose
|
||||
text="UNCONSIGN"
|
||||
onClose={this.props.onRequestHide}
|
||||
submitted={this.state.submitted} />
|
||||
</form>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
export default UnConsignForm;
|
49
js/components/ascribe_forms/form_unconsign_request.js
Normal file
49
js/components/ascribe_forms/form_unconsign_request.js
Normal file
@ -0,0 +1,49 @@
|
||||
import fetch from 'isomorphic-fetch';
|
||||
|
||||
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 './button_submit_close';
|
||||
|
||||
let UnConsignRequestForm = React.createClass({
|
||||
mixins: [FormMixin],
|
||||
|
||||
url() {
|
||||
return ApiUrls.ownership_unconsigns_request
|
||||
},
|
||||
getFormData() {
|
||||
return {
|
||||
bitcoin_id: this.props.edition.bitcoin_id,
|
||||
unconsign_request_message: this.refs.unconsign_request_message.state.value
|
||||
}
|
||||
},
|
||||
renderForm() {
|
||||
let title = this.props.edition.title;
|
||||
let username = this.props.currentUser.username;
|
||||
let message =
|
||||
`Hi,
|
||||
|
||||
I request you to un-consign \" ${title} \".
|
||||
|
||||
Truly yours,
|
||||
${username}`;
|
||||
|
||||
return (
|
||||
<form id="unconsign_request_modal_content" role="form" onSubmit={this.submit}>
|
||||
<InputTextArea
|
||||
ref="unconsign_request_message"
|
||||
defaultValue={message}
|
||||
required="" />
|
||||
<ButtonSubmitOrClose
|
||||
text="UNCONSIGN REQUEST"
|
||||
onClose={this.props.onRequestHide}
|
||||
submitted={this.state.submitted} />
|
||||
</form>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
export default UnConsignRequestForm;
|
43
js/components/ascribe_modal/modal_loan.js
Normal file
43
js/components/ascribe_modal/modal_loan.js
Normal file
@ -0,0 +1,43 @@
|
||||
import React from 'react';
|
||||
import Modal from 'react-bootstrap/lib/Modal';
|
||||
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
|
||||
import ModalTrigger from 'react-bootstrap/lib/ModalTrigger';
|
||||
import Tooltip from 'react-bootstrap/lib/Tooltip';
|
||||
|
||||
import ConsignForm from '../ascribe_forms/form_consign'
|
||||
import ModalMixin from '../../mixins/modal_mixin'
|
||||
|
||||
let ConsignModalButton = React.createClass({
|
||||
render() {
|
||||
return (
|
||||
<OverlayTrigger delay={500} placement="left"
|
||||
overlay={<Tooltip>Have someone else sell the artwork</Tooltip>}>
|
||||
<ModalTrigger modal={<ConsignModal edition={this.props.edition}
|
||||
currentUser={this.props.currentUser}/>}>
|
||||
<div className="btn btn-ascribe-inv">
|
||||
CONSIGN
|
||||
</div>
|
||||
</ModalTrigger>
|
||||
</OverlayTrigger>
|
||||
)
|
||||
}
|
||||
});
|
||||
|
||||
let ConsignModal = React.createClass({
|
||||
mixins : [ModalMixin],
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Modal {...this.props} title="Consign artwork">
|
||||
<div className="modal-body">
|
||||
<ConsignForm edition={this.props.edition}
|
||||
currentUser={this.props.currentUser}
|
||||
onRequestHide={this.onRequestHide}/>
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
export default ConsignModalButton;
|
43
js/components/ascribe_modal/modal_unconsign.js
Normal file
43
js/components/ascribe_modal/modal_unconsign.js
Normal file
@ -0,0 +1,43 @@
|
||||
import React from 'react';
|
||||
import Modal from 'react-bootstrap/lib/Modal';
|
||||
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
|
||||
import ModalTrigger from 'react-bootstrap/lib/ModalTrigger';
|
||||
import Tooltip from 'react-bootstrap/lib/Tooltip';
|
||||
|
||||
import UnConsignForm from '../ascribe_forms/form_unconsign'
|
||||
import ModalMixin from '../../mixins/modal_mixin'
|
||||
|
||||
let UnConsignModalButton = React.createClass({
|
||||
render() {
|
||||
return (
|
||||
<OverlayTrigger delay={500} placement="left"
|
||||
overlay={<Tooltip>Unconsign this artwork</Tooltip>}>
|
||||
<ModalTrigger modal={<UnConsignModal edition={this.props.edition}
|
||||
currentUser={this.props.currentUser}/>}>
|
||||
<div className="btn btn-ascribe-inv">
|
||||
UNCONSIGN
|
||||
</div>
|
||||
</ModalTrigger>
|
||||
</OverlayTrigger>
|
||||
)
|
||||
}
|
||||
});
|
||||
|
||||
let UnConsignModal = React.createClass({
|
||||
mixins : [ModalMixin],
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Modal {...this.props} title="Consign artwork">
|
||||
<div className="modal-body">
|
||||
<UnConsignForm edition={this.props.edition}
|
||||
currentUser={this.props.currentUser}
|
||||
onRequestHide={this.onRequestHide}/>
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
export default UnConsignModalButton;
|
43
js/components/ascribe_modal/modal_unconsign_request.js
Normal file
43
js/components/ascribe_modal/modal_unconsign_request.js
Normal file
@ -0,0 +1,43 @@
|
||||
import React from 'react';
|
||||
import Modal from 'react-bootstrap/lib/Modal';
|
||||
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
|
||||
import ModalTrigger from 'react-bootstrap/lib/ModalTrigger';
|
||||
import Tooltip from 'react-bootstrap/lib/Tooltip';
|
||||
|
||||
import UnConsignRequestForm from '../ascribe_forms/form_unconsign_request'
|
||||
import ModalMixin from '../../mixins/modal_mixin'
|
||||
|
||||
let UnConsignRequestModalButton = React.createClass({
|
||||
render() {
|
||||
return (
|
||||
<OverlayTrigger delay={500} placement="left"
|
||||
overlay={<Tooltip>Request to unconsign the artwork</Tooltip>}>
|
||||
<ModalTrigger modal={<UnConsignRequestModal edition={this.props.edition}
|
||||
currentUser={this.props.currentUser}/>}>
|
||||
<div className="btn btn-ascribe-inv">
|
||||
UNCONSIGN REQUEST
|
||||
</div>
|
||||
</ModalTrigger>
|
||||
</OverlayTrigger>
|
||||
)
|
||||
}
|
||||
});
|
||||
|
||||
let UnConsignRequestModal = React.createClass({
|
||||
mixins : [ModalMixin],
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Modal {...this.props} title="Request to unconsign artwork">
|
||||
<div className="modal-body">
|
||||
<UnConsignRequestForm edition={this.props.edition}
|
||||
currentUser={this.props.currentUser}
|
||||
onRequestHide={this.onRequestHide}/>
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
export default UnConsignRequestModalButton;
|
@ -2,6 +2,8 @@ import React from 'react';
|
||||
|
||||
import ImageViewer from './ascribe_media/image_viewer';
|
||||
import ConsignModalButton from './ascribe_modal/modal_consign';
|
||||
import UnConsignModalButton from './ascribe_modal/modal_unconsign';
|
||||
import UnConsignRequestModalButton from './ascribe_modal/modal_unconsign_request';
|
||||
import TransferModalButton from './ascribe_modal/modal_transfer';
|
||||
import ShareModalButton from './ascribe_modal/modal_share';
|
||||
|
||||
@ -49,6 +51,8 @@ let EditionDetails = React.createClass({
|
||||
<EditionDetailProperty label="owner" value={ this.props.edition.owner } />
|
||||
<br/>
|
||||
<ConsignModalButton edition={ this.props.edition } currentUser={ this.props.currentUser }/>
|
||||
<UnConsignModalButton edition={ this.props.edition } currentUser={ this.props.currentUser }/>
|
||||
<UnConsignRequestModalButton edition={ this.props.edition } currentUser={ this.props.currentUser }/>
|
||||
<TransferModalButton edition={ this.props.edition } currentUser={ this.props.currentUser }/>
|
||||
<ShareModalButton edition={ this.props.edition } currentUser={ this.props.currentUser }/>
|
||||
<hr/>
|
||||
|
@ -3,7 +3,9 @@ import AppConstants from './application_constants';
|
||||
let apiUrls = {
|
||||
'ownership_shares_mail' : AppConstants.baseUrl + 'ownership/shares/mail/',
|
||||
'ownership_transfers' : AppConstants.baseUrl + 'ownership/transfers/',
|
||||
'ownership_consigns' : AppConstants.baseUrl + 'ownership/consigns/'
|
||||
'ownership_consigns' : AppConstants.baseUrl + 'ownership/consigns/',
|
||||
'ownership_unconsigns' : AppConstants.baseUrl + 'ownership/unconsigns/',
|
||||
'ownership_unconsigns_request' : AppConstants.baseUrl + 'ownership/unconsigns/request/'
|
||||
};
|
||||
|
||||
export default apiUrls;
|
@ -1,6 +1,6 @@
|
||||
let constants = {
|
||||
//'baseUrl': 'http://localhost:8000/api/',
|
||||
'baseUrl': 'http://staging.ascribe.io/api/',
|
||||
'baseUrl': 'http://localhost:8000/api/',
|
||||
//'baseUrl': 'http://staging.ascribe.io/api/',
|
||||
'debugCredentialBase64': 'ZGltaUBtYWlsaW5hdG9yLmNvbTowMDAwMDAwMDAw', // dimi@mailinator:0000000000
|
||||
'aclList': ['edit', 'consign', 'transfer', 'loan', 'share', 'download', 'view', 'delete', 'del_from_collection', 'add_to_collection']
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user