summaryrefslogtreecommitdiff
path: root/app/views/search/_filter.html.haml
blob: f35289fe95ed376ecc2b2707e0a977010bd3d534 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
.dropdown.inline
  %button.dropdown-toggle.btn.btn-sm{type: 'button', 'data-toggle' => 'dropdown'}
    %span.light 群组:
    - if @group.present?
      %strong= @group.name
    - else
      任何
    %b.caret
  .dropdown-menu.dropdown-select.dropdown-menu-selectable
    .dropdown-title
      %span Filter results by group
      %button.dropdown-title-button.dropdown-menu-close{aria: {label: "Close"}}
        = icon('times')
    .dropdown-content
      %ul
        %li
          = link_to search_filter_path(group_id: nil), class: ("is-active" if !params[:group_id].present?) do
            任何
        %li.divider
        - current_user.authorized_groups.sort_by(&:name).each do |group|
          %li
            = link_to search_filter_path(group_id: group.id, project_id: nil), class: ("is-active" if params[:group_id] == group.id.to_s) do
              = group.name

.dropdown.inline.prepend-left-10.project-filter
  %button.dropdown-toggle.btn.btn-sm{type: 'button', 'data-toggle' => 'dropdown'}
    %span.light 项目:
    - if @project.present?
      %strong= @project.name_with_namespace
    - else
      任何
    %b.caret
  .dropdown-menu.dropdown-select.dropdown-menu-selectable
    .dropdown-title
      %span Filter results by project
      %button.dropdown-title-button.dropdown-menu-close{aria: {label: "Close"}}
        = icon('times')
    .dropdown-content
      %ul
        %li
          = link_to search_filter_path(project_id: nil), class: ("is-active" if !params[:project_id].present?) do
            任何
        %li.divider
        - current_user.authorized_projects.sort_by(&:name_with_namespace).each do |project|
          %li
            = link_to search_filter_path(project_id: project.id, group_id: nil), class: ("is-active" if params[:project_id] == project.id.to_s) do
              = project.name_with_namespace