BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
fdfa79a7
Commit
fdfa79a7
authored
Mar 12, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'default-pagination' into 'master'
Use same constant for amount of items per page See merge request !1689
parents
2fe69158
f0cbbd70
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
29 additions
and
27 deletions
+29
-27
groups_controller.rb
app/controllers/admin/groups_controller.rb
+3
-3
projects_controller.rb
app/controllers/admin/projects_controller.rb
+3
-3
application_controller.rb
app/controllers/application_controller.rb
+2
-0
groups_controller.rb
app/controllers/dashboard/groups_controller.rb
+1
-1
milestones_controller.rb
app/controllers/dashboard/milestones_controller.rb
+1
-1
dashboard_controller.rb
app/controllers/dashboard_controller.rb
+2
-2
groups_controller.rb
app/controllers/explore/groups_controller.rb
+1
-1
projects_controller.rb
app/controllers/explore/projects_controller.rb
+3
-3
milestones_controller.rb
app/controllers/groups/milestones_controller.rb
+1
-1
groups_controller.rb
app/controllers/groups_controller.rb
+2
-2
profiles_controller.rb
app/controllers/profiles_controller.rb
+1
-1
branches_controller.rb
app/controllers/projects/branches_controller.rb
+1
-1
issues_controller.rb
app/controllers/projects/issues_controller.rb
+1
-1
labels_controller.rb
app/controllers/projects/labels_controller.rb
+1
-1
merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-1
milestones_controller.rb
app/controllers/projects/milestones_controller.rb
+1
-1
tags_controller.rb
app/controllers/projects/tags_controller.rb
+1
-1
wikis_controller.rb
app/controllers/projects/wikis_controller.rb
+1
-1
snippets_controller.rb
app/controllers/snippets_controller.rb
+2
-2
No files found.
app/controllers/admin/groups_controller.rb
View file @
fdfa79a7
...
...
@@ -5,12 +5,12 @@ class Admin::GroupsController < Admin::ApplicationController
@groups
=
Group
.
all
@groups
=
@groups
.
sort
(
@sort
=
params
[
:sort
])
@groups
=
@groups
.
search
(
params
[
:name
])
if
params
[
:name
].
present?
@groups
=
@groups
.
page
(
params
[
:page
]).
per
(
20
)
@groups
=
@groups
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
def
show
@members
=
@group
.
members
.
order
(
"access_level DESC"
).
page
(
params
[
:members_page
]).
per
(
30
)
@projects
=
@group
.
projects
.
page
(
params
[
:projects_page
]).
per
(
30
)
@members
=
@group
.
members
.
order
(
"access_level DESC"
).
page
(
params
[
:members_page
]).
per
(
PER_PAGE
)
@projects
=
@group
.
projects
.
page
(
params
[
:projects_page
]).
per
(
PER_PAGE
)
end
def
new
...
...
app/controllers/admin/projects_controller.rb
View file @
fdfa79a7
...
...
@@ -11,15 +11,15 @@ class Admin::ProjectsController < Admin::ApplicationController
@projects
=
@projects
.
abandoned
if
params
[
:abandoned
].
present?
@projects
=
@projects
.
search
(
params
[
:name
])
if
params
[
:name
].
present?
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
includes
(
:namespace
).
order
(
"namespaces.path, projects.name ASC"
).
page
(
params
[
:page
]).
per
(
20
)
@projects
=
@projects
.
includes
(
:namespace
).
order
(
"namespaces.path, projects.name ASC"
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
def
show
if
@group
@group_members
=
@group
.
members
.
order
(
"access_level DESC"
).
page
(
params
[
:group_members_page
]).
per
(
30
)
@group_members
=
@group
.
members
.
order
(
"access_level DESC"
).
page
(
params
[
:group_members_page
]).
per
(
PER_PAGE
)
end
@project_members
=
@project
.
project_members
.
page
(
params
[
:project_members_page
]).
per
(
30
)
@project_members
=
@project
.
project_members
.
page
(
params
[
:project_members_page
]).
per
(
PER_PAGE
)
end
def
transfer
...
...
app/controllers/application_controller.rb
View file @
fdfa79a7
...
...
@@ -4,6 +4,8 @@ class ApplicationController < ActionController::Base
include
Gitlab
::
CurrentSettings
include
GitlabRoutingHelper
PER_PAGE
=
20
before_filter
:authenticate_user_from_token!
before_filter
:authenticate_user!
before_filter
:reject_blocked!
...
...
app/controllers/dashboard/groups_controller.rb
View file @
fdfa79a7
class
Dashboard
::
GroupsController
<
ApplicationController
def
index
@user_groups
=
current_user
.
group_members
.
page
(
params
[
:page
]).
per
(
20
)
@user_groups
=
current_user
.
group_members
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
def
leave
...
...
app/controllers/dashboard/milestones_controller.rb
View file @
fdfa79a7
...
...
@@ -8,7 +8,7 @@ class Dashboard::MilestonesController < ApplicationController
else
state
(
'active'
)
end
@dashboard_milestones
=
Milestones
::
GroupService
.
new
(
project_milestones
).
execute
@dashboard_milestones
=
Kaminari
.
paginate_array
(
@dashboard_milestones
).
page
(
params
[
:page
]).
per
(
30
)
@dashboard_milestones
=
Kaminari
.
paginate_array
(
@dashboard_milestones
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
def
show
...
...
app/controllers/dashboard_controller.rb
View file @
fdfa79a7
...
...
@@ -25,13 +25,13 @@ class DashboardController < ApplicationController
def
merge_requests
@merge_requests
=
get_merge_requests_collection
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
]).
per
(
20
)
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@merge_requests
=
@merge_requests
.
preload
(
:author
,
:target_project
)
end
def
issues
@issues
=
get_issues_collection
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
20
)
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@issues
=
@issues
.
preload
(
:author
,
:project
)
respond_to
do
|
format
|
...
...
app/controllers/explore/groups_controller.rb
View file @
fdfa79a7
...
...
@@ -8,6 +8,6 @@ class Explore::GroupsController < ApplicationController
@groups
=
GroupsFinder
.
new
.
execute
(
current_user
)
@groups
=
@groups
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
@groups
=
@groups
.
sort
(
@sort
=
params
[
:sort
])
@groups
=
@groups
.
page
(
params
[
:page
]).
per
(
20
)
@groups
=
@groups
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
end
app/controllers/explore/projects_controller.rb
View file @
fdfa79a7
...
...
@@ -11,17 +11,17 @@ class Explore::ProjectsController < ApplicationController
@projects
=
@projects
.
where
(
visibility_level:
params
[
:visibility_level
])
if
params
[
:visibility_level
].
present?
@projects
=
@projects
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
includes
(
:namespace
).
page
(
params
[
:page
]).
per
(
20
)
@projects
=
@projects
.
includes
(
:namespace
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
def
trending
@trending_projects
=
TrendingProjectsFinder
.
new
.
execute
(
current_user
)
@trending_projects
=
@trending_projects
.
page
(
params
[
:page
]).
per
(
10
)
@trending_projects
=
@trending_projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
def
starred
@starred_projects
=
ProjectsFinder
.
new
.
execute
(
current_user
)
@starred_projects
=
@starred_projects
.
reorder
(
'star_count DESC'
)
@starred_projects
=
@starred_projects
.
page
(
params
[
:page
]).
per
(
10
)
@starred_projects
=
@starred_projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
end
app/controllers/groups/milestones_controller.rb
View file @
fdfa79a7
...
...
@@ -10,7 +10,7 @@ class Groups::MilestonesController < ApplicationController
else
state
(
'active'
)
end
@group_milestones
=
Milestones
::
GroupService
.
new
(
project_milestones
).
execute
@group_milestones
=
Kaminari
.
paginate_array
(
@group_milestones
).
page
(
params
[
:page
]).
per
(
30
)
@group_milestones
=
Kaminari
.
paginate_array
(
@group_milestones
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
def
show
...
...
app/controllers/groups_controller.rb
View file @
fdfa79a7
...
...
@@ -52,13 +52,13 @@ class GroupsController < Groups::ApplicationController
def
merge_requests
@merge_requests
=
get_merge_requests_collection
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
]).
per
(
20
)
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@merge_requests
=
@merge_requests
.
preload
(
:author
,
:target_project
)
end
def
issues
@issues
=
get_issues_collection
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
20
)
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@issues
=
@issues
.
preload
(
:author
,
:project
)
respond_to
do
|
format
|
...
...
app/controllers/profiles_controller.rb
View file @
fdfa79a7
...
...
@@ -43,7 +43,7 @@ class ProfilesController < ApplicationController
end
def
history
@events
=
current_user
.
recent_events
.
page
(
params
[
:page
]).
per
(
20
)
@events
=
current_user
.
recent_events
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
def
update_username
...
...
app/controllers/projects/branches_controller.rb
View file @
fdfa79a7
...
...
@@ -8,7 +8,7 @@ class Projects::BranchesController < Projects::ApplicationController
def
index
@sort
=
params
[
:sort
]
||
'name'
@branches
=
@repository
.
branches_sorted_by
(
@sort
)
@branches
=
Kaminari
.
paginate_array
(
@branches
).
page
(
params
[
:page
]).
per
(
30
)
@branches
=
Kaminari
.
paginate_array
(
@branches
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
def
recent
...
...
app/controllers/projects/issues_controller.rb
View file @
fdfa79a7
...
...
@@ -20,7 +20,7 @@ class Projects::IssuesController < Projects::ApplicationController
terms
=
params
[
'issue_search'
]
@issues
=
get_issues_collection
@issues
=
@issues
.
full_search
(
terms
)
if
terms
.
present?
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
20
)
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
respond_to
do
|
format
|
format
.
html
...
...
app/controllers/projects/labels_controller.rb
View file @
fdfa79a7
...
...
@@ -7,7 +7,7 @@ class Projects::LabelsController < Projects::ApplicationController
respond_to
:js
,
:html
def
index
@labels
=
@project
.
labels
.
page
(
params
[
:page
]).
per
(
20
)
@labels
=
@project
.
labels
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
def
new
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
fdfa79a7
...
...
@@ -18,7 +18,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
def
index
@merge_requests
=
get_merge_requests_collection
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
]).
per
(
20
)
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
def
show
...
...
app/controllers/projects/milestones_controller.rb
View file @
fdfa79a7
...
...
@@ -18,7 +18,7 @@ class Projects::MilestonesController < Projects::ApplicationController
end
@milestones
=
@milestones
.
includes
(
:project
)
@milestones
=
@milestones
.
page
(
params
[
:page
]).
per
(
20
)
@milestones
=
@milestones
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
def
new
...
...
app/controllers/projects/tags_controller.rb
View file @
fdfa79a7
...
...
@@ -7,7 +7,7 @@ class Projects::TagsController < Projects::ApplicationController
def
index
sorted
=
VersionSorter
.
rsort
(
@repository
.
tag_names
)
@tags
=
Kaminari
.
paginate_array
(
sorted
).
page
(
params
[
:page
]).
per
(
30
)
@tags
=
Kaminari
.
paginate_array
(
sorted
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
def
create
...
...
app/controllers/projects/wikis_controller.rb
View file @
fdfa79a7
...
...
@@ -7,7 +7,7 @@ class Projects::WikisController < Projects::ApplicationController
before_filter
:load_project_wiki
def
pages
@wiki_pages
=
Kaminari
.
paginate_array
(
@project_wiki
.
pages
).
page
(
params
[
:page
]).
per
(
30
)
@wiki_pages
=
Kaminari
.
paginate_array
(
@project_wiki
.
pages
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
def
show
...
...
app/controllers/snippets_controller.rb
View file @
fdfa79a7
...
...
@@ -16,7 +16,7 @@ class SnippetsController < ApplicationController
layout
:determine_layout
def
index
@snippets
=
SnippetsFinder
.
new
.
execute
(
current_user
,
filter: :all
).
page
(
params
[
:page
]).
per
(
20
)
@snippets
=
SnippetsFinder
.
new
.
execute
(
current_user
,
filter: :all
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
def
user_index
...
...
@@ -28,7 +28,7 @@ class SnippetsController < ApplicationController
filter: :by_user
,
user:
@user
,
scope:
params
[
:scope
]
}).
page
(
params
[
:page
]).
per
(
20
)
page
(
params
[
:page
]).
per
(
PER_PAGE
)
if
@user
==
current_user
render
'current_user_index'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment