Merge branch 'wiki'
This commit is contained in:
commit
e75a42d509
146 changed files with 6300 additions and 261 deletions
23
lib/wikilink.rb
Normal file
23
lib/wikilink.rb
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
class Wikilink < WikiCloth::WikiLinkHandler
|
||||
|
||||
def url_for(page, parent = nil)
|
||||
if parent
|
||||
"/pages/new?title=#{page}&parent=#{parent}"
|
||||
else
|
||||
"/wiki/#{page}"
|
||||
end
|
||||
end
|
||||
|
||||
def link_attributes_for(page)
|
||||
permalink = Page.permalink(page)
|
||||
if Page.exists?(:permalink => permalink)
|
||||
{ :href => url_for(permalink) }
|
||||
else
|
||||
{ :href => url_for(page, params[:referer]), :class => "new_wiki_link"}
|
||||
end
|
||||
end
|
||||
|
||||
def section_link(section)
|
||||
""
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue