- if can? current_user, :write_merge_request, @project
  = link_to new_project_merge_request_path(@project), class: "pull-right btn btn-primary", title: "New Merge Request" do
    %i.icon-plus
    New Merge Request
%h3.page_title
  Merge Requests

%br


.row
  .span3
    = render 'filter'
  .span9
    .ui-box
      .title
        = form_tag project_merge_requests_path(@project), id: "merge_requests_search_form", method: :get, class: :left  do
          = select_tag(:assignee_id, options_from_collection_for_select([unassigned_filter] + @project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee")
          = select_tag(:milestone_id, options_from_collection_for_select([unassigned_filter] + @project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone")
          = hidden_field_tag :f, params[:f]
        .clearfix

      %ul.well-list.mr-list
        = render @merge_requests
        - if @merge_requests.blank?
          %li
            %h4.nothing_here_message Nothing to show here
    - if @merge_requests.present?
      .pull-right
        %span.cgray.pull-right #{@merge_requests.total_count} merge requests for this filter

      = paginate @merge_requests, theme: "gitlab"

:javascript
  $(merge_requestsPage);
