Fix routing issues when navigating over tree, commits etc
This commit is contained in:
parent
49e73f8ac1
commit
c8ba5c2d58
7 changed files with 44 additions and 5 deletions
|
@ -70,4 +70,12 @@ module CommitsHelper
|
|||
escape_javascript(render 'commits/commit', commit: commit)
|
||||
end
|
||||
end
|
||||
|
||||
def diff_line_content(line)
|
||||
if line.blank?
|
||||
" "
|
||||
else
|
||||
line
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -102,7 +102,7 @@ class Project < ActiveRecord::Base
|
|||
if id.include?("/")
|
||||
id = id.split("/")
|
||||
namespace_id = Namespace.find_by_path(id.first).id
|
||||
where(namespace_id: namespace_id).find_by_path(id.last)
|
||||
where(namespace_id: namespace_id).find_by_path(id.second)
|
||||
else
|
||||
where(path: id, namespace_id: nil).last
|
||||
end
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
- if @comments_allowed
|
||||
= render "notes/per_line_note_link", line_code: line_code
|
||||
%td.new_line= link_to raw(type == "old" ? " " : line_new) , "##{line_code}", id: line_code
|
||||
%td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line} "
|
||||
%td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw diff_line_content(line)
|
||||
|
||||
- if @comments_allowed
|
||||
- comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue