Sha256: ed779304ae6d32a39bb489cc1f75b56c61f2a9ae056be28f5e2feeea01536ce2

Contents?: true

Size: 744 Bytes

Versions: 14

Compression:

Stored size: 744 Bytes

Contents

# frozen_string_literal: true

module PagesCore
  class PagesPlugin < Plugin
    class << self
      def configure_localizations!
        unless @localizations_added
          I18n.load_path += Dir[
            new.root.join("config", "locales", "**", "*.{rb,yml}")
          ]
        end
        @localizations_added = true
      end
    end

    paths["db/migrate"] = "db/migrate"

    admin_menu_item "News",  proc { news_admin_pages_path(@locale) }, :pages,
                    if: proc { Page.news_pages.any? },
                    current: proc { @page && @page.parent.try(&:news_page?) }

    admin_menu_item "Pages", proc { admin_pages_path(@locale) }, :pages
    admin_menu_item "Users", proc { admin_users_path }, :account
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
pages_core-3.11.3 lib/pages_core/pages_plugin.rb
pages_core-3.11.2 lib/pages_core/pages_plugin.rb
pages_core-3.11.1 lib/pages_core/pages_plugin.rb
pages_core-3.11.0 lib/pages_core/pages_plugin.rb
pages_core-3.10.2 lib/pages_core/pages_plugin.rb
pages_core-3.10.1 lib/pages_core/pages_plugin.rb
pages_core-3.9.2 lib/pages_core/pages_plugin.rb
pages_core-3.9.1 lib/pages_core/pages_plugin.rb
pages_core-3.9.0 lib/pages_core/pages_plugin.rb
pages_core-3.8.3 lib/pages_core/pages_plugin.rb
pages_core-3.8.2 lib/pages_core/pages_plugin.rb
pages_core-3.8.1 lib/pages_core/pages_plugin.rb
pages_core-3.8.0 lib/pages_core/pages_plugin.rb
pages_core-3.7.0 lib/pages_core/pages_plugin.rb