Make Interweb Links Work Right
Links to a published web should be to the 'publish' action, not to the 'show' action. Previously, the published status of the source, not the target was used. Also, correct display of the Navigation Links for the 'published' action.
This commit is contained in:
parent
11930dfabd
commit
5d47fdff8b
3 changed files with 8 additions and 4 deletions
|
@ -81,7 +81,9 @@ class UrlGenerator < AbstractUrlGenerator
|
|||
end
|
||||
when :publish
|
||||
if known_page
|
||||
href = @controller.url_for :controller => 'wiki', :web => web_address, :action => 'published',
|
||||
web = Web.find_by_address(web_address)
|
||||
action = web.published? ? 'published' : 'show'
|
||||
href = @controller.url_for :controller => 'wiki', :web => web_address, :action => action,
|
||||
:id => name
|
||||
%{<a class="existingWikiWord" href="#{href}">#{text}</a>}
|
||||
else
|
||||
|
@ -89,7 +91,9 @@ class UrlGenerator < AbstractUrlGenerator
|
|||
end
|
||||
else
|
||||
if known_page
|
||||
href = @controller.url_for :controller => 'wiki', :web => web_address, :action => 'show',
|
||||
web = Web.find_by_address(web_address)
|
||||
action = web.published? ? 'published' : 'show'
|
||||
href = @controller.url_for :controller => 'wiki', :web => web_address, :action => action,
|
||||
:id => name
|
||||
%{<a class="existingWikiWord" href="#{href}">#{text}</a>}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue