1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-28 00:28:00 +02:00

add: Loan form for Ikonotv

This commit is contained in:
Tim Daubenschütz 2015-08-28 12:11:29 +02:00
parent 86efb66663
commit 89f68abcec
4 changed files with 50 additions and 17 deletions

View File

@ -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> <IkonotvSubmitButton
<AclProxy className="pull-right"
aclObject={this.props.content.acl} handleSuccess={this.handleSubmitSuccess}
aclName="acl_submit"> piece={this.props.content}/>
<IkonotvSubmitButton
className="pull-right"
piece={this.props.content}
handleSuccess={this.handleSubmitSuccess}/>
</AclProxy>
</div>
); );
}, },

View File

@ -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,16 +32,43 @@ 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>
); );
} }
}); });
export default IkonotvSubmitButton; export default IkonotvSubmitButton;

View File

@ -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 {};

View File

@ -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} />