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

Function fun2

utils/pager.go:211–229  ·  view source on GitHub ↗

** * totalpages > po.LinkItemCount po.CurrentPage < po.LinkItemCount * 123456789...200 */

(po *PageOptions, totalpages int)

Source from the content-addressed store, hash-verified

209 * 123456789...200
210 */
211func fun2(po *PageOptions, totalpages int) string {
212 var rs string = ""
213 rs += getHeader(po, totalpages)
214 for i := 1; i <= po.LinkItemCount+1; i++ {
215 if i == po.LinkItemCount {
216 rs += "<li><a href=\"" + po.Href + "&" + po.ParamName + "=" + con.Itoa(i) + "\">...</a></li>"
217 } else if i == po.LinkItemCount+1 {
218 rs += "<li><a href=\"" + po.Href + "&" + po.ParamName + "=" + con.Itoa(totalpages) + "\">" + con.Itoa(totalpages) + "</a></li>"
219 } else {
220 if po.CurrentPage != i {
221 rs += "<li><a href='" + po.Href + "&" + po.ParamName + "=" + con.Itoa(i) + "'>" + con.Itoa(i) + "</a></li>"
222 } else {
223 rs += "<li class=\"active\"><a href=\"###\">" + con.Itoa(i) + " <span class=\"sr-only\">(current)</span></a></li>"
224 }
225 }
226 }
227 rs += getFooter(po, totalpages)
228 return rs
229}
230
231/**
232 * totalpages <= po.LinkItemCount

Callers 2

GetPagerLinksFunction · 0.85
GetPagerHtmlFunction · 0.85

Calls 2

getHeaderFunction · 0.85
getFooterFunction · 0.85

Tested by

no test coverage detected