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
512cd023
Commit
512cd023
authored
Aug 06, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dashboard/Group issues and mr pages refactoring
parent
21c70354
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
66 additions
and
59 deletions
+66
-59
app/assets/stylesheets/gitlab_bootstrap/nav.scss
app/assets/stylesheets/gitlab_bootstrap/nav.scss
+7
-0
app/contexts/filter_context.rb
app/contexts/filter_context.rb
+1
-1
app/helpers/dashboard_helper.rb
app/helpers/dashboard_helper.rb
+4
-7
app/helpers/groups_helper.rb
app/helpers/groups_helper.rb
+0
-16
app/views/dashboard/issues.html.haml
app/views/dashboard/issues.html.haml
+2
-19
app/views/dashboard/merge_requests.html.haml
app/views/dashboard/merge_requests.html.haml
+1
-1
app/views/groups/issues.html.haml
app/views/groups/issues.html.haml
+2
-14
app/views/groups/merge_requests.html.haml
app/views/groups/merge_requests.html.haml
+1
-1
app/views/shared/_filter.html.haml
app/views/shared/_filter.html.haml
+29
-0
app/views/shared/_issues.html.haml
app/views/shared/_issues.html.haml
+19
-0
No files found.
app/assets/stylesheets/gitlab_bootstrap/nav.scss
View file @
512cd023
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
>
li
>
a
{
>
li
>
a
{
@include
border-radius
(
0
);
@include
border-radius
(
0
);
}
}
&
.nav-stacked
{
&
.nav-stacked
{
>
li
>
a
{
>
li
>
a
{
border-left
:
4px
solid
#EEE
;
border-left
:
4px
solid
#EEE
;
...
@@ -30,6 +31,12 @@
...
@@ -30,6 +31,12 @@
}
}
}
}
}
}
&
.nav-pills-small
{
>
li
>
a
{
padding
:
8px
12px
;
}
}
}
}
.nav-pills
>
.active
>
a
>
i
[
class
^=
"icon-"
]
{
background
:
inherit
;
}
.nav-pills
>
.active
>
a
>
i
[
class
^=
"icon-"
]
{
background
:
inherit
;
}
...
...
app/contexts/filter_context.rb
View file @
512cd023
...
@@ -11,7 +11,7 @@ class FilterContext
...
@@ -11,7 +11,7 @@ class FilterContext
end
end
def
apply_filter
items
def
apply_filter
items
if
params
[
:project_id
]
if
params
[
:project_id
]
.
present?
items
=
items
.
where
(
project_id:
params
[
:project_id
])
items
=
items
.
where
(
project_id:
params
[
:project_id
])
end
end
...
...
app/helpers/dashboard_helper.rb
View file @
512cd023
module
DashboardHelper
module
DashboardHelper
def
dashboard_
filter_path
(
entity
,
options
=
{})
def
filter_path
(
entity
,
options
=
{})
exist_opts
=
{
exist_opts
=
{
status:
params
[
:status
],
status:
params
[
:status
],
project_id:
params
[
:project_id
],
project_id:
params
[
:project_id
],
...
@@ -7,12 +7,9 @@ module DashboardHelper
...
@@ -7,12 +7,9 @@ module DashboardHelper
options
=
exist_opts
.
merge
(
options
)
options
=
exist_opts
.
merge
(
options
)
case
entity
path
=
request
.
path
when
'issue'
then
path
<<
"?
#{
options
.
to_param
}
"
issues_dashboard_path
(
options
)
path
when
'merge_request'
merge_requests_dashboard_path
(
options
)
end
end
end
def
entities_per_project
project
,
entity
def
entities_per_project
project
,
entity
...
...
app/helpers/groups_helper.rb
View file @
512cd023
module
GroupsHelper
module
GroupsHelper
def
group_filter_path
(
entity
,
options
=
{})
exist_opts
=
{
status:
params
[
:status
],
project_id:
params
[
:project_id
],
}
options
=
exist_opts
.
merge
(
options
)
case
entity
when
'issue'
then
issues_group_path
(
@group
,
options
)
when
'merge_request'
merge_requests_group_path
(
@group
,
options
)
end
end
def
remove_user_from_group_message
(
group
,
user
)
def
remove_user_from_group_message
(
group
,
user
)
"You are going to remove
#{
user
.
name
}
from
#{
group
.
name
}
Group. Are you sure?"
"You are going to remove
#{
user
.
name
}
from
#{
group
.
name
}
Group. Are you sure?"
end
end
...
...
app/views/dashboard/issues.html.haml
View file @
512cd023
...
@@ -8,23 +8,6 @@
...
@@ -8,23 +8,6 @@
.row
.row
.span3
.span3
=
render
'filter'
,
entity:
'issue'
=
render
'
shared/
filter'
,
entity:
'issue'
.span9
.span9
-
if
@issues
.
any?
=
render
'shared/issues'
-
@issues
.
group_by
(
&
:project
).
each
do
|
group
|
%div
.ui-box
-
project
=
group
[
0
]
.title
=
link_to_project
project
%i
.icon-angle-right
=
link_to
'issues'
,
project_issues_path
(
project
)
%ul
.well-list.issues-list
-
group
[
1
].
each
do
|
issue
|
=
render
'projects/issues/issue'
,
issue:
issue
%hr
=
paginate
@issues
,
theme:
"gitlab"
-
else
%p
.nothing_here_message
Nothing to show here
app/views/dashboard/merge_requests.html.haml
View file @
512cd023
...
@@ -8,6 +8,6 @@
...
@@ -8,6 +8,6 @@
%hr
%hr
.row
.row
.span3
.span3
=
render
'filter'
,
entity:
'merge_request'
=
render
'
shared/
filter'
,
entity:
'merge_request'
.span9
.span9
=
render
'shared/merge_requests'
=
render
'shared/merge_requests'
app/views/groups/issues.html.haml
View file @
512cd023
...
@@ -6,18 +6,6 @@
...
@@ -6,18 +6,6 @@
%hr
%hr
.row
.row
.span3
.span3
=
render
'filter'
,
entity:
'issue'
=
render
'
shared/
filter'
,
entity:
'issue'
.span9
.span9
-
if
@issues
.
any?
=
render
'shared/issues'
-
@issues
.
group_by
(
&
:project
).
each
do
|
group
|
%div
.ui-box
-
project
=
group
[
0
]
.title
=
link_to_project
project
%ul
.well-list.issues-list
-
group
[
1
].
each
do
|
issue
|
=
render
'projects/issues/issue'
,
issue:
issue
%hr
=
paginate
@issues
,
theme:
"gitlab"
-
else
%p
.nothing_here_message
Nothing to show here
app/views/groups/merge_requests.html.haml
View file @
512cd023
...
@@ -6,6 +6,6 @@
...
@@ -6,6 +6,6 @@
%hr
%hr
.row
.row
.span3
.span3
=
render
'filter'
,
entity:
'merge_request'
=
render
'
shared/
filter'
,
entity:
'merge_request'
.span9
.span9
=
render
'shared/merge_requests'
=
render
'shared/merge_requests'
app/views/
dashboar
d/_filter.html.haml
→
app/views/
share
d/_filter.html.haml
View file @
512cd023
=
form_tag
dashboard_
filter_path
(
entity
),
method:
'get'
do
=
form_tag
filter_path
(
entity
),
method:
'get'
do
%fieldset
%fieldset
%ul
.nav.nav-pills.nav-stacked
%ul
.nav.nav-pills.nav-stacked
%li
{
class:
(
"active"
if
!
params
[
:status
]
)}
%li
{
class:
(
"active"
if
params
[
:status
].
blank?
)}
=
link_to
dashboard_
filter_path
(
entity
,
status:
nil
)
do
=
link_to
filter_path
(
entity
,
status:
nil
)
do
Open
Open
%li
{
class:
(
"active"
if
params
[
:status
]
==
'closed'
)}
%li
{
class:
(
"active"
if
params
[
:status
]
==
'closed'
)}
=
link_to
dashboard_
filter_path
(
entity
,
status:
'closed'
)
do
=
link_to
filter_path
(
entity
,
status:
'closed'
)
do
Closed
Closed
%li
{
class:
(
"active"
if
params
[
:status
]
==
'all'
)}
%li
{
class:
(
"active"
if
params
[
:status
]
==
'all'
)}
=
link_to
dashboard_
filter_path
(
entity
,
status:
'all'
)
do
=
link_to
filter_path
(
entity
,
status:
'all'
)
do
All
All
%fieldset
%fieldset
%legend
Projects:
%legend
Projects:
%ul
.nav.nav-pills.nav-stacked
%ul
.nav.nav-pills.nav-
pills-small.nav-
stacked
-
@projects
.
each
do
|
project
|
-
@projects
.
each
do
|
project
|
-
unless
entities_per_project
(
project
,
entity
).
zero?
-
unless
entities_per_project
(
project
,
entity
).
zero?
%li
{
class:
(
"active"
if
params
[
:project_id
]
==
project
.
id
.
to_s
)}
%li
{
class:
(
"active"
if
params
[
:project_id
]
==
project
.
id
.
to_s
)}
=
link_to
dashboard_
filter_path
(
entity
,
project_id:
project
.
id
)
do
=
link_to
filter_path
(
entity
,
project_id:
project
.
id
)
do
=
project
.
name_with_namespace
=
project
.
name_with_namespace
%small
.pull-right
=
entities_per_project
(
project
,
entity
)
%small
.pull-right
=
entities_per_project
(
project
,
entity
)
%fieldset
%fieldset
%hr
-
if
params
[
:status
].
present?
||
params
[
:project_id
].
present?
=
link_to
"Reset"
,
dashboard_filter_path
(
entity
),
class:
'btn pull-right'
=
link_to
filter_path
(
entity
,
status:
nil
,
project_id:
nil
),
class:
'pull-right cgray'
do
%i
.icon-remove
Clear filter
app/views/shared/_issues.html.haml
0 → 100644
View file @
512cd023
-
if
@issues
.
any?
-
@issues
.
group_by
(
&
:project
).
each
do
|
group
|
%div
.ui-box
-
project
=
group
[
0
]
.title
=
link_to_project
project
%i
.icon-angle-right
=
link_to
'issues'
,
project_issues_path
(
project
)
%ul
.well-list.issues-list
-
group
[
1
].
each
do
|
issue
|
=
render
'projects/issues/issue'
,
issue:
issue
%hr
=
paginate
@issues
,
theme:
"gitlab"
-
else
%p
.nothing_here_message
Nothing to show here
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