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

18 lines
922 B
Text

- subject = local_assigns.fetch(:subject, current_user)
- include_private = local_assigns.fetch(:include_private, false)
- params[:scope] ||= []
= gl_tabs_nav({ class: 'js-snippets-nav-tabs gl-border-b-0 gl-overflow-x-auto gl-flex-grow-1 gl-flex-nowrap' }) do
= gl_tab_link_to subject_snippets_path(subject), { item_active: params[:scope].empty? } do
= _('All')
= gl_tab_counter_badge(include_private ? counts[:total] : counts[:are_public_or_internal])
- if include_private
= gl_tab_link_to subject_snippets_path(subject, scope: 'are_private') do
= _('Private')
= gl_tab_counter_badge(counts[:are_private])
= gl_tab_link_to subject_snippets_path(subject, scope: 'are_internal') do
= _('Internal')
= gl_tab_counter_badge(counts[:are_internal])
= gl_tab_link_to subject_snippets_path(subject, scope: 'are_public') do
= _('Public')
= gl_tab_counter_badge(counts[:are_public])