[#369] pull request: diff tab

This commit is contained in:
Alexander Machehin 2014-12-23 22:49:00 +05:00
parent 466993f097
commit 8c061c19a6
3 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
module DiffHelper
def render_diff_stats(stats)
path = @pull.try(:id) ? polymorphic_path([@project, @pull]) : ''
res = ["<table class='commit_stats'>"]
res = ["<table class='table table-responsive commit_stats'>"]
stats.each_with_index do |stat, ind|
res << "<tr>"
res << "<td>#{link_to stat.filename.rtruncate(120), "#{path}#diff-#{ind}"}</td>"
@ -36,7 +36,7 @@ module DiffHelper
end
prepare(args.merge({filepath: filepath, comments: comments, in_discussion: in_discussion}))
res = '<table class="table diff inline" cellspacing="0" cellpadding="0">'
res = '<table class="table diff inline table-responsive" cellspacing="0" cellpadding="0">'
res << '<tbody>'
res << renderer(diff_display.data) #diff_display.render(Git::Diff::InlineCallback.new comments, path)
res << tr_line_comments(comments) if in_discussion

View File

@ -6,7 +6,7 @@ ul.nav.nav-tabs#pull_tabs role = 'tablist'
href = '#discussion' ]= t 'pull_requests.tabs.discussion'
-if @stats
li role = 'presentation'
a[ data-toggle = 'diff'
a[ data-toggle = 'tab'
role = 'tab'
aria-controls = 'diff'
href = "#diff" ]= "#{t'pull_requests.tabs.diff'} (#{@stats.count})"

View File

@ -1,6 +1,6 @@
- commit_id = pull_diff.deleted_file ? @pull.to_commit.id : @pull.from_commit.id
.file
%a{name: "diff-#{pull_diff_counter}"}
a name = "diff-#{pull_diff_counter}"
.top
.l= h(pull_diff.renamed_file ? "#{pull_diff.a_path.rtruncate 60}=>#{pull_diff.b_path.rtruncate 60}" : pull_diff.b_path.rtruncate(120))
- if @pull.from_project.present?