summaryrefslogtreecommitdiff
path: root/app/views/kaminari
diff options
context:
space:
mode:
authorrandx <dmitriy.zaporozhets@gmail.com>2012-03-22 00:09:56 +0200
committerrandx <dmitriy.zaporozhets@gmail.com>2012-03-22 00:09:56 +0200
commit755a894c911d6eb5604b97bee758306c41cd8d4a (patch)
tree9010b581e346128b2cdacc08987b37136355b01b /app/views/kaminari
parent1fefd7cbd3ef65d34c36f2b4dd8cedb29200c569 (diff)
downloadgitlab-ce-755a894c911d6eb5604b97bee758306c41cd8d4a.tar.gz
Issues pagination
Diffstat (limited to 'app/views/kaminari')
-rw-r--r--app/views/kaminari/admin/_first_page.html.haml (renamed from app/views/kaminari/_first_page.html.haml)0
-rw-r--r--app/views/kaminari/admin/_gap.html.haml (renamed from app/views/kaminari/_gap.html.haml)0
-rw-r--r--app/views/kaminari/admin/_last_page.html.haml (renamed from app/views/kaminari/_last_page.html.haml)0
-rw-r--r--app/views/kaminari/admin/_next_page.html.haml (renamed from app/views/kaminari/_next_page.html.haml)0
-rw-r--r--app/views/kaminari/admin/_page.html.haml (renamed from app/views/kaminari/_page.html.haml)0
-rw-r--r--app/views/kaminari/admin/_paginator.html.haml (renamed from app/views/kaminari/_paginator.html.haml)0
-rw-r--r--app/views/kaminari/admin/_prev_page.html.haml (renamed from app/views/kaminari/_prev_page.html.haml)0
-rw-r--r--app/views/kaminari/gitlab/_first_page.html.haml9
-rw-r--r--app/views/kaminari/gitlab/_gap.html.haml8
-rw-r--r--app/views/kaminari/gitlab/_last_page.html.haml9
-rw-r--r--app/views/kaminari/gitlab/_next_page.html.haml9
-rw-r--r--app/views/kaminari/gitlab/_page.html.haml10
-rw-r--r--app/views/kaminari/gitlab/_paginator.html.haml18
-rw-r--r--app/views/kaminari/gitlab/_prev_page.html.haml9
14 files changed, 72 insertions, 0 deletions
diff --git a/app/views/kaminari/_first_page.html.haml b/app/views/kaminari/admin/_first_page.html.haml
index fee8112f6af..fee8112f6af 100644
--- a/app/views/kaminari/_first_page.html.haml
+++ b/app/views/kaminari/admin/_first_page.html.haml
diff --git a/app/views/kaminari/_gap.html.haml b/app/views/kaminari/admin/_gap.html.haml
index f82f185ac35..f82f185ac35 100644
--- a/app/views/kaminari/_gap.html.haml
+++ b/app/views/kaminari/admin/_gap.html.haml
diff --git a/app/views/kaminari/_last_page.html.haml b/app/views/kaminari/admin/_last_page.html.haml
index 6e41d232b51..6e41d232b51 100644
--- a/app/views/kaminari/_last_page.html.haml
+++ b/app/views/kaminari/admin/_last_page.html.haml
diff --git a/app/views/kaminari/_next_page.html.haml b/app/views/kaminari/admin/_next_page.html.haml
index 76f40e72373..76f40e72373 100644
--- a/app/views/kaminari/_next_page.html.haml
+++ b/app/views/kaminari/admin/_next_page.html.haml
diff --git a/app/views/kaminari/_page.html.haml b/app/views/kaminari/admin/_page.html.haml
index 5966812934f..5966812934f 100644
--- a/app/views/kaminari/_page.html.haml
+++ b/app/views/kaminari/admin/_page.html.haml
diff --git a/app/views/kaminari/_paginator.html.haml b/app/views/kaminari/admin/_paginator.html.haml
index 6f9fb332261..6f9fb332261 100644
--- a/app/views/kaminari/_paginator.html.haml
+++ b/app/views/kaminari/admin/_paginator.html.haml
diff --git a/app/views/kaminari/_prev_page.html.haml b/app/views/kaminari/admin/_prev_page.html.haml
index cef885ee0af..cef885ee0af 100644
--- a/app/views/kaminari/_prev_page.html.haml
+++ b/app/views/kaminari/admin/_prev_page.html.haml
diff --git a/app/views/kaminari/gitlab/_first_page.html.haml b/app/views/kaminari/gitlab/_first_page.html.haml
new file mode 100644
index 00000000000..fee8112f6af
--- /dev/null
+++ b/app/views/kaminari/gitlab/_first_page.html.haml
@@ -0,0 +1,9 @@
+-# Link to the "First" page
+-# available local variables
+-# url: url to the first page
+-# current_page: a page object for the currently displayed page
+-# num_pages: total number of pages
+-# per_page: number of items to fetch per page
+-# remote: data-remote
+%span.first
+ = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote
diff --git a/app/views/kaminari/gitlab/_gap.html.haml b/app/views/kaminari/gitlab/_gap.html.haml
new file mode 100644
index 00000000000..f82f185ac35
--- /dev/null
+++ b/app/views/kaminari/gitlab/_gap.html.haml
@@ -0,0 +1,8 @@
+-# Non-link tag that stands for skipped pages...
+-# available local variables
+-# current_page: a page object for the currently displayed page
+-# num_pages: total number of pages
+-# per_page: number of items to fetch per page
+-# remote: data-remote
+%span.page.gap
+ = raw(t 'views.pagination.truncate')
diff --git a/app/views/kaminari/gitlab/_last_page.html.haml b/app/views/kaminari/gitlab/_last_page.html.haml
new file mode 100644
index 00000000000..6e41d232b51
--- /dev/null
+++ b/app/views/kaminari/gitlab/_last_page.html.haml
@@ -0,0 +1,9 @@
+-# Link to the "Last" page
+-# available local variables
+-# url: url to the last page
+-# current_page: a page object for the currently displayed page
+-# num_pages: total number of pages
+-# per_page: number of items to fetch per page
+-# remote: data-remote
+%span.last
+ = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote}
diff --git a/app/views/kaminari/gitlab/_next_page.html.haml b/app/views/kaminari/gitlab/_next_page.html.haml
new file mode 100644
index 00000000000..e87ab4e0534
--- /dev/null
+++ b/app/views/kaminari/gitlab/_next_page.html.haml
@@ -0,0 +1,9 @@
+-# Link to the "Next" page
+-# available local variables
+-# url: url to the next page
+-# current_page: a page object for the currently displayed page
+-# num_pages: total number of pages
+-# per_page: number of items to fetch per page
+-# remote: data-remote
+%span.next
+ = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote
diff --git a/app/views/kaminari/gitlab/_page.html.haml b/app/views/kaminari/gitlab/_page.html.haml
new file mode 100644
index 00000000000..528bba8f116
--- /dev/null
+++ b/app/views/kaminari/gitlab/_page.html.haml
@@ -0,0 +1,10 @@
+-# Link showing page number
+-# available local variables
+-# page: a page object for "this" page
+-# url: url to this page
+-# current_page: a page object for the currently displayed page
+-# num_pages: total number of pages
+-# per_page: number of items to fetch per page
+-# remote: data-remote
+%span{:class => "page#{' current' if page.current?}"}
+ = link_to_unless page.current?, page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil}
diff --git a/app/views/kaminari/gitlab/_paginator.html.haml b/app/views/kaminari/gitlab/_paginator.html.haml
new file mode 100644
index 00000000000..858fe9c5e33
--- /dev/null
+++ b/app/views/kaminari/gitlab/_paginator.html.haml
@@ -0,0 +1,18 @@
+-# The container tag
+-# available local variables
+-# current_page: a page object for the currently displayed page
+-# num_pages: total number of pages
+-# per_page: number of items to fetch per page
+-# remote: data-remote
+-# paginator: the paginator that renders the pagination tags inside
+= paginator.render do
+ %nav.gitlab_pagination
+ -#= first_page_tag unless current_page.first?
+ = prev_page_tag
+ - each_page do |page|
+ - if page.left_outer? || page.right_outer? || page.inside_window?
+ = page_tag page
+ - elsif !page.was_truncated?
+ = gap_tag
+ = next_page_tag
+ -#= last_page_tag unless current_page.last?
diff --git a/app/views/kaminari/gitlab/_prev_page.html.haml b/app/views/kaminari/gitlab/_prev_page.html.haml
new file mode 100644
index 00000000000..13f0d8adec5
--- /dev/null
+++ b/app/views/kaminari/gitlab/_prev_page.html.haml
@@ -0,0 +1,9 @@
+-# Link to the "Previous" page
+-# available local variables
+-# url: url to the previous page
+-# current_page: a page object for the currently displayed page
+-# num_pages: total number of pages
+-# per_page: number of items to fetch per page
+-# remote: data-remote
+%span.prev
+ = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote