Ejemplo n.º 1
0
// 帖子列表
func (c *Topic) Index(page int) revel.Result {
	title := "最近发表"

	categories := models.GetCategories()
	topics, pagination := models.GetTopics(page, "", "", "created", routes.Topic.Index(page))

	return c.Render(title, topics, pagination, categories)
}
Ejemplo n.º 2
0
// 帖子分类查询,帖子列表按时间排序
func (c *Topic) Category(id int64, page int) revel.Result {
	title := "最近发表"

	categories := models.GetCategories()
	topics, pagination := models.GetTopics(page, "category_id", id, "created", routes.Topic.Category(id, page))

	c.Render(title, topics, pagination, categories)
	return c.RenderTemplate("Topic/Index.html")
}
Ejemplo n.º 3
0
func (c *Topic) Good(page int) revel.Result {
	title := "好帖推荐"

	categories := models.GetCategories()
	topics, pagination := models.GetTopics(page, "good", true, "created", routes.Topic.Good(page))

	c.Render(title, topics, pagination, categories)
	return c.RenderTemplate("Topic/Index.html")
}
Ejemplo n.º 4
0
func (c *Topic) Hot(page int) revel.Result {
	title := "最多点击"

	categories := models.GetCategories()
	topics, pagination := models.GetTopics(page, "", "", "hits", routes.Topic.Hot(page))

	c.Render(title, topics, pagination, categories)
	return c.RenderTemplate("Topic/Index.html")
}