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

Method Star

controllers/SettingController.go:118–151  ·  view source on GitHub ↗

收藏

()

Source from the content-addressed store, hash-verified

116
117// 收藏
118func (this *SettingController) Star() {
119 page, _ := this.GetInt("page")
120 cid, _ := this.GetInt("cid")
121 if page < 1 {
122 page = 1
123 }
124 sort := this.GetString("sort", "read")
125
126 cnt, books, _ := new(models.Star).List(this.Member.MemberId, page, conf.PageSize, cid, sort)
127 if cnt > 1 {
128 //this.Data["PageHtml"] = utils.GetPagerHtml(this.Ctx.Request.RequestURI, page, listRows, int(cnt))
129 this.Data["PageHtml"] = utils.NewPaginations(conf.RollPage, int(cnt), conf.PageSize, page, beego.URLFor("SettingController.Star"), "")
130 }
131 this.Data["Pid"] = 0
132
133 cates := models.NewCategory().CategoryOfUserCollection(this.Member.MemberId)
134 for _, cate := range cates {
135 if cate.Id == cid {
136 if cate.Pid == 0 {
137 this.Data["Pid"] = cate.Id
138 } else {
139 this.Data["Pid"] = cate.Pid
140 }
141 }
142 }
143
144 this.Data["Books"] = books
145 this.Data["Sort"] = sort
146 this.Data["SettingStar"] = true
147 this.Data["SeoTitle"] = "我的收藏 - " + this.Sitename
148 this.TplName = "setting/star.html"
149 this.Data["Cid"] = cid
150 this.Data["Cates"] = cates
151}
152
153// 二维码
154func (this *SettingController) Qrcode() {

Callers

nothing calls this directly

Calls 4

NewPaginationsFunction · 0.92
NewCategoryFunction · 0.92
ListMethod · 0.45

Tested by

no test coverage detected