mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-04-05 20:17:53 +08:00
修复首页不显示分页的BUG
This commit is contained in:
parent
80c7f25223
commit
6686de168c
@ -53,10 +53,10 @@ notifications:
|
|||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
- provider: GitHub
|
- provider: GitHub
|
||||||
name: production
|
|
||||||
auth_token:
|
auth_token:
|
||||||
secure:
|
secure: "Qkhxloft5lBKti7O+vVS+Vrxh7CBAUVhlfdZ9ptBXjFtjt6jHXnaBA2uv2OYbISB"
|
||||||
draft: false
|
draft: false
|
||||||
|
prerelease: false
|
||||||
artifact: godoc_windows_%GOARCH%.7z
|
artifact: godoc_windows_%GOARCH%.7z
|
||||||
on:
|
on:
|
||||||
branch: master
|
branch: master
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
"github.com/lifei6671/godoc/models"
|
"github.com/lifei6671/godoc/models"
|
||||||
"github.com/lifei6671/godoc/utils"
|
"github.com/lifei6671/godoc/utils"
|
||||||
|
"math"
|
||||||
)
|
)
|
||||||
|
|
||||||
type HomeController struct {
|
type HomeController struct {
|
||||||
@ -38,6 +39,7 @@ func (c *HomeController) Index() {
|
|||||||
}else {
|
}else {
|
||||||
c.Data["PageHtml"] = ""
|
c.Data["PageHtml"] = ""
|
||||||
}
|
}
|
||||||
|
c.Data["TotalPages"] = int(math.Ceil(float64(totalCount) / float64(pageSize)))
|
||||||
|
|
||||||
c.Data["Lists"] = books
|
c.Data["Lists"] = books
|
||||||
|
|
||||||
|
@ -509,7 +509,21 @@ textarea{
|
|||||||
word-wrap: break-word; /* Help out IE10+ with class names */
|
word-wrap: break-word; /* Help out IE10+ with class names */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************网站底部样式*************************/
|
.pagination-container {
|
||||||
|
margin: 5px auto;
|
||||||
|
text-align: center !important;
|
||||||
|
display: block !important;
|
||||||
|
}
|
||||||
|
.pagination-container .pagination>li>a,.pagination-container .pagination>li>span{
|
||||||
|
padding: 4px 9px !important;
|
||||||
|
}
|
||||||
|
.pagination-container .pagination>li>a,.pagination-container .pagination>li>span{
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
.pagination-container .pagination>.active>a{
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
/**************网站底部样式*************************/
|
||||||
.footer{
|
.footer{
|
||||||
color: #777;
|
color: #777;
|
||||||
padding: 30px 0;
|
padding: 30px 0;
|
||||||
|
@ -49,6 +49,12 @@
|
|||||||
{{end}}
|
{{end}}
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<nav class="pagination-container">
|
||||||
|
{{if gt .TotalPages 1}}
|
||||||
|
{{.PageHtml}}
|
||||||
|
{{end}}
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{template "widgets/footer.tpl" .}}
|
{{template "widgets/footer.tpl" .}}
|
||||||
|
Loading…
Reference in New Issue
Block a user