enju_circulation 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.
Files changed (181) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -3
  3. data/app/controllers/checkins_controller.rb +2 -2
  4. data/app/controllers/user_group_has_checkout_types_controller.rb +1 -1
  5. data/app/helpers/items_helper.rb +3 -3
  6. data/app/models/checked_item.rb +7 -17
  7. data/app/models/checkin.rb +3 -2
  8. data/app/models/checkout.rb +2 -2
  9. data/app/models/checkout_stat_has_user.rb +1 -1
  10. data/app/models/checkout_type.rb +9 -7
  11. data/app/models/circulation_status.rb +9 -8
  12. data/app/models/concerns/enju_circulation/enju_item.rb +2 -46
  13. data/app/models/concerns/enju_circulation/enju_user_group.rb +0 -1
  14. data/app/models/concerns/enju_circulation/enju_withdraw.rb +1 -7
  15. data/app/models/manifestation_checkout_stat_transition.rb +1 -1
  16. data/app/models/manifestation_reserve_stat_transition.rb +1 -1
  17. data/app/models/reserve.rb +5 -5
  18. data/app/models/reserve_state_machine.rb +3 -2
  19. data/app/models/reserve_transition.rb +1 -1
  20. data/app/models/retain.rb +15 -0
  21. data/app/models/user_checkout_stat_transition.rb +1 -1
  22. data/app/models/user_group_has_checkout_type.rb +15 -37
  23. data/app/models/user_reserve_stat_transition.rb +1 -1
  24. data/app/views/carrier_type_has_checkout_types/_form.html.erb +2 -2
  25. data/app/views/carrier_type_has_checkout_types/index.html.erb +2 -2
  26. data/app/views/carrier_type_has_checkout_types/show.html.erb +2 -2
  27. data/app/views/carrier_types/_carrier_type_has_checkout_type_fields.html.erb +1 -1
  28. data/app/views/checked_items/new.html.erb +1 -1
  29. data/app/views/checkins/_checkin.html.erb +1 -1
  30. data/app/views/checkout_types/_form.html.erb +1 -1
  31. data/app/views/checkout_types/index.html.erb +1 -1
  32. data/app/views/checkout_types/show.html.erb +2 -2
  33. data/app/views/checkouts/_index_user.html.erb +1 -1
  34. data/app/views/checkouts/_list.html.erb +2 -9
  35. data/app/views/checkouts/index.atom.builder +1 -1
  36. data/app/views/checkouts/index.ics.erb +1 -1
  37. data/app/views/checkouts/index.rss.builder +1 -1
  38. data/app/views/circulation_statuses/_form.html.erb +1 -1
  39. data/app/views/circulation_statuses/index.html.erb +1 -1
  40. data/app/views/circulation_statuses/show.html.erb +1 -1
  41. data/app/views/item_has_use_restrictions/index.html.erb +1 -1
  42. data/app/views/item_has_use_restrictions/show.html.erb +1 -1
  43. data/app/views/manifestation_checkout_stats/_group_by_carrier_type.html.erb +3 -3
  44. data/app/views/manifestation_checkout_stats/_group_by_checkout_type.html.erb +3 -3
  45. data/app/views/manifestations/_circulation_status.html.erb +3 -3
  46. data/app/views/profiles/_submenu_checkout.html.erb +1 -1
  47. data/app/views/reserves/_new.html.erb +1 -1
  48. data/app/views/reserves/_new_user.html.erb +1 -1
  49. data/app/views/reserves/edit.html.erb +1 -1
  50. data/app/views/reserves/index.atom.builder +1 -1
  51. data/app/views/reserves/index.html.erb +1 -1
  52. data/app/views/reserves/index.rss.builder +1 -1
  53. data/app/views/reserves/show.html.erb +1 -1
  54. data/app/views/use_restrictions/_form.html.erb +1 -1
  55. data/app/views/use_restrictions/index.html.erb +1 -1
  56. data/app/views/use_restrictions/show.html.erb +1 -1
  57. data/app/views/user_group_has_checkout_types/edit.html.erb +4 -4
  58. data/app/views/user_group_has_checkout_types/index.html.erb +2 -2
  59. data/app/views/user_group_has_checkout_types/new.html.erb +4 -4
  60. data/app/views/user_group_has_checkout_types/show.html.erb +4 -4
  61. data/app/views/user_groups/_user_group_has_checkout_type_fields.html.erb +2 -2
  62. data/config/locales/translation_en.yml +1 -14
  63. data/config/locales/translation_ja.yml +1 -14
  64. data/config/routes.rb +1 -2
  65. data/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +3 -3
  66. data/db/migrate/20190508160525_create_retains.rb +10 -0
  67. data/db/migrate/20190629134017_rename_user_group_has_checkout_type_due_date_before_to_due_date_after.rb +5 -0
  68. data/db/migrate/20190706052525_add_display_name_translations_to_circulation_status.rb +5 -0
  69. data/db/migrate/20190713114724_add_checkout_id_to_checkin.rb +5 -0
  70. data/db/migrate/20190814120827_add_display_name_translations_to_checkout_type.rb +5 -0
  71. data/lib/enju_circulation/version.rb +1 -1
  72. data/lib/generators/enju_circulation/setup/templates/db/fixtures/checkout_types.yml +3 -5
  73. data/lib/generators/enju_circulation/setup/templates/db/fixtures/circulation_statuses.yml +16 -48
  74. data/lib/tasks/enju_circulation_tasks.rake +7 -1
  75. data/spec/concerns/enju_accept_spec.rb +14 -14
  76. data/spec/controllers/accepts_controller_spec.rb +294 -0
  77. data/spec/controllers/baskets_controller_spec.rb +379 -0
  78. data/spec/controllers/checkins_controller_spec.rb +8 -130
  79. data/spec/controllers/items_controller_spec.rb +23 -43
  80. data/spec/dummy/app/mailers/application_mailer.rb +4 -0
  81. data/spec/dummy/app/models/user.rb +1 -1
  82. data/spec/dummy/bin/bundle +1 -1
  83. data/spec/dummy/bin/setup +1 -3
  84. data/spec/dummy/bin/update +4 -2
  85. data/spec/dummy/bin/yarn +3 -3
  86. data/spec/dummy/config/database.yml +70 -9
  87. data/spec/dummy/config/initializers/assets.rb +1 -0
  88. data/spec/dummy/db/development.sqlite3 +0 -0
  89. data/spec/dummy/db/migrate/113_create_events.rb +2 -4
  90. data/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb +2 -4
  91. data/spec/dummy/db/migrate/20090519203307_create_participates.rb +2 -4
  92. data/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb +2 -2
  93. data/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb +1 -1
  94. data/spec/dummy/db/migrate/20140812152348_create_event_export_files.rb +1 -1
  95. data/spec/dummy/db/migrate/20140814070854_add_default_event_category_id_to_event_import_file.rb +1 -1
  96. data/spec/dummy/db/migrate/20151128142913_create_places.rb +14 -0
  97. data/spec/dummy/db/migrate/20151201163718_add_place_id_to_event.rb +5 -0
  98. data/spec/dummy/db/migrate/20160703184258_add_most_recent_to_event_import_file_transitions.rb +9 -0
  99. data/spec/dummy/db/migrate/20160703184311_add_most_recent_to_event_export_file_transitions.rb +9 -0
  100. data/spec/dummy/db/migrate/20180107160726_add_constraints_to_most_recent_for_user_import_file_transitions.rb +1 -1
  101. data/spec/dummy/db/migrate/20180107160740_add_constraints_to_most_recent_for_user_export_file_transitions.rb +1 -1
  102. data/spec/dummy/db/migrate/20180107164558_add_constraints_to_most_recent_for_event_import_file_transitions.rb +13 -0
  103. data/spec/dummy/db/migrate/20180107164617_add_constraints_to_most_recent_for_event_export_file_transitions.rb +13 -0
  104. data/spec/dummy/db/migrate/20181119170645_add_foreign_key_to_events_referencing_event_categories.rb +5 -0
  105. data/spec/dummy/db/migrate/20190630113817_add_display_name_translations_to_library_group.rb +12 -0
  106. data/spec/dummy/db/migrate/20190630115523_add_login_banner_translations_to_library_group.rb +6 -0
  107. data/spec/dummy/db/migrate/20190630151446_add_display_name_translations_to_role.rb +5 -0
  108. data/spec/dummy/db/migrate/20190630153136_add_display_name_translations_to_event.rb +6 -0
  109. data/spec/dummy/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb +21 -0
  110. data/spec/dummy/db/migrate/20190713114940_add_profile_id_to_user.rb +5 -0
  111. data/spec/dummy/db/migrate/20190713115451_add_full_name_translations_to_profile.rb +5 -0
  112. data/spec/dummy/db/schema.rb +221 -184
  113. data/spec/dummy/db/test.sqlite3 +0 -0
  114. data/spec/dummy/private/system/carrier_types/attachments/000/000/001/original/book.png +0 -0
  115. data/spec/dummy/private/system/carrier_types/attachments/000/000/001/thumb/book.png +0 -0
  116. data/spec/factories/accept.rb +1 -1
  117. data/spec/factories/item.rb +4 -4
  118. data/spec/factories/reserve.rb +1 -5
  119. data/spec/fixtures/carrier_types.yml +16 -15
  120. data/spec/fixtures/checkins.yml +2 -1
  121. data/spec/fixtures/checkout_stat_has_users.yml +1 -1
  122. data/spec/fixtures/checkout_types.yml +11 -10
  123. data/spec/fixtures/checkouts.yml +2 -2
  124. data/spec/fixtures/circulation_statuses.yml +26 -34
  125. data/spec/fixtures/content_types.yml +20 -31
  126. data/spec/fixtures/event_categories.yml +23 -23
  127. data/spec/fixtures/frequencies.yml +17 -25
  128. data/spec/fixtures/items.yml +1 -1
  129. data/spec/fixtures/libraries.yml +30 -31
  130. data/spec/fixtures/library_groups.yml +43 -20
  131. data/spec/fixtures/request_status_types.yml +14 -14
  132. data/spec/fixtures/request_types.yml +13 -13
  133. data/spec/fixtures/reserve_transitions.yml +1 -1
  134. data/spec/fixtures/reserves.yml +3 -3
  135. data/spec/fixtures/roles.yml +22 -5
  136. data/spec/fixtures/shelves.yml +16 -15
  137. data/spec/fixtures/user_group_has_checkout_types.yml +24 -24
  138. data/spec/fixtures/user_groups.yml +23 -3
  139. data/spec/helpers/items_helper_spec.rb +1 -1
  140. data/spec/models/checkin_spec.rb +2 -1
  141. data/spec/models/checkout_spec.rb +2 -2
  142. data/spec/models/checkout_stat_has_user_spec.rb +1 -1
  143. data/spec/models/checkout_type_spec.rb +8 -7
  144. data/spec/models/circulation_status_spec.rb +8 -7
  145. data/spec/models/item_spec.rb +6 -8
  146. data/spec/models/manifestation_spec.rb +15 -18
  147. data/spec/models/reserve_spec.rb +3 -3
  148. data/spec/models/resource_export_file_spec.rb +0 -15
  149. data/spec/models/retain_spec.rb +16 -0
  150. data/spec/models/user_group_has_checkout_type_spec.rb +15 -32
  151. data/spec/models/withdraw_spec.rb +4 -6
  152. data/spec/policies/manifestation_policy_spec.rb +2 -1
  153. data/spec/rails_helper.rb +10 -3
  154. data/spec/views/items/index.html.erb_spec.rb +1 -4
  155. metadata +396 -446
  156. data/app/controllers/lending_policies_controller.rb +0 -106
  157. data/app/models/lending_policy.rb +0 -30
  158. data/app/views/lending_policies/_form.html.erb +0 -41
  159. data/app/views/lending_policies/edit.html.erb +0 -13
  160. data/app/views/lending_policies/index.html.erb +0 -42
  161. data/app/views/lending_policies/new.html.erb +0 -12
  162. data/app/views/lending_policies/show.html.erb +0 -50
  163. data/db/migrate/20090831220301_create_lending_policies.rb +0 -21
  164. data/spec/controllers/lending_policies_controller_spec.rb +0 -444
  165. data/spec/controllers/withdraws_controller_spec.rb +0 -26
  166. data/spec/dummy/config/locales/en.yml +0 -208
  167. data/spec/dummy/config/locales/ja.yml +0 -200
  168. data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +0 -5
  169. data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +0 -5
  170. data/spec/dummy/db/migrate/20200425072340_create_manifestation_custom_properties.rb +0 -12
  171. data/spec/dummy/db/migrate/20200425072349_create_item_custom_properties.rb +0 -12
  172. data/spec/dummy/db/migrate/20200425074758_create_manifestation_custom_values.rb +0 -12
  173. data/spec/dummy/db/migrate/20200425074822_create_item_custom_values.rb +0 -12
  174. data/spec/fixtures/accepts.yml +0 -9
  175. data/spec/fixtures/bookstores.yml +0 -99
  176. data/spec/fixtures/budget_types.yml +0 -30
  177. data/spec/fixtures/exemplifies.yml +0 -168
  178. data/spec/fixtures/lending_policies.yml +0 -98
  179. data/spec/models/lending_policy_spec.rb +0 -23
  180. data/spec/system/items_spec.rb +0 -21
  181. data/spec/system/user_group_has_checkout_types.rb +0 -14
@@ -21,15 +21,8 @@
21
21
  <% end %>
22
22
  <% if checkout.shelf %>
23
23
  <%= t('activerecord.models.shelf') %>:
24
- <%= link_to checkout.shelf.display_name.localize, checkout.shelf %>
25
- (<%= link_to checkout.shelf.library.display_name.localize, checkout.shelf.library %>)
26
- <% end %>
27
- <% if checkout.item.manifestation.next_reservation %>
28
- <br />
29
- (<%= link_to_if(current_user.has_role?('Librarian'),
30
- t('page.number_of_reservations',
31
- count: Reserve.waiting.where(manifestation_id: checkout.item.manifestation.id, checked_out_at: nil).count),
32
- reserves_path(query: "manifestation_id_i:#{checkout.item.manifestation.id}")) -%>)
24
+ <%= link_to checkout.shelf.display_name, checkout.shelf %>
25
+ (<%= link_to checkout.shelf.library.display_name, checkout.shelf.library %>)
33
26
  <% end %>
34
27
  </td>
35
28
  <td>
@@ -2,7 +2,7 @@ atom_feed(url: checkouts_url(format: :atom)) do |feed|
2
2
  if @user
3
3
  feed.title t('checkout.user_checkout', login_name: @user.username)
4
4
  else
5
- feed.title t('checkout.library_group_checkout', library_group_name: @library_group.display_name.localize)
5
+ feed.title t('checkout.library_group_checkout', library_group_name: @library_group.display_name)
6
6
  end
7
7
  feed.updated(@checkouts.first ? @checkouts.first.created_at : Time.zone.now)
8
8
 
@@ -7,7 +7,7 @@ RiCal.Calendar do
7
7
  description checkout.item.manifestation.original_title
8
8
  dtstart checkout.due_date.to_date
9
9
  dtend checkout.due_date.to_date
10
- location checkout.item.shelf.library.display_name.localize
10
+ location checkout.item.shelf.library.display_name
11
11
  end
12
12
  end
13
13
  end.to_s
@@ -9,7 +9,7 @@ xml.rss('version' => "2.0",
9
9
  xml.tag! "atom:link", rel: 'self', href: "#{request.protocol}#{request.host_with_port}#{url_for(params.permit.merge(format: :rss, only_path: true))}"
10
10
  xml.tag! "atom:link", rel: 'alternate', href: checkouts_url(user_id: @user.username)
11
11
  else
12
- xml.title t('checkout.library_group_checkout', library_group_name: @library_group.display_name.localize)
12
+ xml.title t('checkout.library_group_checkout', library_group_name: @library_group.display_name)
13
13
  xml.link checkouts_url
14
14
  xml.tag! "atom:link", rel: 'self', href: "#{request.protocol}#{request.host_with_port}#{url_for(params.permit.merge(format: :rss, only_path: true))}"
15
15
  xml.tag! "atom:link", rel: 'alternate', href: checkouts_url
@@ -3,7 +3,7 @@
3
3
 
4
4
  <div class="field">
5
5
  <%= f.label :name %><br />
6
- <%= f.text_field :name %>
6
+ <%= f.text_field :name, required: true %>
7
7
  </div>
8
8
  <div class="field">
9
9
  <%= f.label :display_name %><br />
@@ -23,7 +23,7 @@
23
23
  </td>
24
24
  <td><%= circulation_status.name -%></td>
25
25
  <td>
26
- <%= link_to circulation_status.display_name.localize, circulation_status -%>
26
+ <%= link_to circulation_status.display_name, circulation_status -%>
27
27
  <br />
28
28
  <%= circulation_status.note %>
29
29
  </td>
@@ -10,7 +10,7 @@
10
10
 
11
11
  <p>
12
12
  <strong><%= t('activerecord.attributes.circulation_status.display_name') -%>:</strong>
13
- <%= @circulation_status.display_name.localize -%>
13
+ <%= @circulation_status.display_name -%>
14
14
  </p>
15
15
 
16
16
  <p>
@@ -13,7 +13,7 @@
13
13
  <td><%= link_to item_has_use_restriction.item_id, item_has_use_restriction.item -%></td>
14
14
  <td><%= link_to item_has_use_restriction.item.item_identifier, item_has_use_restriction.item -%></td>
15
15
  <td><%= link_to item_has_use_restriction.item.manifestation.original_title, item_has_use_restriction.item.manifestation -%></td>
16
- <td><%= link_to item_has_use_restriction.use_restriction.display_name.localize, item_has_use_restriction.use_restriction -%></td>
16
+ <td><%= link_to item_has_use_restriction.use_restriction.display_name, item_has_use_restriction.use_restriction -%></td>
17
17
  <td><%= link_to t('page.show'), item_has_use_restriction -%></td>
18
18
  <td><%= link_to t('page.edit'), edit_item_has_use_restriction_path(item_has_use_restriction) -%></td>
19
19
  <td><%= link_to t('page.destroy'), item_has_use_restriction, data: {confirm: t('page.are_you_sure')}, method: :delete -%></td>
@@ -15,7 +15,7 @@
15
15
 
16
16
  <p>
17
17
  <strong><%= t('activerecord.models.use_restriction') -%>:</strong>
18
- <%= link_to @item_has_use_restriction.use_restriction.display_name.localize, @item_has_use_restriction.use_restriction -%>
18
+ <%= link_to @item_has_use_restriction.use_restriction.display_name, @item_has_use_restriction.use_restriction -%>
19
19
  </p>
20
20
 
21
21
  </div>
@@ -7,7 +7,7 @@
7
7
  <%= t('activerecord.models.shelf') %>
8
8
  </th>
9
9
  <% CarrierType.order(:position).each do |carrier_type| %>
10
- <th><%= carrier_type.display_name.localize %></th>
10
+ <th><%= carrier_type.display_name %></th>
11
11
  <% end %>
12
12
  <th><%= t('page.total') %></th>
13
13
  </tr>
@@ -15,10 +15,10 @@
15
15
  <% library.shelves.order(:position).each do |shelf| %>
16
16
  <tr>
17
17
  <td>
18
- <%= library.display_name.localize %>
18
+ <%= library.display_name %>
19
19
  </td>
20
20
  <td>
21
- <%= shelf.display_name.localize %>
21
+ <%= shelf.display_name %>
22
22
  </td>
23
23
  <% CarrierType.order(:position).each do |carrier_type| %>
24
24
  <td>
@@ -7,7 +7,7 @@
7
7
  <%= t('activerecord.models.shelf') %>
8
8
  </th>
9
9
  <% CheckoutType.order(:position).each do |checkout_type| %>
10
- <th><%= checkout_type.display_name.localize %></th>
10
+ <th><%= checkout_type.display_name %></th>
11
11
  <% end %>
12
12
  <th><%= t('page.total') %></th>
13
13
  </tr>
@@ -15,10 +15,10 @@
15
15
  <% library.shelves.order(:position).each do |shelf| %>
16
16
  <tr>
17
17
  <td>
18
- <%= library.display_name.localize %>
18
+ <%= library.display_name %>
19
19
  </td>
20
20
  <td>
21
- <%= shelf.display_name.localize %>
21
+ <%= shelf.display_name %>
22
22
  </td>
23
23
  <% CheckoutType.order(:position).each do |checkout_type| %>
24
24
  <td>
@@ -1,8 +1,8 @@
1
1
  <td>
2
- <%= item.circulation_status.display_name.localize if item.circulation_status -%>
2
+ <%= item.circulation_status.display_name if item.circulation_status -%>
3
3
  <% if item.use_restriction.name == 'Not For Loan' %>
4
4
  <br />
5
- <%= item.use_restriction.display_name.localize %>
5
+ <%= item.use_restriction.display_name %>
6
6
  <% else %>
7
7
  <% if item.retained? %>
8
8
  <br />
@@ -12,7 +12,7 @@
12
12
  <br />
13
13
  (
14
14
  <%= t('activerecord.attributes.checkout.due_date') -%>:
15
- <%= l(item.latest_checkout.due_date, format: :only_date) -%>
15
+ <%= l(item.latest_checkout.due_date, format: :short) -%>
16
16
  )
17
17
  <% end %>
18
18
  <% end %>
@@ -1,7 +1,7 @@
1
1
  <ul>
2
2
  <%- profile.user_group.user_group_has_checkout_types.each do |available_checkout_type| -%>
3
3
  <li>
4
- <%= available_checkout_type.checkout_type.display_name.localize -%>:
4
+ <%= available_checkout_type.checkout_type.display_name -%>:
5
5
  <%= profile.user.checked_item_count[:"#{available_checkout_type.checkout_type.name}"] -%> / <%= available_checkout_type.checkout_limit -%>
6
6
  </li>
7
7
  <%- end -%>
@@ -22,7 +22,7 @@
22
22
 
23
23
  <div class="field">
24
24
  <%= f.label :pickup_location_id %>
25
- <%= f.select :pickup_location_id, @libraries.map{|l| [l.display_name.localize, l.id]} %>
25
+ <%= f.select :pickup_location_id, @libraries.map{|l| [l.display_name, l.id]} %>
26
26
  </div>
27
27
 
28
28
  <% if current_user.has_role?('Librarian') %>
@@ -34,7 +34,7 @@
34
34
 
35
35
  <div class="field">
36
36
  <%= f.label :pickup_location_id %>
37
- <%= f.select :pickup_location_id, @libraries.map{|l| [l.display_name.localize, l.id]} %>
37
+ <%= f.select :pickup_location_id, @libraries.map{|l| [l.display_name, l.id]} %>
38
38
  </div>
39
39
 
40
40
  <div class="actions">
@@ -39,7 +39,7 @@
39
39
 
40
40
  <div class="field">
41
41
  <%= f.label :pickup_location_id %>
42
- <%= f.select :pickup_location_id, @libraries.map{|l| [l.display_name.localize, l.id]} %>
42
+ <%= f.select :pickup_location_id, @libraries.map{|l| [l.display_name, l.id]} %>
43
43
  </div>
44
44
 
45
45
  <p>
@@ -2,7 +2,7 @@ atom_feed(url: reserves_url(format: :atom)) do |feed|
2
2
  if @user
3
3
  feed.title t('reserve.user_reserve', login_name: @user.username)
4
4
  else
5
- feed.title t('reserve.library_group_reserve', library_group_name: @library_group.display_name.localize)
5
+ feed.title t('reserve.library_group_reserve', library_group_name: @library_group.display_name)
6
6
  end
7
7
  feed.updated(@reserves.first ? @reserves.first.created_at : Time.zone.now)
8
8
 
@@ -51,7 +51,7 @@
51
51
  <br />
52
52
  <%= t('activerecord.attributes.reserve.expired_at') %>: <%= l(reserve.expired_at, format: :short) if reserve.expired_at? -%>
53
53
  <br />
54
- <%= t('activerecord.attributes.reserve.pickup_location_id') %>: <%= link_to reserve.pickup_location.display_name.localize, reserve.pickup_location if reserve.pickup_location %>
54
+ <%= t('activerecord.attributes.reserve.pickup_location_id') %>: <%= link_to reserve.pickup_location.display_name, reserve.pickup_location if reserve.pickup_location %>
55
55
  </td>
56
56
  <td>
57
57
  <%= i18n_state(reserve.current_state) -%>
@@ -7,7 +7,7 @@ xml.rss('version' => "2.0",
7
7
  xml.title t('reserve.user_reserve', login_name: @user.username)
8
8
  xml.link reserves_url(user_id: @user.username, format: :rss)
9
9
  else
10
- xml.title t('reserve.library_group_reserve', library_group_name: @library_group.display_name.localize)
10
+ xml.title t('reserve.library_group_reserve', library_group_name: @library_group.display_name)
11
11
  xml.link reserves_url(format: :rss)
12
12
  end
13
13
  xml.description "Next-L Enju, an open source integrated library system developed by Project Next-L"
@@ -23,7 +23,7 @@
23
23
 
24
24
  <p>
25
25
  <strong><%= t('activerecord.attributes.reserve.pickup_location_id') -%>:</strong>
26
- <%= link_to @reserve.pickup_location.display_name.localize, @reserve.pickup_location if @reserve.pickup_location -%>
26
+ <%= link_to @reserve.pickup_location.display_name, @reserve.pickup_location if @reserve.pickup_location -%>
27
27
  </p>
28
28
 
29
29
  <p>
@@ -3,7 +3,7 @@
3
3
 
4
4
  <div class="field">
5
5
  <%= f.label :name %><br />
6
- <%= f.text_field :name %>
6
+ <%= f.text_field :name, required: true %>
7
7
  </div>
8
8
  <div class="field">
9
9
  <%= f.label :display_name %><br />
@@ -23,7 +23,7 @@
23
23
  </td>
24
24
  <td><%= use_restriction.name -%></td>
25
25
  <td>
26
- <%= link_to use_restriction.display_name.localize, use_restriction -%>
26
+ <%= link_to use_restriction.display_name, use_restriction -%>
27
27
  <br />
28
28
  <%= use_restriction.note %>
29
29
  </td>
@@ -10,7 +10,7 @@
10
10
 
11
11
  <p>
12
12
  <strong><%= t('activerecord.attributes.use_restriction.display_name') -%></strong>
13
- <%= @use_restriction.display_name.localize -%>
13
+ <%= @use_restriction.display_name -%>
14
14
  </p>
15
15
 
16
16
  <p>
@@ -7,11 +7,11 @@
7
7
 
8
8
  <div class="field">
9
9
  <%= f.label t('activerecord.models.user_group') -%><br />
10
- <%= f.select(:user_group_id, @user_groups.collect{|u| [u.display_name.localize, u.id]}) -%>
10
+ <%= f.select(:user_group_id, @user_groups.collect{|u| [u.display_name, u.id]}) -%>
11
11
  </div>
12
12
  <div class="field">
13
13
  <%= f.label t('activerecord.models.checkout_type') -%><br />
14
- <%= f.select(:checkout_type_id, @checkout_types.collect{|c| [c.display_name.localize, c.id]}) -%>
14
+ <%= f.select(:checkout_type_id, @checkout_types.collect{|c| [c.display_name, c.id]}) -%>
15
15
  </div>
16
16
  <div class="field">
17
17
  <%= f.label :checkout_limit -%><br />
@@ -34,8 +34,8 @@
34
34
  </div>
35
35
 
36
36
  <div class="field">
37
- <%= f.label :set_due_date_before_closing_day -%>
38
- <%= f.check_box :set_due_date_before_closing_day -%>
37
+ <%= f.label :set_due_date_after_closing_day -%>
38
+ <%= f.check_box :set_due_date_after_closing_day -%>
39
39
  </div>
40
40
 
41
41
  <div class="field">
@@ -11,8 +11,8 @@
11
11
 
12
12
  <%- @user_group_has_checkout_types.each do |user_group_has_checkout_type| -%>
13
13
  <tr class="line<%= cycle("0", "1") -%>">
14
- <td><%= link_to user_group_has_checkout_type.user_group.display_name.localize.localize, user_group_has_checkout_type.user_group -%></td>
15
- <td><%= link_to user_group_has_checkout_type.checkout_type.display_name.localize.localize, user_group_has_checkout_type.checkout_type -%></td>
14
+ <td><%= link_to user_group_has_checkout_type.user_group.display_name.localize, user_group_has_checkout_type.user_group -%></td>
15
+ <td><%= link_to user_group_has_checkout_type.checkout_type.display_name.localize, user_group_has_checkout_type.checkout_type -%></td>
16
16
  <td>
17
17
  <%= link_to t('page.show'), user_group_has_checkout_type -%>
18
18
  <%- if policy(user_group_has_checkout_type).update? -%>
@@ -7,11 +7,11 @@
7
7
 
8
8
  <div class="field">
9
9
  <%= f.label t('activerecord.models.user_group') -%><br />
10
- <%= f.select(:user_group_id, @user_groups.collect{|u| [u.display_name.localize, u.id]}, include_blank: true) -%>
10
+ <%= f.select(:user_group_id, @user_groups.collect{|u| [u.display_name, u.id]}, include_blank: true) -%>
11
11
  </div>
12
12
  <div class="field">
13
13
  <%= f.label t('activerecord.models.checkout_type') -%><br />
14
- <%= f.select(:checkout_type_id, @checkout_types.collect{|c| [c.display_name.localize, c.id]}, include_blank: true) -%>
14
+ <%= f.select(:checkout_type_id, @checkout_types.collect{|c| [c.display_name, c.id]}, include_blank: true) -%>
15
15
  </div>
16
16
  <div class="field">
17
17
  <%= f.label :checkout_limit -%><br />
@@ -34,8 +34,8 @@
34
34
  </div>
35
35
 
36
36
  <div class="field">
37
- <%= f.label :set_due_date_before_closing_day -%>
38
- <%= f.check_box :set_due_date_before_closing_day -%>
37
+ <%= f.label :set_due_date_after_closing_day -%>
38
+ <%= f.check_box :set_due_date_after_closing_day -%>
39
39
  </div>
40
40
 
41
41
  <div class="field">
@@ -5,12 +5,12 @@
5
5
 
6
6
  <p>
7
7
  <strong><%= t('activerecord.models.user_group') -%>:</strong>
8
- <%= link_to @user_group_has_checkout_type.user_group.display_name.localize, @user_group_has_checkout_type.user_group -%>
8
+ <%= link_to @user_group_has_checkout_type.user_group.display_name, @user_group_has_checkout_type.user_group -%>
9
9
  </p>
10
10
 
11
11
  <p>
12
12
  <strong><%= t('activerecord.models.checkout_type') -%>:</strong>
13
- <%= link_to @user_group_has_checkout_type.checkout_type.display_name.localize, @user_group_has_checkout_type.checkout_type -%>
13
+ <%= link_to @user_group_has_checkout_type.checkout_type.display_name, @user_group_has_checkout_type.checkout_type -%>
14
14
  </p>
15
15
 
16
16
  <p>
@@ -39,8 +39,8 @@
39
39
  </p>
40
40
 
41
41
  <p>
42
- <strong><%= t('activerecord.attributes.user_group_has_checkout_type.set_due_date_before_closing_day') -%>:</strong>
43
- <%= localized_boolean(@user_group_has_checkout_type.set_due_date_before_closing_day) -%>
42
+ <strong><%= t('activerecord.attributes.user_group_has_checkout_type.set_due_date_after_closing_day') -%>:</strong>
43
+ <%= localized_boolean(@user_group_has_checkout_type.set_due_date_after_closing_day) -%>
44
44
  </p>
45
45
 
46
46
  <p>
@@ -8,7 +8,7 @@
8
8
  <br />
9
9
  <%= f.label :reservation_limit -%>
10
10
  <%= f.text_field :reservation_limit, class: 'resource_integer' %>
11
- <%= f.label :set_due_date_before_closing_day -%>
12
- <%= f.check_box :set_due_date_before_closing_day %>
11
+ <%= f.label :set_due_date_after_closing_day -%>
12
+ <%= f.check_box :set_due_date_after_closing_day %>
13
13
  <%= link_to_remove_association t('page.remove'), f, data: {confirm: t('page.are_you_sure')} %>
14
14
  </div>
@@ -32,7 +32,6 @@ en:
32
32
  lock_version: Lock version
33
33
  checked_item:
34
34
  due_date: Due date
35
- item: Item
36
35
  checkin:
37
36
  item_id: Item
38
37
  checkout:
@@ -73,7 +72,7 @@ en:
73
72
  checkout_renewal_limit: Checkout renewal limit
74
73
  reservation_limit: Reservation limit
75
74
  reservation_expired_period: Reservation expired period
76
- set_due_date_before_closing_day: Set due date before the closing day
75
+ set_due_date_after_closing_day: Set due date after the closing day
77
76
  fixed_due_date: Fixed due date
78
77
  note: Note
79
78
  position: Position
@@ -125,18 +124,6 @@ en:
125
124
  profile:
126
125
  checkout_icalendar_token: Checkout iCalendar token
127
126
  save_checkout_history: Save checkout history
128
- errors:
129
- models:
130
- item:
131
- attributes:
132
- circulation_status_id:
133
- is_rented: Circulation status is invalid. This item is rented.
134
- is_reserved: Circulation status is invalid. This item is reserved.
135
- withdraw:
136
- attributes:
137
- item_id:
138
- is_rented: is rented.
139
- is_reserved: is reserved.
140
127
 
141
128
  basket:
142
129
  this_account_is_suspended: "This account is suspended."
@@ -30,7 +30,6 @@ ja:
30
30
  lock_version: ロックバージョン
31
31
  checked_item:
32
32
  due_date: 返却期限
33
- item: 個別資料
34
33
  checkin:
35
34
  item_id: 個別資料
36
35
  checkout:
@@ -71,7 +70,7 @@ ja:
71
70
  checkout_renewal_limit: 貸出更新回数の上限
72
71
  reservation_limit: 予約数の上限
73
72
  reservation_expired_period: 予約の期限切れまでの期間
74
- set_due_date_before_closing_day: 返却日を閉館日の前日にする
73
+ set_due_date_after_closing_day: 返却日を閉館日の前日にする
75
74
  fixed_due_date: 固定貸出期限
76
75
  note: 注記
77
76
  position: 位置
@@ -123,18 +122,6 @@ ja:
123
122
  profile:
124
123
  checkout_icalendar_token: 貸出iCalendarのトークン
125
124
  save_checkout_history: 貸出の履歴を保存する
126
- errors:
127
- models:
128
- item:
129
- attributes:
130
- circulation_status_id:
131
- is_rented: この貸出状態には変更できません。資料が貸し出されています。
132
- is_reserved: この貸出状態には変更できません。資料が予約されています。
133
- withdraw:
134
- attributes:
135
- item_id:
136
- is_rented: は貸し出されています。
137
- is_reserved: は予約されています。
138
125
 
139
126
  basket:
140
127
  this_account_is_suspended: "このアカウントは停止されています。"
data/config/routes.rb CHANGED
@@ -34,7 +34,6 @@ Rails.application.routes.draw do
34
34
  resources :items do
35
35
  resources :checked_items
36
36
  resources :item_has_use_restrictions
37
- resources :lending_policies
38
- resources :checkouts
37
+ resources :checkouts
39
38
  end
40
39
  end
@@ -1,8 +1,8 @@
1
1
  class AddNumberOfDayToNotifyOverdueToUserGroup < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
- add_column :user_groups, :number_of_day_to_notify_overdue, :integer, default: 0, null: false
4
- add_column :user_groups, :number_of_day_to_notify_due_date, :integer, default: 0, null: false
5
- add_column :user_groups, :number_of_time_to_notify_overdue, :integer, default: 0, null: false
3
+ add_column :user_groups, :number_of_day_to_notify_overdue, :integer, default: 7, null: false
4
+ add_column :user_groups, :number_of_day_to_notify_due_date, :integer, default: 3, null: false
5
+ add_column :user_groups, :number_of_time_to_notify_overdue, :integer, default: 3, null: false
6
6
  end
7
7
 
8
8
  def self.down
@@ -0,0 +1,10 @@
1
+ class CreateRetains < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :retains do |t|
4
+ t.references :reserve, foreign_key: true, null: false
5
+ t.references :item, foreign_key: true, null: false
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,5 @@
1
+ class RenameUserGroupHasCheckoutTypeDueDateBeforeToDueDateAfter < ActiveRecord::Migration[5.2]
2
+ def change
3
+ rename_column :user_group_has_checkout_types, :set_due_date_before_closing_day, :set_due_date_after_closing_day
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddDisplayNameTranslationsToCirculationStatus < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :circulation_statuses, :display_name_translations, :jsonb, default: {}, null: false
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddCheckoutIdToCheckin < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_reference :checkins, :checkin, foreign_key: true
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddDisplayNameTranslationsToCheckoutType < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :checkout_types, :display_name_translations, :jsonb, default: {}, null: false
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module EnjuCirculation
2
- VERSION = "0.3.9".freeze
2
+ VERSION = "0.4.0.beta.1"
3
3
  end
@@ -3,20 +3,18 @@
3
3
  checkout_type_00001:
4
4
  id: 1
5
5
  name: book
6
- display_name: "en: Book\r\n\
7
- ja: 図書"
6
+ display_name_translations: {"en": "Book", "ja": "図書"}
8
7
  note:
9
8
  position: 1
10
9
  checkout_type_00002:
11
10
  id: 2
12
11
  name: serial
13
- display_name: "en: Serial\r\n\
14
- ja: 定期刊行物"
12
+ display_name_translations: {"en": "Serial", "ja": "定期刊行物"}
15
13
  note:
16
14
  position: 2
17
15
  checkout_type_00003:
18
16
  id: 3
19
17
  name: cd
20
- display_name: CD
18
+ display_name_translations: {"en": "CD", "ja": "CD"}
21
19
  note:
22
20
  position: 3