BigW Consortium Gitlab

Commit fab7fdcf by Maxim Rydkin

replace `is_group_milestone?` with `group_milestone?`

parent ac3e5a58
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)
......
......@@ -70,7 +70,7 @@ module Milestoneish
due_date && due_date.past?
end
def is_group_milestone?
def group_milestone?
false
end
......
......@@ -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
......
......@@ -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'))
......
......@@ -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 @@
&middot;
= 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
\
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment