mtoros-mega_menus 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/Rakefile +1 -1
- data/mega_menus.gemspec +1 -1
- data/rails_generators/menu/templates/helpers/menu_helper.rb +11 -13
- data/rails_generators/menu/templates/views/_menu.html.erb +1 -2
- data/rails_generators/menu/templates/views/add_menu.rjs +1 -1
- data/rails_generators/menu/templates/views/delete_menu.rjs +1 -1
- data/rails_generators/menu/templates/views/down_menu.rjs +1 -1
- data/rails_generators/menu/templates/views/edit_menu.rjs +1 -1
- data/rails_generators/menu/templates/views/up_menu.rjs +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -25,7 +25,7 @@ The current version creates:
|
|
25
25
|
* Rails 2.2
|
26
26
|
|
27
27
|
== NOTES:
|
28
|
-
* The menu is
|
28
|
+
* The menu is located in <ul id="ul_menu_#{m.depth}" class="ul_menu_depth_#{m.depth}">
|
29
29
|
* The selected menu is located in <li class="li_menu_class_selected">
|
30
30
|
* This two id and class values can be easly changed by editing the mega_menu partial and its helper.
|
31
31
|
|
data/Rakefile
CHANGED
@@ -4,7 +4,7 @@ require 'rake'
|
|
4
4
|
begin
|
5
5
|
require 'echoe'
|
6
6
|
|
7
|
-
Echoe.new('mega_menus', '0.6.
|
7
|
+
Echoe.new('mega_menus', '0.6.3') 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
@@ -21,20 +21,10 @@ module <%= "#{file_name.capitalize}Helper" %>
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def html_generation(menu_model, menu_controller,admin_condition, admin_depth)
|
24
|
-
if(admin_condition)
|
25
|
-
if(admin_depth.include?(1))
|
26
|
-
concat link_to_remote( "Add", {:url => {:controller => menu_controller, :action => 'add_menu_form', :menu_id => 1,:menu_model=>menu_model, :menu_controller=>menu_controller } }, {:class => "menu_links_add", :id => "add_menu_link_1"})
|
27
|
-
add_menu_form(menu_model, menu_controller,1)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
menu_list(menu_model, menu_controller,admin_condition, admin_depth)
|
31
|
-
end
|
32
|
-
|
33
|
-
def menu_list(menu_model, menu_controller,admin_condition,admin_depth)
|
34
24
|
allmenus=menu_model.find(:all, :order => "absolute_position")
|
35
25
|
#mdp...previous menu depth
|
36
26
|
pmd=1
|
37
|
-
|
27
|
+
|
38
28
|
if(!params[:menu_id].nil?)
|
39
29
|
menu_id=params[:menu_id]
|
40
30
|
elsif(!session[:menu_id].nil?)
|
@@ -48,10 +38,18 @@ module <%= "#{file_name.capitalize}Helper" %>
|
|
48
38
|
#check if your depth is correct
|
49
39
|
if(admin_depth.include?(m.depth))
|
50
40
|
if(firstm)
|
51
|
-
concat( "<ul class=\"ul_menu_depth_#{m.depth}\">")
|
41
|
+
concat( "<ul id=\"ul_menu_#{m.depth}\" class=\"ul_menu_depth_#{m.depth}\">")
|
42
|
+
if(admin_condition)
|
43
|
+
if(admin_depth.include?(1))
|
44
|
+
concat( "<li id=\"root_add\" class=\"root_add\">")
|
45
|
+
concat link_to_remote( "Add", {:url => {:controller => menu_controller, :action => 'add_menu_form', :menu_id => 1,:menu_model=>menu_model, :menu_controller=>menu_controller } }, {:class => "menu_links_add", :id => "add_menu_link_1"})
|
46
|
+
add_menu_form(menu_model, menu_controller,1)
|
47
|
+
concat( "</li>")
|
48
|
+
end
|
49
|
+
end
|
52
50
|
firstm=FALSE
|
53
51
|
elsif(m.depth > pmd)
|
54
|
-
concat( "<ul class=\"ul_menu_depth_#{m.depth}\">")
|
52
|
+
concat( "<ul id=\"ul_menu_#{m.depth}\" class=\"ul_menu_depth_#{m.depth}\">")
|
55
53
|
elsif(m.depth < pmd)
|
56
54
|
pmd.downto(m.depth+1) {concat( "</ul>")}
|
57
55
|
end
|
@@ -1,5 +1,4 @@
|
|
1
|
-
<div id="mega_menus">
|
2
1
|
<%#"The 3. parameter determines normal mode(FALSE) or edit mode(TRUE)...remove this annoying line" %>
|
3
2
|
<%# "The 4. parameter determines the depth of the menus to be shown...remove this annoying line" %>
|
4
3
|
<%% mega_menus(<%= file_name.capitalize %>, <%= "'#{file_name+ "editor"}'"%>, TRUE, 1..10) %>
|
5
|
-
|
4
|
+
|
@@ -1 +1 @@
|
|
1
|
-
page.
|
1
|
+
page.replace "ul_menu_1", :partial => <%= "'#{file_name}editor/#{file_name}'" %>
|
@@ -1 +1 @@
|
|
1
|
-
page.
|
1
|
+
page.replace "ul_menu_1", :partial => <%= "'#{file_name}editor/#{file_name}'" %>
|
@@ -1 +1 @@
|
|
1
|
-
page.
|
1
|
+
page.replace "ul_menu_1", :partial => <%= "'#{file_name}editor/#{file_name}'" %>
|
@@ -1 +1 @@
|
|
1
|
-
page.
|
1
|
+
page.replace "ul_menu_1", :partial => <%= "'#{file_name}editor/#{file_name}'" %>
|
@@ -1 +1 @@
|
|
1
|
-
page.
|
1
|
+
page.replace "ul_menu_1", :partial => <%= "'#{file_name}editor/#{file_name}'" %>
|