Move plugins to separate directory.
This commit is contained in:
parent
6e990fed4c
commit
6aa8ee7968
59 changed files with 4 additions and 4 deletions
13
plugins/wiki/lib/foodsoft_wiki.rb
Normal file
13
plugins/wiki/lib/foodsoft_wiki.rb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
require 'wikicloth'
|
||||
require 'acts_as_versioned'
|
||||
require 'diffy'
|
||||
require 'content_for_in_controllers'
|
||||
require 'foodsoft_wiki/engine'
|
||||
|
||||
module FoodsoftWiki
|
||||
# Return whether the wiki is used or not.
|
||||
# Enabled by default in {FoodsoftConfig} since it used to be part of the foodsoft core.
|
||||
def self.enabled?
|
||||
FoodsoftConfig[:use_wiki]
|
||||
end
|
||||
end
|
||||
19
plugins/wiki/lib/foodsoft_wiki/engine.rb
Normal file
19
plugins/wiki/lib/foodsoft_wiki/engine.rb
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
module FoodsoftWiki
|
||||
class Engine < ::Rails::Engine
|
||||
def navigation(primary, ctx)
|
||||
return unless FoodsoftWiki.enabled?
|
||||
primary.item :wiki, I18n.t('navigation.wiki.title'), '#', id: nil do |subnav|
|
||||
subnav.item :wiki_home, I18n.t('navigation.wiki.home'), ctx.wiki_path, id: nil
|
||||
subnav.item :all_pages, I18n.t('navigation.wiki.all_pages'), ctx.all_pages_path, id: nil
|
||||
end
|
||||
# move this last added item to just after the foodcoop menu
|
||||
if i = primary.items.index(primary[:foodcoop])
|
||||
primary.items.insert(i+1, primary.items.delete_at(-1))
|
||||
end
|
||||
end
|
||||
|
||||
def default_foodsoft_config(cfg)
|
||||
cfg[:use_wiki] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
3
plugins/wiki/lib/foodsoft_wiki/version.rb
Normal file
3
plugins/wiki/lib/foodsoft_wiki/version.rb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
module FoodsoftWiki
|
||||
VERSION = "0.0.1"
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue