Cleanup wiki plugin a bit
This commit is contained in:
parent
b42672c06c
commit
be128243fc
4 changed files with 42 additions and 37 deletions
|
|
@ -1,22 +0,0 @@
|
|||
class Wikilink < WikiCloth::WikiLinkHandler
|
||||
|
||||
def link_attributes_for(page)
|
||||
permalink = Page.permalink(page)
|
||||
url_options = {:host => FoodsoftConfig[:host], :protocol => FoodsoftConfig[:protocol]}
|
||||
url_options.merge!({:port => FoodsoftConfig[:port]}) if FoodsoftConfig[:port]
|
||||
|
||||
if Page.exists?(:permalink => permalink)
|
||||
{ :href => url_for(:wiki_page_path, permalink: permalink, use_route: :wiki_page) }
|
||||
else
|
||||
{ href: url_for(:new_page_path, title: page, parent: params[:referer]), class: 'new_wiki_link' }
|
||||
end
|
||||
end
|
||||
|
||||
def section_link(section)
|
||||
""
|
||||
end
|
||||
|
||||
def url_for(path_name, options = {})
|
||||
Rails.application.routes.url_helpers.send path_name, options.merge({foodcoop: FoodsoftConfig.scope})
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue