mirror of https://github.com/mindoc-org/mindoc.git
修复首页不显示分页的BUG
parent
80c7f25223
commit
6686de168c
|
@ -53,10 +53,10 @@ notifications:
|
|||
|
||||
deploy:
|
||||
- provider: GitHub
|
||||
name: production
|
||||
auth_token:
|
||||
secure:
|
||||
secure: "Qkhxloft5lBKti7O+vVS+Vrxh7CBAUVhlfdZ9ptBXjFtjt6jHXnaBA2uv2OYbISB"
|
||||
draft: false
|
||||
prerelease: false
|
||||
artifact: godoc_windows_%GOARCH%.7z
|
||||
on:
|
||||
branch: master
|
||||
|
|
|
@ -4,6 +4,7 @@ import (
|
|||
"github.com/astaxie/beego"
|
||||
"github.com/lifei6671/godoc/models"
|
||||
"github.com/lifei6671/godoc/utils"
|
||||
"math"
|
||||
)
|
||||
|
||||
type HomeController struct {
|
||||
|
@ -38,6 +39,7 @@ func (c *HomeController) Index() {
|
|||
}else {
|
||||
c.Data["PageHtml"] = ""
|
||||
}
|
||||
c.Data["TotalPages"] = int(math.Ceil(float64(totalCount) / float64(pageSize)))
|
||||
|
||||
c.Data["Lists"] = books
|
||||
|
||||
|
|
|
@ -509,7 +509,21 @@ textarea{
|
|||
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{
|
||||
color: #777;
|
||||
padding: 30px 0;
|
||||
|
|
|
@ -49,6 +49,12 @@
|
|||
{{end}}
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<nav class="pagination-container">
|
||||
{{if gt .TotalPages 1}}
|
||||
{{.PageHtml}}
|
||||
{{end}}
|
||||
<div class="clearfix"></div>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
{{template "widgets/footer.tpl" .}}
|
||||
|
|
Loading…
Reference in New Issue