mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 18:35:09 +01:00
add: Loan form for Ikonotv
This commit is contained in:
parent
86efb66663
commit
89f68abcec
@ -14,8 +14,11 @@ import GlobalNotificationModel from '../../../../../../models/global_notificatio
|
|||||||
import GlobalNotificationActions from '../../../../../../actions/global_notification_actions';
|
import GlobalNotificationActions from '../../../../../../actions/global_notification_actions';
|
||||||
|
|
||||||
import IkonotvSubmitButton from '../ascribe_buttons/ikonotv_submit_button';
|
import IkonotvSubmitButton from '../ascribe_buttons/ikonotv_submit_button';
|
||||||
|
|
||||||
import AclProxy from '../../../../../acl_proxy';
|
import AclProxy from '../../../../../acl_proxy';
|
||||||
|
|
||||||
|
import AclButton from '../../../../../ascribe_buttons/acl_button';
|
||||||
|
|
||||||
import { getLangText } from '../../../../../../utils/lang_utils';
|
import { getLangText } from '../../../../../../utils/lang_utils';
|
||||||
import { mergeOptions } from '../../../../../../utils/general_utils';
|
import { mergeOptions } from '../../../../../../utils/general_utils';
|
||||||
|
|
||||||
@ -61,16 +64,10 @@ let IkonotvAccordionListItem = React.createClass({
|
|||||||
|
|
||||||
getSubmitButtons() {
|
getSubmitButtons() {
|
||||||
return (
|
return (
|
||||||
<div>
|
|
||||||
<AclProxy
|
|
||||||
aclObject={this.props.content.acl}
|
|
||||||
aclName="acl_submit">
|
|
||||||
<IkonotvSubmitButton
|
<IkonotvSubmitButton
|
||||||
className="pull-right"
|
className="pull-right"
|
||||||
piece={this.props.content}
|
handleSuccess={this.handleSubmitSuccess}
|
||||||
handleSuccess={this.handleSubmitSuccess}/>
|
piece={this.props.content}/>
|
||||||
</AclProxy>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1,10 +1,18 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import Moment from 'moment';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import ModalWrapper from '../../../../../ascribe_modal/modal_wrapper';
|
import ModalWrapper from '../../../../../ascribe_modal/modal_wrapper';
|
||||||
|
|
||||||
|
import LoanForm from '../../../../../ascribe_forms/form_loan';
|
||||||
|
|
||||||
|
import Property from '../../../../../ascribe_forms/property';
|
||||||
|
import InputCheckbox from '../../../../../ascribe_forms/input_checkbox';
|
||||||
|
|
||||||
|
import ApiUrls from '../../../../../../constants/api_urls';
|
||||||
|
|
||||||
import { getLangText } from '../../../../../../utils/lang_utils';
|
import { getLangText } from '../../../../../../utils/lang_utils';
|
||||||
|
|
||||||
let IkonotvSubmitButton = React.createClass({
|
let IkonotvSubmitButton = React.createClass({
|
||||||
@ -24,12 +32,39 @@ let IkonotvSubmitButton = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
||||||
|
let today = new Moment();
|
||||||
|
let enddate = new Moment();
|
||||||
|
enddate.add(1, 'years');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalWrapper
|
<ModalWrapper
|
||||||
trigger={this.getSubmitButton()}
|
trigger={this.getSubmitButton()}
|
||||||
handleSuccess={this.props.handleSuccess}
|
handleSuccess={this.props.handleSuccess}
|
||||||
title={getLangText('Loan to IkonoTV')}>
|
title={getLangText('Loan to IkonoTV archive')}>
|
||||||
|
<LoanForm
|
||||||
|
id={{piece_id: this.props.piece.id}}
|
||||||
|
url={ApiUrls.ownership_loans_pieces}
|
||||||
|
email="submissions@ikono.org"
|
||||||
|
startdate={today}
|
||||||
|
enddate={enddate}
|
||||||
|
gallery="IkonoTV archive"
|
||||||
|
showPersonalMessage={false}
|
||||||
|
handleSuccess={this.props.handleSuccess}>
|
||||||
|
<Property
|
||||||
|
name="terms"
|
||||||
|
className="ascribe-settings-property-collapsible-toggle"
|
||||||
|
style={{paddingBottom: 0}}>
|
||||||
|
<InputCheckbox>
|
||||||
|
<span>
|
||||||
|
{' ' + getLangText('I agree to the Terms of Service of IkonoTV Archive') + ' '}
|
||||||
|
(<a href="https://s3-us-west-2.amazonaws.com/ascribe0/whitelabel/cyland/terms_and_contract.pdf" target="_blank" style={{fontSize: '0.9em', color: 'rgba(0,0,0,0.7)'}}>
|
||||||
|
{getLangText('read')}
|
||||||
|
</a>)
|
||||||
|
</span>
|
||||||
|
</InputCheckbox>
|
||||||
|
</Property>
|
||||||
|
</LoanForm>
|
||||||
</ModalWrapper>
|
</ModalWrapper>
|
||||||
|
|
||||||
);
|
);
|
||||||
|
@ -13,8 +13,8 @@ function getWalletApiUrls(subdomain) {
|
|||||||
}
|
}
|
||||||
else if (subdomain === 'ikonotv'){
|
else if (subdomain === 'ikonotv'){
|
||||||
return {
|
return {
|
||||||
'pieces_list': walletConstants.walletApiEndpoint + subdomain + '/pieces/',
|
'pieces_list': walletConstants.walletApiEndpoint + 'cyland' + '/pieces/',
|
||||||
'piece': walletConstants.walletApiEndpoint + subdomain + '/pieces/${piece_id}/'
|
'piece': walletConstants.walletApiEndpoint + 'cyland' + '/pieces/${piece_id}/'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
|
@ -65,12 +65,13 @@ let ROUTES = {
|
|||||||
),
|
),
|
||||||
'ikonotv': (
|
'ikonotv': (
|
||||||
<Route name="app" path={baseUrl} handler={WalletApp}>
|
<Route name="app" path={baseUrl} handler={WalletApp}>
|
||||||
<Route name="landing" path={baseUrl} handler={IkonotvLanding} />
|
<Redirect from={baseUrl} to="login" />
|
||||||
|
<Redirect from={baseUrl + '/'} to="login" />
|
||||||
<Route name="login" path="login" handler={LoginContainer} />
|
<Route name="login" path="login" handler={LoginContainer} />
|
||||||
<Route name="logout" path="logout" handler={LogoutContainer} />
|
<Route name="logout" path="logout" handler={LogoutContainer} />
|
||||||
<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} />
|
||||||
<Route name="request_loan" path="request_loan" handler={IkonotvRequestLoan} headerTitle="SEND NEW CONTRACT"/>
|
<Route name="request_loan" path="request_loan" handler={IkonotvRequestLoan}/>
|
||||||
<Route name="register_piece" path="register_piece" handler={RegisterPiece} headerTitle="+ NEW WORK"/>
|
<Route name="register_piece" path="register_piece" handler={RegisterPiece} headerTitle="+ NEW WORK"/>
|
||||||
<Route name="pieces" path="collection" handler={IkonotvPieceList} headerTitle="COLLECTION"/>
|
<Route name="pieces" path="collection" handler={IkonotvPieceList} headerTitle="COLLECTION"/>
|
||||||
<Route name="piece" path="pieces/:pieceId" handler={CylandPieceContainer} />
|
<Route name="piece" path="pieces/:pieceId" handler={CylandPieceContainer} />
|
||||||
|
Loading…
Reference in New Issue
Block a user