mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
adjust button choose logic
This commit is contained in:
parent
e589925c9d
commit
3137583b0f
@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import FormMixin from '../../mixins/form_mixin';
|
|
||||||
|
|
||||||
import AclButton from './../ascribe_buttons/acl_button';
|
import AclButton from './../ascribe_buttons/acl_button';
|
||||||
import ActionPanel from '../ascribe_panel/action_panel';
|
import ActionPanel from '../ascribe_panel/action_panel';
|
||||||
import Form from './form';
|
import Form from './form';
|
||||||
@ -78,7 +76,7 @@ let RequestActionForm = React.createClass({
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
getAcceptButton() {
|
getAcceptButtonForm() {
|
||||||
let edition = this.props.editions[0];
|
let edition = this.props.editions[0];
|
||||||
|
|
||||||
if(edition.request_action === 'unconsign') {
|
if(edition.request_action === 'unconsign') {
|
||||||
@ -92,11 +90,17 @@ let RequestActionForm = React.createClass({
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<button
|
<Form
|
||||||
type="submit"
|
url={urls.accept}
|
||||||
className='btn btn-default btn-sm ascribe-margin-1px'>
|
getFormData={this.getFormData}
|
||||||
{getLangText('ACCEPT')}
|
handleSuccess={this.showNotification(getLangText('denied'), edition.request_action, edition.owner)}
|
||||||
</button>
|
className='inline pull-right'>
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className='btn btn-default btn-sm ascribe-margin-1px'>
|
||||||
|
{getLangText('ACCEPT')}
|
||||||
|
</button>
|
||||||
|
</Form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -105,7 +109,7 @@ let RequestActionForm = React.createClass({
|
|||||||
let edition = this.props.editions[0];
|
let edition = this.props.editions[0];
|
||||||
|
|
||||||
let urls = this.getUrls();
|
let urls = this.getUrls();
|
||||||
let acceptButton = this.getAcceptButton();
|
let acceptButtonForm = this.getAcceptButtonForm();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@ -120,13 +124,7 @@ let RequestActionForm = React.createClass({
|
|||||||
{getLangText('REJECT')}
|
{getLangText('REJECT')}
|
||||||
</button>
|
</button>
|
||||||
</Form>
|
</Form>
|
||||||
<Form
|
{acceptButtonForm}
|
||||||
url={urls.accept}
|
|
||||||
getFormData={this.getFormData}
|
|
||||||
handleSuccess={this.showNotification(getLangText('denied'), edition.request_action, edition.owner)}
|
|
||||||
className='inline pull-right'>
|
|
||||||
{acceptButton}
|
|
||||||
</Form>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user