mtoros-mega_menus 0.7.6 → 0.7.7

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
@@ -15,6 +15,7 @@ The current version creates:
15
15
  * a generator for rails to ease the developers work for using this gem, the menu generator creates a template menu structure that the developer can customize.
16
16
  * uses session[:menu_id] to identify the selected menu
17
17
  * possibility to render different menu depths in different places
18
+ * added a publish button in order to hide or set visible menus (publish model field)
18
19
 
19
20
 
20
21
  == STATUS
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.6') do |p|
7
+ Echoe.new('mega_menus', '0.7.7') 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']
@@ -16,13 +16,28 @@ module MegaMenus
16
16
  return FALSE
17
17
  end
18
18
 
19
+ def isRootOf( child_id)
20
+ menu_id=self.id
21
+ while(child_id != 1)
22
+ child_id= self.class.parent_menu(child_id).id
23
+ if(menu_id===child_id)
24
+ return TRUE
25
+ end
26
+ end
27
+ return FALSE
28
+ end
29
+
19
30
  def setPublished
20
31
  self.published=TRUE
21
32
  self.save!
22
- parent_id=self.id
33
+ menu_id=self.id
23
34
  allmenus=self.class.all
24
35
  allmenus.each do |m|
25
- if(m.isChildOf(parent_id))
36
+ if(m.isChildOf(menu_id))
37
+ m.published=TRUE
38
+ m.save!
39
+ end
40
+ if(m.isRootOf(menu_id))
26
41
  m.published=TRUE
27
42
  m.save!
28
43
  end
data/mega_menus.gemspec CHANGED
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{mega_menus}
3
- s.version = "0.7.6"
3
+ s.version = "0.7.7"
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"]
7
- s.date = %q{2008-11-16}
7
+ s.date = %q{2008-11-17}
8
8
  s.description = %q{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}
9
9
  s.email = %q{mtoros@gmail.com}
10
10
  s.extra_rdoc_files = ["README.rdoc", "lib/mega_menus.rb", "lib/mega_menus/editor.rb", "lib/mega_menus/view_helpers.rb"]
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.7.6
4
+ version: 0.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marko Toros
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-16 00:00:00 -08:00
12
+ date: 2008-11-17 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency