});
$(".tabs a.merge-notes-tab").live("click", function() {
- $(".merge-request-commits, .merge-request-diffs").hide();
+ $(".merge-request-diffs").hide();
$(".merge-request-notes").show();
});
- $(".tabs a.merge-commits-tab").live("click", function() {
- if(!MergeRequest.commits_loaded) {
- MergeRequest.loadCommits();
- }
- $(".merge-request-notes, .merge-request-diffs").hide();
- $(".merge-request-commits").show();
- });
-
$(".tabs a.merge-diffs-tab").live("click", function() {
if(!MergeRequest.diffs_loaded) {
MergeRequest.loadDiff();
}
- $(".merge-request-notes, .merge-request-commits").hide();
+ $(".merge-request-notes").hide();
$(".merge-request-diffs").show();
});
},
- loadCommits:
- function() {
- $(".dashboard-loader").show();
- $.ajax({
- type: "GET",
- url: $(".merge-commits-tab").attr("data-url"),
- complete: function(){
- MergeRequest.commits_loaded = true;
- $(".merge-request-notes, .merge-request-diffs").hide();
- $(".dashboard-loader").hide()},
- dataType: "script"});
- },
-
loadDiff:
function() {
$(".dashboard-loader").show();
url: $(".merge-diffs-tab").attr("data-url"),
complete: function(){
MergeRequest.diffs_loaded = true;
- $(".merge-request-notes, .merge-request-commits").hide();
+ $(".merge-request-notes").hide();
$(".dashboard-loader").hide()},
dataType: "script"});
}
@include round-borders-all(4px);
border-color:#ddd;
+ ul {
+ margin:0;
+ }
+
h5 {
padding: 0 10px;
background:#f5f5f5;
@include round-borders-top(4px);
border-top:none;
}
+
+ &:last-child {
+ @include round-borders-bottom(4px);
+ border:none;
+ }
}
}
@notes = @merge_request.notes.inc_author.order("created_at DESC").limit(20)
@note = @project.notes.new(:noteable => @merge_request)
+ @commits = @project.repo.
+ commits_between(@merge_request.target_branch, @merge_request.source_branch).
+ map {|c| Commit.new(c)}.
+ sort_by(&:created_at).
+ reverse
+
render_full_content
respond_to do |format|
end
end
- def commits
- @commits = @project.repo.
- commits_between(@merge_request.target_branch, @merge_request.source_branch).
- map {|c| Commit.new(c)}.
- sort_by(&:created_at).
- reverse
- end
-
def diffs
@diffs = @merge_request.diffs
@commit = @merge_request.last_commit
-- if @commits.size > 0
- .merge-request-commits
- %ul.unstyled= render @commits
+- unless @commits.empty?
+ .ui-box
+ %h5 Commits
+ .merge-request-commits
+ %ul.unstyled= render @commits
-- if @commits.empty?
- %p.cgray Nothing to merge
+- else
+ %h5
+ Nothing to merge from
+ %span.label #{@merge_request.source_branch}
+ to
+ %span.label #{@merge_request.target_branch}
+ %br
%div= simple_format @merge_request.title
+= render "merge_requests/commits"
-.tabs
- %li.active
- = link_to "#notes", :class => "merge-notes-tab tab" do
- Notes
- %li
- = link_to "#commits", "data-url" => commits_project_merge_request_path(@project, @merge_request), :class => "merge-commits-tab tab" do
- Commits
- %li
- = link_to "#diffs", "data-url" => diffs_project_merge_request_path(@project, @merge_request), :class => "merge-diffs-tab tab" do
- Diff
+- 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
- %img{:src => "/assets/ajax-loader-facebook.gif", :class => "dashboard-loader"}
+ %img{:src => "/assets/ajax-loader-facebook.gif", :class => "dashboard-loader"}
.merge-request-notes
.merge_request_notes= render "notes/notes"
%center= image_tag "ajax-loader.gif"
.clear
-.merge-request-commits
.merge-request-diffs
resources :merge_requests do
member do
get :diffs
- get :commits
end
end