diff options
author | Marin Jankovski <marin@gitlab.com> | 2014-09-09 13:10:40 +0400 |
---|---|---|
committer | Marin Jankovski <marin@gitlab.com> | 2014-09-09 13:10:40 +0400 |
commit | 9c3935c5b0b6feddf91fd2170b50e5910b2cc932 (patch) | |
tree | 8ff26258d1a4c589909428abb954b1cd4013095d /app | |
parent | be4359efba514095cda25c225495b55f92a01f45 (diff) |
Use the new path to the partial, move the diff related methods to the new helper.
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/commits_helper.rb | 12 | ||||
-rw-r--r-- | app/helpers/diff_helper.rb | 11 | ||||
-rw-r--r-- | app/views/projects/blob/diff.html.haml | 4 |
3 files changed, 13 insertions, 14 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index 90829963e84..cab2984a4c4 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -31,14 +31,6 @@ module CommitsHelper escape_javascript(render "projects/commits/#{template}", commit: commit, project: project) unless commit.nil? end - def diff_line_content(line) - if line.blank? - " " - else - line - end - end - # Breadcrumb links for a Project and, if applicable, a tree path def commits_breadcrumbs return unless @project && @ref @@ -121,10 +113,6 @@ module CommitsHelper end end - def unfold_bottom_class(bottom) - (bottom) ? 'js-unfold-bottom' : '' - end - def view_file_btn(commit_sha, diff, project) link_to project_blob_path(project, tree_join(commit_sha, diff.new_path)), class: 'btn btn-small view-file js-view-file' do diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb index 6307790d4e7..0f4d6cf4032 100644 --- a/app/helpers/diff_helper.rb +++ b/app/helpers/diff_helper.rb @@ -86,4 +86,15 @@ module DiffHelper lines end + def unfold_bottom_class(bottom) + (bottom) ? 'js-unfold-bottom' : '' + end + + def diff_line_content(line) + if line.blank? + " " + else + line + end + end end diff --git a/app/views/projects/blob/diff.html.haml b/app/views/projects/blob/diff.html.haml index cfb91d6568a..5c79d0ef11f 100644 --- a/app/views/projects/blob/diff.html.haml +++ b/app/views/projects/blob/diff.html.haml @@ -1,7 +1,7 @@ - if @lines.present? - if @form.unfold? && @form.since != 1 && !@form.bottom? %tr.line_holder{ id: @form.since } - = render "projects/commits/diffs/match_line", {line: @match_line, + = render "projects/diffs/match_line", {line: @match_line, line_old: @form.since, line_new: @form.since, bottom: false} - @lines.each_with_index do |line, index| @@ -15,5 +15,5 @@ - if @form.unfold? && @form.bottom? && @form.to < @blob.loc %tr.line_holder{ id: @form.to } - = render "projects/commits/diffs/match_line", {line: @match_line, + = render "projects/diffs/match_line", {line: @match_line, line_old: @form.to, line_new: @form.to, bottom: true} |