Wiki links to files point to the appropriate actions (file, pic)

This commit is contained in:
Alexey Verkhovsky 2005-01-22 16:38:33 +00:00
parent c30989c7eb
commit e6c32bafc6
6 changed files with 47 additions and 34 deletions

View file

@ -48,18 +48,23 @@ class Web
page = pages[name]
text = text || WikiWords.separate(name)
link = CGI.escape(name)
link_type = options[:link_type] || :show
case options[:mode]
when :export
if page then "<a class=\"existingWikiWord\" href=\"#{link}.html\">#{text}</a>"
else "<span class=\"newWikiWord\">#{text}</span>" end
when :publish
if page then "<a class=\"existingWikiWord\" href=\"../published/#{link}\">#{text}</a>"
else "<span class=\"newWikiWord\">#{text}</span>" end
else
if page then "<a class=\"existingWikiWord\" href=\"../show/#{link}\">#{text}</a>"
else "<span class=\"newWikiWord\">#{text}<a href=\"../show/#{link}\">?</a></span>" end
when :export
if page then "<a class=\"existingWikiWord\" href=\"#{link}.html\">#{text}</a>"
else "<span class=\"newWikiWord\">#{text}</span>" end
when :publish
if page then "<a class=\"existingWikiWord\" href=\"../published/#{link}\">#{text}</a>"
else "<span class=\"newWikiWord\">#{text}</span>" end
else
if page
"<a class=\"existingWikiWord\" href=\"../#{link_type}/#{link}\">#{text}</a>"
else
"<span class=\"newWikiWord\">#{text}<a href=\"../#{link_type}/#{link}\">?</a></span>"
end
end
end