merrymenu 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +70 -0
- data/lib/merrymenu/version.rb +1 -1
- data/lib/merrymenu/view_helper.rb +2 -1
- metadata +11 -11
data/README.rdoc
CHANGED
@@ -1,3 +1,73 @@
|
|
1
1
|
= Merrymenu
|
2
2
|
|
3
|
+
== Installation
|
4
|
+
|
5
|
+
in Gemfile
|
6
|
+
gem 'merrumenu'
|
7
|
+
|
8
|
+
rails generate merrymenu:install
|
9
|
+
|
10
|
+
open config/initializers/merrymenu_config.rb and create your first menu
|
11
|
+
|
12
|
+
add merrymenu.css.scss to your stylesheet manifest (application.css)
|
13
|
+
|
14
|
+
== Usage
|
15
|
+
|
16
|
+
in merrymenu_config.rb
|
17
|
+
|
18
|
+
Basic menu
|
19
|
+
|
20
|
+
Merrymenu::Builder.configure do |config|
|
21
|
+
config.menu do |m|
|
22
|
+
m.tab 'tab1', '/tab1'
|
23
|
+
m.tab 'tab2', '/tab2'
|
24
|
+
m.tab 'tab3', '/tab3'
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
Named menu with classes on tabs
|
29
|
+
|
30
|
+
Merrymenu::Builder.configure do |config|
|
31
|
+
config.menu :admin do |m|
|
32
|
+
m.tab 'tab1', '/tab1'
|
33
|
+
m.tab 'tab2', '/tab2', :class => "left"
|
34
|
+
m.tab 'tab3', '/tab3', :class => "right admin"
|
35
|
+
m.tab 'tab4', '/tab4', :class => ["right", "admin"]
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
Set roles to display tabs to certain user
|
40
|
+
|
41
|
+
Merrymenu::Builder.configure do |config|
|
42
|
+
config.menu do |m|
|
43
|
+
m.tab 'tab1', '/tab1'
|
44
|
+
m.tab 'tab2', '/tab2', :roles => "admin writer"
|
45
|
+
m.tab 'tab3', '/tab3', :roles => "admin"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
warning : current_user method should respond true or false to has_roles?(roles="")
|
50
|
+
|
51
|
+
Use I18n translation for tab names
|
52
|
+
|
53
|
+
Merrymenu.configure do |config|
|
54
|
+
config.use_I18n_translation = true
|
55
|
+
end
|
56
|
+
|
57
|
+
Merrymenu::Builder.configure do |config|
|
58
|
+
config.menu do |m|
|
59
|
+
m.tab 'menu.tab1', '/tab1'
|
60
|
+
m.tab 'menu.tab2', '/tab2', :roles => "admin writer"
|
61
|
+
m.tab 'menu.tab3', '/tab3', :roles => "admin"
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
in views
|
66
|
+
|
67
|
+
render_menu
|
68
|
+
render_menu :admin
|
69
|
+
|
70
|
+
see app/assets/stylesheets/merrymenu.css.scss for styling
|
71
|
+
|
72
|
+
|
3
73
|
This project rocks and uses MIT-LICENSE.
|
data/lib/merrymenu/version.rb
CHANGED
@@ -12,7 +12,8 @@ module Merrymenu
|
|
12
12
|
tabs_html << content_tag(:div, render_tab(tab), :class => tab_classes(tab)) if permit?(tab)
|
13
13
|
end
|
14
14
|
|
15
|
-
|
15
|
+
container_html = content_tag(:div, tabs_html.html_safe, :class => 'tabs')
|
16
|
+
menu_html = content_tag(:div, container_html, :class => name)
|
16
17
|
menu_html
|
17
18
|
end
|
18
19
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: merrymenu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-11-18 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &70194817700260 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.1.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70194817700260
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec-rails
|
27
|
-
requirement: &
|
27
|
+
requirement: &70194817699720 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '2.5'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70194817699720
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: sqlite3
|
38
|
-
requirement: &
|
38
|
+
requirement: &70194817699220 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70194817699220
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: factory_girl_rails
|
49
|
-
requirement: &
|
49
|
+
requirement: &70194817698540 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '1.2'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70194817698540
|
58
58
|
description: Rails plugin to build a configurable html menu
|
59
59
|
email:
|
60
60
|
- franck.dagostini@gmail.com
|
@@ -89,7 +89,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
89
89
|
version: '0'
|
90
90
|
segments:
|
91
91
|
- 0
|
92
|
-
hash: -
|
92
|
+
hash: -925506836782741345
|
93
93
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
98
|
version: '0'
|
99
99
|
segments:
|
100
100
|
- 0
|
101
|
-
hash: -
|
101
|
+
hash: -925506836782741345
|
102
102
|
requirements: []
|
103
103
|
rubyforge_project:
|
104
104
|
rubygems_version: 1.8.11
|