PLT-349 adding team mgt to admin console
Этот коммит содержится в:
@@ -1,124 +1,99 @@
|
||||
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
export default class SelectTeam extends React.Component {
|
||||
var Modal = ReactBootstrap.Modal;
|
||||
|
||||
export default class SelectTeamModal extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
};
|
||||
this.doSubmit = this.doSubmit.bind(this);
|
||||
this.doCancel = this.doCancel.bind(this);
|
||||
}
|
||||
|
||||
doSubmit(e) {
|
||||
e.preventDefault();
|
||||
this.props.onModalSubmit(React.findDOMNode(this.refs.team).value);
|
||||
}
|
||||
doCancel() {
|
||||
this.props.onModalDismissed();
|
||||
}
|
||||
render() {
|
||||
if (this.props.teams == null) {
|
||||
return <div/>;
|
||||
}
|
||||
|
||||
var options = [];
|
||||
|
||||
for (var key in this.props.teams) {
|
||||
if (this.props.teams.hasOwnProperty(key)) {
|
||||
var team = this.props.teams[key];
|
||||
options.push(
|
||||
<option
|
||||
key={'opt_' + team.id}
|
||||
value={team.id}
|
||||
>
|
||||
{team.name}
|
||||
</option>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='modal fade'
|
||||
id='select-team'
|
||||
tabIndex='-1'
|
||||
role='dialog'
|
||||
aria-labelledby='teamsModalLabel'
|
||||
<Modal
|
||||
show={this.props.show}
|
||||
onHide={this.doCancel}
|
||||
>
|
||||
<div className='modal-dialog'
|
||||
role='document'
|
||||
<Modal.Header closeButton={true}>
|
||||
<Modal.Title>{'Select Team'}</Modal.Title>
|
||||
</Modal.Header>
|
||||
<form
|
||||
role='form'
|
||||
className='form-horizontal'
|
||||
>
|
||||
<div className='modal-content'>
|
||||
<div className='modal-header'>
|
||||
<button
|
||||
type='button'
|
||||
className='close'
|
||||
data-dismiss='modal'
|
||||
aria-label='Close'
|
||||
>
|
||||
<span aria-hidden='true'>×</span>
|
||||
</button>
|
||||
<h4
|
||||
className='modal-title'
|
||||
id='teamsModalLabel'
|
||||
>
|
||||
{'Select a team'}
|
||||
</h4>
|
||||
<Modal.Body>
|
||||
<div className='form-group'>
|
||||
<div className='col-sm-12'>
|
||||
<select
|
||||
ref='team'
|
||||
size='10'
|
||||
style={{width: '100%'}}
|
||||
>
|
||||
{options}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div className='modal-body'>
|
||||
<table className='more-channel-table table'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<p className='more-channel-name'>{'Descartes'}</p>
|
||||
</td>
|
||||
<td className='td--action'>
|
||||
<button className='btn btn-primary'>{'Join'}</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p className='more-channel-name'>{'Grouping'}</p>
|
||||
</td>
|
||||
<td className='td--action'>
|
||||
<button className='btn btn-primary'>{'Join'}</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p className='more-channel-name'>{'Adventure'}</p>
|
||||
</td>
|
||||
<td className='td--action'>
|
||||
<button className='btn btn-primary'>{'Join'}</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p className='more-channel-name'>{'Crossroads'}</p>
|
||||
</td>
|
||||
<td className='td--action'>
|
||||
<button className='btn btn-primary'>{'Join'}</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p className='more-channel-name'>{'Sky scraping'}</p>
|
||||
</td>
|
||||
<td className='td--action'>
|
||||
<button className='btn btn-primary'>{'Join'}</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p className='more-channel-name'>{'Outdoors'}</p>
|
||||
</td>
|
||||
<td className='td--action'>
|
||||
<button className='btn btn-primary'>{'Join'}</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p className='more-channel-name'>{'Microsoft'}</p>
|
||||
</td>
|
||||
<td className='td--action'>
|
||||
<button className='btn btn-primary'>{'Join'}</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p className='more-channel-name'>{'Apple'}</p>
|
||||
</td>
|
||||
<td className='td--action'>
|
||||
<button className='btn btn-primary'>{'Join'}</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div className='modal-footer'>
|
||||
<button
|
||||
type='button'
|
||||
className='btn btn-default'
|
||||
data-dismiss='modal'
|
||||
>
|
||||
{'Close'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Modal.Body>
|
||||
<Modal.Footer>
|
||||
<button
|
||||
type='button'
|
||||
className='btn btn-default'
|
||||
onClick={this.doCancel}
|
||||
>
|
||||
{'Close'}
|
||||
</button>
|
||||
<button
|
||||
onClick={this.doSubmit}
|
||||
type='submit'
|
||||
className='btn btn-primary'
|
||||
tabIndex='2'
|
||||
>
|
||||
{'Select'}
|
||||
</button>
|
||||
</Modal.Footer>
|
||||
</form>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SelectTeamModal.defaultProps = {
|
||||
show: false
|
||||
};
|
||||
|
||||
SelectTeamModal.propTypes = {
|
||||
teams: React.PropTypes.object,
|
||||
show: React.PropTypes.bool.isRequired,
|
||||
onModalSubmit: React.PropTypes.func,
|
||||
onModalDismissed: React.PropTypes.func
|
||||
};
|
||||
|
||||
Ссылка в новой задаче
Block a user