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
2e839cee
Commit
2e839cee
authored
Jun 17, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed tests. Fixed overrided scope. Better usability for milestone view
parent
b1bdd829
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
68 additions
and
50 deletions
+68
-50
milestones.js.coffee
app/assets/javascripts/milestones.js.coffee
+0
-7
list_context.rb
app/contexts/issues/list_context.rb
+1
-1
issuable.rb
app/models/concerns/issuable.rb
+3
-1
issue.rb
app/models/issue.rb
+0
-2
_issues.html.haml
app/views/milestones/_issues.html.haml
+11
-11
_merge_request.html.haml
app/views/milestones/_merge_request.html.haml
+5
-0
show.html.haml
app/views/milestones/show.html.haml
+45
-25
project_milestones.rb
features/steps/project/project_milestones.rb
+1
-1
userteams.rb
features/steps/userteams/userteams.rb
+2
-2
No files found.
app/assets/javascripts/milestones.js.coffee
deleted
100644 → 0
View file @
b1bdd829
$
->
$
(
'.milestone-merge-requests-filter li[data-closed]'
).
addClass
(
'hide'
)
$
(
'.milestone-merge-requests-filter ul.nav li a'
).
click
->
$
(
'.milestone-merge-requests-filter li'
).
toggleClass
(
'active'
)
$
(
'.milestone-merge-requests-filter li[data-closed]'
).
toggleClass
(
'hide'
)
false
app/contexts/issues/list_context.rb
View file @
2e839cee
...
...
@@ -8,7 +8,7 @@ module Issues
@issues
=
case
params
[
:status
]
when
issues_filter
[
:all
]
then
@project
.
issues
when
issues_filter
[
:closed
]
then
@project
.
issues
.
closed
when
issues_filter
[
:to_me
]
then
@project
.
issues
.
assigned
(
current_user
)
when
issues_filter
[
:to_me
]
then
@project
.
issues
.
assigned
_to
(
current_user
)
when
issues_filter
[
:by_me
]
then
@project
.
issues
.
authored
(
current_user
)
else
@project
.
issues
.
opened
end
...
...
app/models/concerns/issuable.rb
View file @
2e839cee
...
...
@@ -22,8 +22,10 @@ module Issuable
scope
:closed
,
->
{
with_state
(
:closed
)
}
scope
:of_group
,
->
(
group
)
{
where
(
project_id:
group
.
project_ids
)
}
scope
:of_user_team
,
->
(
team
)
{
where
(
project_id:
team
.
project_ids
,
assignee_id:
team
.
member_ids
)
}
scope
:assigned
,
->
(
u
)
{
where
(
assignee_id:
u
.
id
)}
scope
:assigned
_to
,
->
(
u
)
{
where
(
assignee_id:
u
.
id
)}
scope
:recent
,
->
{
order
(
"created_at DESC"
)
}
scope
:assigned
,
->
{
where
(
"assignee_id IS NOT NULL"
)
}
scope
:unassigned
,
->
{
where
(
"assignee_id IS NULL"
)
}
delegate
:name
,
:email
,
...
...
app/models/issue.rb
View file @
2e839cee
...
...
@@ -28,8 +28,6 @@ class Issue < ActiveRecord::Base
scope
:cared
,
->
(
user
)
{
where
(
assignee_id:
user
)
}
scope
:authored
,
->
(
user
)
{
where
(
author_id:
user
)
}
scope
:open_for
,
->
(
user
)
{
opened
.
assigned
(
user
)
}
scope
:assigned
,
->
{
where
(
"assignee_id IS NOT NULL"
)
}
scope
:unassigned
,
->
{
where
(
"assignee_id IS NULL"
)
}
state_machine
:state
,
initial: :opened
do
event
:close
do
...
...
app/views/milestones/_issues.html.haml
View file @
2e839cee
.span6
.ui-box.milestone-issue-filter
%h5
.title
=
title
%ul
.well-list
-
issues
.
each
do
|
issue
|
%li
{
data:
{
closed:
issue
.
closed?
}}
=
link_to
[
@project
,
issue
]
do
%span
.badge.badge-info
##{issue.id}
–
=
link_to_gfm
truncate
(
issue
.
title
,
length:
60
),
[
@project
,
issue
]
\ No newline at end of file
.ui-box
%h5
.title
=
title
%ul
.well-list
-
issues
.
each
do
|
issue
|
%li
=
link_to
[
@project
,
issue
]
do
%span
.badge
{
class:
issue
.
closed?
?
'badge-important'
:
'badge-info'
}
##{issue.id}
=
link_to_gfm
truncate
(
issue
.
title
,
length:
60
),
[
@project
,
issue
]
-
if
issue
.
assignee
.pull-right
=
image_tag
gravatar_icon
(
issue
.
assignee
.
email
,
16
),
class:
"avatar s16"
app/views/milestones/_merge_request.html.haml
0 → 100644
View file @
2e839cee
%li
=
link_to
[
@project
,
merge_request
]
do
%span
.badge.badge-info
##{merge_request.id}
–
=
link_to_gfm
truncate
(
merge_request
.
title
,
length:
60
),
[
@project
,
merge_request
]
app/views/milestones/show.html.haml
View file @
2e839cee
...
...
@@ -55,32 +55,52 @@
=
markdown
@milestone
.
description
.row
=
render
(
partial:
'issues'
,
locals:
{
title:
'Unstarted Issues (open and unassigned)'
,
issues:
@issues
.
opened
.
unassigned
})
=
render
(
partial:
'issues'
,
locals:
{
title:
'Ongoing Issues (open and assigned)'
,
issues:
@issues
.
opened
.
assigned
})
%ul
.nav.nav-tabs
%li
.active
=
link_to
'#tab-issues'
,
'data-toggle'
=>
'tab'
do
Issues
%span
.badge
=
@issues
.
count
%li
=
link_to
'#tab-merge-requests'
,
'data-toggle'
=>
'tab'
do
Merge Requests
%span
.badge
=
@merge_requests
.
count
%li
=
link_to
'#tab-participants'
,
'data-toggle'
=>
'tab'
do
Participants
%span
.badge
=
@users
.
count
.row
.span6
.ui-box.milestone-merge-requests-filter
.title
%ul
.nav.nav-pills
%li
.active
=
link_to
(
'Open Merge Requests'
,
'#'
)
%li
=
link_to
(
'All Merge Requests'
,
'#'
)
%ul
.well-list
-
@merge_requests
.
each
do
|
merge_request
|
%li
{
data:
{
closed:
merge_request
.
closed?
||
merge_request
.
merged?
}}
=
link_to
[
@project
,
merge_request
]
do
%span
.badge.badge-info
##{merge_request.id}
–
=
link_to_gfm
truncate
(
merge_request
.
title
,
length:
60
),
[
@project
,
merge_request
]
=
render
(
:partial
=>
'issues'
,
locals:
{
title:
'Completed Issues (closed)'
,
issues:
@issues
.
closed
})
.tab-content
.tab-pane.active
#tab-issues
.row
.span4
=
render
(
'issues'
,
title:
'Unstarted Issues (open and unassigned)'
,
issues:
@issues
.
opened
.
unassigned
)
.span4
=
render
(
'issues'
,
title:
'Ongoing Issues (open and assigned)'
,
issues:
@issues
.
opened
.
assigned
)
.span4
=
render
(
'issues'
,
title:
'Completed Issues (closed)'
,
issues:
@issues
.
closed
)
%hr
%h6
Participants:
%div
-
@users
.
each
do
|
user
|
=
link_to_member
(
@project
,
user
)
.tab-pane
#tab-merge-requests
.row
.span6
.ui-box
%h5
.title
Open
%ul
.well-list
-
@merge_requests
.
opened
.
each
do
|
merge_request
|
=
render
'merge_request'
,
merge_request:
merge_request
.span6
.ui-box
%h5
.title
Closed
%ul
.well-list
-
@merge_requests
.
closed
.
each
do
|
merge_request
|
=
render
'merge_request'
,
merge_request:
merge_request
.clearfix
.tab-pane
#tab-participants
%ul
.bordered-list
-
@users
.
each
do
|
user
|
%li
=
link_to
user
,
title:
user
.
name
,
class:
"dark"
do
=
image_tag
gravatar_icon
(
user
.
email
,
32
),
class:
"avatar s32"
%strong
=
truncate
(
user
.
name
,
lenght:
40
)
%br
%small
.cgray
=
user
.
username
features/steps/project/project_milestones.rb
View file @
2e839cee
...
...
@@ -50,6 +50,6 @@ class ProjectMilestones < Spinach::FeatureSteps
end
Then
"I should see 3 issues"
do
page
.
should
have_selector
(
'
.milestone-issue-filter .well-list
li'
,
count:
4
)
page
.
should
have_selector
(
'
#tab-issues
li'
,
count:
4
)
end
end
features/steps/userteams/userteams.rb
View file @
2e839cee
...
...
@@ -93,7 +93,7 @@ class Userteams < Spinach::FeatureSteps
Then
'I should see issues from this team assigned to me'
do
team
=
UserTeam
.
last
team
.
projects
.
each
do
|
project
|
project
.
issues
.
assigned
(
current_user
).
each
do
|
issue
|
project
.
issues
.
assigned
_to
(
current_user
).
each
do
|
issue
|
page
.
should
have_content
issue
.
title
end
end
...
...
@@ -121,7 +121,7 @@ class Userteams < Spinach::FeatureSteps
team
=
UserTeam
.
last
team
.
projects
.
each
do
|
project
|
team
.
members
.
each
do
|
member
|
project
.
issues
.
assigned
(
member
).
each
do
|
issue
|
project
.
issues
.
assigned
_to
(
member
).
each
do
|
issue
|
page
.
should
have_content
issue
.
title
end
end
...
...
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