MCPcopy Index your code
hub / github.com/TruthHun/BookStack / Comments

Method Comments

controllers/ManagerController.go:645–667  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

643}
644
645func (this *ManagerController) Comments() {
646 status := this.GetString("status", "0")
647 statusNum, _ := strconv.Atoi(status)
648 p, _ := this.GetInt("page", 1)
649 size, _ := this.GetInt("size", 10)
650 m := models.NewComments()
651 opt := models.CommentOpt{}
652 if status == "" {
653 this.Data["Comments"], _ = m.Comments(p, size, opt)
654 } else {
655 opt.Status = []int{statusNum}
656 this.Data["Comments"], _ = m.Comments(p, size, opt)
657 }
658 this.Data["IsComments"] = true
659 this.Data["Status"] = status
660 count, _ := m.Count(0, statusNum)
661 this.Data["Count"] = count
662 if count > 0 {
663 html := utils.GetPagerHtml(this.Ctx.Request.RequestURI, p, size, int(count))
664 this.Data["PageHtml"] = html
665 }
666 this.TplName = "manager/comments.html"
667}
668
669func (this *ManagerController) ClearComments() {
670 uid, _ := this.GetInt("uid")

Callers 3

IndexMethod · 0.45
ReadMethod · 0.45
GetCommentsMethod · 0.45

Calls 4

CommentsMethod · 0.95
CountMethod · 0.95
NewCommentsFunction · 0.92
GetPagerHtmlFunction · 0.92

Tested by

no test coverage detected