gitlab-org--gitlab-foss/app/helpers/milestones_helper.rb
Stan Hu b60bc655f2 Restore placeholders in issue filters from "Any" to "Milestone" and "Label"
1f11096c included new filters but made it hard to determine which dropdown did
what. This patch restores the original placeholders.
2015-10-08 23:53:32 -07:00

37 lines
994 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
grouped_milestones.unshift(Milestone::None)
grouped_milestones.unshift(Milestone::Any)
options_from_collection_for_select(grouped_milestones, 'name', 'title', params[:milestone_title])
end
end