小调整,修复一bug
This commit is contained in:
parent
72a37d3bc8
commit
8dded98f39
|
@ -29,7 +29,7 @@ var twentyFifteen = PageEle{
|
||||||
<span class="meta-nav screen-reader-text">页 </span>%d</span>`,
|
<span class="meta-nav screen-reader-text">页 </span>%d</span>`,
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p PageEle) Current(page, totalPage int) string {
|
func (p PageEle) Current(page, totalPage, totalRow int) string {
|
||||||
return fmt.Sprintf(p.CurrentEle, page)
|
return fmt.Sprintf(p.CurrentEle, page)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,8 @@ func (i *IndexHandle) ParseIndex(parm *IndexParams) (err error) {
|
||||||
i.Stats = constraints.ParamError
|
i.Stats = constraints.ParamError
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
i.Param.CacheKey = i.Param.getSearchKey()
|
|
||||||
i.Param.ParseParams()
|
i.Param.ParseParams()
|
||||||
|
i.Param.CacheKey = i.Param.getSearchKey()
|
||||||
i.GinH["title"] = i.Param.getTitle()
|
i.GinH["title"] = i.Param.getTitle()
|
||||||
i.GinH["search"] = i.Param.Search
|
i.GinH["search"] = i.Param.Search
|
||||||
i.GinH["header"] = i.Param.Header
|
i.GinH["header"] = i.Param.Header
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Elements interface {
|
type Elements interface {
|
||||||
Current(page, totalPage int) string
|
Current(page, totalPage, totalRows int) string
|
||||||
Prev(url string) string
|
Prev(url string) string
|
||||||
Next(url string) string
|
Next(url string) string
|
||||||
Dots() string
|
Dots() string
|
||||||
|
@ -67,7 +67,7 @@ func (p ParsePagination) ToHtml() (html string) {
|
||||||
for page := start; page <= end; page++ {
|
for page := start; page <= end; page++ {
|
||||||
h := ""
|
h := ""
|
||||||
if p.CurrentPage == page {
|
if p.CurrentPage == page {
|
||||||
h = p.Current(page, p.TotalPage)
|
h = p.Current(page, p.TotalPage, p.TotalRaw)
|
||||||
} else {
|
} else {
|
||||||
h = p.Middle(page, p.Url(p.Path, p.Query, page))
|
h = p.Middle(page, p.Url(p.Path, p.Query, page))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user