mirror of
https://github.com/ascribe/onion.git
synced 2024-06-30 05:31:58 +02:00
adjust props
This commit is contained in:
parent
1620437c86
commit
d3bf990ca5
|
@ -22,7 +22,7 @@ import { getLangText } from '../../utils/lang_utils';
|
||||||
|
|
||||||
let LoanForm = React.createClass({
|
let LoanForm = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
fullform: React.PropTypes.bool,
|
loanHeading: React.PropTypes.string,
|
||||||
email: React.PropTypes.string,
|
email: React.PropTypes.string,
|
||||||
gallery: React.PropTypes.string,
|
gallery: React.PropTypes.string,
|
||||||
startdate: React.PropTypes.object,
|
startdate: React.PropTypes.object,
|
||||||
|
@ -37,7 +37,8 @@ let LoanForm = React.createClass({
|
||||||
|
|
||||||
getDefaultProps() {
|
getDefaultProps() {
|
||||||
return {
|
return {
|
||||||
fullform: false
|
loanHeading: '',
|
||||||
|
showPersonalMessage: true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -103,7 +104,7 @@ let LoanForm = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
getButtons() {
|
getButtons() {
|
||||||
if(this.props.fullform) {
|
if(this.props.loanHeading) {
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
|
@ -129,7 +130,7 @@ let LoanForm = React.createClass({
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
className={classnames({'ascribe-form-bordered': this.props.fullform})}
|
className={classnames({'ascribe-form-bordered': this.props.loanHeading})}
|
||||||
ref='form'
|
ref='form'
|
||||||
url={this.props.url}
|
url={this.props.url}
|
||||||
getFormData={this.getFormData}
|
getFormData={this.getFormData}
|
||||||
|
@ -139,8 +140,8 @@ let LoanForm = React.createClass({
|
||||||
<div className="modal-footer">
|
<div className="modal-footer">
|
||||||
<img src={AppConstants.baseUrl + 'static/img/ascribe_animated_small.gif'} />
|
<img src={AppConstants.baseUrl + 'static/img/ascribe_animated_small.gif'} />
|
||||||
</div>}>
|
</div>}>
|
||||||
<div className={classnames({'ascribe-form-header': true, 'hidden': !this.props.fullform})}>
|
<div className={classnames({'ascribe-form-header': true, 'hidden': !!this.props.loanHeading})}>
|
||||||
<h3>Loan</h3>
|
<h3>{this.props.loanHeading}</h3>
|
||||||
</div>
|
</div>
|
||||||
<Property
|
<Property
|
||||||
name='loanee'
|
name='loanee'
|
||||||
|
@ -165,7 +166,7 @@ let LoanForm = React.createClass({
|
||||||
<Property
|
<Property
|
||||||
name='startdate'
|
name='startdate'
|
||||||
label={getLangText('Start date')}
|
label={getLangText('Start date')}
|
||||||
hidden={!this.props.startdate}>
|
hidden={this.props.startdate}>
|
||||||
<InputDate
|
<InputDate
|
||||||
defaultValue={this.props.startdate}
|
defaultValue={this.props.startdate}
|
||||||
placeholderText={getLangText('Loan start date')} />
|
placeholderText={getLangText('Loan start date')} />
|
||||||
|
@ -173,7 +174,7 @@ let LoanForm = React.createClass({
|
||||||
<Property
|
<Property
|
||||||
name='enddate'
|
name='enddate'
|
||||||
label={getLangText('End date')}
|
label={getLangText('End date')}
|
||||||
hidden={!this.props.enddate}>
|
hidden={this.props.enddate}>
|
||||||
<InputDate
|
<InputDate
|
||||||
defaultValue={this.props.enddate}
|
defaultValue={this.props.enddate}
|
||||||
placeholderText={getLangText('Loan end date')} />
|
placeholderText={getLangText('Loan end date')} />
|
||||||
|
@ -182,7 +183,7 @@ let LoanForm = React.createClass({
|
||||||
name='loan_message'
|
name='loan_message'
|
||||||
label={getLangText('Personal Message')}
|
label={getLangText('Personal Message')}
|
||||||
editable={true}
|
editable={true}
|
||||||
hidden={this.props.showPersonalMessage}>
|
hidden={!this.props.showPersonalMessage}>
|
||||||
<InputTextAreaToggable
|
<InputTextAreaToggable
|
||||||
rows={1}
|
rows={1}
|
||||||
editable={true}
|
editable={true}
|
||||||
|
|
|
@ -77,6 +77,9 @@ let CylandAdditionalDataForm = React.createClass({
|
||||||
<img src={AppConstants.baseUrl + 'static/img/ascribe_animated_small.gif'} />
|
<img src={AppConstants.baseUrl + 'static/img/ascribe_animated_small.gif'} />
|
||||||
</div>
|
</div>
|
||||||
}>
|
}>
|
||||||
|
<div className="ascribe-form-header">
|
||||||
|
<h3>Additional Information</h3>
|
||||||
|
</div>
|
||||||
<FurtherDetailsFileuploader
|
<FurtherDetailsFileuploader
|
||||||
submitKey={this.submitKey}
|
submitKey={this.submitKey}
|
||||||
setIsUploadReady={this.setIsUploadReady}
|
setIsUploadReady={this.setIsUploadReady}
|
||||||
|
|
|
@ -163,14 +163,15 @@ let CylandRegisterPiece = React.createClass({
|
||||||
<Row className="no-margin">
|
<Row className="no-margin">
|
||||||
<Col xs={12} sm={10} md={8} smOffset={1} mdOffset={2}>
|
<Col xs={12} sm={10} md={8} smOffset={1} mdOffset={2}>
|
||||||
<LoanForm
|
<LoanForm
|
||||||
fullform={true}
|
loanHeading="Loan to Cyland archive"
|
||||||
message={getAclFormMessage('acl_loan', '\"' + this.state.piece.title + '\"', this.state.currentUser.username)}
|
message={getAclFormMessage('acl_loan', '\"' + this.state.piece.title + '\"', this.state.currentUser.username)}
|
||||||
id={{piece_id: this.state.piece.id}}
|
id={{piece_id: this.state.piece.id}}
|
||||||
url={ApiUrls.ownership_loans_pieces}
|
url={ApiUrls.ownership_loans_pieces}
|
||||||
email="videoarchive@cyland.org"
|
email="videoarchive@mailinator.com"
|
||||||
gallery="Cyland Archive"
|
gallery="Cyland Archive"
|
||||||
startdate={today}
|
startdate={today}
|
||||||
enddate={datetimeWhenWeAllWillBeFlyingCoolHoverboardsAndDinosaursWillLiveAgain}/>
|
enddate={datetimeWhenWeAllWillBeFlyingCoolHoverboardsAndDinosaursWillLiveAgain}
|
||||||
|
showPersonalMessage={false}/>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user