tabulous 0.0.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +4 -0
- data/README.rdoc +6 -4
- data/lib/generators/tabs/tabs_generator.rb +3 -3
- data/lib/generators/tabs/templates/tabulous.rb +24 -25
- data/lib/tabulous/formatter.rb +2 -4
- data/lib/tabulous/railtie.rb +3 -9
- data/lib/tabulous/tab.rb +4 -30
- data/lib/tabulous/tabulous.rb +58 -38
- data/lib/tabulous/version.rb +1 -1
- data/lib/tasks/tabulous.rake +2 -2
- data/test/applications/main/{config/initializers → app/tabs}/tabulous.rb +38 -39
- data/test/applications/main/test/integration/actions_test.rb +36 -32
- data/test/applications/main/test/integration/active_tab_clickable_test.rb +36 -32
- data/test/applications/main/test/integration/always_render_subtabs_test.rb +36 -32
- data/test/applications/main/test/integration/css_no_scaffolding_test.rb +36 -32
- data/test/applications/main/test/integration/css_scaffolding_test.rb +36 -32
- data/test/applications/main/test/integration/display_text_test.rb +36 -32
- data/test/applications/main/test/integration/enabled_test.rb +36 -32
- data/test/applications/main/test/integration/html5_test.rb +36 -32
- data/test/applications/main/test/integration/path_test.rb +36 -32
- data/test/applications/main/test/integration/visible_test.rb +36 -32
- data/test/applications/main/test/unit/tabs_generator_test.rb +1 -1
- data/test/applications/simple_tabs/{config/initializers → app/tabs}/tabulous.rb +31 -32
- data/test/applications/subtabs/app/tabs/tabulous.rb +166 -0
- data/test/test_application_integration_test_helper.rb +1 -1
- data/test/{test_initializers → test_tab_files}/empty +0 -0
- data/test/test_tab_files/expected +59 -0
- data/test/test_tab_files/random_horizontal_whitespace +59 -0
- data/test/test_tab_files/random_vertical_whitespace +106 -0
- data/test/{test_initializers → test_tab_files}/text +0 -0
- data/test/test_tab_files/trailing_comments +59 -0
- data/test/units/tabulous_formatter_test.rb +8 -8
- metadata +13 -13
- data/test/applications/subtabs/config/initializers/tabulous.rb +0 -167
- data/test/test_initializers/expected +0 -55
- data/test/test_initializers/random_horizontal_whitespace +0 -55
- data/test/test_initializers/random_vertical_whitespace +0 -102
- data/test/test_initializers/trailing_comments +0 -55
@@ -0,0 +1,106 @@
|
|
1
|
+
Tabulous.setup do |config|
|
2
|
+
|
3
|
+
config.tabs do
|
4
|
+
[
|
5
|
+
|
6
|
+
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
7
|
+
|
8
|
+
# TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
|
9
|
+
|
10
|
+
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
11
|
+
|
12
|
+
[ :home_tab , 'Explanation' , '/' , true , true ],
|
13
|
+
[ :galaxies_tab , 'Galaxies' , '/galaxies/elliptical_galaxies' , true , true ],
|
14
|
+
|
15
|
+
|
16
|
+
[ :elliptical_galaxies_subtab , 'Elliptical Galaxies' , '/galaxies/elliptical_galaxies' , true , true ],
|
17
|
+
[ :spiral_galaxies_subtab , 'Spiral Galaxies' , '/galaxies/spiral_galaxies' , true , true ],
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
[ :lenticular_galaxies_subtab , 'Lenticular Galaxies' , '/galaxies/lenticular_galaxies' , true , true ],
|
22
|
+
[ :planets_tab , 'Planets' , '/exoplanets' , true , true ],
|
23
|
+
[ :exoplanets_subtab , 'Exoplanets' , '/exoplanets' , true , true ],
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
[ :rogue_planets_subtab , 'Rogue Planets' , '/rogue_planets' , true , true ],
|
29
|
+
[ :stars_tab , 'Stars' , '/stars' , true , true ],
|
30
|
+
[ :hidden_tab , 'Hidden' , '/hidden/always_visible' , lambda { request.path =~ /(hidden|galaxies)/ } , true ],
|
31
|
+
[ :always_visible_subtab , 'Always Visible' , '/hidden/always_visible' , true , true ],
|
32
|
+
[ :always_hidden_subtab , 'Always Hidden' , '/hidden/always_hidden' , false , true ],
|
33
|
+
[ :disabled_tab , 'Disabled' , '/disabled/always_enabled' , true , lambda { request.path =~ /(disabled|stars)/ } ],
|
34
|
+
[ :always_enabled_subtab , 'Always Enabled' , '/disabled/always_enabled' , true , true ],
|
35
|
+
[ :always_disabled_subtab , 'Always Disabled' , '/disabled/always_disabled' , true , false ],
|
36
|
+
|
37
|
+
|
38
|
+
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
# TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
]
|
51
|
+
end
|
52
|
+
|
53
|
+
config.actions do
|
54
|
+
[
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
#-----------------------------------------------------------------------------------------#
|
61
|
+
|
62
|
+
# CONTROLLER | ACTION | TAB #
|
63
|
+
|
64
|
+
|
65
|
+
#-----------------------------------------------------------------------------------------#
|
66
|
+
|
67
|
+
[ :home , :all_actions , :home_tab ],
|
68
|
+
[ :elliptical_galaxies , :all_actions , :elliptical_galaxies_subtab ],
|
69
|
+
[ :spiral_galaxies , :all_actions , :spiral_galaxies_subtab ],
|
70
|
+
[ :lenticular_galaxies , :all_actions , :lenticular_galaxies_subtab ],
|
71
|
+
[ :exoplanets , :all_actions , :exoplanets_subtab ],
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
[ :rogue_planets , :all_actions , :rogue_planets_subtab ],
|
80
|
+
|
81
|
+
[ :stars , :all_actions , :stars_tab ],
|
82
|
+
|
83
|
+
[ :misc , :always_visible , :always_visible_subtab ],
|
84
|
+
|
85
|
+
[ :misc , :always_hidden , :always_hidden_subtab ],
|
86
|
+
[ :misc , :always_enabled , :always_enabled_subtab ],
|
87
|
+
[ :misc , :always_disabled , :always_disabled_subtab ],
|
88
|
+
#-----------------------------------------------------------------------------------------#
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
# CONTROLLER | ACTION | TAB #
|
93
|
+
|
94
|
+
#-----------------------------------------------------------------------------------------#
|
95
|
+
]
|
96
|
+
end
|
97
|
+
|
98
|
+
config.css.scaffolding = true
|
99
|
+
config.css.background_color = '#cec'
|
100
|
+
config.css.text_color = '#464'
|
101
|
+
config.css.active_tab_color = '#fff'
|
102
|
+
config.css.hover_tab_color = '#dfd'
|
103
|
+
config.css.inactive_tab_color = '#aca'
|
104
|
+
config.css.inactive_text_color = '#8a8'
|
105
|
+
|
106
|
+
end
|
File without changes
|
@@ -0,0 +1,59 @@
|
|
1
|
+
Tabulous.setup do |config|
|
2
|
+
|
3
|
+
config.tabs do # this comment should be preserved and not otherwise affect anything
|
4
|
+
[ # this comment should be preserved and not otherwise affect anything
|
5
|
+
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
6
|
+
# TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
|
7
|
+
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
8
|
+
[ :home_tab , 'Explanation' , '/' , true , true ], # this comment should be preserved and not otherwise affect anything
|
9
|
+
[ :galaxies_tab , 'Galaxies' , '/galaxies/elliptical_galaxies' , true , true ],
|
10
|
+
[ :elliptical_galaxies_subtab , 'Elliptical Galaxies' , '/galaxies/elliptical_galaxies' , true , true ],
|
11
|
+
[ :spiral_galaxies_subtab , 'Spiral Galaxies' , '/galaxies/spiral_galaxies' , true , true ],
|
12
|
+
[ :lenticular_galaxies_subtab , 'Lenticular Galaxies' , '/galaxies/lenticular_galaxies' , true , true ],
|
13
|
+
[ :planets_tab , 'Planets' , '/exoplanets' , true , true ], # this comment should be preserved and not otherwise affect anything
|
14
|
+
[ :exoplanets_subtab , 'Exoplanets' , '/exoplanets' , true , true ],
|
15
|
+
[ :rogue_planets_subtab , 'Rogue Planets' , '/rogue_planets' , true , true ],
|
16
|
+
[ :stars_tab , 'Stars' , '/stars' , true , true ],
|
17
|
+
[ :hidden_tab , 'Hidden' , '/hidden/always_visible' , lambda { request.path =~ /(hidden|galaxies)/ } , true ],
|
18
|
+
[ :always_visible_subtab , 'Always Visible' , '/hidden/always_visible' , true , true ],
|
19
|
+
[ :always_hidden_subtab , 'Always Hidden' , '/hidden/always_hidden' , false , true ],
|
20
|
+
[ :disabled_tab , 'Disabled' , '/disabled/always_enabled' , true , lambda { request.path =~ /(disabled|stars)/ } ],
|
21
|
+
[ :always_enabled_subtab , 'Always Enabled' , '/disabled/always_enabled' , true , true ],
|
22
|
+
[ :always_disabled_subtab , 'Always Disabled' , '/disabled/always_disabled' , true , false ], # this comment should be preserved and not otherwise affect anything
|
23
|
+
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
24
|
+
# TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
|
25
|
+
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
26
|
+
] # this comment should be preserved and not otherwise affect anything
|
27
|
+
end # this comment should be preserved and not otherwise affect anything
|
28
|
+
|
29
|
+
config.actions do # this comment should be preserved and not otherwise affect anything
|
30
|
+
[ # this comment should be preserved and not otherwise affect anything
|
31
|
+
#-----------------------------------------------------------------------------------------#
|
32
|
+
# CONTROLLER | ACTION | TAB #
|
33
|
+
#-----------------------------------------------------------------------------------------#
|
34
|
+
[ :home , :all_actions , :home_tab ], # this comment should be preserved and not otherwise affect anything
|
35
|
+
[ :elliptical_galaxies , :all_actions , :elliptical_galaxies_subtab ],
|
36
|
+
[ :spiral_galaxies , :all_actions , :spiral_galaxies_subtab ],
|
37
|
+
[ :lenticular_galaxies , :all_actions , :lenticular_galaxies_subtab ],
|
38
|
+
[ :exoplanets , :all_actions , :exoplanets_subtab ],
|
39
|
+
[ :rogue_planets , :all_actions , :rogue_planets_subtab ], # this comment should be preserved and not otherwise affect anything
|
40
|
+
[ :stars , :all_actions , :stars_tab ],
|
41
|
+
[ :misc , :always_visible , :always_visible_subtab ],
|
42
|
+
[ :misc , :always_hidden , :always_hidden_subtab ],
|
43
|
+
[ :misc , :always_enabled , :always_enabled_subtab ],
|
44
|
+
[ :misc , :always_disabled , :always_disabled_subtab ],
|
45
|
+
#-----------------------------------------------------------------------------------------#
|
46
|
+
# CONTROLLER | ACTION | TAB #
|
47
|
+
#-----------------------------------------------------------------------------------------#
|
48
|
+
] # this comment should be preserved and not otherwise affect anything
|
49
|
+
end # this comment should be preserved and not otherwise affect anything
|
50
|
+
|
51
|
+
config.css.scaffolding = true
|
52
|
+
config.css.background_color = '#cec'
|
53
|
+
config.css.text_color = '#464'
|
54
|
+
config.css.active_tab_color = '#fff'
|
55
|
+
config.css.hover_tab_color = '#dfd'
|
56
|
+
config.css.inactive_tab_color = '#aca'
|
57
|
+
config.css.inactive_text_color = '#8a8'
|
58
|
+
|
59
|
+
end
|
@@ -26,41 +26,41 @@ class TabulousFormatterTest < Test::Unit::TestCase
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def test_empty_in_empty_out
|
29
|
-
input = IO.readlines('test/
|
29
|
+
input = IO.readlines('test/test_tab_files/empty')
|
30
30
|
result = Tabulous::Formatter.format(input)
|
31
31
|
assert_equal [], result
|
32
32
|
end
|
33
33
|
|
34
34
|
def test_text_in_text_out
|
35
|
-
input = IO.readlines('test/
|
35
|
+
input = IO.readlines('test/test_tab_files/text')
|
36
36
|
expected = input
|
37
37
|
actual = Tabulous::Formatter.format(input)
|
38
38
|
assert_same_text expected, actual
|
39
39
|
end
|
40
40
|
|
41
41
|
def test_well_formatted_in_well_formatted_out
|
42
|
-
input = IO.readlines('test/
|
42
|
+
input = IO.readlines('test/test_tab_files/expected')
|
43
43
|
expected = input
|
44
44
|
actual = Tabulous::Formatter.format(input)
|
45
45
|
assert_same_text expected, actual
|
46
46
|
end
|
47
47
|
|
48
48
|
def test_random_horizontal_whitespace
|
49
|
-
input = IO.readlines('test/
|
50
|
-
expected = IO.readlines('test/
|
49
|
+
input = IO.readlines('test/test_tab_files/random_horizontal_whitespace')
|
50
|
+
expected = IO.readlines('test/test_tab_files/expected')
|
51
51
|
actual = Tabulous::Formatter.format(input)
|
52
52
|
assert_same_text expected, actual
|
53
53
|
end
|
54
54
|
|
55
55
|
def test_random_vertical_whitespace
|
56
|
-
input = IO.readlines('test/
|
57
|
-
expected = IO.readlines('test/
|
56
|
+
input = IO.readlines('test/test_tab_files/random_vertical_whitespace')
|
57
|
+
expected = IO.readlines('test/test_tab_files/expected')
|
58
58
|
actual = Tabulous::Formatter.format(input)
|
59
59
|
assert_same_text expected, actual
|
60
60
|
end
|
61
61
|
|
62
62
|
def test_trailing_comments
|
63
|
-
input = IO.readlines('test/
|
63
|
+
input = IO.readlines('test/test_tab_files/trailing_comments')
|
64
64
|
expected = input
|
65
65
|
actual = Tabulous::Formatter.format(input)
|
66
66
|
assert_same_text expected, actual
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tabulous
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
|
+
- 1
|
7
8
|
- 0
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 0.0.2
|
10
|
+
version: 1.0.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Wyatt Greene
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-03-
|
18
|
+
date: 2011-03-04 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -172,6 +172,7 @@ files:
|
|
172
172
|
- test/applications/main/app/models/galaxy.rb
|
173
173
|
- test/applications/main/app/models/planet.rb
|
174
174
|
- test/applications/main/app/models/star.rb
|
175
|
+
- test/applications/main/app/tabs/tabulous.rb
|
175
176
|
- test/applications/main/app/views/galaxies/_form.html.erb
|
176
177
|
- test/applications/main/app/views/galaxies/edit.html.erb
|
177
178
|
- test/applications/main/app/views/galaxies/index.html.erb
|
@@ -205,7 +206,6 @@ files:
|
|
205
206
|
- test/applications/main/config/initializers/mime_types.rb
|
206
207
|
- test/applications/main/config/initializers/secret_token.rb
|
207
208
|
- test/applications/main/config/initializers/session_store.rb
|
208
|
-
- test/applications/main/config/initializers/tabulous.rb
|
209
209
|
- test/applications/main/config/locales/en.yml
|
210
210
|
- test/applications/main/config/routes.rb
|
211
211
|
- test/applications/main/db/development.sqlite3
|
@@ -256,6 +256,7 @@ files:
|
|
256
256
|
- test/applications/simple_tabs/app/models/galaxy.rb
|
257
257
|
- test/applications/simple_tabs/app/models/planet.rb
|
258
258
|
- test/applications/simple_tabs/app/models/star.rb
|
259
|
+
- test/applications/simple_tabs/app/tabs/tabulous.rb
|
259
260
|
- test/applications/simple_tabs/app/views/galaxies/_form.html.erb
|
260
261
|
- test/applications/simple_tabs/app/views/galaxies/edit.html.erb
|
261
262
|
- test/applications/simple_tabs/app/views/galaxies/index.html.erb
|
@@ -286,7 +287,6 @@ files:
|
|
286
287
|
- test/applications/simple_tabs/config/initializers/mime_types.rb
|
287
288
|
- test/applications/simple_tabs/config/initializers/secret_token.rb
|
288
289
|
- test/applications/simple_tabs/config/initializers/session_store.rb
|
289
|
-
- test/applications/simple_tabs/config/initializers/tabulous.rb
|
290
290
|
- test/applications/simple_tabs/config/locales/en.yml
|
291
291
|
- test/applications/simple_tabs/config/routes.rb
|
292
292
|
- test/applications/simple_tabs/db/development.sqlite3
|
@@ -336,6 +336,7 @@ files:
|
|
336
336
|
- test/applications/subtabs/app/models/rogue_planet.rb
|
337
337
|
- test/applications/subtabs/app/models/spiral_galaxy.rb
|
338
338
|
- test/applications/subtabs/app/models/star.rb
|
339
|
+
- test/applications/subtabs/app/tabs/tabulous.rb
|
339
340
|
- test/applications/subtabs/app/views/exoplanets/_form.html.erb
|
340
341
|
- test/applications/subtabs/app/views/exoplanets/edit.html.erb
|
341
342
|
- test/applications/subtabs/app/views/exoplanets/index.html.erb
|
@@ -383,7 +384,6 @@ files:
|
|
383
384
|
- test/applications/subtabs/config/initializers/mime_types.rb
|
384
385
|
- test/applications/subtabs/config/initializers/secret_token.rb
|
385
386
|
- test/applications/subtabs/config/initializers/session_store.rb
|
386
|
-
- test/applications/subtabs/config/initializers/tabulous.rb
|
387
387
|
- test/applications/subtabs/config/locales/en.yml
|
388
388
|
- test/applications/subtabs/config/routes.rb
|
389
389
|
- test/applications/subtabs/db/development.sqlite3
|
@@ -418,12 +418,12 @@ files:
|
|
418
418
|
- test/test_application_gemfile.rb
|
419
419
|
- test/test_application_integration_test_helper.rb
|
420
420
|
- test/test_application_test_helper.rb
|
421
|
-
- test/
|
422
|
-
- test/
|
423
|
-
- test/
|
424
|
-
- test/
|
425
|
-
- test/
|
426
|
-
- test/
|
421
|
+
- test/test_tab_files/empty
|
422
|
+
- test/test_tab_files/expected
|
423
|
+
- test/test_tab_files/random_horizontal_whitespace
|
424
|
+
- test/test_tab_files/random_vertical_whitespace
|
425
|
+
- test/test_tab_files/text
|
426
|
+
- test/test_tab_files/trailing_comments
|
427
427
|
- test/unit_test_helper.rb
|
428
428
|
- test/units/tabulous_formatter_test.rb
|
429
429
|
has_rdoc: true
|
@@ -1,167 +0,0 @@
|
|
1
|
-
# Tabulous gives you an easy way to set up tabs for your Rails application.
|
2
|
-
#
|
3
|
-
# 1. Configure this initializer.
|
4
|
-
# 2. Add <%= tabs %> and <%= subtabs %> in your layout(s) wherever you want
|
5
|
-
# your tabs to appear.
|
6
|
-
# 3. Add styles for these tabs in your stylesheets.
|
7
|
-
# 4. Profit!
|
8
|
-
|
9
|
-
Tabulous.setup do |config|
|
10
|
-
|
11
|
-
#---------------------------
|
12
|
-
# HOW TO USE THE TABLES
|
13
|
-
#---------------------------
|
14
|
-
#
|
15
|
-
# The following tables are just an array of arrays. As such, you can put
|
16
|
-
# any Ruby code into a cell. For example, you could put "/foo/bar" in
|
17
|
-
# a path cell or you could put "/foo" + "/bar". You can even wrap up code
|
18
|
-
# in a lambda to be executed later. These will be executed in the context
|
19
|
-
# of a Rails view meaning they will have access to view helpers.
|
20
|
-
#
|
21
|
-
# However, there is something special about the format of these tables.
|
22
|
-
# Because it would be a pain for you to manually prettify the tables each
|
23
|
-
# time you edit them, there is a special rake task that does this for
|
24
|
-
# you: rake tabs:format. However, for this prettifier to work properly
|
25
|
-
# you have to follow some special rules:
|
26
|
-
#
|
27
|
-
# * No comments are allowed between rows.
|
28
|
-
# * Comments are allowed to the right of rows, except for header rows.
|
29
|
-
# * And most importantly: commas that separate cells should be surrounded
|
30
|
-
# by spaces and commas that are within cells should not. This gives the
|
31
|
-
# formatter an easy way to distinguish between cells without having
|
32
|
-
# to actually parse the Ruby.
|
33
|
-
|
34
|
-
#----------
|
35
|
-
# TABS
|
36
|
-
#----------
|
37
|
-
#
|
38
|
-
# This is where you define your tabs and subtabs. The order that the tabs
|
39
|
-
# appear in this list is the order they will appear in your views. Any
|
40
|
-
# subtabs defined will have the previous tab as their parent.
|
41
|
-
#
|
42
|
-
# TAB NAME
|
43
|
-
# must end in _tab or _subtab
|
44
|
-
# DISPLAY TEXT
|
45
|
-
# the text the user sees on the tab
|
46
|
-
# PATH
|
47
|
-
# the URL that gets sent to the server when the tab is clicked
|
48
|
-
# VISIBLE
|
49
|
-
# whether to display the tab
|
50
|
-
# ENABLED
|
51
|
-
# whether the tab is disabled (unclickable)
|
52
|
-
|
53
|
-
config.tabs = [
|
54
|
-
#--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
55
|
-
# TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
|
56
|
-
#--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
57
|
-
[ :home_tab , 'Explanation' , '/' , true , true ],
|
58
|
-
[ :galaxies_tab , 'Galaxies' , '/galaxies/elliptical_galaxies' , true , true ],
|
59
|
-
[ :elliptical_galaxies_subtab , 'Elliptical Galaxies' , '/galaxies/elliptical_galaxies' , true , true ],
|
60
|
-
[ :spiral_galaxies_subtab , 'Spiral Galaxies' , '/galaxies/spiral_galaxies' , true , true ],
|
61
|
-
[ :lenticular_galaxies_subtab , 'Lenticular Galaxies' , '/galaxies/lenticular_galaxies' , true , true ],
|
62
|
-
[ :planets_tab , 'Planets' , '/exoplanets' , true , true ],
|
63
|
-
[ :exoplanets_subtab , 'Exoplanets' , '/exoplanets' , true , true ],
|
64
|
-
[ :rogue_planets_subtab , 'Rogue Planets' , '/rogue_planets' , true , true ],
|
65
|
-
[ :stars_tab , lambda { request.path =~ /stars/ ? 'Stars!' : 'Stars' } , lambda { stars_path } , true , true ],
|
66
|
-
[ :hidden_tab , 'Hidden' , '/hidden/always_visible' , lambda { request.path =~ /(hidden|galaxies)/ } , true ],
|
67
|
-
[ :always_visible_subtab , 'Always Visible' , '/hidden/always_visible' , true , true ],
|
68
|
-
[ :always_hidden_subtab , 'Always Hidden' , '/hidden/always_hidden' , false , true ],
|
69
|
-
[ :disabled_tab , 'Disabled' , '/disabled/always_enabled' , true , lambda { request.path =~ /(disabled|stars)/ } ],
|
70
|
-
[ :always_enabled_subtab , 'Always Enabled' , '/disabled/always_enabled' , true , true ],
|
71
|
-
[ :always_disabled_subtab , 'Always Disabled' , '/disabled/always_disabled' , true , false ],
|
72
|
-
#--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
73
|
-
# TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
|
74
|
-
#--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
75
|
-
]
|
76
|
-
|
77
|
-
#-------------
|
78
|
-
# ACTIONS
|
79
|
-
#-------------
|
80
|
-
#
|
81
|
-
# This is where you hook up actions with tabs. That way tabulous knows
|
82
|
-
# which tab and subtab to mark active when an action is rendered.
|
83
|
-
#
|
84
|
-
# CONTROLLER
|
85
|
-
# the name of the controller
|
86
|
-
# ACTION
|
87
|
-
# the name of the action, or :all_actions
|
88
|
-
# TAB
|
89
|
-
# the name of the tab or subtab that is active when this action is rendered
|
90
|
-
|
91
|
-
config.actions = [
|
92
|
-
#-----------------------------------------------------------------------------------------#
|
93
|
-
# CONTROLLER | ACTION | TAB #
|
94
|
-
#-----------------------------------------------------------------------------------------#
|
95
|
-
[ :home , :all_actions , :home_tab ],
|
96
|
-
[ :elliptical_galaxies , :all_actions , :elliptical_galaxies_subtab ],
|
97
|
-
[ :spiral_galaxies , :all_actions , :spiral_galaxies_subtab ],
|
98
|
-
[ :lenticular_galaxies , :all_actions , :lenticular_galaxies_subtab ],
|
99
|
-
[ :exoplanets , :all_actions , :exoplanets_subtab ],
|
100
|
-
[ :rogue_planets , :all_actions , :rogue_planets_subtab ],
|
101
|
-
[ :stars , :all_actions , :stars_tab ],
|
102
|
-
[ :misc , :always_visible , :always_visible_subtab ],
|
103
|
-
[ :misc , :always_hidden , :always_hidden_subtab ],
|
104
|
-
[ :misc , :always_enabled , :always_enabled_subtab ],
|
105
|
-
[ :misc , :always_disabled , :always_disabled_subtab ],
|
106
|
-
#-----------------------------------------------------------------------------------------#
|
107
|
-
# CONTROLLER | ACTION | TAB #
|
108
|
-
#-----------------------------------------------------------------------------------------#
|
109
|
-
]
|
110
|
-
|
111
|
-
#-------------
|
112
|
-
# OPTIONS
|
113
|
-
#-------------
|
114
|
-
|
115
|
-
# By default, you cannot click on the active tab.
|
116
|
-
config.active_tab_clickable = false
|
117
|
-
|
118
|
-
# By default, the subtabs HTML element is not rendered if it is empty.
|
119
|
-
config.always_render_subtabs = false
|
120
|
-
|
121
|
-
# By default, when an action renders and no tab is defined for that action,
|
122
|
-
# an error is thrown. If you turn this off, no error is thrown and the
|
123
|
-
# tabs are simply not rendered.
|
124
|
-
config.raise_error_if_no_tab_found = true
|
125
|
-
|
126
|
-
# By default, div elements are used in the tab markup. When html5 is
|
127
|
-
# true, nav elements are used instead.
|
128
|
-
config.html5 = false
|
129
|
-
|
130
|
-
#------------
|
131
|
-
# STYLES
|
132
|
-
#------------
|
133
|
-
#
|
134
|
-
# The markup that is generated has the following properties:
|
135
|
-
#
|
136
|
-
# Tabs and subtabs that are selected have the class "active".
|
137
|
-
# Tabs and subtabs that are not selected have the class "inactive".
|
138
|
-
# Tabs that are disabled have the class "disabled"; otherwise, "enabled".
|
139
|
-
# Tabs that are not visible do not appear in the markup at all.
|
140
|
-
#
|
141
|
-
# These classes are provided to make it easier for you to create your
|
142
|
-
# own CSS (and JavaScript) for the tabs.
|
143
|
-
|
144
|
-
# Some styles will be generated for you to get you off to a good start.
|
145
|
-
# Scaffolded styles are not meant to be used in production as they
|
146
|
-
# generate invalid HTML markup. They are merely meant to give you a
|
147
|
-
# head start or an easy way to prototype quickly.
|
148
|
-
#
|
149
|
-
config.css.scaffolding = true
|
150
|
-
|
151
|
-
# You can tweak the colors of the generated CSS.
|
152
|
-
#
|
153
|
-
config.css.background_color = '#cec'
|
154
|
-
config.css.text_color = '#464'
|
155
|
-
config.css.active_tab_color = '#fff'
|
156
|
-
config.css.hover_tab_color = '#dfd'
|
157
|
-
config.css.inactive_tab_color = '#aca'
|
158
|
-
config.css.inactive_text_color = '#8a8'
|
159
|
-
|
160
|
-
#-----------
|
161
|
-
# NOTES
|
162
|
-
#-----------
|
163
|
-
#
|
164
|
-
# In development mode this initializer is reloaded for each request so that
|
165
|
-
# you don't have to restart the server each time you edit this file.
|
166
|
-
|
167
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
Tabulous.setup do |config|
|
2
|
-
|
3
|
-
config.tabs = [
|
4
|
-
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
5
|
-
# TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
|
6
|
-
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
7
|
-
[ :home_tab , 'Explanation' , '/' , true , true ],
|
8
|
-
[ :galaxies_tab , 'Galaxies' , '/galaxies/elliptical_galaxies' , true , true ],
|
9
|
-
[ :elliptical_galaxies_subtab , 'Elliptical Galaxies' , '/galaxies/elliptical_galaxies' , true , true ],
|
10
|
-
[ :spiral_galaxies_subtab , 'Spiral Galaxies' , '/galaxies/spiral_galaxies' , true , true ],
|
11
|
-
[ :lenticular_galaxies_subtab , 'Lenticular Galaxies' , '/galaxies/lenticular_galaxies' , true , true ],
|
12
|
-
[ :planets_tab , 'Planets' , '/exoplanets' , true , true ],
|
13
|
-
[ :exoplanets_subtab , 'Exoplanets' , '/exoplanets' , true , true ],
|
14
|
-
[ :rogue_planets_subtab , 'Rogue Planets' , '/rogue_planets' , true , true ],
|
15
|
-
[ :stars_tab , 'Stars' , '/stars' , true , true ],
|
16
|
-
[ :hidden_tab , 'Hidden' , '/hidden/always_visible' , lambda { request.path =~ /(hidden|galaxies)/ } , true ],
|
17
|
-
[ :always_visible_subtab , 'Always Visible' , '/hidden/always_visible' , true , true ],
|
18
|
-
[ :always_hidden_subtab , 'Always Hidden' , '/hidden/always_hidden' , false , true ],
|
19
|
-
[ :disabled_tab , 'Disabled' , '/disabled/always_enabled' , true , lambda { request.path =~ /(disabled|stars)/ } ],
|
20
|
-
[ :always_enabled_subtab , 'Always Enabled' , '/disabled/always_enabled' , true , true ],
|
21
|
-
[ :always_disabled_subtab , 'Always Disabled' , '/disabled/always_disabled' , true , false ],
|
22
|
-
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
23
|
-
# TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
|
24
|
-
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
25
|
-
]
|
26
|
-
|
27
|
-
config.actions = [
|
28
|
-
#-----------------------------------------------------------------------------------------#
|
29
|
-
# CONTROLLER | ACTION | TAB #
|
30
|
-
#-----------------------------------------------------------------------------------------#
|
31
|
-
[ :home , :all_actions , :home_tab ],
|
32
|
-
[ :elliptical_galaxies , :all_actions , :elliptical_galaxies_subtab ],
|
33
|
-
[ :spiral_galaxies , :all_actions , :spiral_galaxies_subtab ],
|
34
|
-
[ :lenticular_galaxies , :all_actions , :lenticular_galaxies_subtab ],
|
35
|
-
[ :exoplanets , :all_actions , :exoplanets_subtab ],
|
36
|
-
[ :rogue_planets , :all_actions , :rogue_planets_subtab ],
|
37
|
-
[ :stars , :all_actions , :stars_tab ],
|
38
|
-
[ :misc , :always_visible , :always_visible_subtab ],
|
39
|
-
[ :misc , :always_hidden , :always_hidden_subtab ],
|
40
|
-
[ :misc , :always_enabled , :always_enabled_subtab ],
|
41
|
-
[ :misc , :always_disabled , :always_disabled_subtab ],
|
42
|
-
#-----------------------------------------------------------------------------------------#
|
43
|
-
# CONTROLLER | ACTION | TAB #
|
44
|
-
#-----------------------------------------------------------------------------------------#
|
45
|
-
]
|
46
|
-
|
47
|
-
config.css.scaffolding = true
|
48
|
-
config.css.background_color = '#cec'
|
49
|
-
config.css.text_color = '#464'
|
50
|
-
config.css.active_tab_color = '#fff'
|
51
|
-
config.css.hover_tab_color = '#dfd'
|
52
|
-
config.css.inactive_tab_color = '#aca'
|
53
|
-
config.css.inactive_text_color = '#8a8'
|
54
|
-
|
55
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
Tabulous.setup do |config|
|
2
|
-
|
3
|
-
config.tabs = [
|
4
|
-
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
5
|
-
# TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
|
6
|
-
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
7
|
-
[ :home_tab , 'Explanation' , '/' , true , true ],
|
8
|
-
[ :galaxies_tab , 'Galaxies' , '/galaxies/elliptical_galaxies' , true , true ],
|
9
|
-
[ :elliptical_galaxies_subtab , 'Elliptical Galaxies' , '/galaxies/elliptical_galaxies' , true , true ],
|
10
|
-
[ :spiral_galaxies_subtab , 'Spiral Galaxies' , '/galaxies/spiral_galaxies' , true , true ],
|
11
|
-
[ :lenticular_galaxies_subtab , 'Lenticular Galaxies' , '/galaxies/lenticular_galaxies' , true , true ],
|
12
|
-
[ :planets_tab , 'Planets' , '/exoplanets' , true , true ],
|
13
|
-
[ :exoplanets_subtab , 'Exoplanets' , '/exoplanets' , true , true ],
|
14
|
-
[ :rogue_planets_subtab , 'Rogue Planets' , '/rogue_planets' , true , true ],
|
15
|
-
[ :stars_tab , 'Stars' , '/stars' , true , true ],
|
16
|
-
[ :hidden_tab , 'Hidden' , '/hidden/always_visible' , lambda { request.path =~ /(hidden|galaxies)/ } , true ],
|
17
|
-
[ :always_visible_subtab , 'Always Visible' , '/hidden/always_visible' , true , true ],
|
18
|
-
[ :always_hidden_subtab , 'Always Hidden' , '/hidden/always_hidden' , false , true ],
|
19
|
-
[ :disabled_tab , 'Disabled' , '/disabled/always_enabled' , true , lambda { request.path =~ /(disabled|stars)/ } ],
|
20
|
-
[ :always_enabled_subtab , 'Always Enabled' , '/disabled/always_enabled' , true , true ],
|
21
|
-
[ :always_disabled_subtab , 'Always Disabled' , '/disabled/always_disabled' , true , false ],
|
22
|
-
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
23
|
-
# TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
|
24
|
-
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
25
|
-
]
|
26
|
-
|
27
|
-
config.actions = [
|
28
|
-
#-----------------------------------------------------------------------------------------#
|
29
|
-
# CONTROLLER | ACTION | TAB #
|
30
|
-
#-----------------------------------------------------------------------------------------#
|
31
|
-
[ :home , :all_actions , :home_tab ],
|
32
|
-
[ :elliptical_galaxies , :all_actions , :elliptical_galaxies_subtab ],
|
33
|
-
[ :spiral_galaxies , :all_actions , :spiral_galaxies_subtab ],
|
34
|
-
[ :lenticular_galaxies , :all_actions , :lenticular_galaxies_subtab ],
|
35
|
-
[ :exoplanets , :all_actions , :exoplanets_subtab ],
|
36
|
-
[ :rogue_planets , :all_actions , :rogue_planets_subtab ],
|
37
|
-
[ :stars , :all_actions , :stars_tab ],
|
38
|
-
[ :misc , :always_visible , :always_visible_subtab ],
|
39
|
-
[ :misc , :always_hidden , :always_hidden_subtab ],
|
40
|
-
[ :misc , :always_enabled , :always_enabled_subtab ],
|
41
|
-
[ :misc , :always_disabled , :always_disabled_subtab ],
|
42
|
-
#-----------------------------------------------------------------------------------------#
|
43
|
-
# CONTROLLER | ACTION | TAB #
|
44
|
-
#-----------------------------------------------------------------------------------------#
|
45
|
-
]
|
46
|
-
|
47
|
-
config.css.scaffolding = true
|
48
|
-
config.css.background_color = '#cec'
|
49
|
-
config.css.text_color = '#464'
|
50
|
-
config.css.active_tab_color = '#fff'
|
51
|
-
config.css.hover_tab_color = '#dfd'
|
52
|
-
config.css.inactive_tab_color = '#aca'
|
53
|
-
config.css.inactive_text_color = '#8a8'
|
54
|
-
|
55
|
-
end
|