admin_data 1.0.11 → 1.0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. data/README.md +25 -0
  2. data/app/controllers/admin_data/base_controller.rb +2 -7
  3. data/app/views/admin_data/main/edit.html.erb +1 -2
  4. data/app/views/admin_data/main/misc/_form.html.erb +9 -2
  5. data/app/views/admin_data/shared/_drop_down_klasses.html.erb +1 -1
  6. data/app/views/admin_data/shared/_powered_by.html.erb +3 -20
  7. data/lib/admin_data/helpers.rb +1 -1
  8. data/lib/admin_data/version.rb +1 -1
  9. data/lib/js/vendor/{code.jquery.com jquery-1.4.2.js → jquery-1.4.2.js} +0 -0
  10. metadata +9 -110
  11. data/README.textile +0 -21
  12. data/lib/js/vendor/jquery.lint.js +0 -604
  13. data/test/factories/article.rb +0 -9
  14. data/test/factories/car.rb +0 -4
  15. data/test/factories/city.rb +0 -4
  16. data/test/factories/comment.rb +0 -6
  17. data/test/factories/door.rb +0 -4
  18. data/test/factories/engine.rb +0 -4
  19. data/test/functional/base_controller_test.rb +0 -5
  20. data/test/functional/feed_controller_test.rb +0 -45
  21. data/test/functional/main_controller_authorization_test.rb +0 -91
  22. data/test/functional/main_controller_test.rb +0 -418
  23. data/test/functional/migration_controller_test.rb +0 -39
  24. data/test/functional/routes_test.rb +0 -59
  25. data/test/functional/search_controller_authorization_test.rb +0 -77
  26. data/test/functional/search_controller_test.rb +0 -811
  27. data/test/helper/view_helper_test.rb +0 -177
  28. data/test/misc_tests/date_validation_test.rb +0 -32
  29. data/test/misc_tests/settings_test.rb +0 -29
  30. data/test/misc_tests/util_test.rb +0 -83
  31. data/test/rails_root/Gemfile +0 -22
  32. data/test/rails_root/Gemfile.lock +0 -101
  33. data/test/rails_root/Rakefile +0 -7
  34. data/test/rails_root/app/controllers/application_controller.rb +0 -3
  35. data/test/rails_root/app/helpers/application_helper.rb +0 -2
  36. data/test/rails_root/app/models/article.rb +0 -25
  37. data/test/rails_root/app/models/city.rb +0 -15
  38. data/test/rails_root/app/models/comment.rb +0 -13
  39. data/test/rails_root/app/models/tech_magazine.rb +0 -2
  40. data/test/rails_root/app/models/vehicle/car.rb +0 -4
  41. data/test/rails_root/app/models/vehicle/door.rb +0 -3
  42. data/test/rails_root/app/models/vehicle/engine.rb +0 -3
  43. data/test/rails_root/app/views/layouts/application.html.erb +0 -14
  44. data/test/rails_root/config/application.rb +0 -42
  45. data/test/rails_root/config/boot.rb +0 -13
  46. data/test/rails_root/config/database.yml +0 -22
  47. data/test/rails_root/config/environment.rb +0 -5
  48. data/test/rails_root/config/environments/development.rb +0 -22
  49. data/test/rails_root/config/environments/production.rb +0 -49
  50. data/test/rails_root/config/environments/test.rb +0 -35
  51. data/test/rails_root/config/initializers/backtrace_silencers.rb +0 -7
  52. data/test/rails_root/config/initializers/inflections.rb +0 -10
  53. data/test/rails_root/config/initializers/mime_types.rb +0 -5
  54. data/test/rails_root/config/initializers/secret_token.rb +0 -7
  55. data/test/rails_root/config/initializers/session_store.rb +0 -8
  56. data/test/rails_root/config/locales/en.yml +0 -5
  57. data/test/rails_root/config/routes.rb +0 -58
  58. data/test/rails_root/config.ru +0 -4
  59. data/test/rails_root/db/migrate/20090809061114_create_tables.rb +0 -70
  60. data/test/rails_root/db/schema.rb +0 -74
  61. data/test/rails_root/db/seeds.rb +0 -7
  62. data/test/rails_root/db/test.sqlite3 +0 -0
  63. data/test/rails_root/script/rails +0 -6
  64. data/test/rails_root/test/performance/browsing_test.rb +0 -0
  65. data/test/rails_root/test/test_helper.rb +0 -13
  66. data/test/support/assertions.rb +0 -20
  67. data/test/test_helper.rb +0 -76
data/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # admin_data works with rails3. [More information is available here](http://github.com/neerajdotname/admin_data/wiki/Installing-admin_data-in-a-Rails-3-project)#
2
+
3
+ #Live Demo#
4
+
5
+ [http://demo.neeraj.name/admin_data](http://demo.neeraj.name/admin_data)
6
+
7
+ #Documentation#
8
+
9
+ [http://github.com/neerajdotname/admin_data/wiki](http://github.com/neerajdotname/admin_data/wiki)
10
+
11
+ #JavaScript Unit tests live result#
12
+
13
+ [http://demo.neeraj.name/admin_data/jstest](http://demo.neeraj.name/admin_data/jstest)
14
+
15
+ #Source code#
16
+
17
+ [http://github.com/neerajdotname/admin_data](http://github.com/neerajdotname/admin_data)
18
+
19
+ #Test#
20
+
21
+ Test code currently resides in a different project [admin_data_test](http://github.com/neerajdotname/admin_data_test) . Test code should be merged into this project very soon.
22
+
23
+ #License#
24
+
25
+ Dual licensed under the [MIT](http://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt) and [GPL version 2](http://github.com/jquery/jquery/blob/master/GPL-LICENSE.txt) licenses.
@@ -94,13 +94,8 @@ class AdminData::BaseController < ApplicationController
94
94
  end
95
95
 
96
96
  def build_drop_down_for_klasses
97
- @drop_down_for_klasses = @klasses.inject([]) do |result,klass|
98
- #TODO FIXME for some weird reason tests fail if I don't do this
99
- if Rails.env.test?
100
- result
101
- else
102
- result << [klass.name.underscore, admin_data_search_url(:klass => klass.name.underscore)]
103
- end
97
+ @drop_down_for_klasses = @klasses.inject([]) do |result, klass|
98
+ result << [klass.name.underscore, admin_data_search_url(:klass => klass.name.underscore)]
104
99
  end
105
100
  end
106
101
 
@@ -14,8 +14,7 @@
14
14
  <div class="content rounded">
15
15
  <div class="inner umbrella">
16
16
  <% url = admin_data_on_k_path(:klass => @klass.name, :id => @model)
17
- html_options = {:class => 'form', :method => :put}
18
- %>
17
+ html_options = {:class => 'form', :method => :put} %>
19
18
  <%= form_for @model, :as => @klass.name.underscore.to_sym, :url => url, :html=> html_options do |f| %>
20
19
  <%= render 'admin_data/shared/flash_message', :model => @model %>
21
20
  <%= render 'admin_data/main/misc/form', :klass => @klass, :f => f %>
@@ -3,11 +3,18 @@
3
3
  <span class='col_name'><%= col.name %></span>
4
4
  <span class='col_type'>[<%= col.type.to_s %>]</span>
5
5
  </div>
6
- <%= admin_data_form_field(klass, @model, col, f).html_safe %>
6
+ <div class='data'>
7
+ <%= admin_data_form_field(klass, @model, col, f).html_safe %>
8
+ </div>
7
9
  <% end %>
8
10
 
9
11
  <div class='group navform' style='padding-top:10px;'>
10
- <%= f.submit('Save', :class => 'button', :disable_with => 'Please wait ...') %>
12
+ <% if params[:action] == 'edit' || params[:action] == 'update' %>
13
+ <% label = 'Update' %>
14
+ <% else %>
15
+ <% label = 'Create' %>
16
+ <% end %>
17
+ <%= f.submit(label, :class => 'button', :disable_with => 'Please wait ...') %>
11
18
  </div>
12
19
 
13
20
  <style>
@@ -1,4 +1,4 @@
1
- <select class='drop_down_value_klass'>
1
+ <select class='drop_down_value_klass' id='drop_down_klasses'>
2
2
  <option></option>
3
3
  <%= options_for_select(drop_down_for_klasses, @drop_down_url) %>
4
4
  </select>
@@ -1,23 +1,6 @@
1
1
  <div id="footer">
2
- <p>
3
- Powered by
4
- <a href='http://github.com/neerajdotname/admin_data/tree/master' class='powered_by'>
5
- admin_data
6
- </a>
7
- </p>
8
-
9
- <p>
10
- <a href='http://github.com/neerajdotname/admin_data/issues' class='powered_by'>
11
- Report Bug
12
- </a>
13
- </p>
14
-
15
- <p>
16
- <a href='http://github.com/neerajdotname/admin_data/wiki' class='powered_by'>
17
- Documentation
18
- </a>
19
- </p>
20
-
2
+ <p> Powered by <%= link_to 'admin_data', 'http://github.com/neerajdotname/admin_data', :class => 'powered_by' %> </p>
3
+ <p> <%= link_to 'Report Bug', 'http://github.com/neerajdotname/admin_data/issues', :class => 'powered_by' %> </p>
4
+ <p> <%= link_to 'Documentation', 'http://github.com/neerajdotname/admin_data/wiki', :class => 'powered_by' %> </p>
21
5
  <div class='clear'></div>
22
-
23
6
  </div>
@@ -148,7 +148,7 @@ module AdminData::Helpers
148
148
 
149
149
  when :datetime
150
150
  if ['created_at', 'updated_at'].include?(col.name)
151
- html << model.new_record? ? '(auto)' : column_value
151
+ html << '(auto)'
152
152
  else
153
153
  value = params[:action] == 'new' ? Time.now : column_value
154
154
  year_value = value.year if value
@@ -1,3 +1,3 @@
1
1
  module AdminData
2
- VERSION = '1.0.11'
2
+ VERSION = '1.0.12'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: admin_data
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 11
10
- version: 1.0.11
9
+ - 12
10
+ version: 1.0.12
11
11
  platform: ruby
12
12
  authors:
13
13
  - Neeraj Singh
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-22 00:00:00 -04:00
18
+ date: 2010-10-12 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -104,10 +104,10 @@ executables: []
104
104
  extensions: []
105
105
 
106
106
  extra_rdoc_files:
107
- - README.textile
107
+ - README.md
108
108
  files:
109
109
  - History.txt
110
- - README.textile
110
+ - README.md
111
111
  - Rakefile
112
112
  - app/controllers/admin_data/base_controller.rb
113
113
  - app/controllers/admin_data/feed_controller.rb
@@ -173,70 +173,14 @@ files:
173
173
  - lib/js/test/ajaxify_advance_search.js
174
174
  - lib/js/test/build_first_row.js
175
175
  - lib/js/test/event_bindings.js
176
- - lib/js/vendor/code.jquery.com jquery-1.4.2.js
177
176
  - lib/js/vendor/jack.js
177
+ - lib/js/vendor/jquery-1.4.2.js
178
178
  - lib/js/vendor/jquery-ui-1.7.2.custom.min.js
179
179
  - lib/js/vendor/jquery.ba-isjquery.js
180
180
  - lib/js/vendor/jquery.form.js
181
- - lib/js/vendor/jquery.lint.js
182
181
  - lib/js/vendor/log.js
183
182
  - lib/js/vendor/qunit.js
184
183
  - lib/js/vendor/rails.js
185
- - test/factories/article.rb
186
- - test/factories/car.rb
187
- - test/factories/city.rb
188
- - test/factories/comment.rb
189
- - test/factories/door.rb
190
- - test/factories/engine.rb
191
- - test/functional/base_controller_test.rb
192
- - test/functional/feed_controller_test.rb
193
- - test/functional/main_controller_authorization_test.rb
194
- - test/functional/main_controller_test.rb
195
- - test/functional/migration_controller_test.rb
196
- - test/functional/routes_test.rb
197
- - test/functional/search_controller_authorization_test.rb
198
- - test/functional/search_controller_test.rb
199
- - test/helper/view_helper_test.rb
200
- - test/misc_tests/date_validation_test.rb
201
- - test/misc_tests/settings_test.rb
202
- - test/misc_tests/util_test.rb
203
- - test/rails_root/Gemfile
204
- - test/rails_root/Gemfile.lock
205
- - test/rails_root/Rakefile
206
- - test/rails_root/app/controllers/application_controller.rb
207
- - test/rails_root/app/helpers/application_helper.rb
208
- - test/rails_root/app/models/article.rb
209
- - test/rails_root/app/models/city.rb
210
- - test/rails_root/app/models/comment.rb
211
- - test/rails_root/app/models/tech_magazine.rb
212
- - test/rails_root/app/models/vehicle/car.rb
213
- - test/rails_root/app/models/vehicle/door.rb
214
- - test/rails_root/app/models/vehicle/engine.rb
215
- - test/rails_root/app/views/layouts/application.html.erb
216
- - test/rails_root/config.ru
217
- - test/rails_root/config/application.rb
218
- - test/rails_root/config/boot.rb
219
- - test/rails_root/config/database.yml
220
- - test/rails_root/config/environment.rb
221
- - test/rails_root/config/environments/development.rb
222
- - test/rails_root/config/environments/production.rb
223
- - test/rails_root/config/environments/test.rb
224
- - test/rails_root/config/initializers/backtrace_silencers.rb
225
- - test/rails_root/config/initializers/inflections.rb
226
- - test/rails_root/config/initializers/mime_types.rb
227
- - test/rails_root/config/initializers/secret_token.rb
228
- - test/rails_root/config/initializers/session_store.rb
229
- - test/rails_root/config/locales/en.yml
230
- - test/rails_root/config/routes.rb
231
- - test/rails_root/db/migrate/20090809061114_create_tables.rb
232
- - test/rails_root/db/schema.rb
233
- - test/rails_root/db/seeds.rb
234
- - test/rails_root/db/test.sqlite3
235
- - test/rails_root/script/rails
236
- - test/rails_root/test/performance/browsing_test.rb
237
- - test/rails_root/test/test_helper.rb
238
- - test/support/assertions.rb
239
- - test/test_helper.rb
240
184
  has_rdoc: true
241
185
  homepage: http://github.com/neerajdotname/admin_data
242
186
  licenses: []
@@ -271,50 +215,5 @@ rubygems_version: 1.3.7
271
215
  signing_key:
272
216
  specification_version: 3
273
217
  summary: Manage database using browser
274
- test_files:
275
- - test/factories/article.rb
276
- - test/factories/car.rb
277
- - test/factories/city.rb
278
- - test/factories/comment.rb
279
- - test/factories/door.rb
280
- - test/factories/engine.rb
281
- - test/functional/base_controller_test.rb
282
- - test/functional/feed_controller_test.rb
283
- - test/functional/main_controller_authorization_test.rb
284
- - test/functional/main_controller_test.rb
285
- - test/functional/migration_controller_test.rb
286
- - test/functional/routes_test.rb
287
- - test/functional/search_controller_authorization_test.rb
288
- - test/functional/search_controller_test.rb
289
- - test/helper/view_helper_test.rb
290
- - test/misc_tests/date_validation_test.rb
291
- - test/misc_tests/settings_test.rb
292
- - test/misc_tests/util_test.rb
293
- - test/rails_root/app/controllers/application_controller.rb
294
- - test/rails_root/app/helpers/application_helper.rb
295
- - test/rails_root/app/models/article.rb
296
- - test/rails_root/app/models/city.rb
297
- - test/rails_root/app/models/comment.rb
298
- - test/rails_root/app/models/tech_magazine.rb
299
- - test/rails_root/app/models/vehicle/car.rb
300
- - test/rails_root/app/models/vehicle/door.rb
301
- - test/rails_root/app/models/vehicle/engine.rb
302
- - test/rails_root/config/application.rb
303
- - test/rails_root/config/boot.rb
304
- - test/rails_root/config/environment.rb
305
- - test/rails_root/config/environments/development.rb
306
- - test/rails_root/config/environments/production.rb
307
- - test/rails_root/config/environments/test.rb
308
- - test/rails_root/config/initializers/backtrace_silencers.rb
309
- - test/rails_root/config/initializers/inflections.rb
310
- - test/rails_root/config/initializers/mime_types.rb
311
- - test/rails_root/config/initializers/secret_token.rb
312
- - test/rails_root/config/initializers/session_store.rb
313
- - test/rails_root/config/routes.rb
314
- - test/rails_root/db/migrate/20090809061114_create_tables.rb
315
- - test/rails_root/db/schema.rb
316
- - test/rails_root/db/seeds.rb
317
- - test/rails_root/test/performance/browsing_test.rb
318
- - test/rails_root/test/test_helper.rb
319
- - test/support/assertions.rb
320
- - test/test_helper.rb
218
+ test_files: []
219
+
data/README.textile DELETED
@@ -1,21 +0,0 @@
1
- h1. This plugin works with rails3. "More information is available here":http://neerajdotname.github.com/admin_data/#howtousethispluginwithrails3
2
-
3
- h1. Live Demo
4
-
5
- "http://demo.neeraj.name/admin_data":http://demo.neeraj.name/admin_data
6
-
7
- h1. Documentation
8
-
9
- "http://neerajdotname.github.com/admin_data":http://neerajdotname.github.com/admin_data
10
-
11
- h1. JavaScript Unit tests live result
12
-
13
- "http://demo.neeraj.name/admin_data/jstest":http://demo.neeraj.name/admin_data/jstest
14
-
15
- h1. Source code
16
-
17
- "http://github.com/neerajdotname/admin_data":http://github.com/neerajdotname/admin_data
18
-
19
- h2. License
20
-
21
- Dual licensed under the "MIT":http://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt and "GPL version 2":http://github.com/jquery/jquery/blob/master/GPL-LICENSE.txt licenses.