Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandx <dmitriy.zaporozhets@gmail.com>2012-03-22 02:09:56 +0400
committerrandx <dmitriy.zaporozhets@gmail.com>2012-03-22 02:09:56 +0400
commit755a894c911d6eb5604b97bee758306c41cd8d4a (patch)
tree9010b581e346128b2cdacc08987b37136355b01b
parent1fefd7cbd3ef65d34c36f2b4dd8cedb29200c569 (diff)
Issues pagination
-rw-r--r--app/assets/stylesheets/common.scss31
-rw-r--r--app/controllers/issues_controller.rb2
-rw-r--r--app/views/admin/projects/index.html.haml2
-rw-r--r--app/views/admin/users/index.html.haml2
-rw-r--r--app/views/issues/_issues.html.haml2
-rw-r--r--app/views/issues/index.html.haml1
-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
20 files changed, 107 insertions, 5 deletions
diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss
index 723f85010c4..a729dfe09ec 100644
--- a/app/assets/stylesheets/common.scss
+++ b/app/assets/stylesheets/common.scss
@@ -461,8 +461,27 @@ img.lil_av {
border-top:none;
form {
- padding-top:16px;
+ padding:9px 0;
+ margin:0px;
}
+
+ .pills {
+ li {
+ padding:3px 0;
+ &.active a { background-color:$style_color; }
+ a {
+ border-radius:7px;
+ }
+ }
+ }
+ }
+
+ &.bottom {
+ padding: 0 10px;
+ background:#f5f5f5;
+ border-top: 1px solid #eee;
+ @include round-borders-bottom(4px);
+ border-bottom:none;
}
&.padded {
@@ -1008,3 +1027,13 @@ p.time {
.thin_area{
height: 150px;
}
+
+.gitlab_pagination {
+ span {
+ padding:0 10px;
+
+ a {
+ color:$link_color;
+ }
+ }
+}
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 53d8b74da8b..1fc59d989c9 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -28,7 +28,7 @@ class IssuesController < ApplicationController
when 2 then @project.issues.closed
when 3 then @project.issues.opened.assigned(current_user)
else @project.issues.opened
- end
+ end.page(params[:page]).per(10)
@issues = @issues.includes(:author, :project)
diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml
index 7cda5220d68..079ae385ccc 100644
--- a/app/views/admin/projects/index.html.haml
+++ b/app/views/admin/projects/index.html.haml
@@ -19,4 +19,4 @@
%td= last_commit(project)
%td= link_to 'Edit', edit_admin_project_path(project), :id => "edit_#{dom_id(project)}", :class => "btn small"
%td= link_to 'Destroy', [:admin, project], :confirm => 'Are you sure?', :method => :delete, :class => "btn small danger"
-= paginate @admin_projects
+= paginate @admin_projects, :theme => "admin"
diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml
index a0b4df1ff10..19eb64782ae 100644
--- a/app/views/admin/users/index.html.haml
+++ b/app/views/admin/users/index.html.haml
@@ -20,4 +20,4 @@
%td= link_to 'Edit', edit_admin_user_path(user), :id => "edit_#{dom_id(user)}", :class => "btn small"
%td= link_to 'Destroy', [:admin, user], :confirm => 'Are you sure?', :method => :delete, :class => "btn small danger"
-= paginate @admin_users
+= paginate @admin_users, :theme => "admin"
diff --git a/app/views/issues/_issues.html.haml b/app/views/issues/_issues.html.haml
index bf863a2dec1..f18cbe209a8 100644
--- a/app/views/issues/_issues.html.haml
+++ b/app/views/issues/_issues.html.haml
@@ -3,3 +3,5 @@
- @issues.non_critical.each do |issue|
= render(:partial => 'issues/show', :locals => {:issue => issue})
+
+%li= paginate @issues, :remote => true, :theme => "gitlab"
diff --git a/app/views/issues/index.html.haml b/app/views/issues/index.html.haml
index e55cae1fa94..283e936e38e 100644
--- a/app/views/issues/index.html.haml
+++ b/app/views/issues/index.html.haml
@@ -38,7 +38,6 @@
- if @issues.blank?
%li
%p.padded Nothing to show here
-
:javascript
var href = $('.issue_search').parent().attr('action');
var last_terms = '';
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