mtoros-mega_menus 0.7.8 → 0.7.9

Sign up to get free protection for your applications and to get access to all the features.
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.8') do |p|
7
+ Echoe.new('mega_menus', '0.7.9') 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,10 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{mega_menus}
3
- s.version = "0.7.8"
3
+ s.version = "0.7.9"
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-21}
7
+ s.date = %q{2008-11-28}
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"]
@@ -36,11 +36,13 @@ module <%= "#{file_name.capitalize}Helper" %>
36
36
  #write the actual menu line for each record
37
37
  if(m.published==TRUE or admin_condition==TRUE)
38
38
  if(m.id==1 and m.children.empty? and admin_depth.include?(m.depth))
39
+ if(admin_condition)
40
+ add_menu_form(menu_model, menu_controller, m.id)
41
+ end
39
42
  concat( "<ul id=\"ul_menu_#{m.depth}\" class=\"ul_menu_depth_#{m.depth} ul_menu\">")
40
43
  if(admin_condition)
41
44
  concat( "<li id=\"root_add_#{m.id}\" class=\"root_add\">")
42
45
  concat( link_to_remote( "<span>Add</span>", {:url => {:controller => menu_controller, :action => 'add_menu_form', :menu_id => m.id,:menu_model=>menu_model, :menu_controller=>menu_controller}}, {:class => "menu_links_add", :title=> "Add",:id => "add_menu_link_#{m.id}"}))
43
- add_menu_form(menu_model, menu_controller, m.id)
44
46
  concat( "</li>")
45
47
  end
46
48
  firstm=FALSE
@@ -49,11 +51,13 @@ module <%= "#{file_name.capitalize}Helper" %>
49
51
  #check if your depth is correct
50
52
  if(admin_depth.include?(m.depth))
51
53
  if(m.depth > pmd or firstm)
54
+ if(admin_condition)
55
+ add_menu_form(menu_model, menu_controller, m.parent_id)
56
+ end
52
57
  concat( "<ul id=\"ul_menu_#{m.depth}\" class=\"ul_menu_depth_#{m.depth} ul_menu\">")
53
58
  if(admin_condition)
54
59
  concat( "<li id=\"root_add_#{m.parent_id}\" class=\"root_add\">")
55
60
  concat( link_to_remote( "<span>Add</span>", {:url => {:controller => menu_controller, :action => 'add_menu_form', :menu_id => m.parent_id,:menu_model=>menu_model, :menu_controller=>menu_controller}}, {:class => "menu_links_add", :title=> "Add",:id => "add_menu_link_#{m.id}"}))
56
- add_menu_form(menu_model, menu_controller, m.parent_id)
57
61
  concat( "</li>")
58
62
  end
59
63
  firstm=FALSE
@@ -63,9 +67,9 @@ module <%= "#{file_name.capitalize}Helper" %>
63
67
  pmd=m.depth
64
68
 
65
69
  #make the selected view appear nicer
66
- if(m.id==menu_id.to_i)
67
- concat( "<li id=\"li_menu_#{m.id}\" class=\"li_menu_class_selected\">")
68
- concat( "<a class=\"selected_menu\" id =\"menu_link_#{m.id}\" href=\"#{m.link}?menu_id=#{m.id}\"> #{m.title} </a>")
70
+ if(m.id==menu_id.to_i || m.isRootOf(menu_id.to_i))
71
+ concat( "<li id=\"li_menu_#{m.id}\" class=\"active\">")
72
+ concat( "<a class=\"active\" id =\"menu_link_#{m.id}\" href=\"#{m.link}?menu_id=#{m.id}\"> #{m.title} </a>")
69
73
  session[:menu_id]=menu_id
70
74
  else
71
75
  concat( "<li id=\"li_menu_#{m.id}\" class=\"li_menu_class\">")
@@ -153,4 +157,5 @@ module <%= "#{file_name.capitalize}Helper" %>
153
157
  end
154
158
  return nil
155
159
  end
160
+
156
161
  end
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.8
4
+ version: 0.7.9
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-21 00:00:00 -08:00
12
+ date: 2008-11-28 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency