1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/public/js/components/log/LogEntryList.jsx

58 lines
1.6 KiB
React
Raw Normal View History

2014-11-13 15:14:41 +01:00
var React = require('react'),
2015-03-17 20:40:22 +01:00
LogEntry = require('./LogEntry');
2014-11-13 15:14:41 +01:00
2014-11-14 07:29:55 +01:00
var LogEntryList = React.createClass({
2014-11-13 15:14:41 +01:00
propTypes: {
events: React.PropTypes.array.isRequired
},
getInitialState: function() {
return {
showFullEvents: false
2015-03-17 20:40:22 +01:00
};
},
2014-11-13 15:14:41 +01:00
render: function() {
2014-11-14 07:29:55 +01:00
var logEntryNodes = this.props.events.map(function(event) {
return <LogEntry event={event} key={event.id} showFullEvents={this.state.showFullEvents} />;
}.bind(this));
2014-11-13 15:14:41 +01:00
return (
<div>
2015-03-17 20:40:22 +01:00
<label className="prs fright-ht768 smalltext">
Show full events
<input
type="checkbox"
className="mlm"
value={this.state.fullEvents}
onChange={this.toggleFullEvents}>
</input>
</label>
2014-11-29 13:55:38 +01:00
<table className='outerborder zebra-striped'>
2014-11-13 15:14:41 +01:00
<thead>
<tr>
2014-11-17 10:10:47 +01:00
<th>When</th>
2014-11-13 15:14:41 +01:00
<th>Action</th>
<th>
2015-03-17 20:40:22 +01:00
Data
</th>
2014-11-13 15:14:41 +01:00
<th>Author</th>
</tr>
</thead>
<tbody>
2014-11-14 07:29:55 +01:00
{logEntryNodes}
2014-11-13 15:14:41 +01:00
</tbody>
</table>
</div>
2015-03-17 20:40:22 +01:00
);
},
2015-03-17 20:40:22 +01:00
toggleFullEvents: function() {
this.setState({showFullEvents: !this.state.showFullEvents});
2014-11-13 15:14:41 +01:00
}
2014-11-13 15:14:41 +01:00
});
2015-03-17 20:40:22 +01:00
module.exports = LogEntryList;