mtoros-mega_menus 0.6.9 → 0.7.0

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/Rakefile CHANGED
@@ -4,7 +4,7 @@ require 'rake'
4
4
  begin
5
5
  require 'echoe'
6
6
 
7
- Echoe.new('mega_menus', '0.6.9') do |p|
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{mega_menus}
3
- s.version = "0.6.9"
3
+ s.version = "0.7.0"
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"]
@@ -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
- pmd.downto(1) {concat( "</ul>")}
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
 
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.9
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marko Toros