index.html.haml 2.74 KB
Newer Older
1
- if can? current_user, :write_merge_request, @project
2
  = link_to new_project_merge_request_path(@project), class: "pull-right btn btn-new", title: "New Merge Request" do
3 4
    %i.icon-plus
    New Merge Request
5
%h3.page-title
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
6
  Merge Requests
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
7
  %span (#{@merge_requests.total_count})
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
8
%hr
9
.row
10
  .col-md-3
11
    = render 'shared/project_filter', project_entities_path: project_merge_requests_path(@project)
12
  .col-md-9
13 14
    .ui-box
      .title
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
        .mr-filters
          %span Filter by
          .dropdown.inline.prepend-left-10
            %a.dropdown-toggle.btn.btn-small{href: '#', "data-toggle" => "dropdown"}
              %i.icon-user
              %span.light assignee:
              - if @assignee.present?
                %strong= @assignee.name
              - elsif params[:assignee_id] == "0"
                Unassigned
              - else
                Any
              %b.caret
            %ul.dropdown-menu
              %li
                = link_to project_filter_path(assignee_id: nil) do
                  Any
                = link_to project_filter_path(assignee_id: 0) do
                  Unassigned
              - @project.team.members.sort_by(&:name).each do |user|
                %li
                  = link_to project_filter_path(assignee_id: user.id) do
37
                    = image_tag avatar_icon(user.email), class: "avatar s16", alt: ''
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
                    = user.name

          .dropdown.inline.prepend-left-10
            %a.dropdown-toggle.btn.btn-small{href: '#', "data-toggle" => "dropdown"}
              %i.icon-time
              %span.light milestone:
              - if @milestone.present?
                %strong= @milestone.title
              - elsif params[:milestone_id] == "0"
                None (backlog)
              - else
                Any
              %b.caret
            %ul.dropdown-menu
              %li
                = link_to project_filter_path(milestone_id: nil) do
                  Any
                = link_to project_filter_path(milestone_id: 0) do
                  None (backlog)
              - project_active_milestones.each do |milestone|
                %li
                  = link_to project_filter_path(milestone_id: milestone.id) do
                    %strong= milestone.title
                    %small.light= milestone.expires_at
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
62

63 64
          .pull-right
            = render 'shared/sort_dropdown'
65

66
      %ul.well-list.mr-list
67 68 69
        = render @merge_requests
        - if @merge_requests.blank?
          %li
70
            %h4.nothing_here_message No merge requests to show
71 72 73 74 75
    - if @merge_requests.present?
      .pull-right
        %span.cgray.pull-right #{@merge_requests.total_count} merge requests for this filter

      = paginate @merge_requests, theme: "gitlab"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
76

77
:javascript
78
  $(merge_requestsPage);