index.html.haml 2.53 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 12
    = render 'shared/project_filter', project_entities_path: project_merge_requests_path(@project),
             labels: true, redirect: 'merge_requests'
13
  .col-md-9
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
    .mr-filters.append-bottom-10
      .dropdown.inline
        %a.dropdown-toggle.btn{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
          - @assignees.sort_by(&:name).each do |user|
            %li
              = link_to project_filter_path(assignee_id: user.id) do
                = image_tag avatar_icon(user.email), class: "avatar s16", alt: ''
                = user.name
37

38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
      .dropdown.inline.prepend-left-10
        %a.dropdown-toggle.btn{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
60

61 62
      .pull-right
        = render 'shared/sort_dropdown'
63

64
    .ui-box
65
      %ul.well-list.mr-list
66 67 68
        = render @merge_requests
        - if @merge_requests.blank?
          %li
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
69
            .nothing-here-block No merge requests to show
70 71 72 73 74
    - 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
75

76
:javascript
77
  $(merge_requestsPage);