diff options
-rw-r--r-- | app/views/shared/issuable/_nav.html.haml | 5 | ||||
-rw-r--r-- | app/views/shared/issuable/nav_links/_all.html.haml | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/app/views/shared/issuable/_nav.html.haml b/app/views/shared/issuable/_nav.html.haml index 3f03cc7a275..6d8a4668cec 100644 --- a/app/views/shared/issuable/_nav.html.haml +++ b/app/views/shared/issuable/_nav.html.haml @@ -1,6 +1,5 @@ - type = local_assigns.fetch(:type, :issues) - page_context_word = type.to_s.humanize(capitalize: false) -- issuables = @issues || @merge_requests %ul.nav-links.issues-state-filters %li{ class: active_when(params[:state] == 'opened') }> @@ -20,6 +19,4 @@ = link_to page_filter_path(state: 'closed', label: true), id: 'state-closed', title: 'Filter by issues that are currently closed.', data: { state: 'closed' } do #{issuables_state_counter_text(type, :closed)} - %li{ class: active_when(params[:state] == 'all') }> - = link_to page_filter_path(state: 'all', label: true), id: 'state-all', title: "Show all #{page_context_word}.", data: { state: 'all' } do - #{issuables_state_counter_text(type, :all)} + = render 'shared/issuable/nav_links/all', page_context_word: page_context_word, counter: issuables_state_counter_text(type, :all) diff --git a/app/views/shared/issuable/nav_links/_all.html.haml b/app/views/shared/issuable/nav_links/_all.html.haml new file mode 100644 index 00000000000..d7ad7090a45 --- /dev/null +++ b/app/views/shared/issuable/nav_links/_all.html.haml @@ -0,0 +1,6 @@ +- page_context_word = local_assigns.fetch(:page_context_word) +- counter = local_assigns.fetch(:counter) + +%li{ class: active_when(params[:state] == 'all') }> + = link_to page_filter_path(state: 'all', label: true), id: 'state-all', title: "Show all #{page_context_word}.", data: { state: 'all' } do + #{counter} |