From 1920d8eabc8d83b4f3ce1a7e6d1d1547a73cf3b3 Mon Sep 17 00:00:00 2001 From: JoBCB Date: Thu, 10 Jun 2021 16:31:43 +0100 Subject: [PATCH] added pagination script to all templates --- templates/artistsindex.html | 111 +++++++++++++++++++++++++-- templates/browsethearchive.html | 72 +++++++++--------- templates/publishersindex.html | 108 +++++++++++++++++++++++++- templates/selfpublishedindex.html | 119 +++++++++++++++++++++++------ templates/zinesindex.html | 122 +++++++++++++++++++++++------- 5 files changed, 434 insertions(+), 98 deletions(-) diff --git a/templates/artistsindex.html b/templates/artistsindex.html index ceeb399..a6dbda5 100644 --- a/templates/artistsindex.html +++ b/templates/artistsindex.html @@ -34,20 +34,115 @@ + + - + + + + {% endblock content %} \ No newline at end of file diff --git a/templates/browsethearchive.html b/templates/browsethearchive.html index 49ac856..07645ff 100644 --- a/templates/browsethearchive.html +++ b/templates/browsethearchive.html @@ -64,43 +64,43 @@ let paginationStart = (startPage - slideRange) <= 1 ? 0 : $("#pagin li").hide(); for (let t = paginationStart; t < (paginationStart + totalSlidePage); t++) { -$("#pagin li").eq(t + 1).show(); -} - -next.show(); -prev.show(); - -if (startPage == 1) { -prev.hide(); -} -else if (startPage == pageCount ) { -next.hide(); -} + $("#pagin li").eq(t + 1).show(); + } + + next.show(); + prev.show(); + + if (startPage == 1) { + prev.hide(); + } + if (startPage == pageCount ) { + next.hide(); + } } showPage = function() { console.log(startPage); -$(".browsethearchive-items").hide(); -$(".browsethearchive-items").each(function(n) { -if (n >= pageSize * (startPage - 1) && n < pageSize * startPage) -$(this).show(); -}); + $(".browsethearchive-items").hide(); + $(".browsethearchive-items").each(function(n) { + if (n >= pageSize * (startPage - 1) && n < pageSize * startPage) + $(this).show(); + }); } for (let i = 0 ; i < pageCount; i++) { -$("#pagin").append('
  • ' + (i + 1) + '
  • '); + $("#pagin").append('
  • ' + (i + 1) + '
  • '); -if (i > pageSize) { -$("#pagin li").eq(i).hide(); -} + if (i > pageSize) { + $("#pagin li").eq(i).hide(); + } } let prev = $("
  • ").addClass("prev").html("Prev").click(function() { let prevLi = $("#pagin li a.current").parent().prev().find("a"); if (prevLi[0]) { -$("#pagin li a.current").removeClass("current"); -prevLi.addClass("current"); + $("#pagin li a.current").removeClass("current"); + prevLi.addClass("current"); } slide(); @@ -111,28 +111,28 @@ showPage(); }); let next = $("
  • ").addClass("next").html("Next").click(function() { -let nextLi = $("#pagin li a.current").parent().next().find("a"); + let nextLi = $("#pagin li a.current").parent().next().find("a"); -if (nextLi[0]) { -$("#pagin li a.current").removeClass("current"); -nextLi.addClass("current"); -} + if (nextLi[0]) { + $("#pagin li a.current").removeClass("current"); + nextLi.addClass("current"); + } -slide(); + slide(); -if (startPage <= pageCount) { -showPage(); -} + if (startPage <= pageCount) { + showPage(); + } }); $("#pagin").prepend(prev).append(next); $("#pagin li a").click(function() { -$('#pagin li a').removeClass('current'); -$(this).addClass('current'); + $('#pagin li a').removeClass('current'); + $(this).addClass('current'); -slide(); -showPage(); + slide(); + showPage(); }); $("#pagin li a").eq(0).addClass("current"); diff --git a/templates/publishersindex.html b/templates/publishersindex.html index 7102a6d..c9076d8 100644 --- a/templates/publishersindex.html +++ b/templates/publishersindex.html @@ -33,12 +33,16 @@ + + - --> + + + + + {% endblock content %} \ No newline at end of file diff --git a/templates/selfpublishedindex.html b/templates/selfpublishedindex.html index 177e65c..b765b9a 100644 --- a/templates/selfpublishedindex.html +++ b/templates/selfpublishedindex.html @@ -37,37 +37,106 @@ -
    -
      +
        +
      -
    + + diff --git a/templates/zinesindex.html b/templates/zinesindex.html index 51c5840..d25d676 100644 --- a/templates/zinesindex.html +++ b/templates/zinesindex.html @@ -37,37 +37,105 @@ -
    -
      +
      -