show.html.haml 2.96 KB
Newer Older
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1 2 3
%h3
  = "Merge Request ##{@merge_request.id}:"
   
4
  %span.pretty_label.branch= @merge_request.source_branch
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
5
  →
6
  %span.pretty_label.branch= @merge_request.target_branch
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
7 8

  %span.right
9
    - if can?(current_user, :modify_merge_request, @merge_request)
10
      - if @merge_request.open?
11 12 13
        = link_to "Show how to merge", "#", :class => "how_to_merge_link btn small padded", :title => "How To Merge"
        = link_to 'Close', project_merge_request_path(@project, @merge_request, :merge_request => {:closed => true }, :status_only => true), :method => :put, :class => "btn small padded", :title => "Close merge request"
        = link_to edit_project_merge_request_path(@project, @merge_request), :class => "btn small padded" do 
14
          Edit
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
15

16
    %br
17
    - if @merge_request.upvotes > 0
18
      .upvotes#upvotes= "+#{pluralize @merge_request.upvotes, 'upvote'}"
19

20
= render "merge_requests/how_to_merge"
21 22 23
.back_link
  = link_to project_merge_requests_path(@project) do 
    ← To merge requests
24

25 26
.main_box
  .top_box_content
27
    %h4
28
      - if @merge_request.closed
29
        .alert-message.error.status_info Closed
30
      - else 
31
        .alert-message.success.status_info Open
32
      = @merge_request.title
33

34
  .middle_box_content
35
    %div
36
      %cite.cgray Created at #{@merge_request.created_at.stamp("Aug 21, 2011")} by 
37 38 39 40 41 42
      = image_tag gravatar_icon(@merge_request.author_email), :width => 16, :class => "lil_av"
      %strong.author= link_to_merge_request_author(@merge_request)

      %cite.cgray and currently assigned to 
      = image_tag gravatar_icon(@merge_request.assignee_email), :width => 16, :class => "lil_av"
      %strong.author= link_to_merge_request_assignee(@merge_request)
43 44 45


  - if @merge_request.closed
46 47 48 49 50 51 52 53 54
    .bottom_box_content
      - if @merge_request.merged?
        %span
          Merged by #{@merge_request.merge_event.author_name} 
          %small #{time_ago_in_words(@merge_request.merge_event.created_at)} ago.
      - elsif @merge_request.closed_event
        %span
          Closed by #{@merge_request.closed_event.author_name} 
          %small #{time_ago_in_words(@merge_request.closed_event.created_at)} ago.
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
55

56
= render "merge_requests/commits"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
57

58
- unless @commits.empty?
randx's avatar
randx committed
59
  .nav.nav-tabs
60 61 62 63 64 65
    %li.active
      = link_to "#notes", :class => "merge-notes-tab tab" do 
        Notes
    %li
      = link_to "#diffs", "data-url" => diffs_project_merge_request_path(@project, @merge_request), :class => "merge-diffs-tab tab" do
        Diff
66

67

68
.merge_request_notes#notes= render "notes/notes", :tid => @merge_request.id, :tt => "merge_request"
69 70

.merge-request-diffs
71
.status
72 73 74

:javascript
  $(function(){
75
    MergeRequest.init();
76
  })
77 78

= render "notes/per_line_form"
79

80 81 82 83 84 85 86 87 88 89
:javascript
  $(document).ready(function(){
    $(".line_note_link, .line_note_reply_link").live("click", function(e) { 
      var form = $(".per_line_form");
      $(this).parent().parent().after(form);
      form.find("#note_line_code").val($(this).attr("line_code"));
      form.show();  
      return false;
    });
  });