Commit 0cb99ee3af39cf928807c967328373ab69e089ca

move the rawdiff toggling into the diff table

Commit diff

app/helpers/browse_helper.rb

 
8484 out << "<td>&nbsp</td></tr>\n"
8585 out << "</thead>\n"
8686 out << differ.render(Gitorious::Diff::InlineTableCallback.new)
87 out << %Q{<tr class="toggle_diff"><td colspan="3">}
88 out << %Q{<small>#{link_to_function "toggle raw diff", "$('diff#{udiff.object_id}').toggle()"}</small></td></tr>}
89 out << %Q{<tr class="raw_diff"><td colspan="3" style="display:none" id="diff#{udiff.object_id}">}
90 out << %Q{<pre>#{h(udiff)}</pre>}
91 out << "</td></tr>"
8792 out << "</table>"
8893 out
8994 end
9898 out = %Q{<table class="codediff sidebyside">\n}
9999 out << %Q{<colgroup class="left"><col class="lines"/><col class="code"/></colgroup>}
100100 out << %Q{<colgroup class="right"><col class="lines"/><col class="code"/></colgroup>}
101 out << %Q{<thead><th colspan="2">#{src_sha}</th>}
102 out << %Q{<th colspan="2">#{dst_sha}</th></thead>}
101 out << %Q{<thead><th colspan="2" class="line-numbers">#{src_sha}</th>}
102 out << %Q{<th colspan="2" class="line-numbers">#{dst_sha}</th></thead>}
103103 out << differ.render(Gitorious::Diff::SidebysideTableCallback.new)
104 out << %Q{<tr class="toggle_diff"><td colspan="4">}
105 out << %Q{<small>#{link_to_function "toggle raw diff", "$('diff#{udiff.object_id}').toggle()"}</small></td></tr>}
106 out << %Q{<tr class="raw_diff"><td colspan="4" style="display:none" id="diff#{udiff.object_id}">}
107 out << %Q{<pre>#{h(udiff)}</pre>}
108 out << "</td></tr>"
104109 out << "</table>"
105110 out
106111 end
toggle raw diff

app/views/browse/commit.html.erb

 
2222 <h2>Commit diff</h2>
2323 <%= render_diffmode_selector -%>
2424
25 <% @diff.each do |file| -%>
25 <% @diff.each do |file, index| -%>
2626 <h4><%= h(file.path) -%><%#=link_to h(file.path), blob_path(file.sha, file.path) -%></h4>
2727 <%= render_diff(file.patch, file.src, file.dst, @diffmode) -%>
28 <small><%= link_to_function "toggle raw diff", "$('#{file.object_id}').toggle()" -%></small>
29 <div class="toggle_diff" style="display:none" id="<%= file.object_id -%>">
30 <p><pre><%= h(file.patch) -%></pre></p>
31 </div>
3228 <% end -%>
3329<% end -%>
3430
toggle raw diff

public/stylesheets/base.css

 
618618}
619619
620620/* diff mode selector */
621ul.mode_selector { float: right;}
621ul.mode_selector {
622 float: right;
623 margin-top: -35px;
624}
622625ul.mode_selector li {
623626 display:inline;
624627 margin-left: 1em;
630630ul.mode_selector li.selected { border-bottom: 1px solid #666; }
631631
632632/* Diff rendering */
633
634.toggle_diff {
635
633tr.toggle_diff { border-top: 1px solid #999; }
634tr.toggle_diff td {
635 background: #ddd;
636 padding: 0 5px 2px 5px;
637 margin-bottom: 5px;
638}
639tr.toggle_diff td small { float:right;}
640tr.raw_diff td {
641 padding-top: 5px;
636642}
637643
638644table tr .line-numbers {
664664 word-wrap: break-word; /* Internet Explorer 5.5+ */
665665 background: #fff;
666666 font: 95%/110% "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace;
667 border-right: 1px solid #999;
667668}
668669
669670table tr td.unwrapped {
toggle raw diff