edgarj 4.06.07 → 4.06.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/edgarj/edgarj_controller.rb +5 -3
- data/app/helpers/edgarj/assoc_helper.rb +11 -33
- data/app/helpers/edgarj/form_drawer.rb +1 -4
- data/app/models/edgarj/page_info.rb +1 -1
- data/lib/edgarj/engine.rb +4 -11
- data/lib/edgarj/version.rb +1 -1
- metadata +76 -90
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a903fc5f0f33be670bc43b83e7cf4688733a964ffaa19945f709b20e8e92ced9
|
4
|
+
data.tar.gz: 9546ae4a090b925449e88ce6654bdac0f03232dc40adc38634645084d6d8cdf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fc02a00e1a6ac4fcd987a322db68718dd33c2aa5759109fba64b1559e70a840dedf38b0d83f3a48d57975e65e08dbe15faf85062b1e120fb4f540d4b50b6f69
|
7
|
+
data.tar.gz: 72824a2d4968d5fd801ad86dc0e7e4e2690f28217496b701c92a91603ffb55e6293f8d9809403ccbf68a399ed516fe6b6f139eb41d49a874824de4faa44abfcf
|
@@ -327,10 +327,13 @@ module Edgarj
|
|
327
327
|
# FIXME: file.close(true) deletes files *BEFORE* actually send file
|
328
328
|
# so that comment it out. Need to clean these work files.
|
329
329
|
def csv_download
|
330
|
+
dir = '/tmp/edgarj/csv_download'
|
331
|
+
FileUtils.mkdir_p(dir)
|
332
|
+
|
330
333
|
filename = sprintf("%s-%s.csv",
|
331
334
|
model_name,
|
332
335
|
Time.now.strftime("%Y%m%d-%H%M%S"))
|
333
|
-
file = Tempfile.new(filename,
|
336
|
+
file = Tempfile.new(filename, dir)
|
334
337
|
csv_visitor = EdgarjHelper::CsvVisitor.new(view_context)
|
335
338
|
file.write CSV.generate_line(model.columns.map{|c| c.name})
|
336
339
|
for rec in user_scoped.where(page_info.record.conditions).
|
@@ -344,8 +347,7 @@ module Edgarj
|
|
344
347
|
end
|
345
348
|
file.write CSV.generate_line(array)
|
346
349
|
end
|
347
|
-
file.close
|
348
|
-
File.chmod(Settings.edgarj.csv_permission, file.path)
|
350
|
+
file.close
|
349
351
|
send_file(file.path, {
|
350
352
|
type: 'text/csv',
|
351
353
|
filename: filename})
|
@@ -164,7 +164,7 @@ module Edgarj
|
|
164
164
|
|
165
165
|
link_to(
|
166
166
|
draw_belongs_to_label_sub(model, col.name, parent_model).html_safe +
|
167
|
-
|
167
|
+
'<span class="edgarj_field_belongs_to_button">選択</span>'.html_safe,
|
168
168
|
popup_path,
|
169
169
|
remote: true)
|
170
170
|
end
|
@@ -177,16 +177,7 @@ module Edgarj
|
|
177
177
|
# popup_field:: Edgarj::PopupHelper::PopupField object
|
178
178
|
# parent_name:: initial parent name
|
179
179
|
def draw_belongs_to_clear_link(f, col_name, popup_field, parent_name, default_label)
|
180
|
-
|
181
|
-
f.hidden_field(col_name)
|
182
|
-
else
|
183
|
-
(' ' +
|
184
|
-
link_to("[#{I18n.t('edgarj.default.clear')}]", '#',
|
185
|
-
onClick: "Edgarj.Popup.clear('#{j(popup_field.id_target)}','#{j(default_label)}'); return false;",
|
186
|
-
id: popup_field.clear_link,
|
187
|
-
style: 'display:' + (parent_name.blank? ? 'none' : '')) +
|
188
|
-
f.hidden_field(col_name)).html_safe
|
189
|
-
end
|
180
|
+
f.hidden_field(col_name)
|
190
181
|
end
|
191
182
|
|
192
183
|
# draw 'belongs_to' popup data-entry field
|
@@ -211,30 +202,17 @@ module Edgarj
|
|
211
202
|
label = content_tag(:span,
|
212
203
|
parent_obj ? parent_obj.name : default_label.html_safe,
|
213
204
|
id: popup_field.label_target)
|
214
|
-
link_tag =
|
205
|
+
link_tag = '<span class="edgarj_field_belongs_to_button">選択</span>'.html_safe
|
215
206
|
if parent_obj
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
remote: true)
|
221
|
-
else
|
222
|
-
link_to(label,
|
223
|
-
# TODO: Hardcoded 'master' prefix should be fixed
|
224
|
-
controller: url_prefix + parent_obj.class.name.underscore.pluralize,
|
225
|
-
action: 'show',
|
226
|
-
id: parent_obj,
|
227
|
-
topic_path: 'add')
|
228
|
-
end
|
207
|
+
link_to(
|
208
|
+
label + link_tag,
|
209
|
+
popup_path,
|
210
|
+
remote: true)
|
229
211
|
else
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
remote: true)
|
235
|
-
else
|
236
|
-
label
|
237
|
-
end
|
212
|
+
link_to(
|
213
|
+
label + link_tag,
|
214
|
+
popup_path,
|
215
|
+
remote: true)
|
238
216
|
end +
|
239
217
|
draw_belongs_to_clear_link(f, col.name, popup_field,
|
240
218
|
parent_obj && parent_obj.name,
|
@@ -157,10 +157,7 @@ module Edgarj
|
|
157
157
|
|
158
158
|
# draw 'belongs_to' field for AR
|
159
159
|
def _draw_belongs_to_field(parent_model, col)
|
160
|
-
|
161
|
-
nil :
|
162
|
-
@vc.draw_belongs_to_label(@f, @drawer.popup_path(col), col.name)
|
163
|
-
_draw_head(col, label){
|
160
|
+
_draw_head(col, nil){
|
164
161
|
@vc.draw_belongs_to_field(@f, @drawer.popup_path(col), col.name)
|
165
162
|
}
|
166
163
|
end
|
data/lib/edgarj/engine.rb
CHANGED
@@ -8,15 +8,6 @@ module Edgarj
|
|
8
8
|
g.templates.unshift File::expand_path('../templates', __FILE__)
|
9
9
|
end
|
10
10
|
|
11
|
-
# load this engine's config
|
12
|
-
# (rails_config default loads from only Rails.root/config/...)
|
13
|
-
def self.load_config
|
14
|
-
engine_config_dir = Pathname.new(File.expand_path('../../../config', __FILE__))
|
15
|
-
Settings.prepend_source!((engine_config_dir + 'settings.yml').to_s)
|
16
|
-
Settings.prepend_source!((engine_config_dir + "settings/#{Rails.env}.yml").to_s)
|
17
|
-
Settings.reload!
|
18
|
-
end
|
19
|
-
|
20
11
|
# Require/load application side edgarj config in RAILS_ROOT/config/edgarj/
|
21
12
|
def self.load_edgarj_conf_in_app
|
22
13
|
[
|
@@ -45,14 +36,16 @@ module Edgarj
|
|
45
36
|
|
46
37
|
# make edgarj related work directories
|
47
38
|
def self.make_work_dir
|
48
|
-
|
39
|
+
work_dirs = [
|
40
|
+
Rails.root + 'tmp/edgarj'
|
41
|
+
]
|
42
|
+
for dir in work_dirs do
|
49
43
|
FileUtils.mkdir_p(dir) if !File.directory?(dir)
|
50
44
|
end
|
51
45
|
end
|
52
46
|
|
53
47
|
initializer "edgarj" do
|
54
48
|
ActiveRecord::SessionStore::Session.table_name = 'edgarj_sssns'
|
55
|
-
Engine::load_config
|
56
49
|
Engine::load_edgarj_conf_in_app
|
57
50
|
Engine::load_decorators
|
58
51
|
for file in Dir.glob(File.join(File.dirname(__FILE__), "../../locale/*.yml")) do
|
data/lib/edgarj/version.rb
CHANGED
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: 4.06.
|
4
|
+
version: 4.06.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fuminori Ido
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -48,36 +48,22 @@ dependencies:
|
|
48
48
|
name: jquery-ui-rails
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - "~>"
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '5.0'
|
54
51
|
- - ">="
|
55
52
|
- !ruby/object:Gem::Version
|
56
|
-
version: 5
|
53
|
+
version: '5'
|
54
|
+
- - "<"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '7'
|
57
57
|
type: :runtime
|
58
58
|
prerelease: false
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- - "~>"
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
version: '5.0'
|
64
61
|
- - ">="
|
65
62
|
- !ruby/object:Gem::Version
|
66
|
-
version: 5
|
67
|
-
-
|
68
|
-
name: config
|
69
|
-
requirement: !ruby/object:Gem::Requirement
|
70
|
-
requirements:
|
71
|
-
- - "~>"
|
72
|
-
- !ruby/object:Gem::Version
|
73
|
-
version: 1.0.0
|
74
|
-
type: :runtime
|
75
|
-
prerelease: false
|
76
|
-
version_requirements: !ruby/object:Gem::Requirement
|
77
|
-
requirements:
|
78
|
-
- - "~>"
|
63
|
+
version: '5'
|
64
|
+
- - "<"
|
79
65
|
- !ruby/object:Gem::Version
|
80
|
-
version:
|
66
|
+
version: '7'
|
81
67
|
- !ruby/object:Gem::Dependency
|
82
68
|
name: kaminari
|
83
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -371,102 +357,102 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
371
357
|
requirements:
|
372
358
|
- - ">="
|
373
359
|
- !ruby/object:Gem::Version
|
374
|
-
version:
|
360
|
+
version: 2.5.0
|
375
361
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
376
362
|
requirements:
|
377
363
|
- - ">="
|
378
364
|
- !ruby/object:Gem::Version
|
379
365
|
version: '0'
|
380
366
|
requirements: []
|
381
|
-
rubygems_version: 3.3.
|
367
|
+
rubygems_version: 3.3.26
|
382
368
|
signing_key:
|
383
369
|
specification_version: 4
|
384
370
|
summary: Scaffold with Ajax, search, sort, 'belongs_to' popup, and more.
|
385
371
|
test_files:
|
386
|
-
- test/
|
387
|
-
- test/models/helpers/edgarj/user_group_users_helper_test.rb
|
388
|
-
- test/models/edgarj/user_group_test.rb
|
389
|
-
- test/models/edgarj/user_group_user_test.rb
|
390
|
-
- test/models/edgarj/model_permission_test.rb
|
391
|
-
- test/models/edgarj/page_info_test.rb
|
392
|
-
- test/models/edgarj/sssn_test.rb
|
393
|
-
- test/edgarj_test.rb
|
394
|
-
- test/integration/navigation_test.rb
|
372
|
+
- test/controllers/edgarj/edgarj_controller_test.rb
|
395
373
|
- test/controllers/edgarj/model_permissions_controller_test.rb
|
396
374
|
- test/controllers/edgarj/user_group_users_controller_test.rb
|
397
|
-
- test/
|
398
|
-
- test/
|
399
|
-
- test/dummy/
|
400
|
-
- test/dummy/
|
375
|
+
- test/dummy/app/assets/javascripts/application.js
|
376
|
+
- test/dummy/app/assets/javascripts/authors.js
|
377
|
+
- test/dummy/app/assets/stylesheets/application.css
|
378
|
+
- test/dummy/app/assets/stylesheets/authors.css
|
379
|
+
- test/dummy/app/assets/stylesheets/scaffold.css
|
380
|
+
- test/dummy/app/controllers/application_controller.rb
|
381
|
+
- test/dummy/app/controllers/authors_controller.rb
|
382
|
+
- test/dummy/app/controllers/authors_popup_controller.rb
|
383
|
+
- test/dummy/app/controllers/books_controller.rb
|
384
|
+
- test/dummy/app/controllers/dummy_auth_mixin.rb
|
385
|
+
- test/dummy/app/decorators/models/edgarj/user_group_decorator.rb
|
386
|
+
- test/dummy/app/helpers/application_helper.rb
|
387
|
+
- test/dummy/app/helpers/authors_helper.rb
|
388
|
+
- test/dummy/app/helpers/authors_popup_helper.rb
|
389
|
+
- test/dummy/app/helpers/books_helper.rb
|
390
|
+
- test/dummy/app/models/author.rb
|
391
|
+
- test/dummy/app/models/book.rb
|
392
|
+
- test/dummy/app/models/user.rb
|
393
|
+
- test/dummy/app/views/layouts/application.html.erb
|
394
|
+
- test/dummy/app/views/layouts/login.html.erb
|
401
395
|
- test/dummy/bin/bundle
|
396
|
+
- test/dummy/bin/rails
|
402
397
|
- test/dummy/bin/rake
|
403
|
-
- test/dummy/
|
404
|
-
- test/dummy/
|
405
|
-
- test/dummy/
|
406
|
-
- test/dummy/
|
407
|
-
- test/dummy/
|
408
|
-
- test/dummy/
|
409
|
-
- test/dummy/
|
410
|
-
- test/dummy/
|
411
|
-
- test/dummy/db/migrate/20131218011851_create_books.rb
|
412
|
-
- test/dummy/db/migrate/20140201000000_add_user_group_id_to_authors.rb
|
413
|
-
- test/dummy/db/migrate/20140807065420_create_users.rb
|
414
|
-
- test/dummy/db/migrate/20131107120635_create_authors.rb
|
415
|
-
- test/dummy/db/schema.rb
|
416
|
-
- test/dummy/config/initializers/session_store.rb
|
398
|
+
- test/dummy/config/edgarj/menu_config.rb
|
399
|
+
- test/dummy/config/environments/development.rb
|
400
|
+
- test/dummy/config/environments/production.rb
|
401
|
+
- test/dummy/config/environments/test.rb
|
402
|
+
- test/dummy/config/initializers/config.rb
|
403
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
404
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
405
|
+
- test/dummy/config/initializers/inflections.rb
|
417
406
|
- test/dummy/config/initializers/mime_types.rb
|
418
407
|
- test/dummy/config/initializers/secret_token.rb
|
408
|
+
- test/dummy/config/initializers/session_store.rb
|
419
409
|
- test/dummy/config/initializers/wrap_parameters.rb
|
420
|
-
- test/dummy/config/initializers/filter_parameter_logging.rb
|
421
|
-
- test/dummy/config/initializers/inflections.rb
|
422
|
-
- test/dummy/config/initializers/config.rb
|
423
|
-
- test/dummy/config/initializers/backtrace_silencers.rb
|
424
|
-
- test/dummy/config/environment.rb
|
425
410
|
- test/dummy/config/locales/en.yml
|
426
411
|
- test/dummy/config/locales/ja.yml
|
427
|
-
- test/dummy/config/environments/development.rb
|
428
|
-
- test/dummy/config/environments/test.rb
|
429
|
-
- test/dummy/config/environments/production.rb
|
430
|
-
- test/dummy/config/boot.rb
|
431
|
-
- test/dummy/config/edgarj/menu_config.rb
|
432
|
-
- test/dummy/config/routes.rb
|
433
|
-
- test/dummy/config/settings.yml
|
434
412
|
- test/dummy/config/settings/development.yml
|
435
413
|
- test/dummy/config/settings/production.yml
|
436
414
|
- test/dummy/config/settings/test.yml
|
415
|
+
- test/dummy/config/settings.yml
|
437
416
|
- test/dummy/config/application.rb
|
417
|
+
- test/dummy/config/boot.rb
|
438
418
|
- test/dummy/config/database.yml
|
439
|
-
- test/dummy/
|
440
|
-
- test/dummy/
|
441
|
-
- test/dummy/
|
442
|
-
- test/dummy/
|
443
|
-
- test/dummy/
|
444
|
-
- test/dummy/
|
445
|
-
- test/dummy/
|
446
|
-
- test/dummy/app/decorators/models/edgarj/user_group_decorator.rb
|
447
|
-
- test/dummy/app/controllers/authors_popup_controller.rb
|
448
|
-
- test/dummy/app/controllers/books_controller.rb
|
449
|
-
- test/dummy/app/controllers/application_controller.rb
|
450
|
-
- test/dummy/app/controllers/dummy_auth_mixin.rb
|
451
|
-
- test/dummy/app/controllers/authors_controller.rb
|
452
|
-
- test/dummy/app/assets/javascripts/application.js
|
453
|
-
- test/dummy/app/assets/javascripts/authors.js
|
454
|
-
- test/dummy/app/assets/stylesheets/scaffold.css
|
455
|
-
- test/dummy/app/assets/stylesheets/application.css
|
456
|
-
- test/dummy/app/assets/stylesheets/authors.css
|
457
|
-
- test/dummy/app/views/layouts/login.html.erb
|
458
|
-
- test/dummy/app/views/layouts/application.html.erb
|
459
|
-
- test/dummy/public/422.html
|
419
|
+
- test/dummy/config/environment.rb
|
420
|
+
- test/dummy/config/routes.rb
|
421
|
+
- test/dummy/db/migrate/20131107120635_create_authors.rb
|
422
|
+
- test/dummy/db/migrate/20131218011851_create_books.rb
|
423
|
+
- test/dummy/db/migrate/20140201000000_add_user_group_id_to_authors.rb
|
424
|
+
- test/dummy/db/migrate/20140807065420_create_users.rb
|
425
|
+
- test/dummy/db/schema.rb
|
460
426
|
- test/dummy/public/404.html
|
427
|
+
- test/dummy/public/422.html
|
461
428
|
- test/dummy/public/500.html
|
462
429
|
- test/dummy/public/favicon.ico
|
430
|
+
- test/dummy/test/controllers/authors_controller_test.rb
|
431
|
+
- test/dummy/test/controllers/authors_popup_controller_test.rb
|
432
|
+
- test/dummy/test/controllers/books_controller_test.rb
|
433
|
+
- test/dummy/test/helpers/authors_helper_test.rb
|
434
|
+
- test/dummy/test/models/rails_config_test.rb
|
435
|
+
- test/dummy/test/models/author_test.rb
|
436
|
+
- test/dummy/test/models/book_test.rb
|
437
|
+
- test/dummy/README.rdoc
|
438
|
+
- test/dummy/Rakefile
|
463
439
|
- test/dummy/config.ru
|
464
|
-
- test/test_helper.rb
|
465
|
-
- test/fixtures/authors.yml
|
466
|
-
- test/fixtures/users.yml
|
467
440
|
- test/fixtures/edgarj/model_permissions.yml
|
468
|
-
- test/fixtures/edgarj/sssns.yml
|
469
441
|
- test/fixtures/edgarj/page_infos.yml
|
470
|
-
- test/fixtures/edgarj/
|
442
|
+
- test/fixtures/edgarj/sssns.yml
|
471
443
|
- test/fixtures/edgarj/user_group_users.yml
|
444
|
+
- test/fixtures/edgarj/user_groups.yml
|
445
|
+
- test/fixtures/authors.yml
|
472
446
|
- test/fixtures/books.yml
|
447
|
+
- test/fixtures/users.yml
|
448
|
+
- test/integration/navigation_test.rb
|
449
|
+
- test/models/edgarj/model_permission_test.rb
|
450
|
+
- test/models/edgarj/page_info_test.rb
|
451
|
+
- test/models/edgarj/sssn_test.rb
|
452
|
+
- test/models/edgarj/user_group_test.rb
|
453
|
+
- test/models/edgarj/user_group_user_test.rb
|
454
|
+
- test/models/helpers/edgarj/model_permissions_helper_test.rb
|
455
|
+
- test/models/helpers/edgarj/user_group_users_helper_test.rb
|
456
|
+
- test/support/edgarj/controller_supporter.rb
|
457
|
+
- test/edgarj_test.rb
|
458
|
+
- test/test_helper.rb
|