Commit 438d614b authored by Phil Hughes's avatar Phil Hughes

Removed label/milestone helper methods

parent 2e07ee7f
......@@ -23,8 +23,14 @@ module IssuablesHelper
def user_dropdown_label(user_id, default_label)
return "Unassigned" if user_id == "0"
user = @project.team.users.find_by(id: user_id) if @project
user = User.find_by_id(user_id) if !@project
if @project
member = @project.team.find_member(user_id)
if member
user = member.user
end
else
user = User.find(user_id)
end
if user
user.name
......@@ -33,22 +39,6 @@ module IssuablesHelper
end
end
def labels_dropdown_label(label_name)
if !label_name
"Label"
else
label_name
end
end
def milestone_dropdown_label(milestone_name)
if !milestone_name
"Milestone"
else
milestone_name
end
end
private
def sidebar_gutter_collapsed?
......
......@@ -21,7 +21,7 @@
.filter-item.inline.milestone-filter
- if params[:milestone_title]
= hidden_field_tag(:milestone_title, params[:milestone_title])
= dropdown_tag(milestone_dropdown_label(params[:milestone_title]), options: { title: "Filter by milestone", toggle_class: 'js-milestone-select js-filter-submit', filter: true, dropdown_class: "dropdown-menu-selectable",
= dropdown_tag(h(params[:milestone_name] || "Milestone"), options: { title: "Filter by milestone", toggle_class: 'js-milestone-select js-filter-submit', filter: true, dropdown_class: "dropdown-menu-selectable",
placeholder: "Search milestones", footer_content: true, data: { show_no: true, show_any: true, field_name: "milestone_title", selected: params[:milestone_title], project_id: (@project.id if @project), milestones: (namespace_project_milestones_path(@project.namespace, @project, :js) if @project) } }) do
- if @project
%ul.dropdown-footer-list
......@@ -42,7 +42,7 @@
.dropdown
%button.dropdown-menu-toggle.js-label-select.js-filter-submit{type: "button", data: {toggle: "dropdown", field_name: "label_name", show_no: "true", show_any: "true", selected: params[:label_name], project_id: (@project.id if @project), labels: (namespace_project_labels_path(@project.namespace, @project, :js) if @project)}}
%span.dropdown-toggle-text
= labels_dropdown_label(params[:label_name])
= h(params[:label_name] || "Label")
= icon('chevron-down')
.dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable
.dropdown-page-one
......
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