index.html.haml 1.98 KB
Newer Older
randx's avatar
randx committed
1
%h3.page_title
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
2 3
  Merge Requests
  - if can? current_user, :write_issue, @project
4
    = link_to new_project_merge_request_path(@project), class: "right btn", title: "New Merge Request" do
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
5
      New Merge Request
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
6

7
%br
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
8

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
9

10 11
.ui-box
  .title
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
    .left
      %ul.nav.nav-pills
        %li{class: ("active" if (params[:f] == 'open' || !params[:f]))}
          = link_to project_merge_requests_path(@project, f: 'open', milestone_id: params[:milestone_id]) do
            Open
        %li{class: ("active" if params[:f] == "closed")}
          = link_to project_merge_requests_path(@project, f: "closed", milestone_id: params[:milestone_id]) do
            Closed
        %li{class: ("active" if params[:f] == 'assigned-to-me')}
          = link_to project_merge_requests_path(@project, f: 'assigned-to-me', milestone_id: params[:milestone_id]) do
            To Me
        %li{class: ("active" if params[:f] == 'all')}
          = link_to project_merge_requests_path(@project, f: 'all', milestone_id: params[:milestone_id]) do
            All
    .right
      = form_tag project_merge_requests_path(@project), id: "merge_requests_search_form", method: :get, class: :right  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
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
32

33 34 35 36
  %ul.unstyled
    = render @merge_requests
    - if @merge_requests.blank?
      %li
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
37
        %h4.nothing_here_message Nothing to show here
38 39 40
    - if @merge_requests.present?
      %li.bottom
        .row
41
          .span7= paginate @merge_requests, theme: "gitlab"
42 43
          .span4.right
            %span.cgray.right #{@merge_requests.total_count} merge requests for this filter
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
44

45 46 47 48
:javascript
  $(function() {
      merge_requestsPage();
    })