File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ func (ArticleController) ReadList(ctx echo.Context) error {
6060 return ctx .Redirect (http .StatusSeeOther , "/articles" )
6161 }
6262
63+ // 旧的分页
6364 var (
6465 hasPrev , hasNext bool
6566 prevId , nextId int
@@ -99,6 +100,13 @@ func (ArticleController) ReadList(ctx echo.Context) error {
99100 "next_id" : nextId ,
100101 }
101102
103+ // 新分页
104+ //curPage := goutils.MustInt(ctx.QueryParam("p"), 1)
105+ //paginator := logic.NewPaginator(curPage)
106+ //total := logic.DefaultArticle.Count(ctx, "")
107+ //pageHtml := paginator.SetTotal(total).GetPageHtml(ctx.Request().URL().Path())
108+ //pageInfo := template.HTML(pageHtml)
109+
102110 // 获取当前用户喜欢对象信息
103111 me , ok := ctx .Get ("user" ).(* model.Me )
104112 var likeFlags map [int ]int
Original file line number Diff line number Diff line change @@ -83,6 +83,14 @@ <h2><a href="/articles/{{.Id}}" target="_blank" title="{{.Title}}">
8383 < li class ="next "> < a href ="/articles?lastid={{.page.next_id}} "> 下一页 →</ a > </ li >
8484 {{end}}
8585 </ ul >
86+ < div class ="sep20 "> </ div >
87+ {{if .page}}
88+ < div class ="box_white ">
89+ < div class ="inner_content ">
90+ < nav class ="text-center "> < ul class ="pagination pagination-sm " style ="margin: 1px 0; "> {{.page}}</ ul > </ nav >
91+ </ div >
92+ </ div >
93+ {{end}}
8694 </ div >
8795 < div class ="col-md-3 col-sm-6 ">
8896 < div class ="sep20 "> </ div >
You can’t perform that action at this time.
0 commit comments