enju_circulation 0.3.11 → 0.4.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (198) 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/checkouts_controller.rb +2 -2
  5. data/app/controllers/demands_controller.rb +1 -1
  6. data/app/controllers/manifestation_checkout_stats_controller.rb +2 -2
  7. data/app/controllers/manifestation_reserve_stats_controller.rb +2 -2
  8. data/app/controllers/reserves_controller.rb +2 -2
  9. data/app/controllers/user_checkout_stats_controller.rb +2 -2
  10. data/app/controllers/user_group_has_checkout_types_controller.rb +1 -1
  11. data/app/controllers/user_reserve_stats_controller.rb +2 -2
  12. data/app/helpers/items_helper.rb +3 -3
  13. data/app/models/checked_item.rb +7 -17
  14. data/app/models/checkin.rb +3 -2
  15. data/app/models/checkout.rb +2 -2
  16. data/app/models/checkout_stat_has_user.rb +1 -1
  17. data/app/models/checkout_type.rb +9 -7
  18. data/app/models/circulation_status.rb +9 -8
  19. data/app/models/concerns/enju_circulation/enju_item.rb +2 -46
  20. data/app/models/concerns/enju_circulation/enju_user_group.rb +0 -1
  21. data/app/models/concerns/enju_circulation/enju_withdraw.rb +1 -7
  22. data/app/models/manifestation_checkout_stat_transition.rb +1 -1
  23. data/app/models/manifestation_reserve_stat_transition.rb +1 -1
  24. data/app/models/reserve.rb +5 -5
  25. data/app/models/reserve_state_machine.rb +3 -2
  26. data/app/models/reserve_transition.rb +1 -1
  27. data/app/models/retain.rb +15 -0
  28. data/app/models/user_checkout_stat_transition.rb +1 -1
  29. data/app/models/user_group_has_checkout_type.rb +15 -37
  30. data/app/models/user_reserve_stat_transition.rb +1 -1
  31. data/app/views/carrier_type_has_checkout_types/_form.html.erb +2 -2
  32. data/app/views/carrier_type_has_checkout_types/index.html.erb +2 -2
  33. data/app/views/carrier_type_has_checkout_types/show.html.erb +2 -2
  34. data/app/views/carrier_types/_carrier_type_has_checkout_type_fields.html.erb +1 -1
  35. data/app/views/checked_items/new.html.erb +1 -1
  36. data/app/views/checkins/_checkin.html.erb +1 -1
  37. data/app/views/checkout_types/_form.html.erb +1 -1
  38. data/app/views/checkout_types/index.html.erb +1 -1
  39. data/app/views/checkout_types/show.html.erb +2 -2
  40. data/app/views/checkouts/_index_user.html.erb +1 -1
  41. data/app/views/checkouts/_list.html.erb +2 -9
  42. data/app/views/checkouts/index.atom.builder +1 -1
  43. data/app/views/checkouts/index.ics.erb +1 -1
  44. data/app/views/checkouts/index.rss.builder +1 -1
  45. data/app/views/checkouts/{index.text.ruby → index.txt.ruby} +0 -0
  46. data/app/views/circulation_statuses/_form.html.erb +1 -1
  47. data/app/views/circulation_statuses/index.html.erb +1 -1
  48. data/app/views/circulation_statuses/show.html.erb +1 -1
  49. data/app/views/item_has_use_restrictions/index.html.erb +1 -1
  50. data/app/views/item_has_use_restrictions/show.html.erb +1 -1
  51. data/app/views/manifestation_checkout_stats/_group_by_carrier_type.html.erb +3 -3
  52. data/app/views/manifestation_checkout_stats/_group_by_checkout_type.html.erb +3 -3
  53. data/app/views/manifestation_checkout_stats/{show.text.erb → show.txt.erb} +0 -0
  54. data/app/views/manifestation_reserve_stats/{show.text.erb → show.txt.erb} +0 -0
  55. data/app/views/manifestations/_circulation_status.html.erb +3 -3
  56. data/app/views/profiles/_submenu_checkout.html.erb +1 -1
  57. data/app/views/reserves/_new.html.erb +1 -1
  58. data/app/views/reserves/_new_user.html.erb +1 -1
  59. data/app/views/reserves/edit.html.erb +1 -1
  60. data/app/views/reserves/index.atom.builder +1 -1
  61. data/app/views/reserves/index.html.erb +1 -1
  62. data/app/views/reserves/index.rss.builder +1 -1
  63. data/app/views/reserves/{index.text.ruby → index.txt.ruby} +0 -0
  64. data/app/views/reserves/show.html.erb +1 -1
  65. data/app/views/use_restrictions/_form.html.erb +1 -1
  66. data/app/views/use_restrictions/index.html.erb +1 -1
  67. data/app/views/use_restrictions/show.html.erb +1 -1
  68. data/app/views/user_checkout_stats/{show.text.erb → show.txt.erb} +0 -0
  69. data/app/views/user_group_has_checkout_types/edit.html.erb +4 -4
  70. data/app/views/user_group_has_checkout_types/index.html.erb +2 -2
  71. data/app/views/user_group_has_checkout_types/new.html.erb +4 -4
  72. data/app/views/user_group_has_checkout_types/show.html.erb +4 -4
  73. data/app/views/user_groups/_user_group_has_checkout_type_fields.html.erb +2 -2
  74. data/app/views/user_reserve_stats/{show.text.erb → show.txt.erb} +0 -0
  75. data/config/locales/translation_en.yml +1 -14
  76. data/config/locales/translation_ja.yml +1 -14
  77. data/config/routes.rb +1 -2
  78. data/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +3 -3
  79. data/db/migrate/20190508160525_create_retains.rb +10 -0
  80. data/db/migrate/20190629134017_rename_user_group_has_checkout_type_due_date_before_to_due_date_after.rb +5 -0
  81. data/db/migrate/20190706052525_add_display_name_translations_to_circulation_status.rb +5 -0
  82. data/db/migrate/20190713114724_add_checkout_id_to_checkin.rb +5 -0
  83. data/db/migrate/20190814120827_add_display_name_translations_to_checkout_type.rb +5 -0
  84. data/lib/enju_circulation/version.rb +1 -1
  85. data/lib/generators/enju_circulation/setup/templates/db/fixtures/checkout_types.yml +3 -5
  86. data/lib/generators/enju_circulation/setup/templates/db/fixtures/circulation_statuses.yml +16 -48
  87. data/lib/tasks/enju_circulation_tasks.rake +7 -1
  88. data/spec/concerns/enju_accept_spec.rb +14 -14
  89. data/spec/controllers/accepts_controller_spec.rb +294 -0
  90. data/spec/controllers/baskets_controller_spec.rb +379 -0
  91. data/spec/controllers/checkins_controller_spec.rb +8 -130
  92. data/spec/controllers/checkouts_controller_spec.rb +5 -5
  93. data/spec/controllers/items_controller_spec.rb +23 -43
  94. data/spec/controllers/reserves_controller_spec.rb +9 -9
  95. data/spec/dummy/app/mailers/application_mailer.rb +4 -0
  96. data/spec/dummy/app/models/user.rb +1 -1
  97. data/spec/dummy/bin/bundle +1 -1
  98. data/spec/dummy/bin/setup +1 -3
  99. data/spec/dummy/bin/update +4 -2
  100. data/spec/dummy/bin/yarn +3 -3
  101. data/spec/dummy/config/database.yml +70 -9
  102. data/spec/dummy/config/initializers/assets.rb +1 -0
  103. data/spec/dummy/db/development.sqlite3 +0 -0
  104. data/spec/dummy/db/migrate/113_create_events.rb +2 -4
  105. data/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb +2 -4
  106. data/spec/dummy/db/migrate/20090519203307_create_participates.rb +2 -4
  107. data/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb +2 -2
  108. data/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb +1 -1
  109. data/spec/dummy/db/migrate/20140812152348_create_event_export_files.rb +1 -1
  110. data/spec/dummy/db/migrate/20140814070854_add_default_event_category_id_to_event_import_file.rb +1 -1
  111. data/spec/dummy/db/migrate/20151128142913_create_places.rb +14 -0
  112. data/spec/dummy/db/migrate/20151201163718_add_place_id_to_event.rb +5 -0
  113. data/spec/dummy/db/migrate/20160703184258_add_most_recent_to_event_import_file_transitions.rb +9 -0
  114. data/spec/dummy/db/migrate/20160703184311_add_most_recent_to_event_export_file_transitions.rb +9 -0
  115. data/spec/dummy/db/migrate/20180107160726_add_constraints_to_most_recent_for_user_import_file_transitions.rb +1 -1
  116. data/spec/dummy/db/migrate/20180107160740_add_constraints_to_most_recent_for_user_export_file_transitions.rb +1 -1
  117. data/spec/dummy/db/migrate/20180107164558_add_constraints_to_most_recent_for_event_import_file_transitions.rb +13 -0
  118. data/spec/dummy/db/migrate/20180107164617_add_constraints_to_most_recent_for_event_export_file_transitions.rb +13 -0
  119. data/spec/dummy/db/migrate/20181119170645_add_foreign_key_to_events_referencing_event_categories.rb +5 -0
  120. data/spec/dummy/db/migrate/20190630113817_add_display_name_translations_to_library_group.rb +12 -0
  121. data/spec/dummy/db/migrate/20190630115523_add_login_banner_translations_to_library_group.rb +6 -0
  122. data/spec/dummy/db/migrate/20190630151446_add_display_name_translations_to_role.rb +5 -0
  123. data/spec/dummy/db/migrate/20190630153136_add_display_name_translations_to_event.rb +6 -0
  124. data/spec/dummy/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb +21 -0
  125. data/spec/dummy/db/migrate/20190713114940_add_profile_id_to_user.rb +5 -0
  126. data/spec/dummy/db/migrate/20190713115451_add_full_name_translations_to_profile.rb +5 -0
  127. data/spec/dummy/db/schema.rb +221 -184
  128. data/spec/dummy/db/test.sqlite3 +0 -0
  129. data/spec/dummy/private/system/carrier_types/attachments/000/000/001/original/book.png +0 -0
  130. data/spec/dummy/private/system/carrier_types/attachments/000/000/001/thumb/book.png +0 -0
  131. data/spec/factories/accept.rb +1 -1
  132. data/spec/factories/item.rb +4 -4
  133. data/spec/factories/reserve.rb +1 -5
  134. data/spec/fixtures/carrier_types.yml +16 -15
  135. data/spec/fixtures/checkins.yml +2 -1
  136. data/spec/fixtures/checkout_stat_has_users.yml +1 -1
  137. data/spec/fixtures/checkout_types.yml +11 -10
  138. data/spec/fixtures/checkouts.yml +2 -2
  139. data/spec/fixtures/circulation_statuses.yml +26 -34
  140. data/spec/fixtures/content_types.yml +20 -31
  141. data/spec/fixtures/event_categories.yml +23 -23
  142. data/spec/fixtures/frequencies.yml +17 -25
  143. data/spec/fixtures/items.yml +1 -1
  144. data/spec/fixtures/libraries.yml +30 -31
  145. data/spec/fixtures/library_groups.yml +43 -20
  146. data/spec/fixtures/request_status_types.yml +14 -14
  147. data/spec/fixtures/request_types.yml +13 -13
  148. data/spec/fixtures/reserve_transitions.yml +1 -1
  149. data/spec/fixtures/reserves.yml +3 -3
  150. data/spec/fixtures/roles.yml +22 -5
  151. data/spec/fixtures/shelves.yml +16 -15
  152. data/spec/fixtures/user_group_has_checkout_types.yml +24 -24
  153. data/spec/fixtures/user_groups.yml +23 -3
  154. data/spec/helpers/items_helper_spec.rb +1 -1
  155. data/spec/models/checked_item_spec.rb +0 -11
  156. data/spec/models/checkin_spec.rb +2 -1
  157. data/spec/models/checkout_spec.rb +2 -2
  158. data/spec/models/checkout_stat_has_user_spec.rb +1 -1
  159. data/spec/models/checkout_type_spec.rb +8 -7
  160. data/spec/models/circulation_status_spec.rb +8 -7
  161. data/spec/models/item_spec.rb +6 -8
  162. data/spec/models/manifestation_spec.rb +15 -18
  163. data/spec/models/reserve_spec.rb +3 -3
  164. data/spec/models/resource_export_file_spec.rb +0 -15
  165. data/spec/models/retain_spec.rb +16 -0
  166. data/spec/models/user_group_has_checkout_type_spec.rb +15 -32
  167. data/spec/models/withdraw_spec.rb +4 -6
  168. data/spec/policies/manifestation_policy_spec.rb +2 -1
  169. data/spec/rails_helper.rb +10 -3
  170. data/spec/system/reserves_spec.rb +1 -1
  171. data/spec/views/items/index.html.erb_spec.rb +1 -4
  172. metadata +402 -452
  173. data/app/controllers/lending_policies_controller.rb +0 -106
  174. data/app/models/lending_policy.rb +0 -30
  175. data/app/views/lending_policies/_form.html.erb +0 -41
  176. data/app/views/lending_policies/edit.html.erb +0 -13
  177. data/app/views/lending_policies/index.html.erb +0 -42
  178. data/app/views/lending_policies/new.html.erb +0 -12
  179. data/app/views/lending_policies/show.html.erb +0 -50
  180. data/db/migrate/20090831220301_create_lending_policies.rb +0 -21
  181. data/spec/controllers/lending_policies_controller_spec.rb +0 -444
  182. data/spec/controllers/withdraws_controller_spec.rb +0 -26
  183. data/spec/dummy/config/locales/en.yml +0 -208
  184. data/spec/dummy/config/locales/ja.yml +0 -200
  185. data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +0 -5
  186. data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +0 -5
  187. data/spec/dummy/db/migrate/20200425072340_create_manifestation_custom_properties.rb +0 -12
  188. data/spec/dummy/db/migrate/20200425072349_create_item_custom_properties.rb +0 -12
  189. data/spec/dummy/db/migrate/20200425074758_create_manifestation_custom_values.rb +0 -12
  190. data/spec/dummy/db/migrate/20200425074822_create_item_custom_values.rb +0 -12
  191. data/spec/fixtures/accepts.yml +0 -9
  192. data/spec/fixtures/bookstores.yml +0 -99
  193. data/spec/fixtures/budget_types.yml +0 -30
  194. data/spec/fixtures/exemplifies.yml +0 -168
  195. data/spec/fixtures/lending_policies.yml +0 -98
  196. data/spec/models/lending_policy_spec.rb +0 -23
  197. data/spec/system/items_spec.rb +0 -21
  198. data/spec/system/user_group_has_checkout_types.rb +0 -14
@@ -1,106 +0,0 @@
1
- class LendingPoliciesController < ApplicationController
2
- before_action :set_lending_policy, only: [:show, :edit, :update, :destroy]
3
- before_action :check_policy, only: [:index, :new, :create]
4
- before_action :get_user_group, :get_item
5
- before_action :prepare_options, only: [:new, :edit]
6
-
7
- # GET /lending_policies
8
- # GET /lending_policies.json
9
- def index
10
- if @item
11
- @lending_policies = @item.lending_policies.page(params[:page])
12
- else
13
- @lending_policies = LendingPolicy.page(params[:page])
14
- end
15
-
16
- respond_to do |format|
17
- format.html # index.html.erb
18
- format.json { render json: @lending_policies }
19
- end
20
- end
21
-
22
- # GET /lending_policies/1
23
- # GET /lending_policies/1.json
24
- def show
25
- respond_to do |format|
26
- format.html # show.html.erb
27
- format.json { render json: @lending_policy }
28
- end
29
- end
30
-
31
- # GET /lending_policies/new
32
- # GET /lending_policies/new.json
33
- def new
34
- respond_to do |format|
35
- format.html # new.html.erb
36
- format.json { render json: @lending_policy }
37
- end
38
- end
39
-
40
- # GET /lending_policies/1/edit
41
- def edit
42
- end
43
-
44
- # POST /lending_policies
45
- # POST /lending_policies.json
46
- def create
47
- respond_to do |format|
48
- if @lending_policy.save
49
- format.html { redirect_to @lending_policy, notice: t('controller.successfully_created', model: t('activerecord.models.lending_policy')) }
50
- format.json { render json: @lending_policy, status: :created, location: @lending_policy }
51
- else
52
- prepare_options
53
- format.html { render action: "new" }
54
- format.json { render json: @lending_policy.errors, status: :unprocessable_entity }
55
- end
56
- end
57
- end
58
-
59
- # PUT /lending_policies/1
60
- # PUT /lending_policies/1.json
61
- def update
62
- respond_to do |format|
63
- if @lending_policy.update(lending_policy_params)
64
- format.html { redirect_to @lending_policy, notice: t('controller.successfully_updated', model: t('activerecord.models.lending_policy')) }
65
- format.json { head :no_content }
66
- else
67
- prepare_options
68
- format.html { render action: "edit" }
69
- format.json { render json: @lending_policy.errors, status: :unprocessable_entity }
70
- end
71
- end
72
- end
73
-
74
- # DELETE /lending_policies/1
75
- # DELETE /lending_policies/1.json
76
- def destroy
77
- @lending_policy.destroy
78
-
79
- respond_to do |format|
80
- format.html { redirect_to lending_policies_url }
81
- format.json { head :no_content }
82
- end
83
- end
84
-
85
- private
86
-
87
- def set_lending_policy
88
- @lending_policy = LendingPolicy.find(params[:id])
89
- authorize @lending_policy
90
- end
91
-
92
- def check_policy
93
- authorize LendingPolicy
94
- end
95
-
96
- def lending_policy_params
97
- params.require(:lending_policy).permit(
98
- :item_id, :user_group_id, :loan_period, :fixed_due_date,
99
- :renewal, :fine, :note, :position
100
- )
101
- end
102
-
103
- def prepare_options
104
- @user_groups = UserGroup.order(:position)
105
- end
106
- end
@@ -1,30 +0,0 @@
1
- class LendingPolicy < ApplicationRecord
2
- default_scope { order('lending_policies.position') }
3
- belongs_to :item
4
- belongs_to :user_group
5
-
6
- validates :item, :user_group, presence: true
7
- validates :user_group_id, uniqueness: { scope: :item_id }
8
- validates_date :fixed_due_date, allow_blank: true
9
-
10
- paginates_per 10
11
-
12
- acts_as_list scope: :item_id
13
- end
14
-
15
- # == Schema Information
16
- #
17
- # Table name: lending_policies
18
- #
19
- # id :integer not null, primary key
20
- # item_id :integer not null
21
- # user_group_id :integer not null
22
- # loan_period :integer default("0"), not null
23
- # fixed_due_date :datetime
24
- # renewal :integer default("0"), not null
25
- # fine :integer default("0"), not null
26
- # note :text
27
- # position :integer
28
- # created_at :datetime
29
- # updated_at :datetime
30
- #
@@ -1,41 +0,0 @@
1
- <%= form_for(@lending_policy) do |f| -%>
2
- <%= f.error_messages -%>
3
-
4
- <div class="field">
5
- <%= f.label :item_id, t('activerecord.models.item') -%><br />
6
- <% if @lending_policy.item %>
7
- <%= link_to @lending_policy.item.item_identifier, @lending_policy.item -%>
8
- (<%= link_to @lending_policy.item.manifestation.try(:original_title), @lending_policy.item.manifestation %>)
9
- <%= f.hidden_field :item_id -%>
10
- <% else %>
11
- <%= f.text_field :item_id -%>
12
- <% end %>
13
- </div>
14
- <div class="field">
15
- <%= f.label :user_group_id, t('activerecord.models.user_group') -%><br />
16
- <%= f.select :user_group_id, @user_groups.collect{|u| [u.display_name.localize, u.id]} -%>
17
- </div>
18
- <div class="field">
19
- <%= f.label :loan_period -%><br />
20
- <%= f.text_field :loan_period -%>
21
- </div>
22
- <div class="field">
23
- <%= f.label :fixed_due_date -%><br />
24
- <%= f.text_field :fixed_due_date, value: @lending_policy.fixed_due_date.try(:strftime, "%Y-%m-%d"), class: 'date_field', placeholder: "#{t('page.example')}: 2011-04-12"-%>
25
- </div>
26
- <div class="field">
27
- <%= f.label :renewal -%><br />
28
- <%= f.text_field :renewal -%>
29
- </div>
30
- <div class="field">
31
- <%= f.label :fine -%><br />
32
- <%= f.text_field :fine -%>
33
- </div>
34
- <div class="field">
35
- <%= f.label :note -%><br />
36
- <%= f.text_area :note -%>
37
- </div>
38
- <div class="actions">
39
- <%= f.submit %>
40
- </div>
41
- <%- end -%>
@@ -1,13 +0,0 @@
1
- <div id="content_detail" class="ui-corner-all ui-widget-content">
2
- <h1 class="title"><%= t('page.editing', model: t('activerecord.models.lending_policy')) -%></h1>
3
- <div id="content_list">
4
- <%= render 'form' %>
5
- </div>
6
- </div>
7
-
8
- <div id="submenu" class="ui-corner-all ui-widget-content">
9
- <ul>
10
- <li><%= link_to t('page.show'), @lending_policy -%></li>
11
- <li><%= link_to t('page.back'), lending_policies_path -%></li>
12
- </ul>
13
- </div>
@@ -1,42 +0,0 @@
1
- <div id="content_detail" class="ui-corner-all ui-widget-content">
2
- <h1 class="title"><%= t('page.listing', model: t('activerecord.models.lending_policy')) -%></h1>
3
- <div id="content_list">
4
-
5
- <table class="table table-striped index">
6
- <tr>
7
- <th><%= t('activerecord.models.item') -%></th>
8
- <th><%= t('activerecord.models.user_group') -%></th>
9
- <th><%= t('activerecord.attributes.lending_policy.loan_period') -%></th>
10
- <th><%= t('activerecord.attributes.lending_policy.fixed_due_date') -%></th>
11
- <th><%= t('activerecord.attributes.lending_policy.renewal') -%></th>
12
- <th><%= t('activerecord.attributes.lending_policy.fine') -%></th>
13
- <th></th>
14
- </tr>
15
-
16
- <%- @lending_policies.each do |lending_policy| -%>
17
- <tr class="line<%= cycle("0", "1") -%>">
18
- <td>
19
- <%= link_to lending_policy.item.item_identifier, lending_policy.item -%><br />
20
- (<%= link_to lending_policy.item.manifestation.original_title, lending_policy.item.manifestation -%>)
21
- </td>
22
- <td><%= link_to lending_policy.user_group.display_name.localize, lending_policy.user_group -%></td>
23
- <td><%= lending_policy.loan_period -%></td>
24
- <td><%= lending_policy.fixed_due_date -%></td>
25
- <td><%= lending_policy.renewal -%></td>
26
- <td><%= lending_policy.fine -%></td>
27
- <td>
28
- <%= link_to t('page.show'), lending_policy -%>
29
- <%= link_to t('page.edit'), edit_lending_policy_path(lending_policy) if policy(lending_policy).update?-%>
30
- <%= link_to t('page.destroy'), lending_policy, data: {confirm: t('page.are_you_sure')}, method: :delete if policy(lending_policy).destroy? -%>
31
- </td>
32
- </tr>
33
- <%- end -%>
34
- </table>
35
-
36
- <%= paginate(@lending_policies) -%>
37
-
38
- </div>
39
- </div>
40
-
41
- <div id="submenu" class="ui-corner-all ui-widget-content">
42
- </div>
@@ -1,12 +0,0 @@
1
- <div id="content_detail" class="ui-corner-all ui-widget-content">
2
- <h1 class="title"><%= t('page.new', model: t('activerecord.models.lending_policy')) -%></h1>
3
- <div id="content_list">
4
- <%= render 'form' %>
5
- </div>
6
- </div>
7
-
8
- <div id="submenu" class="ui-corner-all ui-widget-content">
9
- <ul>
10
- <li><%= link_to t('page.back'), lending_policies_path -%></li>
11
- </ul>
12
- </div>
@@ -1,50 +0,0 @@
1
- <div id="content_detail" class="ui-corner-all ui-widget-content">
2
- <h1 class="title"><%= t('page.showing', model: t('activerecord.models.lending_policy')) -%></h1>
3
- <div id="content_list">
4
- <p id="notice"><%= notice %></p>
5
-
6
- <p>
7
- <strong><%= t('activerecord.models.item') -%>:</strong>
8
- <%= link_to @lending_policy.item.item_identifier, @lending_policy.item -%>
9
- (<%= link_to @lending_policy.item.manifestation.original_title, @lending_policy.item.manifestation -%>)
10
- </p>
11
-
12
- <p>
13
- <strong><%= t('activerecord.models.user_group') -%>:</strong>
14
- <%= link_to @lending_policy.user_group.display_name.localize, @lending_policy.user_group -%>
15
- </p>
16
-
17
- <p>
18
- <strong><%= t('activerecord.attributes.lending_policy.loan_period') -%>:</strong>
19
- <%= @lending_policy.loan_period -%>
20
- </p>
21
-
22
- <p>
23
- <strong><%= t('activerecord.attributes.lending_policy.fixed_due_date') -%>:</strong>
24
- <%= l(@lending_policy.fixed_due_date, format: :only_date) if @lending_policy.fixed_due_date -%>
25
- </p>
26
-
27
- <p>
28
- <strong><%= t('activerecord.attributes.lending_policy.renewal') -%>:</strong>
29
- <%= @lending_policy.renewal -%>
30
- </p>
31
-
32
- <p>
33
- <strong><%= t('activerecord.attributes.lending_policy.fine') -%>:</strong>
34
- <%= @lending_policy.fine -%>
35
- </p>
36
-
37
- <p>
38
- <strong><%= t('activerecord.attributes.lending_policy.note') -%>:</strong>
39
- <%= @lending_policy.note -%>
40
- </p>
41
-
42
- </div>
43
- </div>
44
-
45
- <div id="submenu" class="ui-corner-all ui-widget-content">
46
- <ul>
47
- <li><%= link_to t('page.edit'), edit_lending_policy_path(@lending_policy) -%></li>
48
- <li><%= back_to_index(flash[:page_info]) -%></li>
49
- </ul>
50
- </div>
@@ -1,21 +0,0 @@
1
- class CreateLendingPolicies < ActiveRecord::Migration[4.2]
2
- def self.up
3
- create_table :lending_policies do |t|
4
- t.references :item, index: false, foreign_key: true, null: false
5
- t.references :user_group, index: false, foreign_key: true, null: false
6
- t.integer :loan_period, default: 0, null: false
7
- t.datetime :fixed_due_date
8
- t.integer :renewal, default: 0, null: false
9
- t.integer :fine, default: 0, null: false
10
- t.text :note
11
- t.integer :position
12
-
13
- t.timestamps
14
- end
15
- add_index :lending_policies, [:item_id, :user_group_id], unique: true
16
- end
17
-
18
- def self.down
19
- drop_table :lending_policies
20
- end
21
- end