MCPcopy Index your code
hub / github.com/TruthHun/BookStack / fun3

Function fun3

utils/pager.go:188–205  ·  view source on GitHub ↗

** * 1...6 7 8 9 10 11 12 13 14 15... 200 */

(po *PageOptions, totalpages int)

Source from the content-addressed store, hash-verified

186 * 1...6 7 8 9 10 11 12 13 14 15... 200
187 */
188func fun3(po *PageOptions, totalpages int) string {
189 var rs string = ""
190 rs += getHeader(po, totalpages)
191 rs += "<li><a href='" + po.Href + "&" + po.ParamName + "=" + con.Itoa(1) + "'>" + con.Itoa(1) + "</a></li>"
192 rs += "<a href=''>...</a>"
193 for i := po.CurrentPage - po.LinkItemCount/2 + 1; i <= po.CurrentPage+po.LinkItemCount/2-1; i++ {
194 if po.CurrentPage != i {
195 rs += "<a href='" + po.Href + "&" + po.ParamName + "=" + con.Itoa(i) + "'>" + con.Itoa(i) + "</a>"
196 } else {
197 rs += "<li class=\"active\"><a href=\"###\">" + con.Itoa(i) + " <span class=\"sr-only\">(current)</span></a></li>"
198 }
199 }
200 rs += "<a href=''>...</a>"
201 rs += "<li><a href='" + po.Href + "&" + po.ParamName + "=" + con.Itoa(totalpages) + "'>" + con.Itoa(totalpages) + "</a></li>"
202 rs += getFooter(po, totalpages)
203 return rs
204
205}
206
207/**
208 * totalpages > po.LinkItemCount po.CurrentPage < po.LinkItemCount

Callers 2

GetPagerLinksFunction · 0.85
GetPagerHtmlFunction · 0.85

Calls 2

getHeaderFunction · 0.85
getFooterFunction · 0.85

Tested by

no test coverage detected