标签列表
()
| 67 | |
| 68 | // 标签列表 |
| 69 | func (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 | } |
nothing calls this directly
no test coverage detected