summaryrefslogtreecommitdiff
path: root/app/views/shared/issuable/_label_dropdown.html.haml
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-06-28 16:12:04 +0100
committerPhil Hughes <me@iamphill.com>2016-07-07 09:38:49 +0100
commitbf40aab4db26c378a83455c464c1b98bb4fa154e (patch)
treead0e895ada56c768b933f85e1852eba81b4fd30d /app/views/shared/issuable/_label_dropdown.html.haml
parentecfbb96384b2712aaf6c03dd04a3236b0578e18d (diff)
downloadgitlab-ce-bf40aab4db26c378a83455c464c1b98bb4fa154e.tar.gz
GL dropdowns in issuable form
This allows labels to be created on whilst creating/editing an issuable Closes #12574
Diffstat (limited to 'app/views/shared/issuable/_label_dropdown.html.haml')
-rw-r--r--app/views/shared/issuable/_label_dropdown.html.haml14
1 files changed, 8 insertions, 6 deletions
diff --git a/app/views/shared/issuable/_label_dropdown.html.haml b/app/views/shared/issuable/_label_dropdown.html.haml
index d34d28f6736..bcbe133ce62 100644
--- a/app/views/shared/issuable/_label_dropdown.html.haml
+++ b/app/views/shared/issuable/_label_dropdown.html.haml
@@ -4,19 +4,21 @@
- show_footer = local_assigns.fetch(:show_footer, true)
- data_options = local_assigns.fetch(:data_options, {})
- classes = local_assigns.fetch(:classes, [])
-- dropdown_data = {toggle: 'dropdown', field_name: 'label_name[]', show_no: "true", show_any: "true", selected: params[:label_name], project_id: @project.try(:id), labels: labels_filter_path, default_label: "Label"}
+- selected = local_assigns.fetch(:selected, nil)
+- selected_toggle = local_assigns.fetch(:selected_toggle, nil)
+- dropdown_data = {toggle: 'dropdown', field_name: "label_name[]", show_no: "true", show_any: "true", selected: selected, project_id: @project.try(:id), labels: labels_filter_path, default_label: "Label"}
- dropdown_data.merge!(data_options)
- classes << 'js-extra-options' if extra_options
- classes << 'js-filter-submit' if filter_submit
-- if params[:label_name].present?
- - if params[:label_name].respond_to?('any?')
- - params[:label_name].each do |label|
- = hidden_field_tag "label_name[]", label, id: nil
+- if selected.present?
+ - if selected.respond_to?('any?')
+ - selected.each do |label|
+ = hidden_field_tag data_options[:field_name], label, id: nil
.dropdown
%button.dropdown-menu-toggle.js-label-select.js-multiselect{class: classes.join(' '), type: "button", data: dropdown_data}
%span.dropdown-toggle-text
- = h(multi_label_name(params[:label_name], "Label"))
+ = h(multi_label_name(selected_toggle || selected, "Label"))
= icon('chevron-down')
.dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable
= render partial: "shared/issuable/label_page_default", locals: { title: "Filter by label", show_footer: show_footer, show_create: show_create }