- <% if @action_name != 'published' then %>
+ <% if params['action'] != 'published' then %>
<%= list_item 'Home Page', {:action => 'show', :id => 'HomePage'}, 'Home, Sweet Home', 'H' %> |
<%= list_item 'All Pages', {:action => 'list'}, 'Alphabetically sorted list of pages', 'A' %> |
<%= list_item 'Recently Revised', {:action =>'recently_revised'}, 'Pages sorted by when they were last changed', 'U' %> |
diff --git a/lib/url_generator.rb b/lib/url_generator.rb
index 8f12e535..9eb44cd8 100644
--- a/lib/url_generator.rb
+++ b/lib/url_generator.rb
@@ -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
%{
#{text}}
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
%{
#{text}}
else