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