Fixed links to author pages on wiki/revised_pages
This commit is contained in:
parent
1038c2b373
commit
449a7fb8f3
|
@ -45,7 +45,7 @@ module ApplicationHelper
|
|||
# Creates a hyperlink to a Wiki page, or to a "new page" form if the page doesn't exist yet
|
||||
def link_to_page(page_name, web = @web, text = nil, options = {})
|
||||
raise 'Web not defined' if web.nil?
|
||||
home_page_url = url_for :web => web.address, :action => 'show', :id => page_name, :only_path => true
|
||||
home_page_url = url_for :web => web.address, :action => 'show', :id => 'HomePage', :only_path => true
|
||||
base_url = home_page_url.sub(%r-/show/HomePage/?$-, '')
|
||||
web.make_link(page_name, text, options.merge(:base_url => base_url))
|
||||
end
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
<ul>
|
||||
<% end %>
|
||||
<li>
|
||||
<%= link_to page.name, :web => @web.address, :action => 'show', :id => page.name %>
|
||||
<%= link_to_existing_page page %>
|
||||
<div class="byline" style="margin-bottom: 0px">
|
||||
by <%= page.author_link %>
|
||||
by <%= link_to_page(page.author) %>
|
||||
at <%= page.created_at.strftime "%H:%M" %>
|
||||
<%= "from #{page.author.ip}" if page.author.respond_to?(:ip) %>
|
||||
</div>
|
||||
|
@ -30,3 +30,4 @@
|
|||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
Loading…
Reference in a new issue