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
Jérome Perrin
gitlab-ce
Commits
fab7fdcf
Commit
fab7fdcf
authored
Aug 24, 2017
by
Maxim Rydkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace `is_group_milestone?` with `group_milestone?`
parent
ac3e5a58
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
12 deletions
+12
-12
app/helpers/milestones_routing_helper.rb
app/helpers/milestones_routing_helper.rb
+2
-2
app/models/concerns/milestoneish.rb
app/models/concerns/milestoneish.rb
+1
-1
app/models/milestone.rb
app/models/milestone.rb
+2
-2
app/services/system_note_service.rb
app/services/system_note_service.rb
+1
-1
app/views/shared/milestones/_milestone.html.haml
app/views/shared/milestones/_milestone.html.haml
+3
-3
app/views/shared/milestones/_top.html.haml
app/views/shared/milestones/_top.html.haml
+3
-3
No files found.
app/helpers/milestones_routing_helper.rb
View file @
fab7fdcf
module
MilestonesRoutingHelper
module
MilestonesRoutingHelper
def
milestone_path
(
milestone
,
*
args
)
def
milestone_path
(
milestone
,
*
args
)
if
milestone
.
is_
group_milestone?
if
milestone
.
group_milestone?
group_milestone_path
(
milestone
.
group
,
milestone
,
*
args
)
group_milestone_path
(
milestone
.
group
,
milestone
,
*
args
)
elsif
milestone
.
project_milestone?
elsif
milestone
.
project_milestone?
project_milestone_path
(
milestone
.
project
,
milestone
,
*
args
)
project_milestone_path
(
milestone
.
project
,
milestone
,
*
args
)
...
@@ -8,7 +8,7 @@ module MilestonesRoutingHelper
...
@@ -8,7 +8,7 @@ module MilestonesRoutingHelper
end
end
def
milestone_url
(
milestone
,
*
args
)
def
milestone_url
(
milestone
,
*
args
)
if
milestone
.
is_
group_milestone?
if
milestone
.
group_milestone?
group_milestone_url
(
milestone
.
group
,
milestone
,
*
args
)
group_milestone_url
(
milestone
.
group
,
milestone
,
*
args
)
elsif
milestone
.
project_milestone?
elsif
milestone
.
project_milestone?
project_milestone_url
(
milestone
.
project
,
milestone
,
*
args
)
project_milestone_url
(
milestone
.
project
,
milestone
,
*
args
)
...
...
app/models/concerns/milestoneish.rb
View file @
fab7fdcf
...
@@ -70,7 +70,7 @@ module Milestoneish
...
@@ -70,7 +70,7 @@ module Milestoneish
due_date
&&
due_date
.
past?
due_date
&&
due_date
.
past?
end
end
def
is_
group_milestone?
def
group_milestone?
false
false
end
end
...
...
app/models/milestone.rb
View file @
fab7fdcf
...
@@ -163,7 +163,7 @@ class Milestone < ActiveRecord::Base
...
@@ -163,7 +163,7 @@ class Milestone < ActiveRecord::Base
# Milestone.first.to_reference(same_namespace_project) # => "gitlab-ce%1"
# Milestone.first.to_reference(same_namespace_project) # => "gitlab-ce%1"
#
#
def
to_reference
(
from_project
=
nil
,
format: :iid
,
full:
false
)
def
to_reference
(
from_project
=
nil
,
format: :iid
,
full:
false
)
return
if
is_
group_milestone?
&&
format
!=
:name
return
if
group_milestone?
&&
format
!=
:name
format_reference
=
milestone_format_reference
(
format
)
format_reference
=
milestone_format_reference
(
format
)
reference
=
"
#{
self
.
class
.
reference_prefix
}#{
format_reference
}
"
reference
=
"
#{
self
.
class
.
reference_prefix
}#{
format_reference
}
"
...
@@ -207,7 +207,7 @@ class Milestone < ActiveRecord::Base
...
@@ -207,7 +207,7 @@ class Milestone < ActiveRecord::Base
group
||
project
group
||
project
end
end
def
is_
group_milestone?
def
group_milestone?
group_id
.
present?
group_id
.
present?
end
end
...
...
app/services/system_note_service.rb
View file @
fab7fdcf
...
@@ -142,7 +142,7 @@ module SystemNoteService
...
@@ -142,7 +142,7 @@ module SystemNoteService
#
#
# Returns the created Note object
# Returns the created Note object
def
change_milestone
(
noteable
,
project
,
author
,
milestone
)
def
change_milestone
(
noteable
,
project
,
author
,
milestone
)
format
=
milestone
&
.
is_
group_milestone?
?
:name
:
:iid
format
=
milestone
&
.
group_milestone?
?
:name
:
:iid
body
=
milestone
.
nil?
?
'removed milestone'
:
"changed milestone to
#{
milestone
.
to_reference
(
project
,
format:
format
)
}
"
body
=
milestone
.
nil?
?
'removed milestone'
:
"changed milestone to
#{
milestone
.
to_reference
(
project
,
format:
format
)
}
"
create_note
(
NoteSummary
.
new
(
noteable
,
project
,
author
,
body
,
action:
'milestone'
))
create_note
(
NoteSummary
.
new
(
noteable
,
project
,
author
,
body
,
action:
'milestone'
))
...
...
app/views/shared/milestones/_milestone.html.haml
View file @
fab7fdcf
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
.row
.row
.col-sm-6
.col-sm-6
%strong
=
link_to
truncate
(
milestone
.
title
,
length:
100
),
milestone_path
%strong
=
link_to
truncate
(
milestone
.
title
,
length:
100
),
milestone_path
-
if
milestone
.
is_
group_milestone?
-
if
milestone
.
group_milestone?
%span
- Group Milestone
%span
- Group Milestone
-
else
-
else
%span
- Project Milestone
%span
- Project Milestone
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
·
·
=
link_to
pluralize
(
milestone
.
merge_requests
.
size
,
'Merge Request'
),
merge_requests_path
=
link_to
pluralize
(
milestone
.
merge_requests
.
size
,
'Merge Request'
),
merge_requests_path
.col-sm-6
=
milestone_progress_bar
(
milestone
)
.col-sm-6
=
milestone_progress_bar
(
milestone
)
-
if
milestone
.
is_a?
(
GlobalMilestone
)
||
milestone
.
is_
group_milestone?
-
if
milestone
.
is_a?
(
GlobalMilestone
)
||
milestone
.
group_milestone?
.row
.row
.col-sm-6
.col-sm-6
-
if
milestone
.
legacy_group_milestone?
-
if
milestone
.
legacy_group_milestone?
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
-
if
@group
-
if
@group
.col-sm-6.milestone-actions
.col-sm-6.milestone-actions
-
if
can?
(
current_user
,
:admin_milestones
,
@group
)
-
if
can?
(
current_user
,
:admin_milestones
,
@group
)
-
if
milestone
.
is_
group_milestone?
-
if
milestone
.
group_milestone?
=
link_to
edit_group_milestone_path
(
@group
,
milestone
),
class:
"btn btn-xs btn-grouped"
do
=
link_to
edit_group_milestone_path
(
@group
,
milestone
),
class:
"btn btn-xs btn-grouped"
do
Edit
Edit
\
\
...
...
app/views/shared/milestones/_top.html.haml
View file @
fab7fdcf
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
-
if
group
-
if
group
.pull-right
.pull-right
-
if
can?
(
current_user
,
:admin_milestones
,
group
)
-
if
can?
(
current_user
,
:admin_milestones
,
group
)
-
if
milestone
.
is_
group_milestone?
-
if
milestone
.
group_milestone?
=
link_to
edit_group_milestone_path
(
group
,
milestone
),
class:
"btn btn btn-grouped"
do
=
link_to
edit_group_milestone_path
(
group
,
milestone
),
class:
"btn btn btn-grouped"
do
Edit
Edit
-
if
milestone
.
active?
-
if
milestone
.
active?
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
.detail-page-description.milestone-detail
.detail-page-description.milestone-detail
%h2
.title
%h2
.title
=
markdown_field
(
milestone
,
:title
)
=
markdown_field
(
milestone
,
:title
)
-
if
@milestone
.
is_
group_milestone?
&&
@milestone
.
description
.
present?
-
if
@milestone
.
group_milestone?
&&
@milestone
.
description
.
present?
%div
%div
.description
.description
.wiki
.wiki
...
@@ -67,7 +67,7 @@
...
@@ -67,7 +67,7 @@
Open
Open
%td
%td
=
ms
.
expires_at
=
ms
.
expires_at
-
elsif
@milestone
.
is_
group_milestone?
-
elsif
@milestone
.
group_milestone?
%br
%br
View
View
=
link_to
'Issues'
,
issues_group_path
(
@group
,
milestone_title:
milestone
.
title
)
=
link_to
'Issues'
,
issues_group_path
(
@group
,
milestone_title:
milestone
.
title
)
...
...
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