Commit 9c3935c5 authored by Marin Jankovski's avatar Marin Jankovski

Use the new path to the partial, move the diff related methods to the new helper.

parent be4359ef
...@@ -31,14 +31,6 @@ module CommitsHelper ...@@ -31,14 +31,6 @@ module CommitsHelper
escape_javascript(render "projects/commits/#{template}", commit: commit, project: project) unless commit.nil? escape_javascript(render "projects/commits/#{template}", commit: commit, project: project) unless commit.nil?
end end
def diff_line_content(line)
if line.blank?
"  "
else
line
end
end
# Breadcrumb links for a Project and, if applicable, a tree path # Breadcrumb links for a Project and, if applicable, a tree path
def commits_breadcrumbs def commits_breadcrumbs
return unless @project && @ref return unless @project && @ref
...@@ -121,10 +113,6 @@ module CommitsHelper ...@@ -121,10 +113,6 @@ module CommitsHelper
end end
end end
def unfold_bottom_class(bottom)
(bottom) ? 'js-unfold-bottom' : ''
end
def view_file_btn(commit_sha, diff, project) def view_file_btn(commit_sha, diff, project)
link_to project_blob_path(project, tree_join(commit_sha, diff.new_path)), link_to project_blob_path(project, tree_join(commit_sha, diff.new_path)),
class: 'btn btn-small view-file js-view-file' do class: 'btn btn-small view-file js-view-file' do
......
...@@ -86,4 +86,15 @@ module DiffHelper ...@@ -86,4 +86,15 @@ module DiffHelper
lines lines
end end
def unfold_bottom_class(bottom)
(bottom) ? 'js-unfold-bottom' : ''
end
def diff_line_content(line)
if line.blank?
"  "
else
line
end
end
end end
- if @lines.present? - if @lines.present?
- if @form.unfold? && @form.since != 1 && !@form.bottom? - if @form.unfold? && @form.since != 1 && !@form.bottom?
%tr.line_holder{ id: @form.since } %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} line_old: @form.since, line_new: @form.since, bottom: false}
- @lines.each_with_index do |line, index| - @lines.each_with_index do |line, index|
...@@ -15,5 +15,5 @@ ...@@ -15,5 +15,5 @@
- if @form.unfold? && @form.bottom? && @form.to < @blob.loc - if @form.unfold? && @form.bottom? && @form.to < @blob.loc
%tr.line_holder{ id: @form.to } %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} line_old: @form.to, line_new: @form.to, bottom: true}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment