示例#1
0
文件: topic.go 项目: jsli/gorevel
// 帖子列表
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)
}
示例#2
0
文件: topic.go 项目: jsli/gorevel
// 帖子分类查询,帖子列表按时间排序
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")
}
示例#3
0
文件: topic.go 项目: jsli/gorevel
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")
}
示例#4
0
文件: topic.go 项目: jsli/gorevel
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")
}