Mercurial > hg > soundsoftware-site
comparison lib/redmine/.svn/text-base/menu_manager.rb.svn-base @ 37:94944d00e43c
* Update to SVN trunk rev 4411
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Fri, 19 Nov 2010 13:24:41 +0000 |
parents | 513646585e45 |
children |
comparison
equal
deleted
inserted
replaced
22:40f7cfd4df19 | 37:94944d00e43c |
---|---|
190 end | 190 end |
191 | 191 |
192 def render_menu_node_with_children(node, project=nil) | 192 def render_menu_node_with_children(node, project=nil) |
193 caption, url, selected = extract_node_details(node, project) | 193 caption, url, selected = extract_node_details(node, project) |
194 | 194 |
195 html = returning [] do |html| | 195 html = [].tap do |html| |
196 html << '<li>' | 196 html << '<li>' |
197 # Parent | 197 # Parent |
198 html << render_single_menu_node(node, caption, url, selected) | 198 html << render_single_menu_node(node, caption, url, selected) |
199 | 199 |
200 # Standard children | 200 # Standard children |
201 standard_children_list = returning "" do |child_html| | 201 standard_children_list = "".tap do |child_html| |
202 node.children.each do |child| | 202 node.children.each do |child| |
203 child_html << render_menu_node(child, project) | 203 child_html << render_menu_node(child, project) |
204 end | 204 end |
205 end | 205 end |
206 | 206 |
217 | 217 |
218 # Returns a list of unattached children menu items | 218 # Returns a list of unattached children menu items |
219 def render_unattached_children_menu(node, project) | 219 def render_unattached_children_menu(node, project) |
220 return nil unless node.child_menus | 220 return nil unless node.child_menus |
221 | 221 |
222 returning "" do |child_html| | 222 "".tap do |child_html| |
223 unattached_children = node.child_menus.call(project) | 223 unattached_children = node.child_menus.call(project) |
224 # Tree nodes support #each so we need to do object detection | 224 # Tree nodes support #each so we need to do object detection |
225 if unattached_children.is_a? Array | 225 if unattached_children.is_a? Array |
226 unattached_children.each do |child| | 226 unattached_children.each do |child| |
227 child_html << content_tag(:li, render_unattached_menu_item(child, project)) | 227 child_html << content_tag(:li, render_unattached_menu_item(child, project)) |