activeadmin 0.1.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activeadmin might be problematic. Click here for more details.

Files changed (89) hide show
  1. data/.document +5 -0
  2. data/.gitignore +25 -0
  3. data/Gemfile +16 -0
  4. data/LICENSE +20 -0
  5. data/README.rdoc +201 -0
  6. data/Rakefile +71 -0
  7. data/active_admin.gemspec +22 -0
  8. data/lib/active_admin.rb +229 -0
  9. data/lib/active_admin/action_builder.rb +60 -0
  10. data/lib/active_admin/action_items.rb +48 -0
  11. data/lib/active_admin/asset_registration.rb +34 -0
  12. data/lib/active_admin/breadcrumbs.rb +26 -0
  13. data/lib/active_admin/dashboards.rb +50 -0
  14. data/lib/active_admin/dashboards/dashboard_controller.rb +40 -0
  15. data/lib/active_admin/dashboards/renderer.rb +45 -0
  16. data/lib/active_admin/dashboards/section.rb +43 -0
  17. data/lib/active_admin/dashboards/section_renderer.rb +28 -0
  18. data/lib/active_admin/filters.rb +189 -0
  19. data/lib/active_admin/form_builder.rb +91 -0
  20. data/lib/active_admin/helpers/optional_display.rb +34 -0
  21. data/lib/active_admin/menu.rb +42 -0
  22. data/lib/active_admin/menu_item.rb +67 -0
  23. data/lib/active_admin/namespace.rb +111 -0
  24. data/lib/active_admin/page_config.rb +15 -0
  25. data/lib/active_admin/pages.rb +11 -0
  26. data/lib/active_admin/pages/base.rb +92 -0
  27. data/lib/active_admin/pages/edit.rb +21 -0
  28. data/lib/active_admin/pages/index.rb +58 -0
  29. data/lib/active_admin/pages/index/blog.rb +65 -0
  30. data/lib/active_admin/pages/index/table.rb +48 -0
  31. data/lib/active_admin/pages/index/thumbnails.rb +40 -0
  32. data/lib/active_admin/pages/new.rb +21 -0
  33. data/lib/active_admin/pages/show.rb +54 -0
  34. data/lib/active_admin/renderer.rb +72 -0
  35. data/lib/active_admin/resource.rb +96 -0
  36. data/lib/active_admin/resource_controller.rb +325 -0
  37. data/lib/active_admin/sidebar.rb +78 -0
  38. data/lib/active_admin/table_builder.rb +162 -0
  39. data/lib/active_admin/tabs_renderer.rb +39 -0
  40. data/lib/active_admin/version.rb +3 -0
  41. data/lib/active_admin/view_helpers.rb +106 -0
  42. data/lib/active_admin/views/active_admin_dashboard/index.html.erb +1 -0
  43. data/lib/active_admin/views/active_admin_default/edit.html.erb +1 -0
  44. data/lib/active_admin/views/active_admin_default/index.csv.erb +2 -0
  45. data/lib/active_admin/views/active_admin_default/index.html.erb +1 -0
  46. data/lib/active_admin/views/active_admin_default/new.html.erb +1 -0
  47. data/lib/active_admin/views/active_admin_default/show.html.erb +1 -0
  48. data/lib/active_admin/views/layouts/active_admin.html.erb +40 -0
  49. data/lib/activeadmin.rb +1 -0
  50. data/lib/generators/active_admin/install/install_generator.rb +31 -0
  51. data/lib/generators/active_admin/install/templates/active_admin.css +325 -0
  52. data/lib/generators/active_admin/install/templates/active_admin.js +10 -0
  53. data/lib/generators/active_admin/install/templates/active_admin.rb +47 -0
  54. data/lib/generators/active_admin/install/templates/active_admin_vendor.js +382 -0
  55. data/lib/generators/active_admin/install/templates/dashboards.rb +36 -0
  56. data/lib/generators/active_admin/install/templates/images/orderable.gif +0 -0
  57. data/lib/generators/active_admin/resource/resource_generator.rb +16 -0
  58. data/lib/generators/active_admin/resource/templates/admin.rb +3 -0
  59. data/spec/integration/dashboard_spec.rb +44 -0
  60. data/spec/integration/index_as_blog_spec.rb +65 -0
  61. data/spec/integration/index_as_csv_spec.rb +40 -0
  62. data/spec/integration/index_as_table_spec.rb +160 -0
  63. data/spec/integration/index_as_thumbnails_spec.rb +43 -0
  64. data/spec/integration/layout_spec.rb +82 -0
  65. data/spec/integration/new_view_spec.rb +52 -0
  66. data/spec/integration/show_view_spec.rb +91 -0
  67. data/spec/spec_helper.rb +104 -0
  68. data/spec/support/rails_template.rb +19 -0
  69. data/spec/unit/action_builder_spec.rb +76 -0
  70. data/spec/unit/action_items_spec.rb +41 -0
  71. data/spec/unit/active_admin_spec.rb +52 -0
  72. data/spec/unit/asset_registration_spec.rb +37 -0
  73. data/spec/unit/controller_filters_spec.rb +26 -0
  74. data/spec/unit/dashboard_section_spec.rb +63 -0
  75. data/spec/unit/dashboards_spec.rb +59 -0
  76. data/spec/unit/filter_form_builder_spec.rb +157 -0
  77. data/spec/unit/form_builder_spec.rb +238 -0
  78. data/spec/unit/menu_item_spec.rb +137 -0
  79. data/spec/unit/menu_spec.rb +53 -0
  80. data/spec/unit/namespace_spec.rb +107 -0
  81. data/spec/unit/registration_spec.rb +46 -0
  82. data/spec/unit/renderer_spec.rb +100 -0
  83. data/spec/unit/resource_controller_spec.rb +48 -0
  84. data/spec/unit/resource_spec.rb +197 -0
  85. data/spec/unit/routing_spec.rb +12 -0
  86. data/spec/unit/sidebar_spec.rb +96 -0
  87. data/spec/unit/table_builder_spec.rb +162 -0
  88. data/spec/unit/tabs_renderer_spec.rb +34 -0
  89. metadata +247 -0
@@ -0,0 +1,34 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe ActiveAdmin::TabsRenderer do
4
+
5
+ let(:renderer){ ActiveAdmin::TabsRenderer.new(mock_action_view) }
6
+ let(:menu){ ActiveAdmin::Menu.new }
7
+ let(:html){ renderer.to_html(menu) }
8
+
9
+ # Generate a menu to use
10
+ before do
11
+ menu.add "Blog Posts", "/admin/blog-posts"
12
+ menu.add "Reports", "/admin/reports"
13
+ end
14
+
15
+ it "should generate a ul" do
16
+ html.should have_tag("ul")
17
+ end
18
+
19
+ it "should generate an li for each item" do
20
+ html.should have_tag("li", :parent => { :tag => "ul" })
21
+ end
22
+
23
+ it "should generate a link for each item" do
24
+ html.should have_tag("a", "Blog Posts", :attributes => { :href => '/admin/blog-posts' })
25
+ end
26
+
27
+ describe "marking current item" do
28
+ it "should add the 'current' class to the li" do
29
+ renderer.instance_variable_set :@current_tab, "Blog Posts"
30
+ html.should have_tag("li", :attributes => { :class => "current" })
31
+ end
32
+ end
33
+
34
+ end
metadata ADDED
@@ -0,0 +1,247 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: activeadmin
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 0
9
+ version: 0.1.0
10
+ platform: ruby
11
+ authors:
12
+ - Greg Bell
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-09-07 00:00:00 -07:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ requirement: &id001 !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ segments:
26
+ - 3
27
+ - 0
28
+ - 0
29
+ version: 3.0.0
30
+ prerelease: false
31
+ type: :runtime
32
+ name: rails
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ requirement: &id002 !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ segments:
40
+ - 1
41
+ - 1
42
+ - 0
43
+ - beta
44
+ version: 1.1.0.beta
45
+ prerelease: false
46
+ type: :runtime
47
+ name: formtastic
48
+ version_requirements: *id002
49
+ - !ruby/object:Gem::Dependency
50
+ requirement: &id003 !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ segments:
55
+ - 3
56
+ - 0
57
+ - pre2
58
+ version: 3.0.pre2
59
+ prerelease: false
60
+ type: :runtime
61
+ name: will_paginate
62
+ version_requirements: *id003
63
+ - !ruby/object:Gem::Dependency
64
+ requirement: &id004 !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ segments:
69
+ - 0
70
+ - 9
71
+ - 2
72
+ version: 0.9.2
73
+ prerelease: false
74
+ type: :runtime
75
+ name: meta_search
76
+ version_requirements: *id004
77
+ - !ruby/object:Gem::Dependency
78
+ requirement: &id005 !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ segments:
83
+ - 0
84
+ version: "0"
85
+ prerelease: false
86
+ type: :runtime
87
+ name: inherited_views
88
+ version_requirements: *id005
89
+ description: The administration framework for Ruby on Rails.
90
+ email: gregdbell@gmail.com
91
+ executables: []
92
+
93
+ extensions: []
94
+
95
+ extra_rdoc_files:
96
+ - LICENSE
97
+ - README.rdoc
98
+ files:
99
+ - .document
100
+ - .gitignore
101
+ - Gemfile
102
+ - LICENSE
103
+ - README.rdoc
104
+ - Rakefile
105
+ - active_admin.gemspec
106
+ - lib/active_admin.rb
107
+ - lib/active_admin/action_builder.rb
108
+ - lib/active_admin/action_items.rb
109
+ - lib/active_admin/asset_registration.rb
110
+ - lib/active_admin/breadcrumbs.rb
111
+ - lib/active_admin/dashboards.rb
112
+ - lib/active_admin/dashboards/dashboard_controller.rb
113
+ - lib/active_admin/dashboards/renderer.rb
114
+ - lib/active_admin/dashboards/section.rb
115
+ - lib/active_admin/dashboards/section_renderer.rb
116
+ - lib/active_admin/filters.rb
117
+ - lib/active_admin/form_builder.rb
118
+ - lib/active_admin/helpers/optional_display.rb
119
+ - lib/active_admin/menu.rb
120
+ - lib/active_admin/menu_item.rb
121
+ - lib/active_admin/namespace.rb
122
+ - lib/active_admin/page_config.rb
123
+ - lib/active_admin/pages.rb
124
+ - lib/active_admin/pages/base.rb
125
+ - lib/active_admin/pages/edit.rb
126
+ - lib/active_admin/pages/index.rb
127
+ - lib/active_admin/pages/index/blog.rb
128
+ - lib/active_admin/pages/index/table.rb
129
+ - lib/active_admin/pages/index/thumbnails.rb
130
+ - lib/active_admin/pages/new.rb
131
+ - lib/active_admin/pages/show.rb
132
+ - lib/active_admin/renderer.rb
133
+ - lib/active_admin/resource.rb
134
+ - lib/active_admin/resource_controller.rb
135
+ - lib/active_admin/sidebar.rb
136
+ - lib/active_admin/table_builder.rb
137
+ - lib/active_admin/tabs_renderer.rb
138
+ - lib/active_admin/version.rb
139
+ - lib/active_admin/view_helpers.rb
140
+ - lib/active_admin/views/active_admin_dashboard/index.html.erb
141
+ - lib/active_admin/views/active_admin_default/edit.html.erb
142
+ - lib/active_admin/views/active_admin_default/index.csv.erb
143
+ - lib/active_admin/views/active_admin_default/index.html.erb
144
+ - lib/active_admin/views/active_admin_default/new.html.erb
145
+ - lib/active_admin/views/active_admin_default/show.html.erb
146
+ - lib/active_admin/views/layouts/active_admin.html.erb
147
+ - lib/activeadmin.rb
148
+ - lib/generators/active_admin/install/install_generator.rb
149
+ - lib/generators/active_admin/install/templates/active_admin.css
150
+ - lib/generators/active_admin/install/templates/active_admin.js
151
+ - lib/generators/active_admin/install/templates/active_admin.rb
152
+ - lib/generators/active_admin/install/templates/active_admin_vendor.js
153
+ - lib/generators/active_admin/install/templates/dashboards.rb
154
+ - lib/generators/active_admin/install/templates/images/orderable.gif
155
+ - lib/generators/active_admin/resource/resource_generator.rb
156
+ - lib/generators/active_admin/resource/templates/admin.rb
157
+ - spec/integration/dashboard_spec.rb
158
+ - spec/integration/index_as_blog_spec.rb
159
+ - spec/integration/index_as_csv_spec.rb
160
+ - spec/integration/index_as_table_spec.rb
161
+ - spec/integration/index_as_thumbnails_spec.rb
162
+ - spec/integration/layout_spec.rb
163
+ - spec/integration/new_view_spec.rb
164
+ - spec/integration/show_view_spec.rb
165
+ - spec/spec_helper.rb
166
+ - spec/support/rails_template.rb
167
+ - spec/unit/action_builder_spec.rb
168
+ - spec/unit/action_items_spec.rb
169
+ - spec/unit/active_admin_spec.rb
170
+ - spec/unit/asset_registration_spec.rb
171
+ - spec/unit/controller_filters_spec.rb
172
+ - spec/unit/dashboard_section_spec.rb
173
+ - spec/unit/dashboards_spec.rb
174
+ - spec/unit/filter_form_builder_spec.rb
175
+ - spec/unit/form_builder_spec.rb
176
+ - spec/unit/menu_item_spec.rb
177
+ - spec/unit/menu_spec.rb
178
+ - spec/unit/namespace_spec.rb
179
+ - spec/unit/registration_spec.rb
180
+ - spec/unit/renderer_spec.rb
181
+ - spec/unit/resource_controller_spec.rb
182
+ - spec/unit/resource_spec.rb
183
+ - spec/unit/routing_spec.rb
184
+ - spec/unit/sidebar_spec.rb
185
+ - spec/unit/table_builder_spec.rb
186
+ - spec/unit/tabs_renderer_spec.rb
187
+ has_rdoc: true
188
+ homepage: http://github.com/gregbell/active_admin
189
+ licenses: []
190
+
191
+ post_install_message:
192
+ rdoc_options:
193
+ - --charset=UTF-8
194
+ require_paths:
195
+ - lib
196
+ required_ruby_version: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - ">="
199
+ - !ruby/object:Gem::Version
200
+ segments:
201
+ - 0
202
+ version: "0"
203
+ required_rubygems_version: !ruby/object:Gem::Requirement
204
+ requirements:
205
+ - - ">="
206
+ - !ruby/object:Gem::Version
207
+ segments:
208
+ - 0
209
+ version: "0"
210
+ requirements: []
211
+
212
+ rubyforge_project:
213
+ rubygems_version: 1.3.6
214
+ signing_key:
215
+ specification_version: 3
216
+ summary: The administration framework for Ruby on Rails.
217
+ test_files:
218
+ - spec/integration/dashboard_spec.rb
219
+ - spec/integration/index_as_blog_spec.rb
220
+ - spec/integration/index_as_csv_spec.rb
221
+ - spec/integration/index_as_table_spec.rb
222
+ - spec/integration/index_as_thumbnails_spec.rb
223
+ - spec/integration/layout_spec.rb
224
+ - spec/integration/new_view_spec.rb
225
+ - spec/integration/show_view_spec.rb
226
+ - spec/spec_helper.rb
227
+ - spec/support/rails_template.rb
228
+ - spec/unit/action_builder_spec.rb
229
+ - spec/unit/action_items_spec.rb
230
+ - spec/unit/active_admin_spec.rb
231
+ - spec/unit/asset_registration_spec.rb
232
+ - spec/unit/controller_filters_spec.rb
233
+ - spec/unit/dashboard_section_spec.rb
234
+ - spec/unit/dashboards_spec.rb
235
+ - spec/unit/filter_form_builder_spec.rb
236
+ - spec/unit/form_builder_spec.rb
237
+ - spec/unit/menu_item_spec.rb
238
+ - spec/unit/menu_spec.rb
239
+ - spec/unit/namespace_spec.rb
240
+ - spec/unit/registration_spec.rb
241
+ - spec/unit/renderer_spec.rb
242
+ - spec/unit/resource_controller_spec.rb
243
+ - spec/unit/resource_spec.rb
244
+ - spec/unit/routing_spec.rb
245
+ - spec/unit/sidebar_spec.rb
246
+ - spec/unit/table_builder_spec.rb
247
+ - spec/unit/tabs_renderer_spec.rb