e6ee8d0ebe
This groups milestones by title for issue views like it has been done for the milestone dashboard/project overview. Before milestones with the same title would show up multiple times in the filter dropdown and one could only filter per project and milestone. Now the milestone filter is based on the title of the milestone, i.e. all issues marked with the same milestone title are shown.
34 lines
899 B
Ruby
34 lines
899 B
Ruby
module MilestonesHelper
|
|
def milestones_filter_path(opts = {})
|
|
if @project
|
|
namespace_project_milestones_path(@project.namespace, @project, opts)
|
|
elsif @group
|
|
group_milestones_path(@group, opts)
|
|
else
|
|
dashboard_milestones_path(opts)
|
|
end
|
|
end
|
|
|
|
def milestone_progress_bar(milestone)
|
|
options = {
|
|
class: 'progress-bar progress-bar-success',
|
|
style: "width: #{milestone.percent_complete}%;"
|
|
}
|
|
|
|
content_tag :div, class: 'progress' do
|
|
content_tag :div, nil, options
|
|
end
|
|
end
|
|
|
|
def projects_milestones_options
|
|
milestones =
|
|
if @project
|
|
@project.milestones
|
|
else
|
|
Milestone.where(project_id: @projects)
|
|
end.active
|
|
|
|
grouped_milestones = Milestones::GroupService.new(milestones).execute
|
|
options_from_collection_for_select(grouped_milestones, 'title', 'title', params[:milestone_title])
|
|
end
|
|
end
|