gitlab-org--gitlab-foss/app/views/shared/labels/_nav.html.haml
Dmitriy Zaporozhets 9d476b1142 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 <dmitriy.zaporozhets@gmail.com>
2018-10-04 10:24:50 +02:00

20 lines
868 B
Text

- 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'