mirror of
https://github.com/ascribe/onion.git
synced 2025-01-05 11:25:09 +01:00
adjust acl proxy
This commit is contained in:
parent
d183b9ba1c
commit
8f386dc0cf
@ -15,11 +15,19 @@ let AclProxy = React.createClass({
|
|||||||
React.PropTypes.arrayOf(React.PropTypes.element),
|
React.PropTypes.arrayOf(React.PropTypes.element),
|
||||||
React.PropTypes.element
|
React.PropTypes.element
|
||||||
]).isRequired,
|
]).isRequired,
|
||||||
aclObject: React.PropTypes.object.isRequired,
|
aclObject: React.PropTypes.object,
|
||||||
aclName: React.PropTypes.string.isRequired
|
aclName: React.PropTypes.string,
|
||||||
|
show: React.PropTypes.bool
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
if(this.props.show) {
|
||||||
|
return (
|
||||||
|
<span>
|
||||||
|
{this.props.children}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
if(this.props.aclObject[this.props.aclName]) {
|
if(this.props.aclObject[this.props.aclName]) {
|
||||||
return (
|
return (
|
||||||
<span>
|
<span>
|
||||||
@ -33,6 +41,7 @@ let AclProxy = React.createClass({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default AclProxy;
|
export default AclProxy;
|
@ -16,6 +16,9 @@ import EditionListActions from '../../actions/edition_list_actions';
|
|||||||
import GlobalNotificationModel from '../../models/global_notification_model';
|
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 SubmitToPrizeButton from '../ascribe_buttons/submit_to_prize_button';
|
||||||
|
|
||||||
import { getLangText } from '../../utils/lang_utils';
|
import { getLangText } from '../../utils/lang_utils';
|
||||||
|
|
||||||
let Link = Router.Link;
|
let Link = Router.Link;
|
||||||
@ -125,6 +128,20 @@ let AccordionListItem = React.createClass({
|
|||||||
piece={this.props.content}
|
piece={this.props.content}
|
||||||
toggleCreateEditionsDialog={this.toggleCreateEditionsDialog}
|
toggleCreateEditionsDialog={this.toggleCreateEditionsDialog}
|
||||||
onPollingSuccess={this.onPollingSuccess}/>
|
onPollingSuccess={this.onPollingSuccess}/>
|
||||||
|
<AclProxy
|
||||||
|
show={this.props.content.prize_name === null}>
|
||||||
|
<SubmitToPrizeButton
|
||||||
|
className="pull-right"
|
||||||
|
piece={this.props.content} />
|
||||||
|
</AclProxy>
|
||||||
|
<AclProxy
|
||||||
|
show={this.props.content.prize_name}>
|
||||||
|
<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>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span style={{'clear': 'both'}}></span>
|
<span style={{'clear': 'both'}}></span>
|
||||||
|
23
js/components/ascribe_buttons/submit_to_prize_button.js
Normal file
23
js/components/ascribe_buttons/submit_to_prize_button.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
|
||||||
|
import { getLangText } from '../../utils/lang_utils';
|
||||||
|
|
||||||
|
let SubmitToPrizeButton = React.createClass({
|
||||||
|
propTypes: {
|
||||||
|
className: React.PropTypes.string
|
||||||
|
},
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
className={classNames('btn', 'btn-default', 'btn-xs', this.props.className)}>
|
||||||
|
{getLangText('Submit to prize')}
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export default SubmitToPrizeButton;
|
Loading…
Reference in New Issue
Block a user