0
@@ -36,17 +36,22 @@ module BrowseHelper
0
- # out = %Q{<ul class="path_breadcrumbs">\n}
0
- # out << %Q{ <li>/ #{link_to("root", tree_path(params[:sha], []))}</li>\n}
0
- # current_path.each_with_index do |path, index|
0
- # visited_path << path
0
- # out << %Q{ <li>/ #{link_to(path, tree_path(params[:sha], path))}</li>\n}
0
+ def breadcrumb_path(root_name = "root", commit_id = params[:sha])
0
+ return if current_path.blank?
0
+ out = %Q{<ul class="path_breadcrumbs">\n}
0
+ out << %Q{ <li>#{link_to(root_name, tree_path(commit_id, []))}</li>\n}
0
+ current_path.each_with_index do |path, index|
0
+ if visited_path == current_path
0
+ out << %Q{ <li>/ #{path}</li>\n}
0
+ out << %Q{ <li>/ #{link_to(path, tree_path(commit_id, visited_path))}</li>\n}
0
def render_tag_box_if_match(sha, tags_per_sha)
0
tags = tags_per_sha[sha]
0
@@ -61,26 +66,26 @@ module BrowseHelper
0
# Takes a unified diff as input and renders it as html
0
- def render_diff(udiff,
src_sha, dst_sha, display_mode = "inline")
0
+ def render_diff(udiff,
display_mode = "inline")
0
- render_sidebyside_diff(udiff
, src_sha, dst_sha)
0
+ render_sidebyside_diff(udiff
)
0
- render_inline_diff(udiff
, src_sha, dst_sha)
0
+ render_inline_diff(udiff
)
0
#diff = Diff::Display::Unified.new(load_diff("simple"))
0
#diff.render(Diff::Renderer::Base.new)
0
- def render_inline_diff(udiff
, src_sha, dst_sha)
0
+ def render_inline_diff(udiff
)
0
differ = Diff::Display::Unified.new(udiff)
0
out = %Q{<table class="codediff inline">\n}
0
- out << %Q{<td class="line-numbers">#{src_sha}</td>}
0
- out << %Q{<td class="line-numbers">#{dst_sha}</td>}
0
+ out << %Q{<td class="line-numbers"></td>}
0
+ out << %Q{<td class="line-numbers"></td>}
0
out << "<td> </td></tr>\n"
0
out << differ.render(Gitorious::Diff::InlineTableCallback.new)
0
@@ -93,13 +98,13 @@ module BrowseHelper
0
- def render_sidebyside_diff(udiff
, src_sha, dst_sha)
0
+ def render_sidebyside_diff(udiff
)
0
differ = Diff::Display::Unified.new(udiff)
0
out = %Q{<table class="codediff sidebyside">\n}
0
out << %Q{<colgroup class="left"><col class="lines"/><col class="code"/></colgroup>}
0
out << %Q{<colgroup class="right"><col class="lines"/><col class="code"/></colgroup>}
0
- out << %Q{<thead><th class="line-numbers">#{src_sha}</th><th></th>}
0
- out << %Q{<th class="line-numbers">#{dst_sha}</th><th></th></thead>}
0
+ out << %Q{<thead><th class="line-numbers"></th><th></th>}
0
+ out << %Q{<th class="line-numbers"></th><th></th></thead>}
0
out << differ.render(Gitorious::Diff::SidebysideTableCallback.new)
0
out << %Q{<tr class="toggle_diff"><td colspan="4">}
0
out << %Q{<small>#{link_to_function "toggle raw diff", "$('diff#{udiff.object_id}').toggle()"}</small></td></tr>}