mtoros-mega_menus 0.6.2 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 located in <div id="mega_menus\">
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.2') do |p|
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{mega_menus}
3
- s.version = "0.6.2"
3
+ s.version = "0.6.3"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Marko Toros"]
@@ -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
- </div>
4
+
@@ -1 +1 @@
1
- page.replace_html "mega_menus", :partial => <%= "'#{file_name}editor/#{file_name}'" %>
1
+ page.replace "ul_menu_1", :partial => <%= "'#{file_name}editor/#{file_name}'" %>
@@ -1 +1 @@
1
- page.replace_html "mega_menus", :partial => <%= "'#{file_name}editor/#{file_name}'" %>
1
+ page.replace "ul_menu_1", :partial => <%= "'#{file_name}editor/#{file_name}'" %>
@@ -1 +1 @@
1
- page.replace_html "mega_menus", :partial => <%= "'#{file_name}editor/#{file_name}'" %>
1
+ page.replace "ul_menu_1", :partial => <%= "'#{file_name}editor/#{file_name}'" %>
@@ -1 +1 @@
1
- page.replace_html "mega_menus", :partial => <%= "'#{file_name}editor/#{file_name}'" %>
1
+ page.replace "ul_menu_1", :partial => <%= "'#{file_name}editor/#{file_name}'" %>
@@ -1 +1 @@
1
- page.replace_html "mega_menus", :partial => <%= "'#{file_name}editor/#{file_name}'" %>
1
+ page.replace "ul_menu_1", :partial => <%= "'#{file_name}editor/#{file_name}'" %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mtoros-mega_menus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marko Toros