1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +01:00

loan/share forms multiedition

This commit is contained in:
ddejongh 2015-06-02 14:00:05 +02:00
parent dc3d024f8d
commit 74faa286f1
4 changed files with 11 additions and 58 deletions

View File

@ -25,7 +25,7 @@ let LoanForm = React.createClass({
}, },
getFormData() { getFormData() {
return { return {
bitcoin_id: this.props.edition.bitcoin_id, bitcoin_id: this.getBitcoinIds().join(),
loanee: this.refs.loanee.state.value, loanee: this.refs.loanee.state.value,
gallery_name: this.refs.gallery_name.state.value, gallery_name: this.refs.gallery_name.state.value,
startdate: this.refs.startdate.state.value, startdate: this.refs.startdate.state.value,
@ -59,15 +59,17 @@ let LoanForm = React.createClass({
}); });
}, },
renderForm() { renderForm() {
let title = this.props.edition.title; let title = this.getTitlesString().join("");
let username = this.props.currentUser.username; let username = this.props.currentUser.username;
let message = let message =
`Hi, `Hi,
I loan \" ${title} \" to you. I loan :
${title}to you.
Truly yours, Truly yours,
${username}`; ${username}`;
let contract = <InputHidden ref="terms" value="True"/>; let contract = <InputHidden ref="terms" value="True"/>;
if (this.state.loaneeHasContract){ if (this.state.loaneeHasContract){
let label = <div> let label = <div>
@ -82,13 +84,6 @@ ${username}`;
label={label} label={label}
/> />
} }
//<InputText
// ref="startdate"
// name="startdate"
// placeHolder="Loan start date"
// required="required"
// type="text"
// submitted={this.state.submitted}/>
return ( return (
<form id="loan_modal_content" role="form" onSubmit={this.submit}> <form id="loan_modal_content" role="form" onSubmit={this.submit}>
<input className="invisible" type="email" name="fake_loanee"/> <input className="invisible" type="email" name="fake_loanee"/>

View File

@ -16,18 +16,19 @@ let ShareForm = React.createClass({
}, },
getFormData() { getFormData() {
return { return {
bitcoin_id: this.props.edition.bitcoin_id, bitcoin_id: this.getBitcoinIds().join(),
share_emails: this.refs.share_emails.state.value, share_emails: this.refs.share_emails.state.value,
share_message: this.refs.share_message.state.value share_message: this.refs.share_message.state.value
} }
}, },
renderForm() { renderForm() {
let title = this.props.edition.title; let title = this.getTitlesString().join("");
let username = this.props.currentUser.username; let username = this.props.currentUser.username;
let message = let message =
`Hi, `Hi,
I am sharing \" ${title} \" with you. I am sharing :
${title}with you.
Truly yours, Truly yours,
${username}`; ${username}`;

View File

@ -1,43 +0,0 @@
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 TransferForm from '../ascribe_forms/form_transfer'
import ModalMixin from '../../mixins/modal_mixin'
let TransferModalButton = React.createClass({
render() {
return (
<OverlayTrigger delay={500} placement="left"
overlay={<Tooltip>Transfer the ownership of the artwork</Tooltip>}>
<ModalTrigger modal={<TransferModal edition={this.props.edition}
currentUser={this.props.currentUser}/>}>
<div className="btn btn-ascribe-inv">
TRANSFER
</div>
</ModalTrigger>
</OverlayTrigger>
)
}
});
let TransferModal = React.createClass({
mixins : [ModalMixin],
render() {
return (
<Modal {...this.props} title="Transfer artwork">
<div className="modal-body">
<TransferForm edition={this.props.edition}
currentUser={this.props.currentUser}
onRequestHide={this.onRequestHide}/>
</div>
</Modal>
)
}
});
export default TransferModalButton;

View File

@ -1,6 +1,6 @@
let constants = { let constants = {
'baseUrl': 'http://localhost:8000/api/', //'baseUrl': 'http://localhost:8000/api/',
//'baseUrl': 'http://staging.ascribe.io/api/', 'baseUrl': 'http://staging.ascribe.io/api/',
'debugCredentialBase64': 'ZGltaUBtYWlsaW5hdG9yLmNvbTowMDAwMDAwMDAw', // dimi@mailinator:0000000000 'debugCredentialBase64': 'ZGltaUBtYWlsaW5hdG9yLmNvbTowMDAwMDAwMDAw', // dimi@mailinator:0000000000
'aclList': ['edit', 'consign', 'transfer', 'loan', 'share', 'download', 'view', 'delete', 'del_from_collection', 'add_to_collection'] 'aclList': ['edit', 'consign', 'transfer', 'loan', 'share', 'download', 'view', 'delete', 'del_from_collection', 'add_to_collection']
}; };