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
data/app/models/shelf.rb
CHANGED
@@ -12,6 +12,7 @@ class Shelf < ApplicationRecord
|
|
12
12
|
before_update :reset_position
|
13
13
|
|
14
14
|
acts_as_list scope: :library
|
15
|
+
translates :display_name
|
15
16
|
|
16
17
|
searchable do
|
17
18
|
string :shelf_name do
|
@@ -53,15 +54,16 @@ end
|
|
53
54
|
#
|
54
55
|
# Table name: shelves
|
55
56
|
#
|
56
|
-
# id
|
57
|
-
# name
|
58
|
-
# display_name
|
59
|
-
# note
|
60
|
-
# library_id
|
61
|
-
# items_count
|
62
|
-
# position
|
63
|
-
# created_at
|
64
|
-
# updated_at
|
65
|
-
# deleted_at
|
66
|
-
# closed
|
57
|
+
# id :integer not null, primary key
|
58
|
+
# name :string not null
|
59
|
+
# display_name :text
|
60
|
+
# note :text
|
61
|
+
# library_id :integer not null
|
62
|
+
# items_count :integer default(0), not null
|
63
|
+
# position :integer
|
64
|
+
# created_at :datetime
|
65
|
+
# updated_at :datetime
|
66
|
+
# deleted_at :datetime
|
67
|
+
# closed :boolean default(FALSE), not null
|
68
|
+
# display_name_translations :jsonb not null
|
67
69
|
#
|
@@ -61,7 +61,7 @@ end
|
|
61
61
|
# user_id :integer
|
62
62
|
# user_export_file_name :string
|
63
63
|
# user_export_content_type :string
|
64
|
-
# user_export_file_size :
|
64
|
+
# user_export_file_size :bigint
|
65
65
|
# user_export_updated_at :datetime
|
66
66
|
# executed_at :datetime
|
67
67
|
# created_at :datetime
|
@@ -6,7 +6,7 @@ class UserExportFileStateMachine
|
|
6
6
|
state :completed
|
7
7
|
state :failed
|
8
8
|
|
9
|
-
transition from: :pending, to:
|
9
|
+
transition from: :pending, to: :started
|
10
10
|
transition from: :started, to: [:completed, :failed]
|
11
11
|
|
12
12
|
after_transition(from: :pending, to: :started) do |user_export_file|
|
data/app/models/user_group.rb
CHANGED
@@ -5,6 +5,7 @@ class UserGroup < ApplicationRecord
|
|
5
5
|
validates_numericality_of :valid_period_for_new_user,
|
6
6
|
greater_than_or_equal_to: 0,
|
7
7
|
allow_blank: true
|
8
|
+
translates :display_name
|
8
9
|
|
9
10
|
paginates_per 10
|
10
11
|
end
|
@@ -26,4 +27,5 @@ end
|
|
26
27
|
# number_of_day_to_notify_overdue :integer default(7), not null
|
27
28
|
# number_of_day_to_notify_due_date :integer default(3), not null
|
28
29
|
# number_of_time_to_notify_overdue :integer default(3), not null
|
30
|
+
# display_name_translations :jsonb not null
|
29
31
|
#
|
@@ -45,7 +45,7 @@ class UserImportFile < ApplicationRecord
|
|
45
45
|
# 利用者情報をTSVファイルを用いて作成します。
|
46
46
|
def import
|
47
47
|
transition_to!(:started)
|
48
|
-
num = { user_imported: 0, user_found: 0,
|
48
|
+
num = { user_imported: 0, user_found: 0, error: 0 }
|
49
49
|
rows = open_import_file(create_import_temp_file(user_import))
|
50
50
|
row_num = 1
|
51
51
|
|
@@ -69,34 +69,35 @@ class UserImportFile < ApplicationRecord
|
|
69
69
|
num[:user_found] += 1
|
70
70
|
else
|
71
71
|
new_user = User.new
|
72
|
-
new_user.role = Role.find_by(name: row['role'])
|
73
|
-
if new_user.role
|
74
|
-
unless user.has_role?(new_user.role.name)
|
75
|
-
num[:failed] += 1
|
76
|
-
next
|
77
|
-
end
|
78
|
-
else
|
79
|
-
new_user.role = Role.find(2) # User
|
80
|
-
end
|
81
72
|
new_user.username = username
|
82
73
|
new_user.assign_attributes(set_user_params(row))
|
83
74
|
profile = Profile.new
|
84
75
|
profile.assign_attributes(set_profile_params(row))
|
76
|
+
if row['role'].present?
|
77
|
+
role = Role.find_by(name: row['role'])
|
78
|
+
else
|
79
|
+
role = Role.find(2) # User
|
80
|
+
end
|
85
81
|
|
86
82
|
Profile.transaction do
|
87
|
-
if
|
83
|
+
if profile.valid? && role
|
88
84
|
new_user.profile = profile
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
import_result.save
|
98
|
-
num[:error] += 1
|
85
|
+
new_user.role = role
|
86
|
+
|
87
|
+
if new_user.save
|
88
|
+
import_result.user = new_user
|
89
|
+
import_result.save!
|
90
|
+
num[:user_imported] += 1
|
91
|
+
next
|
92
|
+
end
|
99
93
|
end
|
94
|
+
|
95
|
+
error_message = "line #{row_num}: "
|
96
|
+
error_message += new_user.errors.full_messages.join(" ")
|
97
|
+
error_message += profile.errors.full_messages.join(" ")
|
98
|
+
import_result.error_message = error_message
|
99
|
+
import_result.save
|
100
|
+
num[:error] += 1
|
100
101
|
end
|
101
102
|
end
|
102
103
|
end
|
@@ -145,7 +146,7 @@ class UserImportFile < ApplicationRecord
|
|
145
146
|
)
|
146
147
|
|
147
148
|
username = row['username']
|
148
|
-
new_user = User.
|
149
|
+
new_user = User.where(username: username).first
|
149
150
|
if new_user.try(:profile)
|
150
151
|
new_user.assign_attributes(set_user_params(row))
|
151
152
|
new_user.profile.assign_attributes(set_profile_params(row))
|
@@ -192,7 +193,7 @@ class UserImportFile < ApplicationRecord
|
|
192
193
|
rows.each do |row|
|
193
194
|
row_num += 1
|
194
195
|
username = row['username'].to_s.strip
|
195
|
-
remove_user = User.
|
196
|
+
remove_user = User.where(username: username).first
|
196
197
|
if remove_user.try(:deletable_by?, user)
|
197
198
|
UserImportFile.transaction do
|
198
199
|
remove_user.destroy
|
@@ -288,15 +289,15 @@ class UserImportFile < ApplicationRecord
|
|
288
289
|
# @param [Hash] row 利用者情報のハッシュ
|
289
290
|
def set_profile_params(row)
|
290
291
|
params = {}
|
291
|
-
user_group = UserGroup.
|
292
|
+
user_group = UserGroup.where(name: row['user_group']).first
|
292
293
|
unless user_group
|
293
294
|
user_group = default_user_group
|
294
295
|
end
|
295
296
|
params[:user_group_id] = user_group.id if user_group
|
296
297
|
|
297
|
-
required_role = Role.
|
298
|
+
required_role = Role.where(name: row['required_role']).first
|
298
299
|
unless required_role
|
299
|
-
required_role = Role.
|
300
|
+
required_role = Role.where(name: 'Librarian').first
|
300
301
|
end
|
301
302
|
params[:required_role_id] = required_role.id if required_role
|
302
303
|
|
@@ -318,7 +319,7 @@ class UserImportFile < ApplicationRecord
|
|
318
319
|
params[:locale] = row['locale']
|
319
320
|
end
|
320
321
|
|
321
|
-
library = Library.
|
322
|
+
library = Library.where(name: row['library'].to_s.strip).first
|
322
323
|
unless library
|
323
324
|
library = default_library || Library.web
|
324
325
|
end
|
@@ -6,7 +6,7 @@ class UserImportFileStateMachine
|
|
6
6
|
state :completed
|
7
7
|
state :failed
|
8
8
|
|
9
|
-
transition from: :pending, to:
|
9
|
+
transition from: :pending, to: :started
|
10
10
|
transition from: :started, to: [:completed, :failed]
|
11
11
|
|
12
12
|
after_transition(from: :pending, to: :started) do |user_import_file|
|
data/app/models/withdraw.rb
CHANGED
@@ -7,10 +7,16 @@ class Withdraw < ApplicationRecord
|
|
7
7
|
uniqueness: true, #{ message: I18n.t('withdraw.already_withdrawn', locale: I18n.default_locale) },
|
8
8
|
presence: true #, { message: I18n.translate('withdraw.item_not_found', locale: I18n.default_locale) }
|
9
9
|
validates_presence_of :basket_id
|
10
|
+
validate :check_item
|
10
11
|
|
11
12
|
attr_accessor :item_identifier
|
12
13
|
|
13
14
|
paginates_per 10
|
15
|
+
|
16
|
+
def check_item
|
17
|
+
errors.add(:item) if item.try(:rent?)
|
18
|
+
errors.add(:item) if item.try(:reserved?)
|
19
|
+
end
|
14
20
|
end
|
15
21
|
|
16
22
|
# == Schema Information
|
@@ -20,8 +20,8 @@
|
|
20
20
|
<td>
|
21
21
|
<%= render 'manifestations/show_index', manifestation: accept.item.manifestation %>
|
22
22
|
<%= link_to accept.item.item_identifier, accept.item -%> / <%= accept.item.call_number %>
|
23
|
-
(<%= link_to accept.item.shelf.library.display_name
|
24
|
-
<%= link_to accept.item.shelf.display_name
|
23
|
+
(<%= link_to accept.item.shelf.library.display_name, accept.item.shelf.library %> /
|
24
|
+
<%= link_to accept.item.shelf.display_name, accept.item.shelf %>)<br />
|
25
25
|
<%=l accept.created_at %>
|
26
26
|
</td>
|
27
27
|
</tr>
|
@@ -23,8 +23,8 @@
|
|
23
23
|
<% if accept.item %>
|
24
24
|
<%= render 'manifestations/show_index', manifestation: accept.item.manifestation %>
|
25
25
|
<%= link_to accept.item.item_identifier, accept.item -%> / <%= accept.item.call_number %>
|
26
|
-
(<%= link_to accept.item.shelf.library.display_name
|
27
|
-
<%= link_to accept.item.shelf.display_name
|
26
|
+
(<%= link_to accept.item.shelf.library.display_name, accept.item.shelf.library %> /
|
27
|
+
<%= link_to accept.item.shelf.display_name, accept.item.shelf %>)<br />
|
28
28
|
<%=l accept.created_at %>
|
29
29
|
<% end %>
|
30
30
|
</td>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
<%- end -%>
|
20
20
|
</td>
|
21
21
|
<td><%= link_to budget_type.name, budget_type -%></td>
|
22
|
-
<td><%= link_to budget_type.display_name
|
22
|
+
<td><%= link_to budget_type.display_name, budget_type -%></td>
|
23
23
|
<td><%= budget_type.note -%></td>
|
24
24
|
<td>
|
25
25
|
<%- if policy(budget_type).update? -%>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<ul>
|
4
4
|
<%- @events.each do |event| -%>
|
5
5
|
<li>
|
6
|
-
<%= link_to event.display_name
|
6
|
+
<%= link_to event.display_name, event -%>
|
7
7
|
<% if event.all_day? %>
|
8
8
|
(<%= l(event.start_at, format: :only_date) -%> - <%= l(event.end_at, format: :only_date) -%>)
|
9
9
|
<% else %>
|
@@ -20,12 +20,12 @@
|
|
20
20
|
<% unless @library.web? %>
|
21
21
|
<div class="field">
|
22
22
|
<%= f.label :isil -%><br />
|
23
|
-
<%= f.text_field :isil, class: '
|
23
|
+
<%= f.text_field :isil, class: 'resource_identifierr' -%>
|
24
24
|
</div>
|
25
25
|
|
26
26
|
<div class="field">
|
27
27
|
<%= f.label t('activerecord.models.country') -%><br />
|
28
|
-
<%= f.select(:country_id, @countries.collect{|c| [c.display_name
|
28
|
+
<%= f.select(:country_id, @countries.collect{|c| [c.display_name, c.id]}) -%>
|
29
29
|
</div>
|
30
30
|
|
31
31
|
<div class="field">
|
@@ -48,16 +48,6 @@
|
|
48
48
|
<%= f.text_area :street, class: 'resource_textarea' -%>
|
49
49
|
</div>
|
50
50
|
|
51
|
-
<div class="field">
|
52
|
-
<%= f.label :latitude -%><br />
|
53
|
-
<%= f.text_field :latitude -%>
|
54
|
-
</div>
|
55
|
-
|
56
|
-
<div class="field">
|
57
|
-
<%= f.label :longitude -%><br />
|
58
|
-
<%= f.text_field :longitude -%>
|
59
|
-
</div>
|
60
|
-
|
61
51
|
<div class="field">
|
62
52
|
<%= f.label :telephone_number_1 -%><br />
|
63
53
|
<%= f.phone_field :telephone_number_1 -%>
|
@@ -12,10 +12,10 @@
|
|
12
12
|
var marker = new google.maps.Marker({
|
13
13
|
position: latlng,
|
14
14
|
map: map,
|
15
|
-
title: '<%= library.display_name
|
15
|
+
title: '<%= library.display_name %>'
|
16
16
|
});
|
17
17
|
var infowindow = new google.maps.InfoWindow({
|
18
|
-
content: '<%= library.display_name
|
18
|
+
content: '<%= library.display_name %>'
|
19
19
|
});
|
20
20
|
google.maps.event.addListener(marker, 'click', function() {
|
21
21
|
infowindow.open(map,marker);
|
@@ -1,12 +1,25 @@
|
|
1
|
-
<
|
2
|
-
<script>
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
|
2
|
+
<script type="text/javascript">
|
3
|
+
google.maps.event.addDomListener(window, 'load', function() {
|
4
|
+
var latlng = new google.maps.LatLng(<%= library.latitude %>, <%= library.longitude %>);
|
5
|
+
var options = {
|
6
|
+
zoom: 16,
|
7
|
+
center: latlng,
|
8
|
+
mapTypeId: google.maps.MapTypeId.ROADMAP,
|
9
|
+
scaleControl: true
|
10
|
+
};
|
11
|
+
var map = new google.maps.Map(document.getElementById("library_map"), options);
|
12
|
+
var marker = new google.maps.Marker({
|
13
|
+
position: latlng,
|
14
|
+
map: map,
|
15
|
+
title: '<%= library.display_name %>'
|
16
|
+
});
|
17
|
+
var infowindow = new google.maps.InfoWindow({
|
18
|
+
content: '<%= library.display_name %>'
|
19
|
+
});
|
20
|
+
google.maps.event.addListener(marker, 'click', function() {
|
21
|
+
infowindow.open(map,marker);
|
22
|
+
});
|
11
23
|
});
|
12
24
|
</script>
|
25
|
+
<div id="library_map" style="width: 500px; height: 500px;"></div>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<div data-role="header">
|
2
2
|
<a href="javascript:history.back()" data-icon="back" data-iconpos="notext" class="ui-btn-left"><%= t('page.back') %></a>
|
3
|
-
<h1 class="title"><%= @library.display_name
|
3
|
+
<h1 class="title"><%= @library.display_name -%></h1>
|
4
4
|
</div>
|
5
5
|
<div data-role="content">
|
6
6
|
<div id="detail">
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div id="content_detail" class="ui-corner-all ui-widget-content">
|
2
|
-
<h1 class="title"><%= @library.display_name
|
2
|
+
<h1 class="title"><%= @library.display_name -%></h1>
|
3
3
|
<div id="content_list">
|
4
4
|
<p id="notice"><%= notice %></p>
|
5
5
|
|
@@ -71,7 +71,7 @@
|
|
71
71
|
<%- @library.shelves.each do |shelf| -%>
|
72
72
|
<tr class="line<%= cycle("0", "1") -%>">
|
73
73
|
<td>
|
74
|
-
<%= link_to shelf.display_name
|
74
|
+
<%= link_to shelf.display_name, shelf_path(shelf, library_id: @library.name) -%>
|
75
75
|
<%- shelf.picture_files.each do |picture_file| -%>
|
76
76
|
<%= link_to image_tag('icons/picture.png', size: '16x16', class: 'enju_icon', alt: t('page.picture')), picture_file_path(picture_file, format: :download), rel: "shelf_#{h(shelf.id)}" -%>
|
77
77
|
<%- end -%>
|
@@ -6,10 +6,13 @@
|
|
6
6
|
<%= f.text_field :name, class: 'short_name' -%>
|
7
7
|
</div>
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
<% I18n.available_locales.each do |locale| %>
|
10
|
+
<div class="field">
|
11
|
+
<% display_name = "display_name_#{locale.to_s}" %>
|
12
|
+
<%= f.label :display_name -%> (<%= locale.to_s %>)<br />
|
13
|
+
<%= f.text_field display_name -%>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
13
16
|
|
14
17
|
<div class="field">
|
15
18
|
<%= f.label :header_logo -%><br />
|
@@ -31,17 +34,15 @@
|
|
31
34
|
<%= f.url_field :url, class: 'resource_url' -%>
|
32
35
|
</div>
|
33
36
|
|
34
|
-
<%
|
37
|
+
<% I18n.available_locales.each do |locale| -%>
|
35
38
|
<div class="field">
|
36
|
-
<%= f.label :login_banner -%> (<%=
|
37
|
-
<%= f.text_area
|
39
|
+
<%= f.label :login_banner -%> (<%= locale -%>)<br />
|
40
|
+
<%= f.text_area :"login_banner_#{locale.to_s}" -%>
|
38
41
|
</div>
|
39
|
-
<% end -%>
|
40
42
|
|
41
|
-
|
42
|
-
|
43
|
-
<%= f.
|
44
|
-
<%= f.text_area LibraryGroup.localized_attr_name_for(:footer_banner, language.iso_639_1) -%>
|
43
|
+
<div class="field">
|
44
|
+
<%= f.label :footer_banner -%> (<%= locale -%>)<br />
|
45
|
+
<%= f.text_area :"footer_banner_#{locale.to_s}" -%>
|
45
46
|
</div>
|
46
47
|
<% end -%>
|
47
48
|
|
@@ -66,7 +67,7 @@
|
|
66
67
|
|
67
68
|
<div class="field">
|
68
69
|
<%= f.label t('activerecord.models.country') -%><br />
|
69
|
-
<%= f.select(:country_id, @countries.collect{|c| [c.display_name
|
70
|
+
<%= f.select(:country_id, @countries.collect{|c| [c.display_name, c.id]}) -%>
|
70
71
|
</div>
|
71
72
|
|
72
73
|
<% if defined?(EnjuBookmark) %>
|