Cache Revisions

Fix config/routes.rb to make revisions cacheable.
Cache revisions.
Modify the history page so that it links to the current page (and diff).
This commit is contained in:
Jacques Distler 2009-03-31 15:54:41 -05:00
parent 73a7ceef03
commit 69bfc1028b
4 changed files with 13 additions and 4 deletions

View file

@ -54,7 +54,12 @@ module ApplicationHelper
# Create a hyperlink to a particular revision of a Wiki page
def link_to_revision(page, revision_number, text = nil, mode = nil, html_options = {})
link_to(
revision_number == page.revisions.length ?
link_to(
text || page.plain_name,
{:web => @web.address, :action => 'show', :id => page.name,
:mode => mode}, html_options) :
link_to(
text || page.plain_name + "(rev # #{revision_number})",
{:web => @web.address, :action => 'revision', :id => page.name,
:rev => revision_number, :mode => mode}, html_options)