<%= @page.locked_by_link %> just started editing this page.
-<% else %>
- <%= @page.locked_by_link %> has been editing this page for <%= @page.lock_duration(Time.now) %> minutes.
-<% end %>
+
+ <%= link_to_page(@page.locked_by) %>
+ <% if @page.lock_duration(Time.now) == 0 %>
+ just started editing this page.
+ <% else %>
+ has been editing this page for <%= @page.lock_duration(Time.now) %> minutes.
+ <% end %>
+
<%= link_to 'Edit the page anyway',
diff --git a/app/views/wiki/revision.rhtml b/app/views/wiki/revision.rhtml
index 1819e37e..725a6e7b 100644
--- a/app/views/wiki/revision.rhtml
+++ b/app/views/wiki/revision.rhtml
@@ -18,7 +18,7 @@
<%= "Revision from #{@revision.pretty_created_at} by" %>
- <%= @page.web.make_link(@revision.author) %>
+ <%= link_to_page @revision.author %>
diff --git a/app/views/wiki/web_list.rhtml b/app/views/wiki/web_list.rhtml
index ebdde98d..b11eca50 100644
--- a/app/views/wiki/web_list.rhtml
+++ b/app/views/wiki/web_list.rhtml
@@ -4,15 +4,15 @@
<% for web in @webs %>
<% if web.published %>
- <%= web.make_link 'HomePage', web.name, :mode => :publish %> (read-only) /
- <%= web.make_link 'HomePage', 'editable version', :mode => :edit %> (requires login)
+ <%= link_to_page 'HomePage', web, web.name, :mode => 'publish' %>
+ (read-only) /
+ <%= link_to_page 'HomePage', web, 'editable version', :mode => 'show' %> (requires login)
<% else %>
- <%= web.make_link 'HomePage', nil, :mode => :edit %>
+ <%= link_to_page 'HomePage', web, web.name, :mode => 'show' %>
<% end %>
<%= web.pages.length %> pages by <%= web.authors.length %> authors
-
<% end %>
diff --git a/test/unit/chunks/wiki_test.rb b/test/unit/chunks/wiki_test.rb
index 043f547c..a20eea8a 100755
--- a/test/unit/chunks/wiki_test.rb
+++ b/test/unit/chunks/wiki_test.rb
@@ -44,26 +44,26 @@ class WikiTest < Test::Unit::TestCase
def test_file_types
# only link
- assert_link_parsed_as 'only text', 'only text', 'show', '[[only text]]'
+ assert_link_parsed_as 'only text', 'only text', :show, '[[only text]]'
# link and text
- assert_link_parsed_as 'page name', 'link text', 'show', '[[page name|link text]]'
+ assert_link_parsed_as 'page name', 'link text', :show, '[[page name|link text]]'
# link and type (file)
- assert_link_parsed_as 'foo.tar.gz', 'foo.tar.gz', 'file', '[[foo.tar.gz:file]]'
+ assert_link_parsed_as 'foo.tar.gz', 'foo.tar.gz', :file, '[[foo.tar.gz:file]]'
# link and type (pic)
- assert_link_parsed_as 'foo.tar.gz', 'foo.tar.gz', 'pic', '[[foo.tar.gz:pic]]'
+ assert_link_parsed_as 'foo.tar.gz', 'foo.tar.gz', :pic, '[[foo.tar.gz:pic]]'
# link, text and type
- assert_link_parsed_as 'foo.tar.gz', 'FooTar', 'file', '[[foo.tar.gz|FooTar:file]]'
+ assert_link_parsed_as 'foo.tar.gz', 'FooTar', :file, '[[foo.tar.gz|FooTar:file]]'
# NEGATIVE TEST CASES
# empty page name
- assert_link_parsed_as '|link text?', '|link text?', 'file', '[[|link text?:file]]'
+ assert_link_parsed_as '|link text?', '|link text?', :file, '[[|link text?:file]]'
# empty link text
- assert_link_parsed_as 'page name?|', 'page name?|', 'file', '[[page name?|:file]]'
+ assert_link_parsed_as 'page name?|', 'page name?|', :file, '[[page name?|:file]]'
# empty link type
- assert_link_parsed_as 'page name', 'link?:', 'show', '[[page name|link?:]]'
+ assert_link_parsed_as 'page name', 'link?:', :show, '[[page name|link?:]]'
# unknown link type
- assert_link_parsed_as 'page name:create_system', 'page name:create_system', 'show',
+ assert_link_parsed_as 'page name:create_system', 'page name:create_system', :show,
'[[page name:create_system]]'
end
@@ -78,4 +78,3 @@ class WikiTest < Test::Unit::TestCase
end
end
-