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
Léo-Paul Géneau
gitlab-ce
Commits
52d8ed9e
Commit
52d8ed9e
authored
Mar 22, 2012
by
randx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pagination for Merge Requests. Fixed for issues
parent
755a894c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
17 deletions
+24
-17
app/assets/stylesheets/common.scss
app/assets/stylesheets/common.scss
+7
-8
app/controllers/issues_controller.rb
app/controllers/issues_controller.rb
+2
-2
app/controllers/merge_requests_controller.rb
app/controllers/merge_requests_controller.rb
+1
-1
app/views/issues/_issues.html.haml
app/views/issues/_issues.html.haml
+8
-3
app/views/kaminari/gitlab/_paginator.html.haml
app/views/kaminari/gitlab/_paginator.html.haml
+0
-2
app/views/merge_requests/index.html.haml
app/views/merge_requests/index.html.haml
+6
-1
No files found.
app/assets/stylesheets/common.scss
View file @
52d8ed9e
...
@@ -476,8 +476,7 @@ img.lil_av {
...
@@ -476,8 +476,7 @@ img.lil_av {
}
}
}
}
&
.bottom
{
.bottom
{
padding
:
0
10px
;
background
:
#f5f5f5
;
background
:
#f5f5f5
;
border-top
:
1px
solid
#eee
;
border-top
:
1px
solid
#eee
;
@include
round-borders-bottom
(
4px
);
@include
round-borders-bottom
(
4px
);
...
@@ -1029,11 +1028,11 @@ p.time {
...
@@ -1029,11 +1028,11 @@ p.time {
}
}
.gitlab_pagination
{
.gitlab_pagination
{
span
{
span
a
{
color
:
$link_color
;
}
padding
:
0
10px
;
.prev
,
.next
,
.current
,
.page
a
{
padding
:
10px
;
a
{
}
color
:
$link_color
;
.current
{
}
border-bottom
:
2px
solid
$style_color
;
}
}
}
}
app/controllers/issues_controller.rb
View file @
52d8ed9e
...
@@ -28,9 +28,9 @@ class IssuesController < ApplicationController
...
@@ -28,9 +28,9 @@ class IssuesController < ApplicationController
when
2
then
@project
.
issues
.
closed
when
2
then
@project
.
issues
.
closed
when
3
then
@project
.
issues
.
opened
.
assigned
(
current_user
)
when
3
then
@project
.
issues
.
opened
.
assigned
(
current_user
)
else
@project
.
issues
.
opened
else
@project
.
issues
.
opened
end
.
page
(
params
[
:page
]).
per
(
1
0
)
end
.
page
(
params
[
:page
]).
per
(
2
0
)
@issues
=
@issues
.
includes
(
:author
,
:project
)
@issues
=
@issues
.
includes
(
:author
,
:project
)
.
order
(
"critical, updated_at"
)
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
# index.html.erb
format
.
html
# index.html.erb
...
...
app/controllers/merge_requests_controller.rb
View file @
52d8ed9e
...
@@ -28,7 +28,7 @@ class MergeRequestsController < ApplicationController
...
@@ -28,7 +28,7 @@ class MergeRequestsController < ApplicationController
when
2
then
@merge_requests
.
closed
when
2
then
@merge_requests
.
closed
when
3
then
@merge_requests
.
opened
.
assigned
(
current_user
)
when
3
then
@merge_requests
.
opened
.
assigned
(
current_user
)
else
@merge_requests
.
opened
else
@merge_requests
.
opened
end
end
.
page
(
params
[
:page
]).
per
(
20
)
@merge_requests
=
@merge_requests
.
includes
(
:author
,
:project
).
order
(
"created_at desc"
)
@merge_requests
=
@merge_requests
.
includes
(
:author
,
:project
).
order
(
"created_at desc"
)
end
end
...
...
app/views/issues/_issues.html.haml
View file @
52d8ed9e
-
@issues
.
critical
.
each
do
|
issue
|
-
@issues
.
select
(
&
:critical
)
.
each
do
|
issue
|
=
render
(
:partial
=>
'issues/show'
,
:locals
=>
{
:issue
=>
issue
})
=
render
(
:partial
=>
'issues/show'
,
:locals
=>
{
:issue
=>
issue
})
-
@issues
.
non_critical
.
each
do
|
issue
|
-
@issues
.
reject
(
&
:critical
)
.
each
do
|
issue
|
=
render
(
:partial
=>
'issues/show'
,
:locals
=>
{
:issue
=>
issue
})
=
render
(
:partial
=>
'issues/show'
,
:locals
=>
{
:issue
=>
issue
})
%li
=
paginate
@issues
,
:remote
=>
true
,
:theme
=>
"gitlab"
-
if
@issues
.
present?
%li
.bottom
.row
.span10
=
paginate
@issues
,
:remote
=>
true
,
:theme
=>
"gitlab"
.span4.right
%span
.cgray.right
#{
@issues
.
total_count
}
issues for this filter
app/views/kaminari/gitlab/_paginator.html.haml
View file @
52d8ed9e
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
-# paginator: the paginator that renders the pagination tags inside
-# paginator: the paginator that renders the pagination tags inside
=
paginator
.
render
do
=
paginator
.
render
do
%nav
.gitlab_pagination
%nav
.gitlab_pagination
-#= first_page_tag unless current_page.first?
=
prev_page_tag
=
prev_page_tag
-
each_page
do
|
page
|
-
each_page
do
|
page
|
-
if
page
.
left_outer?
||
page
.
right_outer?
||
page
.
inside_window?
-
if
page
.
left_outer?
||
page
.
right_outer?
||
page
.
inside_window?
...
@@ -15,4 +14,3 @@
...
@@ -15,4 +14,3 @@
-
elsif
!
page
.
was_truncated?
-
elsif
!
page
.
was_truncated?
=
gap_tag
=
gap_tag
=
next_page_tag
=
next_page_tag
-#= last_page_tag unless current_page.last?
app/views/merge_requests/index.html.haml
View file @
52d8ed9e
...
@@ -27,5 +27,10 @@
...
@@ -27,5 +27,10 @@
-
if
@merge_requests
.
blank?
-
if
@merge_requests
.
blank?
%li
%li
%p
.padded
Nothing to show here
%p
.padded
Nothing to show here
-
if
@merge_requests
.
present?
%li
.bottom
.row
.span10
=
paginate
@merge_requests
,
:theme
=>
"gitlab"
.span4.right
%span
.cgray.right
#{
@merge_requests
.
total_count
}
merge requests for this filter
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