[FIXES BVILD] Further improvement to diff.rb (I hope not to touch this beast again any time soon); See Changes ripped out from WikiController#show, will become a separate action

This commit is contained in:
Alexey Verkhovsky 2006-03-11 21:27:49 +00:00
parent 0aa87bf348
commit c435bf2f2b
4 changed files with 84 additions and 77 deletions

View file

@ -49,6 +49,10 @@ class WikiController < ApplicationController
@authors = @page_names_by_author.keys.sort
end
def changes
raise "Not implemented yet"
end
def export_html
stylesheet = File.read(File.join(RAILS_ROOT, 'public', 'stylesheets', 'instiki.css'))
export_pages_as_zip('html') do |page|

View file

@ -7,20 +7,6 @@
<%= @renderer.display_content %>
</div>
<% if @page.revisions.length > 1 %>
<div id="changes" style="display: none">
<p style="background: #eee; padding: 3px; border: 1px solid silver">
<small>
Showing changes from revision #<%= @page.revisions.size - 2 %> to #<%= @page.revisions.size - 1 %>:
<ins class="diffins">Added</ins> | <del class="diffdel">Removed</del>
</small>
</p>
<%= @renderer.display_diff %>
</div>
<% end %>
<div class="byline">
<%= @page.revisions? ? "Revised" : "Created" %> on <%= format_date(@page.revised_at) %>
by <%= author_link(@page) %>
@ -60,12 +46,10 @@
<% end %>
<% if @page.revisions.length > 1 %>
<span id="show_changes">
| <a href="#" name="see_changes" onClick="toggleChanges(); return false;">See changes</a>
</span>
<span id="hide_changes" name="hide_changes" style="display: none">
| <a href="#" onClick="toggleChanges(); return false;">Hide changes</a>
</span>
<%= link_to('See changes',
{:web => @web.address, :action => 'changes', :id => @page.name},
{:class => 'navlink', :accesskey => 'C', :name => 'see_changes'})
%>
<% end %>
<small>
@ -85,19 +69,3 @@
<%= render :partial => 'inbound_links' %>
</div>
<script language="Javascript" type="text/Javascript">
function toggleChanges() {
if (document.getElementById("changes").style.display == "none") {
document.getElementById("changes").style.display = "block";
document.getElementById("revision").style.display = "none";
document.getElementById("show_changes").style.display = "none";
document.getElementById("hide_changes").style.display = "inline";
} else {
document.getElementById("changes").style.display = "none";
document.getElementById("revision").style.display = "block";
document.getElementById("show_changes").style.display = "inline";
document.getElementById("hide_changes").style.display = "none";
}
}
</script>