From 9d476b11426ca757114e85343f548ab3ed15beeb Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 3 Oct 2018 13:36:35 +0300 Subject: Refactor labels_filter_path and labels nav Refactor labels_filter_path method to be consistent with other similar methods like search_filter_path, milestones_filter_path etc. Also move repeating code in labels index page nav into shared partial Signed-off-by: Dmitriy Zaporozhets --- app/views/shared/labels/_nav.html.haml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 app/views/shared/labels/_nav.html.haml (limited to 'app/views/shared/labels') diff --git a/app/views/shared/labels/_nav.html.haml b/app/views/shared/labels/_nav.html.haml new file mode 100644 index 00000000000..98572db738b --- /dev/null +++ b/app/views/shared/labels/_nav.html.haml @@ -0,0 +1,20 @@ +- subscribed = params[:subscribed] + +.top-area.adjust + %ul.nav-links.nav.nav-tabs + %li{ class: active_when(subscribed != 'true') }> + = link_to labels_filter_path do + = _('All') + - if current_user + %li{ class: active_when(subscribed == 'true') }> + = link_to labels_filter_path(subscribed: 'true') do + = _('Subscribed') + .nav-controls + = form_tag labels_filter_path, method: :get do + = hidden_field_tag :subscribed, params[:subscribed] + .input-group + = search_field_tag :search, params[:search], { placeholder: _('Filter'), id: 'label-search', class: 'form-control search-text-input input-short', spellcheck: false } + %span.input-group-append + %button.btn.btn-default{ type: "submit", "aria-label" => _('Submit search') } + = icon("search") + = render 'shared/labels/sort_dropdown' -- cgit v1.2.3