enju_library 0.3.9 → 0.4.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -3
- data/app/controllers/concerns/enju_library/controller.rb +5 -5
- data/app/controllers/libraries_controller.rb +4 -1
- data/app/controllers/library_groups_controller.rb +7 -1
- data/app/controllers/request_status_types_controller.rb +6 -1
- data/app/controllers/request_types_controller.rb +6 -1
- data/app/controllers/shelves_controller.rb +4 -1
- data/app/controllers/user_groups_controller.rb +3 -0
- data/app/helpers/enju_library/application_helper.rb +18 -0
- data/app/models/budget_type.rb +9 -7
- data/app/models/concerns/enju_library/enju_user.rb +10 -0
- data/app/models/library.rb +29 -43
- data/app/models/library_group.rb +10 -11
- data/app/models/request_status_type.rb +9 -7
- data/app/models/request_type.rb +9 -7
- data/app/models/search_engine.rb +14 -18
- data/app/models/shelf.rb +13 -11
- data/app/models/user_export_file.rb +1 -1
- data/app/models/user_export_file_state_machine.rb +1 -1
- data/app/models/user_group.rb +2 -0
- data/app/models/user_import_file.rb +28 -27
- data/app/models/user_import_file_state_machine.rb +1 -1
- data/app/models/withdraw.rb +6 -0
- data/app/policies/shelf_policy.rb +1 -1
- data/app/views/accepts/_list.html.erb +2 -2
- data/app/views/accepts/index.html.erb +2 -2
- data/app/views/budget_types/_form.html.erb +1 -1
- data/app/views/budget_types/index.html.erb +1 -1
- data/app/views/budget_types/show.html.erb +1 -1
- data/app/views/libraries/_calendar.html.erb +1 -1
- data/app/views/libraries/_form.html.erb +2 -12
- data/app/views/libraries/_map.html+phone.erb +2 -2
- data/app/views/libraries/_map.html.erb +23 -10
- data/app/views/libraries/index.html.erb +1 -1
- data/app/views/libraries/show.html+phone.erb +1 -1
- data/app/views/libraries/show.html+phone.slim +1 -1
- data/app/views/libraries/show.html.erb +2 -2
- data/app/views/library_groups/_form.html.erb +14 -13
- data/app/views/library_groups/index.html.erb +1 -1
- data/app/views/library_groups/show.html.erb +2 -2
- data/app/views/picture_files/_index_shelf.html.erb +1 -1
- data/app/views/request_status_types/_form.html.erb +1 -1
- data/app/views/request_status_types/index.html.erb +1 -1
- data/app/views/request_status_types/show.html.erb +1 -1
- data/app/views/request_types/_form.html.erb +1 -1
- data/app/views/request_types/index.html.erb +1 -1
- data/app/views/request_types/show.html.erb +1 -1
- data/app/views/shelves/_form.html.erb +1 -1
- data/app/views/shelves/_select_form.html.erb +1 -1
- data/app/views/shelves/index.html.erb +3 -3
- data/app/views/shelves/show.html+phone.erb +1 -1
- data/app/views/shelves/show.html+phone.slim +1 -1
- data/app/views/shelves/show.html.erb +2 -2
- data/app/views/user_groups/_form.html.erb +1 -1
- data/app/views/user_groups/index.html.erb +1 -1
- data/app/views/user_groups/show.html.erb +2 -2
- data/app/views/user_import_files/_results.html.erb +0 -5
- data/app/views/user_import_files/new.html.erb +2 -2
- data/app/views/user_import_files/show.html.erb +2 -2
- data/app/views/user_import_results/index.html.erb +11 -0
- data/app/views/withdraws/_list.html.erb +2 -2
- data/app/views/withdraws/index.html.erb +3 -3
- data/app/views/withdraws/new.html.erb +1 -1
- data/config/locales/translation_en.yml +2 -4
- data/config/locales/translation_ja.yml +2 -4
- data/db/migrate/20160813191647_add_max_number_of_results_to_library_group.rb +1 -1
- data/db/migrate/20190630113817_add_display_name_translations_to_library_group.rb +12 -0
- data/db/migrate/20190630115523_add_login_banner_translations_to_library_group.rb +6 -0
- data/lib/enju_library/version.rb +1 -1
- data/lib/generators/enju_library/setup/setup_generator.rb +2 -7
- data/lib/generators/enju_library/setup/templates/db/fixtures/budget_types.yml +4 -0
- data/lib/generators/enju_library/setup/templates/db/fixtures/libraries.yml +2 -2
- data/lib/generators/enju_library/setup/templates/db/fixtures/library_groups.yml +11 -5
- data/lib/generators/enju_library/setup/templates/db/fixtures/user_groups.yml +1 -2
- data/spec/controllers/budget_types_controller_spec.rb +1 -1
- data/spec/controllers/items_controller_spec.rb +35 -0
- data/spec/dummy/app/helpers/application_helper.rb +1 -0
- data/spec/dummy/app/models/user.rb +1 -2
- data/spec/dummy/bin/bundle +1 -1
- data/spec/dummy/bin/setup +1 -3
- data/spec/dummy/bin/update +4 -2
- data/spec/dummy/bin/yarn +3 -3
- data/spec/dummy/config/application.rb +1 -0
- data/spec/dummy/config/database.yml +70 -9
- data/spec/dummy/config/initializers/assets.rb +1 -1
- data/spec/dummy/config/storage.yml +34 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/113_create_events.rb +2 -4
- data/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb +2 -4
- data/spec/dummy/db/migrate/20090519203307_create_participates.rb +2 -4
- data/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb +2 -2
- data/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20140812152348_create_event_export_files.rb +1 -1
- data/spec/dummy/db/migrate/20140814070854_add_default_event_category_id_to_event_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20151128142913_create_places.rb +14 -0
- data/spec/dummy/db/migrate/20151201163718_add_place_id_to_event.rb +5 -0
- data/spec/dummy/db/migrate/20160319144230_create_issn_records.rb +11 -0
- data/spec/dummy/db/migrate/20160506144040_create_isbn_records.rb +11 -0
- data/spec/dummy/db/migrate/20160703184258_add_most_recent_to_event_import_file_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160703184311_add_most_recent_to_event_export_file_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20170116134107_create_issn_record_and_manifestations.rb +11 -0
- data/spec/dummy/db/migrate/20170116134120_create_isbn_record_and_manifestations.rb +11 -0
- data/spec/dummy/db/migrate/20170116150432_create_jpno_records.rb +10 -0
- data/spec/dummy/db/migrate/20171126072934_create_ndla_records.rb +10 -0
- data/spec/dummy/db/migrate/20180107162659_add_constraints_to_most_recent_for_message_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107162711_add_constraints_to_most_recent_for_message_request_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107164558_add_constraints_to_most_recent_for_event_import_file_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107164617_add_constraints_to_most_recent_for_event_export_file_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20181030072731_add_not_null_to_position_on_carrier_type.rb +14 -0
- data/spec/dummy/db/migrate/20181119170645_add_foreign_key_to_events_referencing_event_categories.rb +5 -0
- data/spec/dummy/db/migrate/20190102034126_create_doi_records.rb +13 -0
- data/spec/dummy/db/migrate/20190208135957_create_active_storage_tables.active_storage.rb +27 -0
- data/spec/dummy/db/migrate/20190311154610_create_periodicals.rb +10 -0
- data/spec/dummy/db/migrate/20190312033839_create_periodical_and_manifestations.rb +11 -0
- data/spec/dummy/db/migrate/20190314151124_add_full_name_translations_to_create.rb +7 -0
- data/spec/dummy/db/migrate/20190501043418_create_ndl_bib_id_records.rb +10 -0
- data/spec/dummy/db/migrate/20190508160525_create_retains.rb +10 -0
- data/spec/dummy/db/migrate/20190512133459_upgrade_enju_event_to_enju_leaf20.rb +115 -0
- data/spec/dummy/db/migrate/20190629134017_rename_user_group_has_checkout_type_due_date_before_to_due_date_after.rb +5 -0
- data/spec/dummy/db/migrate/20190630151446_add_display_name_translations_to_role.rb +5 -0
- data/spec/dummy/db/migrate/20190630153136_add_display_name_translations_to_event.rb +6 -0
- data/spec/dummy/db/migrate/20190706052525_add_display_name_translations_to_circulation_status.rb +5 -0
- data/spec/dummy/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb +21 -0
- data/spec/dummy/db/migrate/20190713114724_add_checkout_id_to_checkin.rb +6 -0
- data/spec/dummy/db/migrate/20190713114940_add_profile_id_to_user.rb +5 -0
- data/spec/dummy/db/migrate/20190713115451_add_full_name_translations_to_profile.rb +5 -0
- data/spec/dummy/db/migrate/20190814120827_add_display_name_translations_to_checkout_type.rb +5 -0
- data/spec/dummy/db/schema.rb +402 -204
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/factories/budget_types.rb +8 -7
- data/spec/factories/profile.rb +9 -2
- data/spec/factories/user.rb +25 -31
- data/spec/factories/user_export_file.rb +5 -0
- data/spec/factories/user_import_file.rb +7 -0
- data/spec/factories/user_import_result.rb +6 -0
- data/spec/fixtures/agent_relationship_types.yml +34 -0
- data/spec/fixtures/agent_types.yml +11 -11
- data/spec/fixtures/agents.yml +27 -27
- data/spec/fixtures/baskets.yml +1 -0
- data/spec/fixtures/bookstores.yml +1 -0
- data/spec/fixtures/budget_types.yml +9 -7
- data/spec/fixtures/carrier_type_has_checkout_types.yml +5 -5
- data/spec/fixtures/carrier_types.yml +28 -24
- data/spec/fixtures/checked_items.yml +6 -6
- data/spec/fixtures/checkins.yml +4 -11
- data/spec/fixtures/checkout_stat_has_manifestations.yml +5 -5
- data/spec/fixtures/checkout_stat_has_users.yml +6 -6
- data/spec/fixtures/checkout_types.yml +11 -11
- data/spec/fixtures/checkouts.yml +16 -17
- data/spec/fixtures/circulation_statuses.yml +29 -38
- data/spec/fixtures/classification_types.yml +63 -0
- data/spec/fixtures/content_types.yml +20 -31
- data/spec/fixtures/create_types.yml +43 -0
- data/spec/fixtures/event_categories.yml +23 -23
- data/spec/fixtures/frequencies.yml +17 -25
- data/spec/fixtures/identifier_types.yml +42 -0
- data/spec/fixtures/item_has_use_restrictions.yml +11 -11
- data/spec/fixtures/items.yml +28 -17
- data/spec/fixtures/languages.yml +12 -13
- data/spec/fixtures/lending_policies.yml +8 -15
- data/spec/fixtures/libraries.yml +30 -29
- data/spec/fixtures/library_groups.yml +12 -9
- data/spec/fixtures/manifestation_checkout_stats.yml +4 -3
- data/spec/fixtures/manifestation_relationship_types.yml +29 -0
- data/spec/fixtures/manifestation_reserve_stats.yml +4 -3
- data/spec/fixtures/manifestations.yml +60 -50
- data/spec/fixtures/message_requests.yml +3 -3
- data/spec/fixtures/produce_types.yml +29 -0
- data/spec/fixtures/profiles.yml +11 -6
- data/spec/fixtures/realize_types.yml +36 -0
- data/spec/fixtures/request_status_types.yml +14 -13
- data/spec/fixtures/request_types.yml +13 -12
- data/spec/fixtures/reserve_stat_has_manifestations.yml +5 -5
- data/spec/fixtures/reserve_stat_has_users.yml +5 -5
- data/spec/fixtures/reserve_transitions.yml +8 -7
- data/spec/fixtures/reserves.yml +44 -64
- data/spec/fixtures/roles.yml +22 -5
- data/spec/fixtures/search_engines.yml +13 -12
- data/spec/fixtures/shelves.yml +16 -15
- data/spec/fixtures/subject_heading_types.yml +39 -0
- data/spec/fixtures/subject_types.yml +28 -0
- data/spec/fixtures/use_restrictions.yml +4 -4
- data/spec/fixtures/user_checkout_stats.yml +4 -4
- data/spec/fixtures/user_export_files.yml +1 -1
- data/spec/fixtures/user_group_has_checkout_types.yml +19 -19
- data/spec/fixtures/user_groups.yml +4 -3
- data/spec/fixtures/user_has_roles.yml +3 -4
- data/spec/fixtures/user_reserve_stats.yml +5 -4
- data/spec/models/budget_type_spec.rb +8 -7
- data/spec/models/library_group_spec.rb +5 -14
- data/spec/models/library_spec.rb +26 -25
- data/spec/models/request_status_type_spec.rb +8 -7
- data/spec/models/request_type_spec.rb +8 -7
- data/spec/models/search_engine_spec.rb +13 -12
- data/spec/models/shelf_spec.rb +12 -11
- data/spec/models/user_export_file_spec.rb +2 -2
- data/spec/models/user_group_spec.rb +1 -6
- data/spec/models/user_import_file_spec.rb +23 -23
- data/spec/rails_helper.rb +10 -2
- data/spec/system/libraries_spec.rb +5 -5
- metadata +476 -493
- data/app/helpers/shelves_helper.rb +0 -16
- data/app/views/layouts/libraries.html.erb +0 -31
- data/app/views/libraries/_map_header.html.erb +0 -6
- data/db/migrate/20151213070943_add_translation_table_to_library_group.rb +0 -18
- data/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +0 -22
- data/lib/generators/enju_library/setup/templates/db/fixtures/library_group/translations.yml +0 -12
- data/spec/dummy/app/assets/config/manifest.js +0 -5
- data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +0 -5
- data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +0 -5
- data/spec/dummy/db/migrate/20200425072340_create_manifestation_custom_properties.rb +0 -12
- data/spec/dummy/db/migrate/20200425072349_create_item_custom_properties.rb +0 -12
- data/spec/dummy/db/migrate/20200425074758_create_manifestation_custom_values.rb +0 -12
- data/spec/dummy/db/migrate/20200425074822_create_item_custom_values.rb +0 -12
- data/spec/dummy/yarn.lock +0 -7535
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e934beedc96dce953f9b68e7cb6d95bea1e0e4cb83454f03a5f2404797a52269
|
4
|
+
data.tar.gz: 0fc18a6416735b39a602e6389a6ccfe1b5410bab4ccf648d88a77ea76e1077ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ebd80409b9b708aaf8253f17276c4c250f5d743606d016332fbc639669a009c4b35359f22264f0f73a0b5f327cbe867a5067d0ae953b88461c77767fdaa7d99
|
7
|
+
data.tar.gz: 2c60aa8ecdecfe494380649894c571de5634024a10006b4b41067da1fde3e7aa40e218baa1bf64a858f31f79eefa4cfd0cb5b66b2e750bceb1b86711bc87228e
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# EnjuLibrary
|
2
|
-
[![
|
3
|
-
[![Coverage Status](https://coveralls.io/repos/github/next-l/enju_library/badge.svg?branch=
|
4
|
-
[![security](https://hakiri.io/github/next-l/enju_library/1.3.svg)](https://hakiri.io/github/next-l/enju_library/1.3)
|
2
|
+
[![CircleCI](https://circleci.com/gh/next-l/enju_library/tree/2.x.svg?style=svg)](https://circleci.com/gh/next-l/enju_library/tree/2.x)
|
3
|
+
[![Coverage Status](https://coveralls.io/repos/github/next-l/enju_library/badge.svg?branch=2.x)](https://coveralls.io/github/next-l/enju_library?branch=2.x)
|
5
4
|
|
6
5
|
This project rocks and uses MIT-LICENSE.
|
7
6
|
|
@@ -21,7 +21,7 @@ module EnjuLibrary
|
|
21
21
|
format.html {render template: 'page/403', status: :forbidden}
|
22
22
|
# format.html.phone {render template: 'page/403', status: 403}
|
23
23
|
format.xml {render template: 'page/403', status: :forbidden}
|
24
|
-
format.json { render
|
24
|
+
format.json { render text: '{"error": "forbidden"}' }
|
25
25
|
format.rss {render template: 'page/403.xml', status: :forbidden}
|
26
26
|
end
|
27
27
|
else
|
@@ -29,7 +29,7 @@ module EnjuLibrary
|
|
29
29
|
format.html { redirect_to main_app.new_user_session_url }
|
30
30
|
# format.html.phone { redirect_to new_user_session_url }
|
31
31
|
format.xml { render template: 'page/403', status: :forbidden }
|
32
|
-
format.json { render
|
32
|
+
format.json { render text: '{"error": "forbidden"}' }
|
33
33
|
format.rss { render template: 'page/403.xml', status: :forbidden }
|
34
34
|
end
|
35
35
|
end
|
@@ -41,7 +41,7 @@ module EnjuLibrary
|
|
41
41
|
format.html { render template: 'page/404', status: :not_found }
|
42
42
|
# format.html.phone { render template: 'page/404', status: 404 }
|
43
43
|
format.xml { render template: 'page/404', status: :not_found }
|
44
|
-
format.json { render
|
44
|
+
format.json { render text: '{"error": "not_found"}' }
|
45
45
|
format.rss { render template: 'page/404.xml', status: :not_found }
|
46
46
|
end
|
47
47
|
end
|
@@ -57,7 +57,7 @@ module EnjuLibrary
|
|
57
57
|
format.html {render file: "#{Rails.root}/public/500", layout: false, status: :internal_server_error}
|
58
58
|
# format.html.phone {render file: "#{Rails.root}/public/500", layout: false, status: 500}
|
59
59
|
format.xml {render template: 'page/500', status: :internal_server_error}
|
60
|
-
format.json { render
|
60
|
+
format.json { render text: '{"error": "server_error"}' }
|
61
61
|
format.xml {render template: 'page/500.xml', status: :internal_server_error}
|
62
62
|
end
|
63
63
|
end
|
@@ -70,7 +70,7 @@ module EnjuLibrary
|
|
70
70
|
format.html {render template: "page/500_nosolr", layout: false, status: :internal_server_error}
|
71
71
|
# format.html.phone {render template: "page/500_nosolr", layout: false, status: 500}
|
72
72
|
format.xml {render template: 'page/500', status: :internal_server_error}
|
73
|
-
format.json { render
|
73
|
+
format.json { render text: '{"error": "server_error"}' }
|
74
74
|
format.xml {render template: 'page/500.xml', status: :internal_server_error}
|
75
75
|
end
|
76
76
|
end
|
@@ -133,7 +133,10 @@ class LibrariesController < ApplicationController
|
|
133
133
|
:name, :display_name, :short_display_name, :zip_code, :street,
|
134
134
|
:locality, :region, :telephone_number_1, :telephone_number_2, :fax_number,
|
135
135
|
:note, :call_number_rows, :call_number_delimiter, :library_group_id,
|
136
|
-
:country_id, :opening_hour, :isil, :position,
|
136
|
+
:country_id, :opening_hour, :isil, :position,
|
137
|
+
I18n.available_locales.map{|locale|
|
138
|
+
:"display_name_#{locale.to_s}"
|
139
|
+
}
|
137
140
|
)
|
138
141
|
end
|
139
142
|
|
@@ -82,13 +82,19 @@ class LibraryGroupsController < ApplicationController
|
|
82
82
|
:book_jacket_source, :screenshot_generator, :erms_url,
|
83
83
|
:header_logo, :delete_header_logo,
|
84
84
|
:allow_bookmark_external_url, # EnjuBookmark
|
85
|
+
I18n.available_locales.map{|locale|
|
86
|
+
[
|
87
|
+
:"display_name_#{locale.to_s}",
|
88
|
+
:"login_banner_#{locale.to_s}",
|
89
|
+
:"footer_banner_#{locale.to_s}"
|
90
|
+
]
|
91
|
+
},
|
85
92
|
{
|
86
93
|
colors_attributes: [:id, :property, :code]
|
87
94
|
},
|
88
95
|
{
|
89
96
|
user_attributes: [:email]
|
90
97
|
},
|
91
|
-
*LibraryGroup.globalize_attribute_names,
|
92
98
|
)
|
93
99
|
end
|
94
100
|
end
|
@@ -95,6 +95,11 @@ class RequestStatusTypesController < ApplicationController
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def request_status_type_params
|
98
|
-
params.require(:request_status_type).permit(
|
98
|
+
params.require(:request_status_type).permit(
|
99
|
+
:name, :display_name, :note,
|
100
|
+
I18n.available_locales.map{|locale|
|
101
|
+
:"display_name_#{locale.to_s}"
|
102
|
+
}
|
103
|
+
)
|
99
104
|
end
|
100
105
|
end
|
@@ -95,6 +95,11 @@ class RequestTypesController < ApplicationController
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def request_type_params
|
98
|
-
params.require(:request_type).permit(
|
98
|
+
params.require(:request_type).permit(
|
99
|
+
:name, :display_name, :note,
|
100
|
+
I18n.available_locales.map{|locale|
|
101
|
+
:"display_name_#{locale.to_s}"
|
102
|
+
}
|
103
|
+
)
|
99
104
|
end
|
100
105
|
end
|
@@ -149,7 +149,10 @@ class ShelvesController < ApplicationController
|
|
149
149
|
|
150
150
|
def shelf_params
|
151
151
|
params.require(:shelf).permit(
|
152
|
-
:name, :display_name, :note, :library_id, :closed
|
152
|
+
:name, :display_name, :note, :library_id, :closed,
|
153
|
+
I18n.available_locales.map{|locale|
|
154
|
+
:"display_name_#{locale.to_s}"
|
155
|
+
}
|
153
156
|
)
|
154
157
|
end
|
155
158
|
end
|
@@ -103,6 +103,9 @@ class UserGroupsController < ApplicationController
|
|
103
103
|
:number_of_day_to_notify_overdue,
|
104
104
|
:number_of_day_to_notify_due_date,
|
105
105
|
:number_of_time_to_notify_overdue,
|
106
|
+
I18n.available_locales.map{|locale|
|
107
|
+
:"display_name_#{locale.to_s}"
|
108
|
+
},
|
106
109
|
# EnjuCirculation
|
107
110
|
{user_group_has_checkout_types_attributes: [
|
108
111
|
:id, :checkout_type_id, :checkout_limit, :checkout_period, :checkout_renewal_limit,
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module EnjuLibrary
|
2
|
+
module ApplicationHelper
|
3
|
+
def library_shelf_facet(current_library, facet)
|
4
|
+
library = Library.where(name: facet.value).select([:name, :display_name_translations]).first
|
5
|
+
return nil unless library
|
6
|
+
current = true if current_library.try(:name) == library.name
|
7
|
+
content_tag :li do
|
8
|
+
if current
|
9
|
+
content_tag :strong do
|
10
|
+
link_to("#{library.display_name.localize} (" + facet.count.to_s + ")", url_for(filtered_params.merge(page: nil, library_id: library.name, only_path: true)))
|
11
|
+
end
|
12
|
+
else
|
13
|
+
link_to("#{library.display_name.localize} (" + facet.count.to_s + ")", url_for(filtered_params.merge(page: nil, library_id: library.name, only_path: true)))
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/app/models/budget_type.rb
CHANGED
@@ -2,6 +2,7 @@ class BudgetType < ApplicationRecord
|
|
2
2
|
include MasterModel
|
3
3
|
validates :name, presence: true, format: { with: /\A[0-9A-Za-z][0-9A-Za-z_\-\s,]*[0-9a-z]\Z/ }
|
4
4
|
has_many :items
|
5
|
+
translates :display_name
|
5
6
|
|
6
7
|
private
|
7
8
|
|
@@ -14,11 +15,12 @@ end
|
|
14
15
|
#
|
15
16
|
# Table name: budget_types
|
16
17
|
#
|
17
|
-
# id
|
18
|
-
# name
|
19
|
-
# display_name
|
20
|
-
# note
|
21
|
-
# position
|
22
|
-
# created_at
|
23
|
-
# updated_at
|
18
|
+
# id :integer not null, primary key
|
19
|
+
# name :string
|
20
|
+
# display_name :text
|
21
|
+
# note :text
|
22
|
+
# position :integer
|
23
|
+
# created_at :datetime
|
24
|
+
# updated_at :datetime
|
25
|
+
# display_name_translations :jsonb not null
|
24
26
|
#
|
data/app/models/library.rb
CHANGED
@@ -10,6 +10,7 @@ class Library < ApplicationRecord
|
|
10
10
|
extend FriendlyId
|
11
11
|
friendly_id :name
|
12
12
|
geocoded_by :address
|
13
|
+
translates :display_name
|
13
14
|
|
14
15
|
searchable do
|
15
16
|
text :name, :display_name, :note, :address
|
@@ -28,20 +29,6 @@ class Library < ApplicationRecord
|
|
28
29
|
validates :isil, format: { with: /\A[A-Za-z]{1,4}-[A-Za-z0-9\/:\-]{2,11}\z/ }, allow_blank: true
|
29
30
|
after_validation :geocode, if: :address_changed?
|
30
31
|
after_create :create_shelf
|
31
|
-
after_save :clear_all_cache
|
32
|
-
after_destroy :clear_all_cache
|
33
|
-
|
34
|
-
def self.all_cache
|
35
|
-
if Rails.env == 'production'
|
36
|
-
Rails.cache.fetch('library_all'){ Library.all }
|
37
|
-
else
|
38
|
-
Library.all
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def clear_all_cache
|
43
|
-
Rails.cache.delete('library_all')
|
44
|
-
end
|
45
32
|
|
46
33
|
def create_shelf
|
47
34
|
shelf = Shelf.new
|
@@ -62,12 +49,10 @@ class Library < ApplicationRecord
|
|
62
49
|
def address(locale = I18n.locale)
|
63
50
|
case locale.to_sym
|
64
51
|
when :ja
|
65
|
-
"#{region
|
52
|
+
"#{region}#{locality}#{street}"
|
66
53
|
else
|
67
|
-
"#{street
|
54
|
+
"#{street} #{locality} #{region}"
|
68
55
|
end
|
69
|
-
rescue Psych::SyntaxError
|
70
|
-
nil
|
71
56
|
end
|
72
57
|
|
73
58
|
def address_changed?
|
@@ -94,29 +79,30 @@ end
|
|
94
79
|
#
|
95
80
|
# Table name: libraries
|
96
81
|
#
|
97
|
-
# id
|
98
|
-
# name
|
99
|
-
# display_name
|
100
|
-
# short_display_name
|
101
|
-
# zip_code
|
102
|
-
# street
|
103
|
-
# locality
|
104
|
-
# region
|
105
|
-
# telephone_number_1
|
106
|
-
# telephone_number_2
|
107
|
-
# fax_number
|
108
|
-
# note
|
109
|
-
# call_number_rows
|
110
|
-
# call_number_delimiter
|
111
|
-
# library_group_id
|
112
|
-
# users_count
|
113
|
-
# position
|
114
|
-
# country_id
|
115
|
-
# created_at
|
116
|
-
# updated_at
|
117
|
-
# deleted_at
|
118
|
-
# opening_hour
|
119
|
-
# isil
|
120
|
-
# latitude
|
121
|
-
# longitude
|
82
|
+
# id :integer not null, primary key
|
83
|
+
# name :string not null
|
84
|
+
# display_name :text
|
85
|
+
# short_display_name :string not null
|
86
|
+
# zip_code :string
|
87
|
+
# street :text
|
88
|
+
# locality :text
|
89
|
+
# region :text
|
90
|
+
# telephone_number_1 :string
|
91
|
+
# telephone_number_2 :string
|
92
|
+
# fax_number :string
|
93
|
+
# note :text
|
94
|
+
# call_number_rows :integer default(1), not null
|
95
|
+
# call_number_delimiter :string default("|"), not null
|
96
|
+
# library_group_id :integer not null
|
97
|
+
# users_count :integer default(0), not null
|
98
|
+
# position :integer
|
99
|
+
# country_id :integer
|
100
|
+
# created_at :datetime
|
101
|
+
# updated_at :datetime
|
102
|
+
# deleted_at :datetime
|
103
|
+
# opening_hour :text
|
104
|
+
# isil :string
|
105
|
+
# latitude :float
|
106
|
+
# longitude :float
|
107
|
+
# display_name_translations :jsonb not null
|
122
108
|
#
|
data/app/models/library_group.rb
CHANGED
@@ -2,14 +2,14 @@ class LibraryGroup < ApplicationRecord
|
|
2
2
|
#include Singleton
|
3
3
|
include MasterModel
|
4
4
|
|
5
|
-
has_many :libraries
|
6
|
-
has_many :colors
|
5
|
+
has_many :libraries
|
6
|
+
has_many :colors
|
7
7
|
belongs_to :country, optional: true
|
8
8
|
belongs_to :user, optional: true
|
9
9
|
|
10
10
|
validates :url, presence: true, url: true
|
11
11
|
validates :max_number_of_results, numericality: {
|
12
|
-
greater_than_or_equal_to:
|
12
|
+
greater_than_or_equal_to: 1
|
13
13
|
}
|
14
14
|
accepts_nested_attributes_for :colors, update_only: true
|
15
15
|
accepts_nested_attributes_for :user, update_only: true
|
@@ -18,8 +18,7 @@ class LibraryGroup < ApplicationRecord
|
|
18
18
|
:erms_url
|
19
19
|
], coder: JSON
|
20
20
|
|
21
|
-
translates :login_banner, :footer_banner
|
22
|
-
globalize_accessors
|
21
|
+
translates :login_banner, :footer_banner, :display_name
|
23
22
|
|
24
23
|
if ENV['ENJU_STORAGE'] == 's3'
|
25
24
|
has_attached_file :header_logo, storage: :s3, styles: { medium: 'x80'},
|
@@ -44,7 +43,7 @@ class LibraryGroup < ApplicationRecord
|
|
44
43
|
end
|
45
44
|
|
46
45
|
def self.system_name(locale = I18n.locale)
|
47
|
-
LibraryGroup.site_config.
|
46
|
+
LibraryGroup.site_config.send(:"display_name_#{locale.to_s}")
|
48
47
|
end
|
49
48
|
|
50
49
|
def config?
|
@@ -97,7 +96,7 @@ end
|
|
97
96
|
# settings :text
|
98
97
|
# html_snippet :text
|
99
98
|
# book_jacket_source :string
|
100
|
-
# max_number_of_results :integer default(
|
99
|
+
# max_number_of_results :integer default(500)
|
101
100
|
# family_name_first :boolean default(TRUE)
|
102
101
|
# screenshot_generator :string
|
103
102
|
# pub_year_facet_range_interval :integer default(10)
|
@@ -105,10 +104,10 @@ end
|
|
105
104
|
# csv_charset_conversion :boolean default(FALSE), not null
|
106
105
|
# header_logo_file_name :string
|
107
106
|
# header_logo_content_type :string
|
108
|
-
# header_logo_file_size :
|
107
|
+
# header_logo_file_size :bigint
|
109
108
|
# header_logo_updated_at :datetime
|
110
109
|
# header_logo_meta :text
|
111
|
-
#
|
112
|
-
#
|
113
|
-
#
|
110
|
+
# display_name_translations :jsonb not null
|
111
|
+
# login_banner_translations :jsonb not null
|
112
|
+
# footer_banner_translations :jsonb not null
|
114
113
|
#
|
@@ -2,6 +2,7 @@ class RequestStatusType < ApplicationRecord
|
|
2
2
|
include MasterModel
|
3
3
|
validates :name, presence: true, format: { with: /\A[0-9A-Za-z][0-9A-Za-z_\-\s,]*[0-9a-z]\Z/ }
|
4
4
|
has_many :reserves
|
5
|
+
translates :display_name
|
5
6
|
|
6
7
|
private
|
7
8
|
|
@@ -14,11 +15,12 @@ end
|
|
14
15
|
#
|
15
16
|
# Table name: request_status_types
|
16
17
|
#
|
17
|
-
# id
|
18
|
-
# name
|
19
|
-
# display_name
|
20
|
-
# note
|
21
|
-
# position
|
22
|
-
# created_at
|
23
|
-
# updated_at
|
18
|
+
# id :integer not null, primary key
|
19
|
+
# name :string not null
|
20
|
+
# display_name :text
|
21
|
+
# note :text
|
22
|
+
# position :integer
|
23
|
+
# created_at :datetime
|
24
|
+
# updated_at :datetime
|
25
|
+
# display_name_translations :jsonb not null
|
24
26
|
#
|
data/app/models/request_type.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
class RequestType < ApplicationRecord
|
2
2
|
include MasterModel
|
3
3
|
validates :name, presence: true, format: { with: /\A[0-9A-Za-z][0-9A-Za-z_\-\s,]*[0-9a-z]\Z/ }
|
4
|
+
translates :display_name
|
4
5
|
|
5
6
|
private
|
6
7
|
|
@@ -13,11 +14,12 @@ end
|
|
13
14
|
#
|
14
15
|
# Table name: request_types
|
15
16
|
#
|
16
|
-
# id
|
17
|
-
# name
|
18
|
-
# display_name
|
19
|
-
# note
|
20
|
-
# position
|
21
|
-
# created_at
|
22
|
-
# updated_at
|
17
|
+
# id :integer not null, primary key
|
18
|
+
# name :string not null
|
19
|
+
# display_name :text
|
20
|
+
# note :text
|
21
|
+
# position :integer
|
22
|
+
# created_at :datetime
|
23
|
+
# updated_at :datetime
|
24
|
+
# display_name_translations :jsonb not null
|
23
25
|
#
|
data/app/models/search_engine.rb
CHANGED
@@ -6,14 +6,9 @@ class SearchEngine < ApplicationRecord
|
|
6
6
|
validates :http_method, presence: true, inclusion: %w(get post)
|
7
7
|
validates :url, presence: true, url: true, length: { maximum: 255 }
|
8
8
|
validates :base_url, presence: true, url: true, length: { maximum: 255 }
|
9
|
-
after_save :clear_all_cache
|
10
|
-
after_destroy :clear_all_cache
|
11
9
|
|
12
10
|
paginates_per 10
|
13
|
-
|
14
|
-
def clear_all_cache
|
15
|
-
Rails.cache.delete('search_engine_all')
|
16
|
-
end
|
11
|
+
translates :display_name
|
17
12
|
|
18
13
|
def search_params(query)
|
19
14
|
params = {}
|
@@ -31,16 +26,17 @@ end
|
|
31
26
|
#
|
32
27
|
# Table name: search_engines
|
33
28
|
#
|
34
|
-
# id
|
35
|
-
# name
|
36
|
-
# display_name
|
37
|
-
# url
|
38
|
-
# base_url
|
39
|
-
# http_method
|
40
|
-
# query_param
|
41
|
-
# additional_param
|
42
|
-
# note
|
43
|
-
# position
|
44
|
-
# created_at
|
45
|
-
# updated_at
|
29
|
+
# id :integer not null, primary key
|
30
|
+
# name :string not null
|
31
|
+
# display_name :text
|
32
|
+
# url :string not null
|
33
|
+
# base_url :text not null
|
34
|
+
# http_method :text not null
|
35
|
+
# query_param :text not null
|
36
|
+
# additional_param :text
|
37
|
+
# note :text
|
38
|
+
# position :integer
|
39
|
+
# created_at :datetime
|
40
|
+
# updated_at :datetime
|
41
|
+
# display_name_translations :jsonb not null
|
46
42
|
#
|