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

Method List

controllers/LabelController.go:69–95  ·  view source on GitHub ↗

标签列表

()

Source from the content-addressed store, hash-verified

67
68// 标签列表
69func (this *LabelController) List() {
70 this.Data["IsLabel"] = true
71 this.TplName = "label/list.html"
72
73 pageIndex, _ := this.GetInt("page", 1)
74 pageSize := 200
75
76 labels, totalCount, err := models.NewLabel().FindToPager(pageIndex, pageSize)
77 if err != nil {
78 this.ShowErrorPage(50001, err.Error())
79 }
80 if totalCount > 0 {
81 html := utils.NewPaginations(conf.RollPage, totalCount, pageSize, pageIndex, beego.URLFor("LabelController.List"), "")
82 this.Data["PageHtml"] = html
83 } else {
84 this.Data["PageHtml"] = ""
85 }
86 this.Data["TotalPages"] = int(math.Ceil(float64(totalCount) / float64(pageSize)))
87
88 this.Data["Labels"] = labels
89 this.GetSeoByPage("label_list", map[string]string{
90 "title": "标签",
91 "keywords": "标签",
92 "description": this.Sitename + "专注于文档在线写作、协作、分享、阅读与托管,让每个人更方便地发布、分享和获得知识。",
93 })
94
95}

Callers

nothing calls this directly

Calls 5

NewLabelFunction · 0.92
NewPaginationsFunction · 0.92
ShowErrorPageMethod · 0.80
GetSeoByPageMethod · 0.80
FindToPagerMethod · 0.45

Tested by

no test coverage detected