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

Method Books

controllers/ManagerController.go:374–400  ·  view source on GitHub ↗

书籍列表.

()

Source from the content-addressed store, hash-verified

372
373// 书籍列表.
374func (this *ManagerController) Books() {
375 pageIndex, _ := this.GetInt("page", 1)
376 private, _ := this.GetInt("private")
377 wd := this.GetString("wd")
378
379 size := conf.PageSize
380
381 books, totalCount, _ := models.NewBookResult().FindToPager(pageIndex, size, private, wd)
382
383 if totalCount > 0 {
384 this.Data["PageHtml"] = utils.NewPaginations(conf.RollPage, totalCount, size, pageIndex, beego.URLFor("ManagerController.Books"), fmt.Sprintf("&private=%v&wd=%v", private, wd))
385 } else {
386 this.Data["PageHtml"] = ""
387 }
388
389 this.Data["Lists"] = books
390 this.Data["Wd"] = wd
391 this.Data["IsBooks"] = true
392 this.GetSeoByPage("manage_project_list", map[string]string{
393 "title": "书籍管理 - " + this.Sitename,
394 "keywords": "书籍管理",
395 "description": this.Sitename + "专注于文档在线写作、协作、分享、阅读与托管,让每个人更方便地发布、分享和获得知识。",
396 })
397 this.Data["Private"] = private
398 this.TplName = "manager/books.html"
399 this.Data["Versions"], _ = models.NewVersion().Lists(1, 10000, "")
400}
401
402// 编辑书籍.
403func (this *ManagerController) EditBook() {

Callers

nothing calls this directly

Calls 6

NewBookResultFunction · 0.92
NewPaginationsFunction · 0.92
NewVersionFunction · 0.92
GetSeoByPageMethod · 0.80
FindToPagerMethod · 0.45
ListsMethod · 0.45

Tested by

no test coverage detected