Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_snippets_scope_menu.html.haml « snippets « views « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c312226dd6c9878acd5e7b0d16e77408fea00140 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- subject = local_assigns.fetch(:subject, current_user)
- include_private = local_assigns.fetch(:include_private, false)

.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")
      %span.badge.badge-pill
        - if include_private
          = subject.snippets.count
        - else
          = subject.snippets.public_and_internal.count

  - if include_private
    %li{ class: active_when(params[:scope] == "are_private") }
      = link_to subject_snippets_path(subject, scope: 'are_private') do
        = _("Private")
        %span.badge.badge-pill
          = subject.snippets.are_private.count

  %li{ class: active_when(params[:scope] == "are_internal") }
    = link_to subject_snippets_path(subject, scope: 'are_internal') do
      = _("Internal")
      %span.badge.badge-pill
        = subject.snippets.are_internal.count

  %li{ class: active_when(params[:scope] == "are_public") }
    = link_to subject_snippets_path(subject, scope: 'are_public') do
      = _("Public")
      %span.badge.badge-pill
        = subject.snippets.are_public.count