diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2017-08-10 16:01:38 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2017-08-14 14:53:42 +0300 |
commit | c1f9403e45e636651010929b6113add34f8e6a8a (patch) | |
tree | 1f4dba647c4de1f43b01082c71fd70884c7ec54e /app/views | |
parent | 21a6898b10ed75f6260e72467b9e1f839d48456c (diff) |
Use Prev/Next pagination for exploring projects
This changes the pagination of the "Explore" pages so they use a simpler
pagination system that only shows "Prev" and "Next" buttons. This
removes the need for getting the total number of rows to display, a
process that can easily take up to 2 seconds when browsing through a
large list of projects.
Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/27390
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/kaminari/gitlab/_without_count.html.haml | 8 | ||||
-rw-r--r-- | app/views/shared/projects/_list.html.haml | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/app/views/kaminari/gitlab/_without_count.html.haml b/app/views/kaminari/gitlab/_without_count.html.haml new file mode 100644 index 00000000000..250029c4475 --- /dev/null +++ b/app/views/kaminari/gitlab/_without_count.html.haml @@ -0,0 +1,8 @@ +.gl-pagination + %ul.pagination.clearfix + - if previous_path + %li.prev + = link_to(t('views.pagination.previous'), previous_path, rel: 'prev') + - if next_path + %li.next + = link_to(t('views.pagination.next'), next_path, rel: 'next') diff --git a/app/views/shared/projects/_list.html.haml b/app/views/shared/projects/_list.html.haml index 914506bf0ce..0bedfea3502 100644 --- a/app/views/shared/projects/_list.html.haml +++ b/app/views/shared/projects/_list.html.haml @@ -23,6 +23,6 @@ = icon('lock fw', base: 'circle', class: 'fa-lg private-fork-icon') %strong= pluralize(@private_forks_count, 'private fork') %span you have no access to. - = paginate(projects, remote: remote, theme: "gitlab") if projects.respond_to? :total_pages + = paginate_collection(projects, remote: remote) - else .nothing-here-block No projects found |