From 56b8b358ca636ef54a57f287ed102b444bbc1cb8 Mon Sep 17 00:00:00 2001 From: metaskop Date: Mon, 10 Apr 2017 16:57:30 +0200 Subject: [PATCH 1/3] [req171] first / last page front end implementation --- bl-kernel/helpers/paginator.class.php | 34 ++++++++++++++++++++++ bl-languages/en_US.json | 2 ++ bl-themes/log/assets/css/main.css | 42 +++++++++++++++++++++++++-- bl-themes/log/php/home.php | 7 +++++ 4 files changed, 83 insertions(+), 2 deletions(-) diff --git a/bl-kernel/helpers/paginator.class.php b/bl-kernel/helpers/paginator.class.php index 645a0304..e7b187ac 100644 --- a/bl-kernel/helpers/paginator.class.php +++ b/bl-kernel/helpers/paginator.class.php @@ -58,6 +58,40 @@ class Paginator { return $url.'?page='.self::get('prevPage'); } + public static function urlLastPage() + { + global $Url; + + $domain = trim(DOMAIN_BASE,'/'); + $filter = trim($Url->activeFilter(), '/'); + + if(empty($filter)) { + $url = $domain.'/'.$Url->slug(); + } + else { + $url = $domain.'/'.$filter.'/'.$Url->slug(); + } + + return $url.'?page='.self::get('numberOfPosts'); + } + + public static function urlFirstPage() + { + global $Url; + + $domain = trim(DOMAIN_BASE,'/'); + $filter = trim($Url->activeFilter(), '/'); + + if(empty($filter)) { + $url = $domain.'/'.$Url->slug(); + } + else { + $url = $domain.'/'.$filter.'/'.$Url->slug(); + } + + return $url.'?page=0'; + } + public static function html($textPrevPage=false, $textNextPage=false, $showPageNumber=false) { global $Language; diff --git a/bl-languages/en_US.json b/bl-languages/en_US.json index e92c7774..f304551a 100644 --- a/bl-languages/en_US.json +++ b/bl-languages/en_US.json @@ -51,6 +51,8 @@ "themes": "Themes", "prev-page": "Prev page", "next-page": "Next page", + "first-page": "First page", + "last-page": "Last page", "configure-plugin": "Configure plugin", "confirm-delete-this-action-cannot-be-undone": "Confirm delete, this action cannot be undone.", "site-title": "Site title", diff --git a/bl-themes/log/assets/css/main.css b/bl-themes/log/assets/css/main.css index 8af48f5e..0bea930f 100644 --- a/bl-themes/log/assets/css/main.css +++ b/bl-themes/log/assets/css/main.css @@ -2271,13 +2271,50 @@ content: '\f053'; } +ul.actions.pagination .last { + text-decoration: none; + } + + ul.actions.pagination .next:after { + content: ""; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + font-family: FontAwesome; + font-style: normal; + font-weight: normal; + text-transform: none !important; + } + + ul.actions.pagination .next:after { + content: '\f050'; + } +ul.actions.pagination .first { + text-decoration: none; + } + + ul.actions.pagination .next:after { + content: ""; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + font-family: FontAwesome; + font-style: normal; + font-weight: normal; + text-transform: none !important; + } + + ul.actions.pagination .next:after { + content: '\f049'; + } + + @media screen and (max-width: 1280px) { ul.actions.pagination { text-align: center; } - ul.actions.pagination .next, ul.actions.pagination .previous { + ul.actions.pagination .next, ul.actions.pagination .previous, + ul.actions.pagination .last, ul.actions.pagination .first { min-width: 20em; } @@ -2285,7 +2322,8 @@ @media screen and (max-width: 736px) { - ul.actions.pagination .next, ul.actions.pagination .previous { + ul.actions.pagination .next, ul.actions.pagination .previous, + ul.actions.pagination .last, ul.actions.pagination .first { min-width: 18em; } diff --git a/bl-themes/log/php/home.php b/bl-themes/log/php/home.php index 35b7e177..8216cd6b 100644 --- a/bl-themes/log/php/home.php +++ b/bl-themes/log/php/home.php @@ -73,11 +73,18 @@ \ No newline at end of file From 57f32b6c2db4001755dfec950148edda99da2d46 Mon Sep 17 00:00:00 2001 From: metaskop Date: Mon, 10 Apr 2017 17:03:15 +0200 Subject: [PATCH 2/3] [req171] first / last page front end implementation --- bl-themes/log/assets/css/main.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bl-themes/log/assets/css/main.css b/bl-themes/log/assets/css/main.css index 0bea930f..c2f65859 100644 --- a/bl-themes/log/assets/css/main.css +++ b/bl-themes/log/assets/css/main.css @@ -2271,7 +2271,7 @@ content: '\f053'; } -ul.actions.pagination .last { + ul.actions.pagination .last { text-decoration: none; } @@ -2288,7 +2288,7 @@ ul.actions.pagination .last { ul.actions.pagination .next:after { content: '\f050'; } -ul.actions.pagination .first { + ul.actions.pagination .first { text-decoration: none; } From 928856fe818a151b104531c601937c340b915ddd Mon Sep 17 00:00:00 2001 From: metaskop Date: Mon, 10 Apr 2017 17:29:10 +0200 Subject: [PATCH 3/3] [req171] bug fixes --- bl-kernel/helpers/paginator.class.php | 2 +- bl-themes/log/assets/css/main.css | 8 ++++---- bl-themes/log/php/home.php | 9 ++------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/bl-kernel/helpers/paginator.class.php b/bl-kernel/helpers/paginator.class.php index e7b187ac..2ee6af66 100644 --- a/bl-kernel/helpers/paginator.class.php +++ b/bl-kernel/helpers/paginator.class.php @@ -72,7 +72,7 @@ class Paginator { $url = $domain.'/'.$filter.'/'.$Url->slug(); } - return $url.'?page='.self::get('numberOfPosts'); + return $url.'?page='.self::get('numberOfPages'); } public static function urlFirstPage() diff --git a/bl-themes/log/assets/css/main.css b/bl-themes/log/assets/css/main.css index c2f65859..46f3f6fe 100644 --- a/bl-themes/log/assets/css/main.css +++ b/bl-themes/log/assets/css/main.css @@ -2275,7 +2275,7 @@ text-decoration: none; } - ul.actions.pagination .next:after { + ul.actions.pagination .last:after { content: ""; -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; @@ -2285,14 +2285,14 @@ text-transform: none !important; } - ul.actions.pagination .next:after { + ul.actions.pagination .last:after { content: '\f050'; } ul.actions.pagination .first { text-decoration: none; } - ul.actions.pagination .next:after { + ul.actions.pagination .first:before { content: ""; -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; @@ -2302,7 +2302,7 @@ text-transform: none !important; } - ul.actions.pagination .next:after { + ul.actions.pagination .first:before { content: '\f049'; } diff --git a/bl-themes/log/php/home.php b/bl-themes/log/php/home.php index 8216cd6b..a165bcb9 100644 --- a/bl-themes/log/php/home.php +++ b/bl-themes/log/php/home.php @@ -73,18 +73,13 @@ \ No newline at end of file