diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 5cda325e..c2bfad42 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -9,7 +9,7 @@ class WikiController < ApplicationController before_filter :load_page before_filter :dnsbl_check, :only => [:edit, :new, :save, :export_html, :export_markup] caches_action :show, :published, :authors, :tex, :s5, :print, :recently_revised, :list, :file_list, - :history, :atom_with_content, :atom_with_headlines, :if => Proc.new { |c| c.send(:do_caching?) } + :history, :revision, :atom_with_content, :atom_with_headlines, :if => Proc.new { |c| c.send(:do_caching?) } cache_sweeper :revision_sweeper layout 'default', :except => [:atom_with_content, :atom_with_headlines, :atom, :tex, :s5, :export_html] diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6d09c910..f6662834 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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) diff --git a/app/views/wiki/history.html.erb b/app/views/wiki/history.html.erb index 4b24be38..94b3e9b2 100644 --- a/app/views/wiki/history.html.erb +++ b/app/views/wiki/history.html.erb @@ -7,7 +7,10 @@ <%- for rev in @revisions_by_day[day] -%>