app/helpers/toolbar_helper.rb in social_stream-base-0.9.13 vs app/helpers/toolbar_helper.rb in social_stream-base-0.9.14
- old
+ new
@@ -14,11 +14,12 @@
#
# Toolbar allows you to autoexpand certain menu section that may be of interest for your view.
# For example, the messages menu when you are looking your inbox. This is done through :option element.
#
# To get it working, you should use the proper :option to be expanded, ":option => :messages" in the
- # mentioned example. This will try, automatically, to expand the section of the menu where its root
+ # mentioned example. This will try
+ # Base toolbar items, automatically, to expand the section of the menu where its root
# list link, the one expanding the section, has an id equal to "#messages_menu". If you use
# ":options => :contacts" it will try to expand "#contacts_menu".
#
# For now its working with :option => :messages, :contacts or :groups
#
@@ -47,10 +48,12 @@
end
content = capture do
if options[:profile]
render :partial => 'toolbar/profile', :locals => { :subject => options[:profile] }
+ elsif options[:option].present? and options[:option].to_s.eql? 'messages'
+ render :partial => 'toolbar/messages'
else
render :partial => 'toolbar/home'
end
end
@@ -86,12 +89,17 @@
#Prints the home toolbar menu.
def home_toolbar_menu
render_items home_toolbar_items
end
- #Prints the home profile menu.
+ #Prints the profile toolbar menu.
def profile_toolbar_menu(subject=current_subject)
render_items profile_toolbar_items(subject)
+ end
+
+ #Prints the messages toolbar menu.
+ def messages_toolbar_menu
+ render_items messages_toolbar_items
end
#Renders array of navigation items with simple_navigation
def render_items(items)
menu = render_navigation :items => items