enju_manifestation_viewer 0.2.0.beta.2 → 0.2.0.beta.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (22) hide show
  1. checksums.yaml +4 -4
  2. data/db/migrate/20160813191533_add_book_jacket_source_to_library_group.rb +5 -0
  3. data/db/migrate/20160813191820_add_screenshot_generator_to_library_group.rb +5 -0
  4. data/lib/enju_manifestation_viewer/book_jacket_helper.rb +5 -5
  5. data/lib/enju_manifestation_viewer/version.rb +1 -1
  6. data/spec/dummy/app/controllers/application_controller.rb +3 -1
  7. data/spec/dummy/config/application.rb +2 -0
  8. data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +1 -1
  9. data/spec/dummy/db/migrate/20150506105356_add_error_message_to_user_import_result.rb +5 -0
  10. data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +13 -0
  11. data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +13 -0
  12. data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +9 -0
  13. data/spec/dummy/db/migrate/20160610093229_add_html_snippet_to_library_group.rb +5 -0
  14. data/spec/dummy/db/migrate/20160627232219_add_most_recent_to_user_import_file_transitions.rb +9 -0
  15. data/spec/dummy/db/migrate/20160627232316_add_most_recent_to_user_export_file_transitions.rb +9 -0
  16. data/spec/dummy/db/migrate/20160813191647_add_max_number_of_results_to_library_group.rb +5 -0
  17. data/spec/dummy/db/migrate/20160813191733_add_family_name_first_to_library_group.rb +5 -0
  18. data/spec/dummy/db/migrate/20160813192542_add_pub_year_facet_range_interval_to_library_group.rb +5 -0
  19. data/spec/dummy/db/migrate/20160813203039_add_user_id_to_library_group.rb +5 -0
  20. data/spec/dummy/db/schema.rb +39 -5
  21. data/spec/fixtures/library_groups.yml +4 -1
  22. metadata +58 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b4815ff139192696f0e1f1b5da363df4609d10f2
4
- data.tar.gz: 53b617d46b5dd88eb805d8b18cc28df635ed5829
3
+ metadata.gz: 471b2b84649f2660a71eb9c127577d5ea263650c
4
+ data.tar.gz: a93dee9d4cd432390e044b3c42b9f9c321c969a0
5
5
  SHA512:
6
- metadata.gz: 7b372e122e807a22cb7470dc7f5adf0af8d761c2ce41d783578e35c0450d7e09ac5faafd9163ea10e4a119c4ea9b28979d20c9726838a09d441f645eb4422215
7
- data.tar.gz: e0f94d357f1ea74b52a5e137d4825d5ba94185b4881e034c0c9a7d897dadbc4ccba32da20b0844b142292b9f8fbeb5bf3ab4ad0591eb9683f22ad8502a9cdfc0
6
+ metadata.gz: 7495ccc3be586133ae20549370e0d9463bc08ee88a401287a6c177eba0fa47841d383588353141e851b8674a26d86278a4b303af54e3a0fc19c7a8e5fb3c6663
7
+ data.tar.gz: fd3dc9d4a9cb18df989b1bdca360f6a51887ed1d9dbce12cd9b2d26807d41d206bb6057ec850eba4043ae19c8e1b34805b62591eb4288788618285e162a42abc
@@ -0,0 +1,5 @@
1
+ class AddBookJacketSourceToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_column :library_groups, :book_jacket_source, :string
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddScreenshotGeneratorToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_column :library_groups, :screenshot_generator, :string
4
+ end
5
+ end
@@ -26,7 +26,7 @@ module EnjuManifestationViewer
26
26
  link
27
27
  end
28
28
 
29
- def screenshot_tag(manifestation, generator = LibraryGroup.site_config.settings[:screenshot_generator])
29
+ def screenshot_tag(manifestation, generator = LibraryGroup.site_config.screenshot_generator)
30
30
  return nil unless manifestation.try(:access_address)
31
31
  case generator
32
32
  when "mozshot"
@@ -40,7 +40,7 @@ module EnjuManifestationViewer
40
40
  end
41
41
  end
42
42
 
43
- def book_jacket_tag(manifestation, generator = LibraryGroup.site_config.settings[:book_jacket_source])
43
+ def book_jacket_tag(manifestation, generator = LibraryGroup.site_config.book_jacket_source)
44
44
  return nil unless manifestation
45
45
  case generator
46
46
  when "amazon"
@@ -59,7 +59,7 @@ module EnjuManifestationViewer
59
59
  "http://#{hostname}/dp/#{asin}"
60
60
  end
61
61
 
62
- def book_jacket_source_link(source = LibraryGroup.site_config.settings[:book_jacket_source])
62
+ def book_jacket_source_link(source = LibraryGroup.site_config.book_jacket_source)
63
63
  case source
64
64
  when "google"
65
65
  link_to "Google Books", "http://books.google.com/"
@@ -68,7 +68,7 @@ module EnjuManifestationViewer
68
68
  end
69
69
  end
70
70
 
71
- def book_jacket_header(source = LibraryGroup.site_config.settings[:book_jacket_source])
71
+ def book_jacket_header(source = LibraryGroup.site_config.book_jacket_source)
72
72
  string = ''
73
73
  case source
74
74
  when "google"
@@ -78,7 +78,7 @@ module EnjuManifestationViewer
78
78
  string.html_safe
79
79
  end
80
80
 
81
- def screenshot_generator_link(generator = LibraryGroup.site_config.settings[:screenshot_generator])
81
+ def screenshot_generator_link(generator = LibraryGroup.site_config.screenshot_generator)
82
82
  case generator
83
83
  when "mozshot"
84
84
  link_to "MozShot", "http://mozshot.nemui.org/"
@@ -1,3 +1,3 @@
1
1
  module EnjuManifestationViewer
2
- VERSION = "0.2.0.beta.2"
2
+ VERSION = "0.2.0.beta.3"
3
3
  end
@@ -1,7 +1,9 @@
1
1
  class ApplicationController < ActionController::Base
2
2
  protect_from_forgery
3
3
 
4
- enju_leaf
4
+ include EnjuLibrary::Controller
5
+ include EnjuBiblio::Controller
6
+ before_action :set_paper_trail_whodunnit
5
7
  after_action :verify_authorized
6
8
 
7
9
  include Pundit
@@ -5,6 +5,8 @@ require 'rails/all'
5
5
  Bundler.require(*Rails.groups)
6
6
  require 'enju_manifestation_viewer'
7
7
  require 'enju_leaf'
8
+ require 'globalize'
9
+ require 'globalize-accessors'
8
10
 
9
11
  module Dummy
10
12
  class Application < Rails::Application
@@ -6,7 +6,7 @@ class CreateUserImportFiles < ActiveRecord::Migration
6
6
  t.datetime :executed_at
7
7
  t.string :user_import_file_name
8
8
  t.string :user_import_content_type
9
- t.string :user_import_file_size
9
+ t.integer :user_import_file_size
10
10
  t.datetime :user_import_updated_at
11
11
  t.string :user_import_fingerprint
12
12
  t.string :edit_mode
@@ -0,0 +1,5 @@
1
+ class AddErrorMessageToUserImportResult < ActiveRecord::Migration
2
+ def change
3
+ add_column :user_import_results, :error_message, :text
4
+ end
5
+ end
@@ -0,0 +1,13 @@
1
+ class CreateWithdraws < ActiveRecord::Migration
2
+ def change
3
+ create_table :withdraws do |t|
4
+ t.integer :basket_id
5
+ t.integer :item_id
6
+ t.integer :librarian_id
7
+
8
+ t.timestamps null: false
9
+ end
10
+ add_index :withdraws, :basket_id
11
+ add_index :withdraws, :item_id
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class AddTranslationTableToLibraryGroup < ActiveRecord::Migration
2
+ def up
3
+ LibraryGroup.create_translation_table!({
4
+ login_banner: :text
5
+ }, {
6
+ migrate_data: true
7
+ })
8
+ end
9
+
10
+ def down
11
+ LibraryGroup.drop_translation_table! migrate_data: true
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ class AddFooterBannerToLibraryGroup < ActiveRecord::Migration
2
+ def up
3
+ LibraryGroup.add_translation_fields! footer_banner: :text
4
+ end
5
+
6
+ def down
7
+ remove_column :library_group_translations, :footer_banner
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ class AddHtmlSnippetToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_column :library_groups, :html_snippet, :text
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ class AddMostRecentToUserImportFileTransitions < ActiveRecord::Migration
2
+ def up
3
+ add_column :user_import_file_transitions, :most_recent, :boolean, null: true
4
+ end
5
+
6
+ def down
7
+ remove_column :user_import_file_transitions, :most_recent
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddMostRecentToUserExportFileTransitions < ActiveRecord::Migration
2
+ def up
3
+ add_column :user_export_file_transitions, :most_recent, :boolean, null: true
4
+ end
5
+
6
+ def down
7
+ remove_column :user_export_file_transitions, :most_recent
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ class AddMaxNumberOfResultsToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_column :library_groups, :max_number_of_results, :integer, default: 500
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddFamilyNameFirstToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_column :library_groups, :family_name_first, :boolean, default: true
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddPubYearFacetRangeIntervalToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_column :library_groups, :pub_year_facet_range_interval, :integer, default: 10
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddUserIdToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_reference :library_groups, :user, index: true, foreign_key: true
4
+ end
5
+ end
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20150221063719) do
14
+ ActiveRecord::Schema.define(version: 20160813203039) do
15
15
 
16
16
  create_table "accepts", force: :cascade do |t|
17
17
  t.integer "basket_id"
@@ -425,10 +425,22 @@ ActiveRecord::Schema.define(version: 20150221063719) do
425
425
  add_index "libraries", ["library_group_id"], name: "index_libraries_on_library_group_id"
426
426
  add_index "libraries", ["name"], name: "index_libraries_on_name", unique: true
427
427
 
428
+ create_table "library_group_translations", force: :cascade do |t|
429
+ t.integer "library_group_id", null: false
430
+ t.string "locale", null: false
431
+ t.datetime "created_at", null: false
432
+ t.datetime "updated_at", null: false
433
+ t.text "login_banner"
434
+ t.text "footer_banner"
435
+ end
436
+
437
+ add_index "library_group_translations", ["library_group_id"], name: "index_library_group_translations_on_library_group_id"
438
+ add_index "library_group_translations", ["locale"], name: "index_library_group_translations_on_locale"
439
+
428
440
  create_table "library_groups", force: :cascade do |t|
429
- t.string "name", null: false
441
+ t.string "name", null: false
430
442
  t.text "display_name"
431
- t.string "short_name", null: false
443
+ t.string "short_name", null: false
432
444
  t.text "my_networks"
433
445
  t.text "login_banner"
434
446
  t.text "note"
@@ -437,11 +449,19 @@ ActiveRecord::Schema.define(version: 20150221063719) do
437
449
  t.datetime "created_at"
438
450
  t.datetime "updated_at"
439
451
  t.text "admin_networks"
440
- t.string "url", default: "http://localhost:3000/"
452
+ t.string "url", default: "http://localhost:3000/"
441
453
  t.text "settings"
454
+ t.text "html_snippet"
455
+ t.string "book_jacket_source"
456
+ t.integer "max_number_of_results", default: 500
457
+ t.boolean "family_name_first", default: true
458
+ t.string "screenshot_generator"
459
+ t.integer "pub_year_facet_range_interval", default: 10
460
+ t.integer "user_id"
442
461
  end
443
462
 
444
463
  add_index "library_groups", ["short_name"], name: "index_library_groups_on_short_name"
464
+ add_index "library_groups", ["user_id"], name: "index_library_groups_on_user_id"
445
465
 
446
466
  create_table "licenses", force: :cascade do |t|
447
467
  t.string "name", null: false
@@ -843,6 +863,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
843
863
  t.integer "user_export_file_id"
844
864
  t.datetime "created_at"
845
865
  t.datetime "updated_at"
866
+ t.boolean "most_recent"
846
867
  end
847
868
 
848
869
  add_index "user_export_file_transitions", ["sort_key", "user_export_file_id"], name: "index_user_export_file_transitions_on_sort_key_and_file_id", unique: true
@@ -888,6 +909,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
888
909
  t.integer "user_import_file_id"
889
910
  t.datetime "created_at"
890
911
  t.datetime "updated_at"
912
+ t.boolean "most_recent"
891
913
  end
892
914
 
893
915
  add_index "user_import_file_transitions", ["sort_key", "user_import_file_id"], name: "index_user_import_file_transitions_on_sort_key_and_file_id", unique: true
@@ -899,7 +921,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
899
921
  t.datetime "executed_at"
900
922
  t.string "user_import_file_name"
901
923
  t.string "user_import_content_type"
902
- t.string "user_import_file_size"
924
+ t.integer "user_import_file_size"
903
925
  t.datetime "user_import_updated_at"
904
926
  t.string "user_import_fingerprint"
905
927
  t.string "edit_mode"
@@ -917,6 +939,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
917
939
  t.text "body"
918
940
  t.datetime "created_at"
919
941
  t.datetime "updated_at"
942
+ t.text "error_message"
920
943
  end
921
944
 
922
945
  create_table "users", force: :cascade do |t|
@@ -957,4 +980,15 @@ ActiveRecord::Schema.define(version: 20150221063719) do
957
980
 
958
981
  add_index "versions", ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
959
982
 
983
+ create_table "withdraws", force: :cascade do |t|
984
+ t.integer "basket_id"
985
+ t.integer "item_id"
986
+ t.integer "librarian_id"
987
+ t.datetime "created_at", null: false
988
+ t.datetime "updated_at", null: false
989
+ end
990
+
991
+ add_index "withdraws", ["basket_id"], name: "index_withdraws_on_basket_id"
992
+ add_index "withdraws", ["item_id"], name: "index_withdraws_on_item_id"
993
+
960
994
  end
@@ -12,8 +12,11 @@ one:
12
12
  login_banner: "*Next-L Enju*"
13
13
  admin_networks: "0.0.0.0/0\r\n\
14
14
  ::/0"
15
+ book_jacket_source: "google"
16
+ screenshot_generator: "mozshot"
15
17
  settings:
16
- "{\"max_number_of_results\":200,\"family_name_first\":true,\"amazon_hostname\":\"www.amazon.co.jp\",\"book_jacket_source\":\"google\",\"screenshot_generator\":\"mozshot\"}"
18
+ "{\"amazon_hostname\":\"www.amazon.co.jp\"}"
19
+ user_id: 1
17
20
 
18
21
  # == Schema Information
19
22
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enju_manifestation_viewer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.beta.2
4
+ version: 0.2.0.beta.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kosuke Tanabe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-12 00:00:00.000000000 Z
11
+ date: 2016-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: enju_biblio
@@ -16,28 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.0.beta.2
19
+ version: 0.2.0.beta.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.0.beta.2
26
+ version: 0.2.0.beta.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: enju_leaf
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.2.0.beta.1
33
+ version: 1.2.0.beta.2
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.2.0.beta.1
40
+ version: 1.2.0.beta.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: globalize
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: globalize-accessors
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
41
69
  - !ruby/object:Gem::Dependency
42
70
  name: sqlite3
43
71
  requirement: !ruby/object:Gem::Requirement
@@ -154,6 +182,8 @@ files:
154
182
  - app/views/manifestations/_scribd.html.erb
155
183
  - app/views/manifestations/_youtube.html.erb
156
184
  - config/routes.rb
185
+ - db/migrate/20160813191533_add_book_jacket_source_to_library_group.rb
186
+ - db/migrate/20160813191820_add_screenshot_generator_to_library_group.rb
157
187
  - lib/enju_manifestation_viewer.rb
158
188
  - lib/enju_manifestation_viewer/book_jacket_helper.rb
159
189
  - lib/enju_manifestation_viewer/engine.rb
@@ -318,6 +348,17 @@ files:
318
348
  - spec/dummy/db/migrate/20141003181336_add_full_name_transcription_to_profile.rb
319
349
  - spec/dummy/db/migrate/20141003182825_add_date_of_birth_to_profile.rb
320
350
  - spec/dummy/db/migrate/20150221063719_add_settings_to_library_group.rb
351
+ - spec/dummy/db/migrate/20150506105356_add_error_message_to_user_import_result.rb
352
+ - spec/dummy/db/migrate/20150924115059_create_withdraws.rb
353
+ - spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb
354
+ - spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb
355
+ - spec/dummy/db/migrate/20160610093229_add_html_snippet_to_library_group.rb
356
+ - spec/dummy/db/migrate/20160627232219_add_most_recent_to_user_import_file_transitions.rb
357
+ - spec/dummy/db/migrate/20160627232316_add_most_recent_to_user_export_file_transitions.rb
358
+ - spec/dummy/db/migrate/20160813191647_add_max_number_of_results_to_library_group.rb
359
+ - spec/dummy/db/migrate/20160813191733_add_family_name_first_to_library_group.rb
360
+ - spec/dummy/db/migrate/20160813192542_add_pub_year_facet_range_interval_to_library_group.rb
361
+ - spec/dummy/db/migrate/20160813203039_add_user_id_to_library_group.rb
321
362
  - spec/dummy/db/schema.rb
322
363
  - spec/dummy/public/404.html
323
364
  - spec/dummy/public/422.html
@@ -512,6 +553,17 @@ test_files:
512
553
  - spec/dummy/db/migrate/20141003181336_add_full_name_transcription_to_profile.rb
513
554
  - spec/dummy/db/migrate/20141003182825_add_date_of_birth_to_profile.rb
514
555
  - spec/dummy/db/migrate/20150221063719_add_settings_to_library_group.rb
556
+ - spec/dummy/db/migrate/20150506105356_add_error_message_to_user_import_result.rb
557
+ - spec/dummy/db/migrate/20150924115059_create_withdraws.rb
558
+ - spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb
559
+ - spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb
560
+ - spec/dummy/db/migrate/20160610093229_add_html_snippet_to_library_group.rb
561
+ - spec/dummy/db/migrate/20160627232219_add_most_recent_to_user_import_file_transitions.rb
562
+ - spec/dummy/db/migrate/20160627232316_add_most_recent_to_user_export_file_transitions.rb
563
+ - spec/dummy/db/migrate/20160813191647_add_max_number_of_results_to_library_group.rb
564
+ - spec/dummy/db/migrate/20160813191733_add_family_name_first_to_library_group.rb
565
+ - spec/dummy/db/migrate/20160813192542_add_pub_year_facet_range_interval_to_library_group.rb
566
+ - spec/dummy/db/migrate/20160813203039_add_user_id_to_library_group.rb
515
567
  - spec/dummy/db/schema.rb
516
568
  - spec/dummy/public/404.html
517
569
  - spec/dummy/public/422.html