mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
disable submit prize with ACL
This commit is contained in:
parent
2258968856
commit
5ce549e533
js/components
ascribe_accordion_list
ascribe_buttons
whitelabel/prize/components/ascribe_buttons
@ -21,7 +21,7 @@ import GlobalNotificationModel from '../../models/global_notification_model';
|
|||||||
import GlobalNotificationActions from '../../actions/global_notification_actions';
|
import GlobalNotificationActions from '../../actions/global_notification_actions';
|
||||||
|
|
||||||
import AclProxy from '../acl_proxy';
|
import AclProxy from '../acl_proxy';
|
||||||
import SubmitToPrizeButton from '../ascribe_buttons/submit_to_prize_button';
|
import SubmitToPrizeButton from '../whitelabel/prize/components/ascribe_buttons/submit_to_prize_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';
|
||||||
@ -178,21 +178,13 @@ let AccordionListItem = React.createClass({
|
|||||||
onPollingSuccess={this.onPollingSuccess}/>
|
onPollingSuccess={this.onPollingSuccess}/>
|
||||||
</AclProxy>
|
</AclProxy>
|
||||||
<AclProxy
|
<AclProxy
|
||||||
show={this.props.content.prize === null}>
|
aclObject={this.props.content.acl}
|
||||||
|
aclName="acl_submit_to_prize">
|
||||||
<SubmitToPrizeButton
|
<SubmitToPrizeButton
|
||||||
className="pull-right"
|
className="pull-right"
|
||||||
piece={this.props.content}
|
piece={this.props.content}
|
||||||
handleSuccess={this.handleSubmitPrizeSuccess}/>
|
handleSuccess={this.handleSubmitPrizeSuccess}/>
|
||||||
</AclProxy>
|
</AclProxy>
|
||||||
<AclProxy
|
|
||||||
show={this.props.content.prize}>
|
|
||||||
<button
|
|
||||||
disabled
|
|
||||||
className="btn btn-default btn-xs pull-right">
|
|
||||||
{getLangText('Submitted to prize')} <span className="glyphicon glyphicon-ok"
|
|
||||||
aria-hidden="true"></span>
|
|
||||||
</button>
|
|
||||||
</AclProxy>
|
|
||||||
{this.getLicences()}
|
{this.getLicences()}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,42 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import classNames from 'classnames';
|
|
||||||
|
|
||||||
import ModalWrapper from '../ascribe_modal/modal_wrapper';
|
|
||||||
import PieceSubmitToPrizeForm from '../ascribe_forms/form_submit_to_prize';
|
|
||||||
|
|
||||||
import { getLangText } from '../../utils/lang_utils';
|
|
||||||
|
|
||||||
let SubmitToPrizeButton = React.createClass({
|
|
||||||
propTypes: {
|
|
||||||
className: React.PropTypes.string,
|
|
||||||
handleSuccess: React.PropTypes.func,
|
|
||||||
piece: React.PropTypes.object.isRequired
|
|
||||||
},
|
|
||||||
|
|
||||||
getSubmitButton() {
|
|
||||||
return (
|
|
||||||
<button
|
|
||||||
className={classNames('btn', 'btn-default', 'btn-xs', this.props.className)}>
|
|
||||||
{getLangText('Submit to prize')}
|
|
||||||
</button>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<ModalWrapper
|
|
||||||
button={this.getSubmitButton()}
|
|
||||||
handleSuccess={this.props.handleSuccess}
|
|
||||||
title={getLangText('Submit to prize')}>
|
|
||||||
<PieceSubmitToPrizeForm
|
|
||||||
piece={this.props.piece}
|
|
||||||
handleSuccess={this.props.handleSuccess}/>
|
|
||||||
</ModalWrapper>
|
|
||||||
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default SubmitToPrizeButton;
|
|
@ -0,0 +1,54 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
|
||||||
|
import ModalWrapper from '../../../../ascribe_modal/modal_wrapper';
|
||||||
|
import PieceSubmitToPrizeForm from '../../../../ascribe_forms/form_submit_to_prize';
|
||||||
|
|
||||||
|
import { getLangText } from '../../../../../utils/lang_utils';
|
||||||
|
|
||||||
|
let SubmitToPrizeButton = React.createClass({
|
||||||
|
propTypes: {
|
||||||
|
className: React.PropTypes.string,
|
||||||
|
handleSuccess: React.PropTypes.func,
|
||||||
|
piece: React.PropTypes.object.isRequired
|
||||||
|
},
|
||||||
|
|
||||||
|
getSubmitButton() {
|
||||||
|
if (this.props.piece.prize) {
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
disabled
|
||||||
|
className="btn btn-default btn-xs pull-right">
|
||||||
|
{getLangText('Submitted to prize')} <span className="glyphicon glyphicon-ok"
|
||||||
|
aria-hidden="true"></span>
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
className={classNames('btn', 'btn-default', 'btn-xs', this.props.className)}>
|
||||||
|
{getLangText('Submit to prize')}
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<ModalWrapper
|
||||||
|
button={this.getSubmitButton()}
|
||||||
|
handleSuccess={this.props.handleSuccess}
|
||||||
|
title={getLangText('Submit to prize')}>
|
||||||
|
<PieceSubmitToPrizeForm
|
||||||
|
piece={this.props.piece}
|
||||||
|
handleSuccess={this.props.handleSuccess}/>
|
||||||
|
</ModalWrapper>
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export default SubmitToPrizeButton;
|
Loading…
Reference in New Issue
Block a user