2016-11-03 12:29:30 +05:30
|
|
|
- project = @target_project || @project
|
|
|
|
- extra_class = extra_class || ''
|
|
|
|
- show_menu_above = show_menu_above || false
|
2018-11-08 19:23:39 +05:30
|
|
|
- selected = local_assigns.fetch(:selected, nil)
|
|
|
|
|
2016-11-24 13:41:30 +05:30
|
|
|
- selected_text = selected.try(:title) || params[:milestone_title]
|
2016-11-03 12:29:30 +05:30
|
|
|
- dropdown_title = local_assigns.fetch(:dropdown_title, "Filter by milestone")
|
2017-08-17 22:00:37 +05:30
|
|
|
- if selected.present? || params[:milestone_title].present?
|
2016-11-24 13:41:30 +05:30
|
|
|
= hidden_field_tag(name, name == :milestone_title ? selected_text : selected.id)
|
2018-11-18 11:00:15 +05:30
|
|
|
= dropdown_tag(milestone_dropdown_label(selected_text), options: { title: dropdown_title, toggle_class: "qa-issuable-milestone-dropdown js-milestone-select js-filter-submit #{extra_class}", filter: true, dropdown_class: "qa-issuable-dropdown-menu-milestone dropdown-menu-selectable dropdown-menu-milestone",
|
2020-11-24 15:15:51 +05:30
|
|
|
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), default_label: "Milestone" } }) do
|
2016-11-03 12:29:30 +05:30
|
|
|
- if project
|
2016-06-02 11:05:42 +05:30
|
|
|
%ul.dropdown-footer-list
|
2016-11-03 12:29:30 +05:30
|
|
|
- if can? current_user, :admin_milestone, project
|
2016-06-02 11:05:42 +05:30
|
|
|
%li
|
2017-09-10 17:25:29 +05:30
|
|
|
= link_to new_project_milestone_path(project), title: "New Milestone" do
|
2016-06-02 11:05:42 +05:30
|
|
|
Create new
|
|
|
|
%li
|
2017-09-10 17:25:29 +05:30
|
|
|
= link_to project_milestones_path(project) do
|
2016-11-03 12:29:30 +05:30
|
|
|
- if can? current_user, :admin_milestone, project
|
2016-06-02 11:05:42 +05:30
|
|
|
Manage milestones
|
|
|
|
- else
|
|
|
|
View milestones
|