Repository: zeppelin Updated Branches: refs/heads/gh-pages 12633f472 -> 400d6b1de
[gh-pages] set max size for pagination btn & hide arrows when current page is first/last ### What is this PR for? As the number of Helium packages is increasing, more pagination buttons will be generated accordingly. If we don't set `maxSize`, pagination layout will be broken when screen size is small. So I set the `maxSize` to 5 to prevent it. And also hided unnecessary arrows when current page is on first & last. (related feedback is https://github.com/apache/zeppelin/pull/2174#issuecomment-289776096 suggested by 1ambda) ### What type of PR is it? Improvement | gh-pages ### What is the Jira issue? N/A ### How should this be tested? Run the website(`gh-pages`) locally as described in [here](https://github.com/apache/zeppelin/tree/gh-pages#run-website) and click pagination button ### Screenshots (if appropriate) - before  - after  ### Questions: * Does the licenses files need update? no * Is there breaking changes for older versions? no * Does this needs documentation? no Author: AhyoungRyu <fbdkdu...@hanmail.net> Closes #2212 from AhyoungRyu/improve/pagination and squashes the following commits: 3c7cba3 [AhyoungRyu] Hide unnecessary first & last button 599e063 [AhyoungRyu] Set maxSize for pagination Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/400d6b1d Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/400d6b1d Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/400d6b1d Branch: refs/heads/gh-pages Commit: 400d6b1de309873212e511333ad87a0ef2cda3aa Parents: 12633f4 Author: AhyoungRyu <fbdkdu...@hanmail.net> Authored: Sat Apr 1 22:21:53 2017 +0900 Committer: ahyoungryu <ahyoung...@apache.org> Committed: Sat Apr 8 13:25:42 2017 +0900 ---------------------------------------------------------------------- assets/themes/zeppelin/css/style.css | 23 +++++++++++++++++++++++ helium_packages.md | 6 ++++++ 2 files changed, 29 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/400d6b1d/assets/themes/zeppelin/css/style.css ---------------------------------------------------------------------- diff --git a/assets/themes/zeppelin/css/style.css b/assets/themes/zeppelin/css/style.css index 04a5dfc..36ff972 100644 --- a/assets/themes/zeppelin/css/style.css +++ b/assets/themes/zeppelin/css/style.css @@ -670,6 +670,29 @@ a.anchorjs-link:hover { text-decoration: none; } background: #c9e2f9; } +/* hide arrows when current page is on first & last */ +.hide-first-boundaries.pagination > .disabled > a, +.hide-first-boundaries.pagination > li:first-child > a, +.hide-first-boundaries.pagination > li:first-child > span { + display: none; +} + +.hide-first-boundaries.pagination > .active > a { + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; +} + +.hide-last-boundaries.pagination > .disabled > a, +.hide-last-boundaries.pagination > li:last-child > a, +.hide-last-boundaries.pagination > li:last-child > span { + display: none; +} + +.hide-last-boundaries.pagination > .active > a { + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; +} + /* For what's new section */ .new { background: rgba(226, 233, 239, 0.4); http://git-wip-us.apache.org/repos/asf/zeppelin/blob/400d6b1d/helium_packages.md ---------------------------------------------------------------------- diff --git a/helium_packages.md b/helium_packages.md index 4792a37..a7cd3cf 100644 --- a/helium_packages.md +++ b/helium_packages.md @@ -98,6 +98,9 @@ and [What is Apache Zeppelin Spell](https://zeppelin.apache.org/docs/snapshot/de <div class="text-center" style="margin-top: 24px;"> <ul uib-pagination boundary-links="true" total-items="latestPkgInfo.length" ng-model="currentPage" class="pagination-sm" + ng-class="{'hide-first-boundaries': currentPage == 1, 'hide-last-boundaries': currentPage >= latestPkgInfo.length/itemsPerPage}" + max-size="maxSize" + items-per-page="itemsPerPage" previous-text="‹" next-text="›" first-text="«" last-text="»"></ul> </div> </div> @@ -143,6 +146,9 @@ and [What is Apache Zeppelin Spell](https://zeppelin.apache.org/docs/snapshot/de <ul uib-pagination boundary-links="true" total-items="pkgs.length" ng-model="$parent.currentPage" class="pagination-sm" ng-show="$parent.pkgListByType === types" + ng-class="{'hide-first-boundaries': $parent.currentPage == 1, 'hide-last-boundaries': $parent.currentPage >= pkgs.length/itemsPerPage}" + max-size="maxSize" + items-per-page="itemsPerPage" previous-text="‹" next-text="›" first-text="«" last-text="»"></ul> </div> </div>