Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
085538c2
Commit
085538c2
authored
Mar 19, 2016
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the configured Kaminari "per page" default
parent
3f22a92f
Changes
28
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
34 additions
and
37 deletions
+34
-37
app/controllers/admin/groups_controller.rb
app/controllers/admin/groups_controller.rb
+3
-3
app/controllers/admin/labels_controller.rb
app/controllers/admin/labels_controller.rb
+1
-1
app/controllers/admin/projects_controller.rb
app/controllers/admin/projects_controller.rb
+3
-3
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+0
-2
app/controllers/autocomplete_controller.rb
app/controllers/autocomplete_controller.rb
+1
-1
app/controllers/concerns/global_milestones.rb
app/controllers/concerns/global_milestones.rb
+1
-1
app/controllers/concerns/issues_action.rb
app/controllers/concerns/issues_action.rb
+1
-1
app/controllers/concerns/merge_requests_action.rb
app/controllers/concerns/merge_requests_action.rb
+1
-1
app/controllers/dashboard/groups_controller.rb
app/controllers/dashboard/groups_controller.rb
+1
-1
app/controllers/dashboard/projects_controller.rb
app/controllers/dashboard/projects_controller.rb
+2
-2
app/controllers/dashboard/snippets_controller.rb
app/controllers/dashboard/snippets_controller.rb
+1
-1
app/controllers/dashboard/todos_controller.rb
app/controllers/dashboard/todos_controller.rb
+1
-1
app/controllers/explore/groups_controller.rb
app/controllers/explore/groups_controller.rb
+1
-1
app/controllers/explore/projects_controller.rb
app/controllers/explore/projects_controller.rb
+3
-3
app/controllers/explore/snippets_controller.rb
app/controllers/explore/snippets_controller.rb
+1
-1
app/controllers/groups_controller.rb
app/controllers/groups_controller.rb
+1
-1
app/controllers/profiles_controller.rb
app/controllers/profiles_controller.rb
+1
-2
app/controllers/projects/branches_controller.rb
app/controllers/projects/branches_controller.rb
+1
-1
app/controllers/projects/forks_controller.rb
app/controllers/projects/forks_controller.rb
+1
-1
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+1
-1
app/controllers/projects/labels_controller.rb
app/controllers/projects/labels_controller.rb
+1
-1
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-1
app/controllers/projects/milestones_controller.rb
app/controllers/projects/milestones_controller.rb
+1
-1
app/controllers/projects/snippets_controller.rb
app/controllers/projects/snippets_controller.rb
+1
-1
app/controllers/projects/tags_controller.rb
app/controllers/projects/tags_controller.rb
+1
-1
app/controllers/projects/wikis_controller.rb
app/controllers/projects/wikis_controller.rb
+1
-1
app/controllers/snippets_controller.rb
app/controllers/snippets_controller.rb
+1
-1
app/controllers/users_controller.rb
app/controllers/users_controller.rb
+1
-1
No files found.
app/controllers/admin/groups_controller.rb
View file @
085538c2
...
...
@@ -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
(
PER_PAGE
)
@groups
=
@groups
.
page
(
params
[
:page
])
end
def
show
@members
=
@group
.
members
.
order
(
"access_level DESC"
).
page
(
params
[
:members_page
])
.
per
(
PER_PAGE
)
@projects
=
@group
.
projects
.
page
(
params
[
:projects_page
])
.
per
(
PER_PAGE
)
@members
=
@group
.
members
.
order
(
"access_level DESC"
).
page
(
params
[
:members_page
])
@projects
=
@group
.
projects
.
page
(
params
[
:projects_page
])
end
def
new
...
...
app/controllers/admin/labels_controller.rb
View file @
085538c2
...
...
@@ -2,7 +2,7 @@ class Admin::LabelsController < Admin::ApplicationController
before_action
:set_label
,
only:
[
:show
,
:edit
,
:update
,
:destroy
]
def
index
@labels
=
Label
.
templates
.
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
@labels
=
Label
.
templates
.
page
(
params
[
:page
])
end
def
show
...
...
app/controllers/admin/projects_controller.rb
View file @
085538c2
...
...
@@ -12,15 +12,15 @@ class Admin::ProjectsController < Admin::ApplicationController
@projects
=
@projects
.
non_archived
unless
params
[
:with_archived
].
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
(
PER_PAGE
)
@projects
=
@projects
.
includes
(
:namespace
).
order
(
"namespaces.path, projects.name ASC"
).
page
(
params
[
:page
])
end
def
show
if
@group
@group_members
=
@group
.
members
.
order
(
"access_level DESC"
).
page
(
params
[
:group_members_page
])
.
per
(
PER_PAGE
)
@group_members
=
@group
.
members
.
order
(
"access_level DESC"
).
page
(
params
[
:group_members_page
])
end
@project_members
=
@project
.
project_members
.
page
(
params
[
:project_members_page
])
.
per
(
PER_PAGE
)
@project_members
=
@project
.
project_members
.
page
(
params
[
:project_members_page
])
end
def
transfer
...
...
app/controllers/application_controller.rb
View file @
085538c2
...
...
@@ -6,8 +6,6 @@ class ApplicationController < ActionController::Base
include
GitlabRoutingHelper
include
PageLayoutHelper
PER_PAGE
=
20
before_action
:authenticate_user_from_token!
before_action
:authenticate_user!
before_action
:validate_user_service_ticket!
...
...
app/controllers/autocomplete_controller.rb
View file @
085538c2
...
...
@@ -7,7 +7,7 @@ class AutocompleteController < ApplicationController
@users
=
@users
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
@users
=
@users
.
active
@users
=
@users
.
reorder
(
:name
)
@users
=
@users
.
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
@users
=
@users
.
page
(
params
[
:page
])
if
params
[
:search
].
blank?
# Include current user if available to filter by "Me"
...
...
app/controllers/concerns/global_milestones.rb
View file @
085538c2
...
...
@@ -6,7 +6,7 @@ module GlobalMilestones
@milestones
=
MilestonesFinder
.
new
.
execute
(
@projects
,
params
)
@milestones
=
GlobalMilestone
.
build_collection
(
@milestones
)
@milestones
=
@milestones
.
sort_by
{
|
x
|
x
.
due_date
.
nil?
?
epoch
:
x
.
due_date
}
@milestones
=
Kaminari
.
paginate_array
(
@milestones
).
page
(
params
[
:page
])
.
per
(
ApplicationController
::
PER_PAGE
)
@milestones
=
Kaminari
.
paginate_array
(
@milestones
).
page
(
params
[
:page
])
end
def
milestone
...
...
app/controllers/concerns/issues_action.rb
View file @
085538c2
...
...
@@ -3,7 +3,7 @@ module IssuesAction
def
issues
@issues
=
get_issues_collection
.
non_archived
@issues
=
@issues
.
page
(
params
[
:page
])
.
per
(
ApplicationController
::
PER_PAGE
)
@issues
=
@issues
.
page
(
params
[
:page
])
@issues
=
@issues
.
preload
(
:author
,
:project
)
@label
=
@issuable_finder
.
labels
.
first
...
...
app/controllers/concerns/merge_requests_action.rb
View file @
085538c2
...
...
@@ -3,7 +3,7 @@ module MergeRequestsAction
def
merge_requests
@merge_requests
=
get_merge_requests_collection
.
non_archived
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
])
.
per
(
ApplicationController
::
PER_PAGE
)
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
])
@merge_requests
=
@merge_requests
.
preload
(
:author
,
:target_project
)
@label
=
@issuable_finder
.
labels
.
first
...
...
app/controllers/dashboard/groups_controller.rb
View file @
085538c2
class
Dashboard::GroupsController
<
Dashboard
::
ApplicationController
def
index
@group_members
=
current_user
.
group_members
.
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
@group_members
=
current_user
.
group_members
.
page
(
params
[
:page
])
end
end
app/controllers/dashboard/projects_controller.rb
View file @
085538c2
...
...
@@ -8,7 +8,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
@projects
=
filter_projects
(
@projects
)
@projects
=
@projects
.
includes
(
:namespace
)
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
@projects
=
@projects
.
page
(
params
[
:page
])
@last_push
=
current_user
.
recent_push
...
...
@@ -32,7 +32,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
@projects
=
filter_projects
(
@projects
)
@projects
=
@projects
.
includes
(
:namespace
,
:forked_from_project
,
:tags
)
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
@projects
=
@projects
.
page
(
params
[
:page
])
@last_push
=
current_user
.
recent_push
@groups
=
[]
...
...
app/controllers/dashboard/snippets_controller.rb
View file @
085538c2
...
...
@@ -6,6 +6,6 @@ class Dashboard::SnippetsController < Dashboard::ApplicationController
user:
current_user
,
scope:
params
[
:scope
]
)
@snippets
=
@snippets
.
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
@snippets
=
@snippets
.
page
(
params
[
:page
])
end
end
app/controllers/dashboard/todos_controller.rb
View file @
085538c2
...
...
@@ -2,7 +2,7 @@ class Dashboard::TodosController < Dashboard::ApplicationController
before_action
:find_todos
,
only:
[
:index
,
:destroy
,
:destroy_all
]
def
index
@todos
=
@todos
.
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
@todos
=
@todos
.
page
(
params
[
:page
])
end
def
destroy
...
...
app/controllers/explore/groups_controller.rb
View file @
085538c2
...
...
@@ -3,6 +3,6 @@ class Explore::GroupsController < Explore::ApplicationController
@groups
=
Group
.
order_id_desc
@groups
=
@groups
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
@groups
=
@groups
.
sort
(
@sort
=
params
[
:sort
])
@groups
=
@groups
.
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
@groups
=
@groups
.
page
(
params
[
:page
])
end
end
app/controllers/explore/projects_controller.rb
View file @
085538c2
...
...
@@ -8,7 +8,7 @@ class Explore::ProjectsController < Explore::ApplicationController
@projects
=
@projects
.
where
(
visibility_level:
params
[
:visibility_level
])
if
params
[
:visibility_level
].
present?
@projects
=
filter_projects
(
@projects
)
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
includes
(
:namespace
).
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
@projects
=
@projects
.
includes
(
:namespace
).
page
(
params
[
:page
])
respond_to
do
|
format
|
format
.
html
...
...
@@ -23,7 +23,7 @@ class Explore::ProjectsController < Explore::ApplicationController
def
trending
@projects
=
TrendingProjectsFinder
.
new
.
execute
(
current_user
)
@projects
=
filter_projects
(
@projects
)
@projects
=
@projects
.
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
@projects
=
@projects
.
page
(
params
[
:page
])
respond_to
do
|
format
|
format
.
html
...
...
@@ -39,7 +39,7 @@ class Explore::ProjectsController < Explore::ApplicationController
@projects
=
ProjectsFinder
.
new
.
execute
(
current_user
)
@projects
=
filter_projects
(
@projects
)
@projects
=
@projects
.
reorder
(
'star_count DESC'
)
@projects
=
@projects
.
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
@projects
=
@projects
.
page
(
params
[
:page
])
respond_to
do
|
format
|
format
.
html
...
...
app/controllers/explore/snippets_controller.rb
View file @
085538c2
class
Explore::SnippetsController
<
Explore
::
ApplicationController
def
index
@snippets
=
SnippetsFinder
.
new
.
execute
(
current_user
,
filter: :all
)
@snippets
=
@snippets
.
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
@snippets
=
@snippets
.
page
(
params
[
:page
])
end
end
app/controllers/groups_controller.rb
View file @
085538c2
...
...
@@ -44,7 +44,7 @@ class GroupsController < Groups::ApplicationController
@projects
=
@projects
.
includes
(
:namespace
)
@projects
=
filter_projects
(
@projects
)
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
if
params
[
:filter_projects
].
blank?
@projects
=
@projects
.
page
(
params
[
:page
])
if
params
[
:filter_projects
].
blank?
@shared_projects
=
@group
.
shared_projects
...
...
app/controllers/profiles_controller.rb
View file @
085538c2
...
...
@@ -34,8 +34,7 @@ class ProfilesController < Profiles::ApplicationController
def
audit_log
@events
=
AuditEvent
.
where
(
entity_type:
"User"
,
entity_id:
current_user
.
id
).
order
(
"created_at DESC"
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
page
(
params
[
:page
])
end
def
update_username
...
...
app/controllers/projects/branches_controller.rb
View file @
085538c2
...
...
@@ -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
(
PER_PAGE
)
@branches
=
Kaminari
.
paginate_array
(
@branches
).
page
(
params
[
:page
])
@max_commits
=
@branches
.
reduce
(
0
)
do
|
memo
,
branch
|
diverging_commit_counts
=
repository
.
diverging_commit_counts
(
branch
)
...
...
app/controllers/projects/forks_controller.rb
View file @
085538c2
...
...
@@ -15,7 +15,7 @@ class Projects::ForksController < Projects::ApplicationController
@sort
=
params
[
:sort
]
||
'id_desc'
@forks
=
@forks
.
search
(
params
[
:filter_projects
])
if
params
[
:filter_projects
].
present?
@forks
=
@forks
.
order_by
(
@sort
).
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
@forks
=
@forks
.
order_by
(
@sort
).
page
(
params
[
:page
])
respond_to
do
|
format
|
format
.
html
...
...
app/controllers/projects/issues_controller.rb
View file @
085538c2
...
...
@@ -33,7 +33,7 @@ class Projects::IssuesController < Projects::ApplicationController
end
end
@issues
=
@issues
.
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
@issues
=
@issues
.
page
(
params
[
:page
])
@label
=
@project
.
labels
.
find_by
(
title:
params
[
:label_name
])
respond_to
do
|
format
|
...
...
app/controllers/projects/labels_controller.rb
View file @
085538c2
...
...
@@ -11,7 +11,7 @@ class Projects::LabelsController < Projects::ApplicationController
respond_to
:js
,
:html
def
index
@labels
=
@project
.
labels
.
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
@labels
=
@project
.
labels
.
page
(
params
[
:page
])
respond_to
do
|
format
|
format
.
html
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
085538c2
...
...
@@ -34,7 +34,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
end
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
])
@merge_requests
=
@merge_requests
.
preload
(
:target_project
)
@label
=
@project
.
labels
.
find_by
(
title:
params
[
:label_name
])
...
...
app/controllers/projects/milestones_controller.rb
View file @
085538c2
...
...
@@ -22,7 +22,7 @@ class Projects::MilestonesController < Projects::ApplicationController
respond_to
do
|
format
|
format
.
html
do
@milestones
=
@milestones
.
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
@milestones
=
@milestones
.
page
(
params
[
:page
])
end
format
.
json
do
render
json:
@milestones
...
...
app/controllers/projects/snippets_controller.rb
View file @
085538c2
...
...
@@ -21,7 +21,7 @@ class Projects::SnippetsController < Projects::ApplicationController
filter: :by_project
,
project:
@project
})
@snippets
=
@snippets
.
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
@snippets
=
@snippets
.
page
(
params
[
:page
])
end
def
new
...
...
app/controllers/projects/tags_controller.rb
View file @
085538c2
...
...
@@ -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
(
PER_PAGE
)
@tags
=
Kaminari
.
paginate_array
(
sorted
).
page
(
params
[
:page
])
@releases
=
project
.
releases
.
where
(
tag:
@tags
)
end
...
...
app/controllers/projects/wikis_controller.rb
View file @
085538c2
...
...
@@ -7,7 +7,7 @@ class Projects::WikisController < Projects::ApplicationController
before_action
:load_project_wiki
def
pages
@wiki_pages
=
Kaminari
.
paginate_array
(
@project_wiki
.
pages
).
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
@wiki_pages
=
Kaminari
.
paginate_array
(
@project_wiki
.
pages
).
page
(
params
[
:page
])
end
def
show
...
...
app/controllers/snippets_controller.rb
View file @
085538c2
...
...
@@ -25,7 +25,7 @@ class SnippetsController < ApplicationController
filter: :by_user
,
user:
@user
,
scope:
params
[
:scope
]
}).
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
page
(
params
[
:page
])
render
'index'
else
...
...
app/controllers/users_controller.rb
View file @
085538c2
...
...
@@ -100,7 +100,7 @@ class UsersController < ApplicationController
def
load_projects
@projects
=
PersonalProjectsFinder
.
new
(
@user
).
execute
(
current_user
)
.
page
(
params
[
:page
])
.
per
(
PER_PAGE
)
.
page
(
params
[
:page
])
end
def
load_contributed_projects
...
...
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