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 {
60
60
return ctx .Redirect (http .StatusSeeOther , "/articles" )
61
61
}
62
62
63
+ // 旧的分页
63
64
var (
64
65
hasPrev , hasNext bool
65
66
prevId , nextId int
@@ -99,6 +100,13 @@ func (ArticleController) ReadList(ctx echo.Context) error {
99
100
"next_id" : nextId ,
100
101
}
101
102
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
+
102
110
// 获取当前用户喜欢对象信息
103
111
me , ok := ctx .Get ("user" ).(* model.Me )
104
112
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}}">
83
83
< li class ="next "> < a href ="/articles?lastid={{.page.next_id}} "> 下一页 →</ a > </ li >
84
84
{{end}}
85
85
</ 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}}
86
94
</ div >
87
95
< div class ="col-md-3 col-sm-6 ">
88
96
< div class ="sep20 "> </ div >
You can’t perform that action at this time.
0 commit comments