diff options
author | Phil Hughes <me@iamphill.com> | 2016-03-07 17:28:37 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-03-10 13:54:54 +0000 |
commit | d6e5ed8a97b20eff242b394999a71fb828822d50 (patch) | |
tree | 13c06144398ae4878bd687ba1d8ccc26f9ca5d67 | |
parent | 04fc44841d3fd4e26d977b88fc1d187f1da79568 (diff) | |
download | gitlab-ce-d6e5ed8a97b20eff242b394999a71fb828822d50.tar.gz |
Extra links in label filter dropdown fotoer
-rw-r--r-- | app/assets/stylesheets/framework/dropdowns.scss | 8 | ||||
-rw-r--r-- | app/helpers/dropdowns_helper.rb | 10 | ||||
-rw-r--r-- | app/views/shared/issuable/_filter.html.haml | 6 |
3 files changed, 21 insertions, 3 deletions
diff --git a/app/assets/stylesheets/framework/dropdowns.scss b/app/assets/stylesheets/framework/dropdowns.scss index 357423709bf..ba65a8b17c6 100644 --- a/app/assets/stylesheets/framework/dropdowns.scss +++ b/app/assets/stylesheets/framework/dropdowns.scss @@ -301,6 +301,14 @@ border-top: 1px solid $dropdown-divider-color; } +.dropdown-footer-list { + font-size: 14px; + + a { + padding-left: 10px; + } +} + .dropdown-loading { position: absolute; top: 0; diff --git a/app/helpers/dropdowns_helper.rb b/app/helpers/dropdowns_helper.rb index 49c40e31176..5e3ee734314 100644 --- a/app/helpers/dropdowns_helper.rb +++ b/app/helpers/dropdowns_helper.rb @@ -1,5 +1,5 @@ module DropdownsHelper - def dropdown_tag(toggle_text, id: nil, toggle_class: nil, dropdown_class: nil, title: false, filter: false, placeholder: "", data: {}, &block) + def dropdown_tag(toggle_text, id: nil, toggle_class: nil, dropdown_class: nil, title: false, filter: false, placeholder: "", footer_content: false, data: {}, &block) content_tag :div, class: "dropdown" do toggle_hash = data.merge({toggle: "dropdown"}) @@ -33,7 +33,13 @@ module DropdownsHelper end output += content_tag :div, class: "dropdown-content" do - capture(&block) if block + capture(&block) if block && !footer_content + end + + if block && footer_content + output += content_tag :div, class: "dropdown-footer" do + capture(&block) + end end output += content_tag :div, class: "dropdown-loading" do diff --git a/app/views/shared/issuable/_filter.html.haml b/app/views/shared/issuable/_filter.html.haml index 2be1ee1f727..18d3f0e5065 100644 --- a/app/views/shared/issuable/_filter.html.haml +++ b/app/views/shared/issuable/_filter.html.haml @@ -25,7 +25,11 @@ .filter-item.inline.labels-filter = dropdown_tag("Label", title: "Filter by label", toggle_class: "js-label-select", filter: true, dropdown_class: "dropdown-menu-labels dropdown-menu-selectable", - placeholder: "Search labels", data: {field_name: "label_name", selected: params[:label_name], project_id: @project.id}) + placeholder: "Search labels", footer_content: true, data: {field_name: "label_name", selected: params[:label_name], project_id: @project.id}) do + %ul.dropdown-footer-list + %li + = link_to namespace_project_labels_path(@project.namespace, @project) do + Manage labels .pull-right = render 'shared/sort_dropdown' |