Module: Goldberg::Helper
- Defined in:
- lib/six-updater-web/vendor/plugins/goldberg/lib/goldberg/helper.rb
Overview
Goldberg::Helper will be added as a helper to ActionController::Base, so its methods will be available in the views throughout all controllers (just as if they’d been added to ApplicationHelper).
Instance Method Summary collapse
-
#goldberg_breadcrumbs ⇒ Object
Renders the breadcrumbs (i.e. representing the user’s current position in the menu hierarchy).
-
#goldberg_left_menu ⇒ Object
Renders a nested side menu, for all levels below the main menu.
-
#goldberg_login ⇒ Object
Renders the login prompt.
-
#goldberg_main_menu ⇒ Object
Renders a top (i.e. one level deep) static menu.
-
#goldberg_suckerfish_menu ⇒ Object
Renders an entire multilevel suckerfish menu.
-
#goldberg_title ⇒ Object
Renders the title of the page: either the ContentPage.name or the current controller and action.
Instance Method Details
#goldberg_breadcrumbs ⇒ Object
Renders the breadcrumbs (i.e. representing the user’s current position in the menu hierarchy).
41 42 43 |
# File 'lib/six-updater-web/vendor/plugins/goldberg/lib/goldberg/helper.rb', line 41 def render :file => "#{RAILS_ROOT}/vendor/plugins/goldberg/app/views/goldberg/menu_items/_breadcrumbs.rhtml", :use_full_path => false, :locals => {:crumbs => Goldberg..crumbs} end |
#goldberg_left_menu ⇒ Object
Renders a nested side menu, for all levels below the main menu.
25 26 27 28 29 |
# File 'lib/six-updater-web/vendor/plugins/goldberg/lib/goldberg/helper.rb', line 25 def render :file => "#{RAILS_ROOT}/vendor/plugins/goldberg/app/views/goldberg/menu_items/_menubar.rhtml", :use_full_path => false, :locals => {:level => 1, :depth => (Goldberg.settings. - 2), :class_attr => 'sidemenu'} end |
#goldberg_login ⇒ Object
Renders the login prompt. This changes depending on whether a user is logged in or not. If a user is logged in, a mini-form is presented with a button to log out. If not, a link to the auth/login page is presented.
49 50 51 |
# File 'lib/six-updater-web/vendor/plugins/goldberg/lib/goldberg/helper.rb', line 49 def goldberg_login render :file => "#{RAILS_ROOT}/vendor/plugins/goldberg/app/views/goldberg/auth/_login.rhtml", :use_full_path => false end |
#goldberg_main_menu ⇒ Object
Renders a top (i.e. one level deep) static menu.
20 21 22 |
# File 'lib/six-updater-web/vendor/plugins/goldberg/lib/goldberg/helper.rb', line 20 def render :file => "#{RAILS_ROOT}/vendor/plugins/goldberg/app/views/goldberg/menu_items/_menubar.rhtml", :use_full_path => false, :locals => {:level => 0, :depth => 0, :class_attr => nil} end |
#goldberg_suckerfish_menu ⇒ Object
Renders an entire multilevel suckerfish menu. Whether this is to be rendered along the top, left hand or right hand side of the page depends on the page’s stylesheet. This code just returns the menu structure.
35 36 37 |
# File 'lib/six-updater-web/vendor/plugins/goldberg/lib/goldberg/helper.rb', line 35 def render :file => "#{RAILS_ROOT}/vendor/plugins/goldberg/app/views/goldberg/menu_items/_suckerfish.rhtml", :use_full_path => false, :locals => {:items => Goldberg..(0)} end |
#goldberg_title ⇒ Object
Renders the title of the page: either the ContentPage.name or the current controller and action.
9 10 11 12 13 14 15 16 17 |
# File 'lib/six-updater-web/vendor/plugins/goldberg/lib/goldberg/helper.rb', line 9 def goldberg_title if params[:controller] == 'goldberg/content_pages' and ( params[:action] == 'view' or params[:action] == 'view_default') "#{@content_page.title}" else "#{params[:controller]} | #{params[:action]}" end end |