2016-06-17 14:44:53 +09:00
|
|
|
import React, { PropTypes, Component } from 'react';
|
2016-06-11 16:36:18 +09:00
|
|
|
import { ListContainer, DocumentContainer } from "meteor/utilities:react-list-container";
|
2016-06-23 11:40:35 +09:00
|
|
|
import Posts from "meteor/nova:posts";
|
2016-06-10 19:19:32 +09:00
|
|
|
|
2016-06-17 14:44:53 +09:00
|
|
|
class PostsHome extends Component {
|
2016-06-11 16:36:18 +09:00
|
|
|
|
2016-06-17 14:44:53 +09:00
|
|
|
getDefaultView() {
|
|
|
|
return {view: 'top'}
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2016-06-11 16:36:18 +09:00
|
|
|
|
2016-06-17 14:44:53 +09:00
|
|
|
const params = {...this.getDefaultView(), ...this.props.location.query, listId: "posts.list.main"};
|
|
|
|
const {selector, options} = Posts.parameters.get(params);
|
2016-06-11 16:36:18 +09:00
|
|
|
|
2016-06-17 14:44:53 +09:00
|
|
|
return (
|
|
|
|
<ListContainer
|
|
|
|
collection={Posts}
|
|
|
|
publication="posts.list"
|
|
|
|
selector={selector}
|
|
|
|
options={options}
|
|
|
|
terms={params}
|
|
|
|
joins={Posts.getJoins()}
|
|
|
|
component={Telescope.components.PostsList}
|
|
|
|
cacheSubscription={false}
|
|
|
|
listId={params.listId}
|
|
|
|
limit={Telescope.settings.get("postsPerPage", 10)}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
}
|
2016-06-10 19:19:32 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = PostsHome;
|