Example #1
0
func (this *NoticeRouter) Get() {
	this.Data["IsNotificationPage"] = true
	this.TplNames = "post/notice.html"

	if this.CheckLoginRedirect() {
		return
	}

	var notifications []models.Notification
	qs := models.Notifications(this.User.Id)

	pers := 10
	count, _ := models.CountObjects(qs)
	pager := this.SetPaginator(pers, count)

	qs = qs.OrderBy("-Created").Limit(pers, pager.Offset()).RelatedSel()

	models.ListObjects(qs, &notifications)
	this.Data["Notifications"] = notifications

	var cats []models.Category
	var topics []models.Topic
	post.ListCategories(&cats)
	this.Data["Categories"] = cats
	post.ListTopics(&topics)
	this.Data["Topics"] = topics
}
Example #2
0
//Get all the categories
func (this *PostListRouter) setCategories(cats *[]models.Category) {
	//@see modules/post/topic_util.go
	post.ListCategories(cats)
	this.Data["Categories"] = *cats
}