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
|
# 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 = {})
|
def link_to_page(page_name, web = @web, text = nil, options = {})
|
||||||
raise 'Web not defined' if web.nil?
|
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/?$-, '')
|
base_url = home_page_url.sub(%r-/show/HomePage/?$-, '')
|
||||||
web.make_link(page_name, text, options.merge(:base_url => base_url))
|
web.make_link(page_name, text, options.merge(:base_url => base_url))
|
||||||
end
|
end
|
||||||
|
|
|
@ -20,9 +20,9 @@
|
||||||
<ul>
|
<ul>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li>
|
<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">
|
<div class="byline" style="margin-bottom: 0px">
|
||||||
by <%= page.author_link %>
|
by <%= link_to_page(page.author) %>
|
||||||
at <%= page.created_at.strftime "%H:%M" %>
|
at <%= page.created_at.strftime "%H:%M" %>
|
||||||
<%= "from #{page.author.ip}" if page.author.respond_to?(:ip) %>
|
<%= "from #{page.author.ip}" if page.author.respond_to?(:ip) %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -30,3 +30,4 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Reference in a new issue