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

8 9 10 11
  %small
    created at 
    = @merge_request.created_at.stamp("Aug 21, 2011")

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
12
  %span.right
13
    - if can?(current_user, :modify_merge_request, @merge_request)
14 15 16 17
      - if @merge_request.closed
        = link_to 'Reopen', project_merge_request_path(@project, @merge_request, :merge_request => {:closed => false }, :status_only => true), :method => :put,  :class => "btn"
      - else
        = link_to 'Close', project_merge_request_path(@project, @merge_request, :merge_request => {:closed => true }, :status_only => true), :method => :put, :class => "btn", :title => "Close merge request"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
18
      = link_to edit_project_merge_request_path(@project, @merge_request), :class => "btn small" do 
19
        Edit
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
20

21 22 23
.back_link
  = link_to project_merge_requests_path(@project) do 
    ← To merge requests
24 25


Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
26
%hr
27 28 29
- if @merge_request.closed
  .alert-message.error Closed
- else 
30 31 32 33
  .alert-message.success 
    = link_to "#", :class => "info_link", :title => "How To Merge" do 
      = image_tag "Info-UI.PNG"
    Open
34

35
= render "merge_requests/how_to_merge"
36 37 38

%div.well
  %div
39 40
    %cite.cgray Created by
    = image_tag gravatar_icon(@merge_request.author_email), :width => 16, :class => "lil_av"
41
    %strong.author= link_to_merge_request_author(@merge_request)
42 43 44

    %cite.cgray and currently assigned to 
    = image_tag gravatar_icon(@merge_request.assignee_email), :width => 16, :class => "lil_av"
45
    %strong.author= link_to_merge_request_assignee(@merge_request)
46 47
      
    %hr
48 49 50
    

  %div= simple_format @merge_request.title
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
51

52
= render "merge_requests/commits"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
53

54 55 56 57 58 59 60 61
- unless @commits.empty?
  .tabs
    %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
62

63
    %img{:src => "/assets/ajax-loader-facebook.gif", :class => "dashboard-loader"}
64 65

.merge-request-notes
66
  .merge_request_notes= render "notes/notes", :tid => @merge_request.id, :tt => "merge_request"
67 68

.merge-request-diffs
69 70 71 72


:javascript
  $(function(){
73
    MergeRequest.init();
74
  })
75 76 77 78 79 80 81 82 83 84 85 86

= render "notes/per_line_form"
: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;
    });
  });