Merge pull request #334 from abf/rosa-build:fix-too-long-rendering

too long rendering
This commit is contained in:
avm 2013-12-30 20:21:27 +04:00
commit ad4b25d281
3 changed files with 15 additions and 15 deletions

View File

@ -245,7 +245,7 @@ class Projects::WikiController < Projects::BaseController
when 'revert' then "Reverted page #{@name.to_s}"
when 'revert_wiki' then "Reverted wiki"
end
msg += " (#{params['format']})" if params['format']
msg << " (#{params['format']})" if params['format']
end
msg = 'Unhandled action' if !msg || msg.empty?
{ :message => msg }

View File

@ -37,12 +37,12 @@ module DiffHelper
end
prepare(args.merge({:filepath => filepath, :comments => comments, :in_discussion => in_discussion}))
res = "<table class='diff inline' cellspacing='0' cellpadding='0' ng-non-bindable>"
res += "<tbody>"
res += renderer diff_display.data #diff_display.render(Git::Diff::InlineCallback.new comments, path)
res += tr_line_comments(comments) if in_discussion
res += "</tbody>"
res += "</table>"
res = '<table class="diff inline" cellspacing="0" cellpadding="0" ng-non-bindable>'
res << '<tbody>'
res << renderer(diff_display.data) #diff_display.render(Git::Diff::InlineCallback.new comments, path)
res << tr_line_comments(comments) if in_discussion
res << '</tbody>'
res << '</table>'
res.html_safe
end
@ -214,11 +214,11 @@ module DiffHelper
res = '<span class="diff-content">'
if line.inline_changes?
prefix, changed, postfix = line.segments.map{|segment| escape(segment) }
res += "#{prefix}<span class='idiff'>#{changed}</span>#{postfix}"
res << "#{prefix}<span class='idiff'>#{changed}</span>#{postfix}"
else
res += escape(line)
res << escape(line)
end
res += '</span>'
res << '</span>'
res
end

View File

@ -33,15 +33,15 @@ module GitHelper
parts = @path.split("/")
current_path = parts.first
res += parts.length == 1 ? parts.first : link_to(parts.first, tree_path(@project, @treeish, current_path)) + " / "
res << (parts.length == 1 ? parts.first : link_to(parts.first, tree_path(@project, @treeish, current_path)) + " / ")
parts[1..-2].each do |part|
current_path = File.join([current_path, part].compact)
res += link_to(part, tree_path(@project, @treeish, current_path))
res += " / "
res << link_to(part, tree_path(@project, @treeish, current_path))
res << " / "
end
res += parts.last if parts.length > 1
res << parts.last if parts.length > 1
else
res = "#{link_to @project.name, tree_path(@project)} /"
end
@ -51,7 +51,7 @@ module GitHelper
def render_line_numbers(n)
res = ""
1.upto(n) {|i| res += "<span id='L#{i}'><a href='#L#{i}'>#{i}</a></span><br/>" }
1.upto(n){ |i| res << "<span id='L#{i}'><a href='#L#{i}'>#{i}</a></span><br/>" }
res.html_safe
end