edgarj 0.01.16 → 0.01.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95a59cec1ce91f18d3eccda430acb189dd641be5
4
- data.tar.gz: d26ea0409b6c8e2837b3328a9767b444bff2b273
3
+ metadata.gz: 99f55ad6f5d4c50cd6f6752bf333e38655a70239
4
+ data.tar.gz: 80669198293ca6f20bb3b01f14ec221ccd755555
5
5
  SHA512:
6
- metadata.gz: 318b696efc49518af04fd599718cfb5ecaeb48be713004c6159f1569a3c372daf5b4631372e98d72b530a58e0415139ee8ba4c1c55a3a0b62264e0818a146390
7
- data.tar.gz: 9f2d4dcfff4dcf60fb8d0c4c62ed862e09c6b5d8251f5125e0c3d669a9d0c443f69ce2cd63bc84d24dabf3275f0d486d42040fc8a6b2c19cf885f5fd19ada7a8
6
+ metadata.gz: e30dbda0b377819dc6dca9b92ee2ebd27fb037b3c6606101a8e9c2247320250f79b8f49f63da75b485dd3e6033c9376fb7bd4c01d6fa7fc2b1af121d8f059227
7
+ data.tar.gz: 2c90fe6ed827c5dcab1b6faf083b03093c243e069476833fa90854bd15df87285a094a849da7949611d0b3dc27906934fbadf85bc12e9c9349434f11e58fc86b
@@ -256,20 +256,6 @@ module Edgarj
256
256
  turn_on_flags.map{|f| rec.class.human_const_name(bitset, f) }.join(' ')
257
257
  end
258
258
 
259
- # get enum Module.
260
- #
261
- # When Col(camelized argument col name) module exists, the Col is
262
- # assumed enum definition.
263
- def get_enum(model, col)
264
- col_name = col.name
265
- if model.const_defined?(col_name.camelize, false)
266
- enum = model.const_get(col_name.camelize)
267
- enum.is_a?(Module) ? enum : nil
268
- else
269
- nil
270
- end
271
- end
272
-
273
259
  # draw enum column in list.
274
260
  #
275
261
  # When enum for col is defined, constant string (rather than rec.col value)
@@ -189,6 +189,7 @@ module Edgarj
189
189
  @model.table_name + '.' + col.name
190
190
  end
191
191
 
192
+ # overwrite to replace form drawer for the model
192
193
  def form_drawer_class
193
194
  Edgarj::FormDrawer::Base
194
195
  end
@@ -229,6 +230,25 @@ module Edgarj
229
230
  end
230
231
  end
231
232
  end
233
+
234
+ # overwrite to replace form drawer for search
235
+ def search_form_drawer_class
236
+ Edgarj::FormDrawer::Search
237
+ end
238
+
239
+ def draw_search_form(record)
240
+ @vc.form_for(record, url: {action: 'search'}, html: {
241
+ id: '_edgarj_search_form',
242
+ remote: true,
243
+ method: :get}) do |f|
244
+ f.fields_for(record._operator) do |o|
245
+ search_form_drawer_class.new(self, record, f, o).draw()
246
+ end +
247
+
248
+ # to avoid submit on 1-textfield form when hit [ENTER] key
249
+ '<input type="text" name="dummy" style="visibility:hidden" size=0>'.html_safe
250
+ end
251
+ end
232
252
  end
233
253
  end
234
254
  end
@@ -24,17 +24,8 @@ _form.html.erb:: record form
24
24
  </ul>
25
25
  </div>
26
26
  <% end %>
27
- <%= form_for(@search, url: {action: 'search'}, html: {
28
- id: '_edgarj_search_form',
29
- remote: true,
30
- method: :get}) do |f| %>
31
- <%= f.fields_for(@search._operator) do |o| %>
32
- <%= Edgarj::FormDrawer::Search.new(@drawer, @search, f, o).draw() %>
33
- <%# to avoid submit on 1-textfield form when hit [ENTER] key: %>
34
- <input type="text" name="dummy" style="visibility:hidden" size=0>
35
- <% end %>
36
- <% end %>
37
27
  <%= draw_search_form_buttons %>
28
+ <%= @drawer.draw_search_form(@search) %>
38
29
 
39
30
  <%= javascript_tag do %>
40
31
  <% id = 'edgarj_search_operator_selection' %>
@@ -1,3 +1,3 @@
1
1
  module Edgarj
2
- VERSION = "0.01.16"
2
+ VERSION = "0.01.17"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edgarj
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.01.16
4
+ version: 0.01.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fuminori Ido
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-09 00:00:00.000000000 Z
11
+ date: 2014-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -151,14 +151,11 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  description: |
154
- Edgarj provides CRUD functions on controller and view for any model
155
- as follows:
156
-
157
- * Ajax CRUD
158
- * sort by clicking column header
159
- * QBE(Query By Example) search (under construction, sorry)
160
- * CSV download
161
- * popup for belongs_to attribute
154
+ Edgarj is an Ajax-based scaffold with QBE(Query By Example) search form,
155
+ column sort on record list,
156
+ popup view & controller for 'belongs_to' relation table to pick up a parent record,
157
+ csv download, and
158
+ user-role based access control.
162
159
  email:
163
160
  - ido00 at sourceforge.net
164
161
  executables: []
@@ -367,90 +364,90 @@ required_rubygems_version: !ruby/object:Gem::Requirement
367
364
  version: '0'
368
365
  requirements: []
369
366
  rubyforge_project:
370
- rubygems_version: 2.2.2
367
+ rubygems_version: 2.4.1
371
368
  signing_key:
372
369
  specification_version: 4
373
370
  summary: Scaffold with Ajax, search, sort, 'belongs_to' popup, and more.
374
371
  test_files:
375
- - test/integration/navigation_test.rb
376
- - test/unit/helpers/edgarj/model_permissions_helper_test.rb
377
- - test/unit/helpers/edgarj/user_group_users_helper_test.rb
378
- - test/unit/edgarj/user_group_user_test.rb
379
- - test/unit/edgarj/sssn_test.rb
380
- - test/unit/edgarj/user_group_test.rb
381
- - test/unit/edgarj/page_info_test.rb
382
- - test/unit/edgarj/model_permission_test.rb
383
- - test/support/edgarj/controller_supporter.rb
384
- - test/test_helper.rb
385
- - test/dummy/test/helpers/authors_helper_test.rb
386
- - test/dummy/test/unit/book_test.rb
387
- - test/dummy/test/unit/author_test.rb
388
- - test/dummy/test/functional/authors_controller_test.rb
389
- - test/dummy/test/functional/books_controller_test.rb
390
- - test/dummy/README.rdoc
372
+ - test/fixtures/users.yml
373
+ - test/fixtures/edgarj/model_permissions.yml
374
+ - test/fixtures/edgarj/sssns.yml
375
+ - test/fixtures/edgarj/user_group_users.yml
376
+ - test/fixtures/edgarj/page_infos.yml
377
+ - test/fixtures/edgarj/user_groups.yml
378
+ - test/fixtures/authors.yml
379
+ - test/fixtures/books.yml
380
+ - test/dummy/Rakefile
391
381
  - test/dummy/config.ru
382
+ - test/dummy/bin/rails
392
383
  - test/dummy/bin/bundle
393
384
  - test/dummy/bin/rake
394
- - test/dummy/bin/rails
395
- - test/dummy/db/schema.rb
396
- - test/dummy/db/migrate/20131218011851_create_books.rb
397
- - test/dummy/db/migrate/20140807065420_create_users.rb
398
- - test/dummy/db/migrate/20140201000000_add_user_group_id_to_authors.rb
399
- - test/dummy/db/migrate/20131107120635_create_authors.rb
400
- - test/dummy/Rakefile
401
- - test/dummy/config/routes.rb
402
- - test/dummy/config/boot.rb
403
- - test/dummy/config/environment.rb
404
- - test/dummy/config/database.yml
405
- - test/dummy/config/environments/test.rb
406
- - test/dummy/config/environments/production.rb
407
- - test/dummy/config/environments/development.rb
385
+ - test/dummy/app/decorators/models/edgarj/user_group_decorator.rb
386
+ - test/dummy/app/assets/stylesheets/application.css
387
+ - test/dummy/app/assets/stylesheets/authors.css
388
+ - test/dummy/app/assets/stylesheets/scaffold.css
389
+ - test/dummy/app/assets/javascripts/application.js
390
+ - test/dummy/app/assets/javascripts/authors.js
391
+ - test/dummy/app/views/layouts/login.html.erb
392
+ - test/dummy/app/views/layouts/application.html.erb
393
+ - test/dummy/app/models/author.rb
394
+ - test/dummy/app/models/book.rb
395
+ - test/dummy/app/models/user.rb
396
+ - test/dummy/app/controllers/dummy_auth_mixin.rb
397
+ - test/dummy/app/controllers/application_controller.rb
398
+ - test/dummy/app/controllers/authors_popup_controller.rb
399
+ - test/dummy/app/controllers/books_controller.rb
400
+ - test/dummy/app/controllers/authors_controller.rb
401
+ - test/dummy/app/helpers/authors_helper.rb
402
+ - test/dummy/app/helpers/authors_popup_helper.rb
403
+ - test/dummy/app/helpers/application_helper.rb
404
+ - test/dummy/app/helpers/books_helper.rb
405
+ - test/dummy/config/locales/en.yml
408
406
  - test/dummy/config/application.rb
409
407
  - test/dummy/config/edgarj/menu_config.rb
410
- - test/dummy/config/locales/en.yml
411
- - test/dummy/config/initializers/strong_parameter.rb
412
- - test/dummy/config/initializers/inflections.rb
408
+ - test/dummy/config/environments/production.rb
409
+ - test/dummy/config/environments/development.rb
410
+ - test/dummy/config/environments/test.rb
411
+ - test/dummy/config/environment.rb
413
412
  - test/dummy/config/initializers/wrap_parameters.rb
414
- - test/dummy/config/initializers/session_store.rb
415
- - test/dummy/config/initializers/secret_token.rb
416
- - test/dummy/config/initializers/filter_parameter_logging.rb
417
413
  - test/dummy/config/initializers/mime_types.rb
418
414
  - test/dummy/config/initializers/backtrace_silencers.rb
419
- - test/dummy/script/rails
415
+ - test/dummy/config/initializers/secret_token.rb
416
+ - test/dummy/config/initializers/filter_parameter_logging.rb
417
+ - test/dummy/config/initializers/inflections.rb
418
+ - test/dummy/config/initializers/strong_parameter.rb
419
+ - test/dummy/config/initializers/session_store.rb
420
+ - test/dummy/config/routes.rb
421
+ - test/dummy/config/database.yml
422
+ - test/dummy/config/boot.rb
420
423
  - test/dummy/public/favicon.ico
421
- - test/dummy/public/404.html
422
424
  - test/dummy/public/422.html
423
425
  - test/dummy/public/500.html
424
- - test/dummy/app/views/layouts/login.html.erb
425
- - test/dummy/app/views/layouts/application.html.erb
426
- - test/dummy/app/decorators/models/edgarj/user_group_decorator.rb
427
- - test/dummy/app/helpers/authors_helper.rb
428
- - test/dummy/app/helpers/books_helper.rb
429
- - test/dummy/app/helpers/application_helper.rb
430
- - test/dummy/app/helpers/authors_popup_helper.rb
431
- - test/dummy/app/models/book.rb
432
- - test/dummy/app/models/author.rb
433
- - test/dummy/app/models/user.rb
434
- - test/dummy/app/assets/javascripts/authors.js
435
- - test/dummy/app/assets/javascripts/application.js
436
- - test/dummy/app/assets/stylesheets/scaffold.css
437
- - test/dummy/app/assets/stylesheets/authors.css
438
- - test/dummy/app/assets/stylesheets/application.css
439
- - test/dummy/app/controllers/authors_controller.rb
440
- - test/dummy/app/controllers/books_controller.rb
441
- - test/dummy/app/controllers/dummy_auth_mixin.rb
442
- - test/dummy/app/controllers/application_controller.rb
443
- - test/dummy/app/controllers/authors_popup_controller.rb
426
+ - test/dummy/public/404.html
427
+ - test/dummy/README.rdoc
428
+ - test/dummy/db/schema.rb
429
+ - test/dummy/db/migrate/20131218011851_create_books.rb
430
+ - test/dummy/db/migrate/20131107120635_create_authors.rb
431
+ - test/dummy/db/migrate/20140201000000_add_user_group_id_to_authors.rb
432
+ - test/dummy/db/migrate/20140807065420_create_users.rb
433
+ - test/dummy/test/unit/author_test.rb
434
+ - test/dummy/test/unit/book_test.rb
435
+ - test/dummy/test/functional/books_controller_test.rb
436
+ - test/dummy/test/functional/authors_controller_test.rb
437
+ - test/dummy/test/helpers/authors_helper_test.rb
438
+ - test/dummy/script/rails
439
+ - test/unit/edgarj/sssn_test.rb
440
+ - test/unit/edgarj/model_permission_test.rb
441
+ - test/unit/edgarj/user_group_test.rb
442
+ - test/unit/edgarj/user_group_user_test.rb
443
+ - test/unit/edgarj/page_info_test.rb
444
+ - test/unit/helpers/edgarj/user_group_users_helper_test.rb
445
+ - test/unit/helpers/edgarj/model_permissions_helper_test.rb
446
+ - test/support/edgarj/controller_supporter.rb
444
447
  - test/edgar_test.rb
445
- - test/fixtures/authors.yml
446
- - test/fixtures/users.yml
447
- - test/fixtures/edgarj/page_infos.yml
448
- - test/fixtures/edgarj/user_group_users.yml
449
- - test/fixtures/edgarj/user_groups.yml
450
- - test/fixtures/edgarj/model_permissions.yml
451
- - test/fixtures/edgarj/sssns.yml
452
- - test/fixtures/books.yml
448
+ - test/test_helper.rb
449
+ - test/integration/navigation_test.rb
453
450
  - test/functional/edgarj/user_group_users_controller_test.rb
454
- - test/functional/edgarj/edgarj_controller_test.rb
455
451
  - test/functional/edgarj/model_permissions_controller_test.rb
452
+ - test/functional/edgarj/edgarj_controller_test.rb
456
453
  has_rdoc: