Sha256: b1bc86d55d0e878f74e2a32397ba6f54495e45811b8dd68fbeafa5991d033d43

Contents?: true

Size: 1.28 KB

Versions: 6

Compression:

Stored size: 1.28 KB

Contents

module Caterpillar
  # Portlet navigation on Rails.
  #
  # Caterpillar installs a partial 'caterpillar/navigation' into your views,
  # along with an image and a CSS file.
  # You need to add a filter 'caterpillar' which you will only load in
  # development environment - in production the portlet container will be the
  # 'window manager'. This partial helps you to navigate between your portlets.
  #
  # This will go to your ApplicationController:
  #   if RAILS_ENV=='development'
  #     before_filter :caterpillar
  #   end
  #
  #   def caterpillar # :nodoc:
  #     @caterpillar_navigation = Caterpillar::Navigation.rails
  #     @caterpillar_navigation_defaults = {
  #       :uid => 13904,
  #       :gid => 13912
  #     }
  #   end
  #
  # This will go the body of your layout:
  #   <% if @caterpillar_navigation -%>
  #     <%= stylesheet_link_tag 'caterpillar/caterpillar' %>
  #     <%= javascript_include_tag 'caterpillar/caterpillar' %>
  #     <%= render :partial => "caterpillar/navigation" %>
  #   <% end -%>
  #
  class Navigation

    # Method for formulating the portlets hash in Rails environment
    def self.rails
      config = Util.eval_configuration
      config.routes = Util.parse_routes(config)
      return Util.categorize(Parser.new(config).portlets)
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
caterpillar-0.9.2 lib/caterpillar/navigation.rb
caterpillar-0.9.0 lib/caterpillar/navigation.rb
caterpillar-0.9.1 lib/caterpillar/navigation.rb
caterpillar-0.9.4 lib/caterpillar/navigation.rb
caterpillar-0.9.5 lib/caterpillar/navigation.rb
caterpillar-0.9.6 lib/caterpillar/navigation.rb