History Pages
From Jason Blevins: Create a "History" page for each wiki page. Link to it, and to the "Diff" page from "Recently Revised". Also, correct a bug in listing/deleting links to uploaded video and audio files.
This commit is contained in:
parent
7c0874bf4c
commit
d5a65e6ac8
6 changed files with 74 additions and 2 deletions
|
@ -52,6 +52,22 @@ module ApplicationHelper
|
|||
UrlGenerator.new(@controller).make_link(page.author.name, page.web, nil, options)
|
||||
end
|
||||
|
||||
# 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(
|
||||
text || page.plain_name + "(rev # #{revision_number})",
|
||||
{:web => @web.address, :action => 'revision', :id => page.name,
|
||||
:rev => revision_number, :mode => mode}, html_options)
|
||||
end
|
||||
|
||||
# Create a hyperlink to the history of a particular Wiki page
|
||||
def link_to_history(page, text = nil, html_options = {})
|
||||
link_to(
|
||||
text || page.plain_name + "(history)",
|
||||
{:web => @web.address, :action => 'history', :id => page.name},
|
||||
html_options)
|
||||
end
|
||||
|
||||
def base_url
|
||||
home_page_url = url_for :controller => 'admin', :action => 'create_system', :only_path => true
|
||||
home_page_url.sub(%r-/create_system/?$-, '')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue