From e21c07399019a8077a2e632c0858f5a4f8bbc313 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Mon, 11 Apr 2022 16:40:41 +0200 Subject: [PATCH] Paginazione: non veniva disabilitato il pulsante successiva e ultima. --- zakegg.go | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/zakegg.go b/zakegg.go index a0a5589..5a6803e 100644 --- a/zakegg.go +++ b/zakegg.go @@ -64,16 +64,34 @@ func Paginazione(start int, rows int, rows_x_page int, url string) string { } if start < int(rows / rows_x_page) * rows_x_page { - ret += fmt.Sprintf(`
  • + successiva := start + rows_x_page + if successiva >= rows { + ret += `
  • + + + +
  • ` + ret += `
  • + + + +
  • ` + } else { + ret += fmt.Sprintf(`
  • -
  • `, url, start + rows_x_page) - ret += fmt.Sprintf(`
  • +
  • `, url, successiva) + ultima := (rows / rows_x_page) * rows_x_page + if ultima >= rows { + ultima -= rows_x_page + } + ret += fmt.Sprintf(`
  • -
  • `, url, (rows / rows_x_page) * rows_x_page) + `, url, ultima) + } } else { ret += `
  • -- 2.49.0