Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki

This commit is contained in:
Jacques Distler 2010-05-27 01:18:06 -05:00
commit 44e54ee4c6
3 changed files with 4 additions and 4 deletions

View file

@ -33,6 +33,6 @@ def initialize(match_data, content)
# TODO move presentation of page metadata to controller/view # TODO move presentation of page metadata to controller/view
def url(category) def url(category)
%{<a class="category_link" href="#{@content.url_generator.url_for :web => @content.web.address, %{<a class="category_link" href="#{@content.url_generator.url_for :web => @content.web.address,
:action => 'list'}/#{CGI.escape(category)}">#{category}</a>} :action => 'list', :only_path => true}/#{CGI.escape(category)}">#{category}</a>}
end end
end end

View file

@ -123,7 +123,7 @@ class StubUrlGenerator < AbstractUrlGenerator
def url_for(hash = {}) def url_for(hash = {})
if(hash[:action] == 'list') if(hash[:action] == 'list')
"http://example.com/#{hash[:web]}/list" "/#{hash[:web]}/list"
else else
'../files/pngs' '../files/pngs'
end end

View file

@ -8,9 +8,9 @@ class CategoryTest < Test::Unit::TestCase
def test_single_category def test_single_category
match(Category, 'category: test', :list => ['test'], :hidden => nil, :unmask_text => match(Category, 'category: test', :list => ['test'], :hidden => nil, :unmask_text =>
"<div class=\"property\"> category: <a class=\"category_link\" href=\"http://example.com/wiki1/list/test\">test</a></div>") "<div class=\"property\"> category: <a class=\"category_link\" href=\"/wiki1/list/test\">test</a></div>")
match(Category, 'category : chunk test ', :list => ['chunk test'], :hidden => nil, :unmask_text => match(Category, 'category : chunk test ', :list => ['chunk test'], :hidden => nil, :unmask_text =>
"<div class=\"property\"> category: <a class=\"category_link\" href=\"http://example.com/wiki1/list/chunk+test\">chunk test</a></div>") "<div class=\"property\"> category: <a class=\"category_link\" href=\"/wiki1/list/chunk+test\">chunk test</a></div>")
match(Category, ':category: test', :list => ['test'], :hidden => ':') match(Category, ':category: test', :list => ['test'], :hidden => ':')
end end