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
Show 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
def
milestone_path
(
milestone
,
*
args
)
if
milestone
.
is_
group_milestone?
if
milestone
.
group_milestone?
group_milestone_path
(
milestone
.
group
,
milestone
,
*
args
)
elsif
milestone
.
project_milestone?
project_milestone_path
(
milestone
.
project
,
milestone
,
*
args
)
...
...
@@ -8,7 +8,7 @@ module MilestonesRoutingHelper
end
def
milestone_url
(
milestone
,
*
args
)
if
milestone
.
is_
group_milestone?
if
milestone
.
group_milestone?
group_milestone_url
(
milestone
.
group
,
milestone
,
*
args
)
elsif
milestone
.
project_milestone?
project_milestone_url
(
milestone
.
project
,
milestone
,
*
args
)
...
...
app/models/concerns/milestoneish.rb
View file @
fab7fdcf
...
...
@@ -70,7 +70,7 @@ module Milestoneish
due_date
&&
due_date
.
past?
end
def
is_
group_milestone?
def
group_milestone?
false
end
...
...
app/models/milestone.rb
View file @
fab7fdcf
...
...
@@ -163,7 +163,7 @@ class Milestone < ActiveRecord::Base
# Milestone.first.to_reference(same_namespace_project) # => "gitlab-ce%1"
#
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
)
reference
=
"
#{
self
.
class
.
reference_prefix
}#{
format_reference
}
"
...
...
@@ -207,7 +207,7 @@ class Milestone < ActiveRecord::Base
group
||
project
end
def
is_
group_milestone?
def
group_milestone?
group_id
.
present?
end
...
...
app/services/system_note_service.rb
View file @
fab7fdcf
...
...
@@ -142,7 +142,7 @@ module SystemNoteService
#
# Returns the created Note object
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
)
}
"
create_note
(
NoteSummary
.
new
(
noteable
,
project
,
author
,
body
,
action:
'milestone'
))
...
...
app/views/shared/milestones/_milestone.html.haml
View file @
fab7fdcf
...
...
@@ -5,7 +5,7 @@
.row
.col-sm-6
%strong
=
link_to
truncate
(
milestone
.
title
,
length:
100
),
milestone_path
-
if
milestone
.
is_
group_milestone?
-
if
milestone
.
group_milestone?
%span
- Group Milestone
-
else
%span
- Project Milestone
...
...
@@ -18,7 +18,7 @@
·
=
link_to
pluralize
(
milestone
.
merge_requests
.
size
,
'Merge Request'
),
merge_requests_path
.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
.col-sm-6
-
if
milestone
.
legacy_group_milestone?
...
...
@@ -31,7 +31,7 @@
-
if
@group
.col-sm-6.milestone-actions
-
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
Edit
\
...
...
app/views/shared/milestones/_top.html.haml
View file @
fab7fdcf
...
...
@@ -22,7 +22,7 @@
-
if
group
.pull-right
-
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
Edit
-
if
milestone
.
active?
...
...
@@ -33,7 +33,7 @@
.detail-page-description.milestone-detail
%h2
.title
=
markdown_field
(
milestone
,
:title
)
-
if
@milestone
.
is_
group_milestone?
&&
@milestone
.
description
.
present?
-
if
@milestone
.
group_milestone?
&&
@milestone
.
description
.
present?
%div
.description
.wiki
...
...
@@ -67,7 +67,7 @@
Open
%td
=
ms
.
expires_at
-
elsif
@milestone
.
is_
group_milestone?
-
elsif
@milestone
.
group_milestone?
%br
View
=
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