mtoros-mega_menus 0.6.9 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/mega_menus.gemspec +1 -1
- data/rails_generators/menu/templates/helpers/menu_helper.rb +16 -1
- metadata +1 -1
data/Rakefile
CHANGED
@@ -4,7 +4,7 @@ require 'rake'
|
|
4
4
|
begin
|
5
5
|
require 'echoe'
|
6
6
|
|
7
|
-
Echoe.new('mega_menus', '0.
|
7
|
+
Echoe.new('mega_menus', '0.7.0') do |p|
|
8
8
|
p.summary = "Treeview menu Gem for Rails"
|
9
9
|
p.description = "Adds a model, controller to perform the tasks in order to have a treeview menu. To use this gem simply install it and write script/generate menu name_of_the_menu"
|
10
10
|
p.author = ['Marko Toros']
|
data/mega_menus.gemspec
CHANGED
@@ -42,6 +42,7 @@ module <%= "#{file_name.capitalize}Helper" %>
|
|
42
42
|
add_menu_form(menu_model, menu_controller, m.id)
|
43
43
|
concat( "</li>")
|
44
44
|
end
|
45
|
+
firstm=FALSE
|
45
46
|
end
|
46
47
|
if(m.id!=1 and m.isChildOf(admin_parent))
|
47
48
|
#check if your depth is correct
|
@@ -90,7 +91,21 @@ module <%= "#{file_name.capitalize}Helper" %>
|
|
90
91
|
end
|
91
92
|
end
|
92
93
|
end
|
93
|
-
|
94
|
+
if(firstm==TRUE and <%= "#{file_name.capitalize}" %>.exists?(admin_parent))
|
95
|
+
concat( "<ul id=\"ul_menu_#{admin_depth.first}\" class=\"ul_menu_depth_#{admin_depth.first} ul_menu\">")
|
96
|
+
if(admin_condition)
|
97
|
+
concat( "<li id=\"root_add_#{admin_parent}\" class=\"root_add\">")
|
98
|
+
concat( link_to_remote( "<span>Add</span>", {:url => {:controller => menu_controller, :action => 'add_menu_form', :menu_id => admin_parent,:menu_model=>menu_model, :menu_controller=>menu_controller}}, {:class => "menu_links_add", :title=> "Add",:id => "add_menu_link_#{admin_parent}"}))
|
99
|
+
add_menu_form(menu_model, menu_controller, admin_parent)
|
100
|
+
concat( "</li>")
|
101
|
+
end
|
102
|
+
pmd=admin_depth.first
|
103
|
+
elsif(firstm==TRUE)
|
104
|
+
concat( "<ul id=\"ul_menu_#{admin_depth.first}\" class=\"ul_menu_depth_#{admin_depth.first} ul_menu\">")
|
105
|
+
concat( "</ul>")
|
106
|
+
end
|
107
|
+
pmd.downto(admin_depth.first) {concat( "</ul>")}
|
108
|
+
|
94
109
|
return nil
|
95
110
|
end
|
96
111
|
|