mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 18:35:09 +01:00
loan request + answer complete
This commit is contained in:
parent
8406272187
commit
79106dd106
@ -95,11 +95,11 @@ let AclButton = React.createClass({
|
|||||||
else if (this.props.action === 'acl_loan_request'){
|
else if (this.props.action === 'acl_loan_request'){
|
||||||
return {
|
return {
|
||||||
title: getLangText('Loan artwork'),
|
title: getLangText('Loan artwork'),
|
||||||
tooltip: getLangText('Loan your artwork for a limited period of time'),
|
tooltip: getLangText('Someone requested you to loan your artwork for a limited period of time'),
|
||||||
form: (<LoanRequestAnswerForm
|
form: (<LoanRequestAnswerForm
|
||||||
message={message}
|
message={message}
|
||||||
id={this.getFormDataId()}
|
id={this.getFormDataId()}
|
||||||
url={this.isPiece() ? ApiUrls.ownership_loans_pieces : ApiUrls.ownership_loans_editions}/>
|
url={ApiUrls.ownership_loans_pieces_request_confirm}/>
|
||||||
),
|
),
|
||||||
handleSuccess: this.showNotification
|
handleSuccess: this.showNotification
|
||||||
};
|
};
|
||||||
|
@ -200,7 +200,7 @@ let LoanForm = React.createClass({
|
|||||||
editable={true}
|
editable={true}
|
||||||
defaultValue={this.props.message}
|
defaultValue={this.props.message}
|
||||||
placeholder={getLangText('Enter a message...')}
|
placeholder={getLangText('Enter a message...')}
|
||||||
required="required"/>
|
required={this.props.showPersonalMessage ? 'required' : ''}/>
|
||||||
</Property>
|
</Property>
|
||||||
<Property
|
<Property
|
||||||
name='password'
|
name='password'
|
||||||
|
@ -22,19 +22,10 @@ import { getLangText } from '../../utils/lang_utils';
|
|||||||
|
|
||||||
let LoanRequestAnswerForm = React.createClass({
|
let LoanRequestAnswerForm = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
loanHeading: React.PropTypes.string,
|
|
||||||
email: React.PropTypes.string,
|
|
||||||
gallery: React.PropTypes.string,
|
|
||||||
startdate: React.PropTypes.object,
|
|
||||||
enddate: React.PropTypes.object,
|
|
||||||
showPersonalMessage: React.PropTypes.bool,
|
|
||||||
showEndDate: React.PropTypes.bool,
|
|
||||||
showStartDate: React.PropTypes.bool,
|
|
||||||
showPassword: React.PropTypes.bool,
|
|
||||||
url: React.PropTypes.string,
|
url: React.PropTypes.string,
|
||||||
id: React.PropTypes.object,
|
id: React.PropTypes.object,
|
||||||
message: React.PropTypes.string,
|
message: React.PropTypes.string,
|
||||||
handleSuccess: React.PropTypes.func
|
handleSuccess: React.PropTypes.func.required
|
||||||
},
|
},
|
||||||
|
|
||||||
getDefaultProps() {
|
getDefaultProps() {
|
||||||
@ -64,8 +55,6 @@ let LoanRequestAnswerForm = React.createClass({
|
|||||||
this.setState(state);
|
this.setState(state);
|
||||||
},
|
},
|
||||||
|
|
||||||
handleLoanSuccess() {},
|
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let startDate = null;
|
let startDate = null;
|
||||||
@ -87,7 +76,7 @@ let LoanRequestAnswerForm = React.createClass({
|
|||||||
enddate={endDate}
|
enddate={endDate}
|
||||||
showPassword={true}
|
showPassword={true}
|
||||||
showPersonalMessage={false}
|
showPersonalMessage={false}
|
||||||
handleSuccess={this.handleLoanSuccess}/>
|
handleSuccess={this.props.handleSuccess}/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return <span/>;
|
return <span/>;
|
||||||
|
@ -45,6 +45,9 @@ let RequestActionForm = React.createClass({
|
|||||||
} else if (this.props.requestAction === 'loan' && this.isPiece()){
|
} else if (this.props.requestAction === 'loan' && this.isPiece()){
|
||||||
urls.accept = ApiUrls.ownership_loans_pieces_confirm;
|
urls.accept = ApiUrls.ownership_loans_pieces_confirm;
|
||||||
urls.deny = ApiUrls.ownership_loans_pieces_deny;
|
urls.deny = ApiUrls.ownership_loans_pieces_deny;
|
||||||
|
} else if (this.props.requestAction === 'loan_request' && this.isPiece()){
|
||||||
|
urls.accept = ApiUrls.ownership_loans_pieces_request_confirm;
|
||||||
|
urls.deny = ApiUrls.ownership_loans_pieces_request_deny;
|
||||||
}
|
}
|
||||||
|
|
||||||
return urls;
|
return urls;
|
||||||
@ -90,7 +93,7 @@ let RequestActionForm = React.createClass({
|
|||||||
<AclButton
|
<AclButton
|
||||||
availableAcls={{'acl_unconsign': true}}
|
availableAcls={{'acl_unconsign': true}}
|
||||||
action="acl_unconsign"
|
action="acl_unconsign"
|
||||||
buttonAcceptClassName='inline pull-right'
|
buttonAcceptClassName='inline pull-right btn-sm ascribe-margin-1px'
|
||||||
pieceOrEditions={this.props.pieceOrEditions}
|
pieceOrEditions={this.props.pieceOrEditions}
|
||||||
currentUser={this.props.currentUser}
|
currentUser={this.props.currentUser}
|
||||||
handleSuccess={this.props.handleSuccess} />
|
handleSuccess={this.props.handleSuccess} />
|
||||||
@ -101,7 +104,7 @@ let RequestActionForm = React.createClass({
|
|||||||
availableAcls={{'acl_loan_request': true}}
|
availableAcls={{'acl_loan_request': true}}
|
||||||
action="acl_loan_request"
|
action="acl_loan_request"
|
||||||
buttonAcceptName="LOAN"
|
buttonAcceptName="LOAN"
|
||||||
buttonAcceptClassName='inline pull-right'
|
buttonAcceptClassName='inline pull-right btn-sm ascribe-margin-1px'
|
||||||
pieceOrEditions={this.props.pieceOrEditions}
|
pieceOrEditions={this.props.pieceOrEditions}
|
||||||
currentUser={this.props.currentUser}
|
currentUser={this.props.currentUser}
|
||||||
handleSuccess={this.props.handleSuccess} />
|
handleSuccess={this.props.handleSuccess} />
|
||||||
|
@ -33,6 +33,8 @@ let ApiUrls = {
|
|||||||
'ownership_loans_pieces_confirm': AppConstants.apiEndpoint + 'ownership/loans/pieces/confirm/',
|
'ownership_loans_pieces_confirm': AppConstants.apiEndpoint + 'ownership/loans/pieces/confirm/',
|
||||||
'ownership_loans_pieces_deny': AppConstants.apiEndpoint + 'ownership/loans/pieces/deny/',
|
'ownership_loans_pieces_deny': AppConstants.apiEndpoint + 'ownership/loans/pieces/deny/',
|
||||||
'ownership_loans_pieces_request': AppConstants.apiEndpoint + 'ownership/loans/pieces/request/',
|
'ownership_loans_pieces_request': AppConstants.apiEndpoint + 'ownership/loans/pieces/request/',
|
||||||
|
'ownership_loans_pieces_request_confirm': AppConstants.apiEndpoint + 'ownership/loans/pieces/request_confirm/',
|
||||||
|
'ownership_loans_pieces_request_deny': AppConstants.apiEndpoint + 'ownership/loans/pieces/request_deny/',
|
||||||
'ownership_loans_editions': AppConstants.apiEndpoint + 'ownership/loans/editions/',
|
'ownership_loans_editions': AppConstants.apiEndpoint + 'ownership/loans/editions/',
|
||||||
'ownership_loans_confirm': AppConstants.apiEndpoint + 'ownership/loans/editions/confirm/',
|
'ownership_loans_confirm': AppConstants.apiEndpoint + 'ownership/loans/editions/confirm/',
|
||||||
'ownership_loans_deny': AppConstants.apiEndpoint + 'ownership/loans/editions/deny/',
|
'ownership_loans_deny': AppConstants.apiEndpoint + 'ownership/loans/editions/deny/',
|
||||||
|
Loading…
Reference in New Issue
Block a user