- <%= @renderer.display_content %>
+ <%= @show_diff ? @renderer.display_diff : @renderer.display_content %>
@@ -43,12 +44,11 @@
{:class => 'navlink', :accesskey => 'R', :name => 'to_previous_revision'})
%>
(<%= @page.revisions.length - 1 %> revisions)
- <% end %>
-
- <% if @page.revisions.length > 1 %>
- <%= link_to('See changes',
- {:web => @web.address, :action => 'changes', :id => @page.name},
- {:class => 'navlink', :accesskey => 'C', :name => 'see_changes'})
+ |
+ <%= link_to(@show_diff ? 'Hide changes' : 'See changes',
+ { :web => @web.address, :action => 'show', :id => @page.name,
+ :mode => (@show_diff ? nil : 'diff') },
+ { :class => 'navlink', :accesskey => 'C', :name => 'see_changes' })
%>
<% end %>
diff --git a/app/views/wiki/revision.rhtml b/app/views/wiki/revision.rhtml
index 7e08455a..27f28b9e 100644
--- a/app/views/wiki/revision.rhtml
+++ b/app/views/wiki/revision.rhtml
@@ -1,21 +1,12 @@
-<% @title = "#{@page.plain_name} (Rev ##{@revision_number})" %>
+<%
+ @title = "#{@page.plain_name} (Rev ##{@revision_number}#{@show_diff ? ', changes' : ''})"
+%>
+
- <%= @renderer.display_content %>
+ <%= @show_diff ? @renderer.display_diff : @renderer.display_content %>
-
-
-
- Showing changes from revision #<%= @revision_number - 1 %> to #<%= @revision_number %>:
- Added | Removed
-
-
-
- <%= @renderer.display_diff %>
-
-
-
<%= "Revision from #{format_date(@revision.revised_at)} by" %>
<%= link_to_page @revision.author %>
@@ -58,12 +49,12 @@
%>
<% if @revision_number > 0 %>
-
- | See changes
-
-
- | Hide changes
-
+ |
+ <%= link_to(@show_diff ? 'Hide changes' : 'See changes',
+ {:web => @web.address, :action => 'revision', :id => @page.name,
+ :rev => @revision_number, :mode => (@show_diff ? nil : 'diff') },
+ {:class => 'navlink', :accesskey => 'C', :name => 'see_changes'})
+ %>
<% end %>
|
diff --git a/config/routes.rb b/config/routes.rb
index 74532f2e..225f37ee 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -19,6 +19,8 @@ ActionController::Routing::Routes.draw do |map|
connect_to_web map, ':web/import/:id', :controller => 'file', :action => 'import'
connect_to_web map, ':web/login', :controller => 'wiki', :action => 'login'
connect_to_web map, ':web/web_list', :controller => 'wiki', :action => 'web_list'
+ connect_to_web map, ':web/show/diff/:id', :controller => 'wiki', :action => 'show', :mode => 'diff'
+ connect_to_web map, ':web/revision/diff/:id', :controller => 'wiki', :action => 'revision', :mode => 'diff'
connect_to_web map, ':web/:action/:id', :controller => 'wiki'
connect_to_web map, ':web/:action', :controller => 'wiki'
connect_to_web map, ':web', :controller => 'wiki', :action => 'index'
diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb
index 50eeeaea..2e44066e 100755
--- a/test/functional/wiki_controller_test.rb
+++ b/test/functional/wiki_controller_test.rb
@@ -613,7 +613,6 @@ class WikiControllerTest < Test::Unit::TestCase
assert_response :missing
end
-
def test_tex
r = process('tex', 'web' => 'wiki1', 'id' => 'HomePage')
assert_success