2016-07-20 06:20:33 -04:00
|
|
|
- project = @target_project || @project
|
2016-07-16 04:32:08 -04:00
|
|
|
- extra_class = extra_class || ''
|
2016-10-05 13:05:44 -04:00
|
|
|
- show_menu_above = show_menu_above || false
|
2016-10-26 07:18:29 -04:00
|
|
|
- selected_text = selected.try(:title) || params[:milestone_title]
|
2016-10-14 06:15:44 -04:00
|
|
|
- dropdown_title = local_assigns.fetch(:dropdown_title, "Filter by milestone")
|
2016-12-15 10:07:41 -05:00
|
|
|
- if selected.present? || params[:milestone_title].present?
|
2016-10-26 07:18:29 -04:00
|
|
|
= hidden_field_tag(name, name == :milestone_title ? selected_text : selected.id)
|
2016-10-14 05:49:23 -04:00
|
|
|
= dropdown_tag(milestone_dropdown_label(selected_text), options: { title: dropdown_title, toggle_class: "js-milestone-select js-filter-submit #{extra_class}", filter: true, dropdown_class: "dropdown-menu-selectable dropdown-menu-milestone",
|
2017-05-03 18:21:14 -04:00
|
|
|
placeholder: "Search milestones", footer_content: project.present?, data: { show_no: true, show_menu_above: show_menu_above, show_any: show_any, show_upcoming: show_upcoming, show_started: show_started, field_name: name, selected: selected_text, project_id: project.try(:id), milestones: milestones_filter_dropdown_path, default_label: "Milestone" } }) do
|
2016-08-30 07:11:09 -04:00
|
|
|
- if project
|
2016-03-16 15:14:31 -04:00
|
|
|
%ul.dropdown-footer-list
|
2016-07-16 03:23:02 -04:00
|
|
|
- if can? current_user, :admin_milestone, project
|
2016-03-16 15:14:31 -04:00
|
|
|
%li
|
2016-07-16 03:23:02 -04:00
|
|
|
= link_to new_namespace_project_milestone_path(project.namespace, project), title: "New Milestone" do
|
2016-03-16 15:14:31 -04:00
|
|
|
Create new
|
|
|
|
%li
|
2016-07-16 03:23:02 -04:00
|
|
|
= link_to namespace_project_milestones_path(project.namespace, project) do
|
|
|
|
- if can? current_user, :admin_milestone, project
|
2016-03-16 15:14:31 -04:00
|
|
|
Manage milestones
|
|
|
|
- else
|
|
|
|
View milestones
|