gitlab-org--gitlab-foss/app/views/snippets/_snippets_scope_menu.html.haml

32 lines
1.1 KiB
Text
Raw Normal View History

- subject = local_assigns.fetch(:subject, current_user)
- include_private = local_assigns.fetch(:include_private, false)
2018-04-19 23:34:20 -04:00
.nav-links.snippet-scope-menu.mobile-separator.nav.nav-tabs
%li{ class: active_when(params[:scope].nil?) }
= link_to subject_snippets_path(subject) do
= _("All")
2018-04-09 12:33:41 -04:00
%span.badge.badge-pill
- if include_private
= counts[:total]
- else
= counts[:are_public_or_internal]
- if include_private
%li{ class: active_when(params[:scope] == "are_private") }
= link_to subject_snippets_path(subject, scope: 'are_private') do
= _("Private")
2018-04-09 12:33:41 -04:00
%span.badge.badge-pill
= counts[:are_private]
%li{ class: active_when(params[:scope] == "are_internal") }
= link_to subject_snippets_path(subject, scope: 'are_internal') do
= _("Internal")
2018-04-09 12:33:41 -04:00
%span.badge.badge-pill
= counts[:are_internal]
%li{ class: active_when(params[:scope] == "are_public") }
= link_to subject_snippets_path(subject, scope: 'are_public') do
= _("Public")
2018-04-09 12:33:41 -04:00
%span.badge.badge-pill
= counts[:are_public]