enju_circulation 0.1.0.pre37 → 0.1.0.pre38
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/checked_items_controller.rb +3 -3
- data/app/controllers/checkins_controller.rb +2 -2
- data/app/controllers/checkout_types_controller.rb +2 -2
- data/app/controllers/circulation_statuses_controller.rb +75 -4
- data/app/controllers/lending_policies_controller.rb +72 -2
- data/app/controllers/use_restrictions_controller.rb +75 -4
- data/app/models/checkin.rb +1 -1
- data/app/models/checkout.rb +1 -1
- data/app/models/circulation_status.rb +1 -5
- data/app/models/reserve.rb +6 -6
- data/app/models/use_restriction.rb +1 -5
- data/app/views/checked_items/_list.html.erb +2 -2
- data/app/views/checked_items/edit.html.erb +1 -1
- data/app/views/checked_items/show.html.erb +1 -1
- data/app/views/checkins/_list.html.erb +1 -1
- data/app/views/checkout_types/index.html.erb +16 -13
- data/app/views/checkouts/_index_user.html.erb +1 -1
- data/app/views/circulation_statuses/index.html.erb +12 -4
- data/app/views/use_restrictions/index.html.erb +13 -5
- data/config/routes.rb +3 -6
- data/lib/enju_circulation/version.rb +1 -1
- data/spec/controllers/checked_items_controller_spec.rb +7 -7
- data/spec/controllers/checkins_controller_spec.rb +5 -5
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +0 -2
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/solr/default/data/index/_7tr.fdt +0 -0
- data/spec/dummy/solr/default/data/index/{_7f0.fdx → _7tr.fdx} +0 -0
- data/spec/dummy/solr/default/data/index/{_7f0.fnm → _7tr.fnm} +0 -0
- data/spec/dummy/solr/default/data/index/{_7f0.nvd → _7tr.nvd} +0 -0
- data/spec/dummy/solr/default/data/index/{_7f0.nvm → _7tr.nvm} +0 -0
- data/spec/dummy/solr/default/data/index/{_7f0.si → _7tr.si} +0 -0
- data/spec/dummy/solr/default/data/index/{_7f0_Lucene41_0.doc → _7tr_Lucene41_0.doc} +0 -0
- data/spec/dummy/solr/default/data/index/{_7f0_Lucene41_0.pos → _7tr_Lucene41_0.pos} +0 -0
- data/spec/dummy/solr/default/data/index/{_7f0_Lucene41_0.tim → _7tr_Lucene41_0.tim} +0 -0
- data/spec/dummy/solr/default/data/index/{_7f0_Lucene41_0.tip → _7tr_Lucene41_0.tip} +0 -0
- data/spec/dummy/solr/default/data/index/segments.gen +0 -0
- data/spec/dummy/solr/default/data/index/segments_cjn +0 -0
- data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000015396 → tlog.0000000000000016249} +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000016250 +0 -0
- data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000015394 → tlog.0000000000000016251} +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000016252 +0 -0
- data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000015402 → tlog.0000000000000016253} +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000016254 +0 -0
- data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000015400 → tlog.0000000000000016255} +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000016256 +0 -0
- data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000015398 → tlog.0000000000000016257} +0 -0
- data/spec/dummy/tmp/cache/stdout +629 -0
- data/spec/dummy/tmp/pids/redis-test.pid +1 -1
- data/spec/routing/checked_items_routing_spec.rb +0 -16
- data/spec/views/checkout_types/index.html.erb_spec.rb +2 -2
- data/spec/views/use_restrictions/index.html.erb_spec.rb +2 -2
- metadata +50 -52
- data/spec/dummy/db/migrate/20121116033446_add_doi_to_manifestation.rb +0 -6
- data/spec/dummy/solr/default/data/index/_7f0.fdt +0 -0
- data/spec/dummy/solr/default/data/index/segments_bvw +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000015395 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000015397 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000015399 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000015401 +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a351d924a626f215711e04a84233a743723855c
|
4
|
+
data.tar.gz: ffd37f15ff29d2c38f2c80b238cf7e67f3866d08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 903430be5e4584e3cfb17e2854458d6ebf68334f7b91f42c5d12f3d2c18a5e7eade3eeb67aa877d51786785e5dad5087acf484b1233fe20ab44c911745e0613f
|
7
|
+
data.tar.gz: 89158339d97c670bf648d111f12aac3d3696d5922f541486f8ad20b9936686c08a5a2e49d4419ede7a414c08469468731715249f92902c085a51644c3cf8f571
|
@@ -64,9 +64,9 @@ class CheckedItemsController < ApplicationController
|
|
64
64
|
if @checked_item.item.include_supplements
|
65
65
|
flash[:message] << t('item.this_item_include_supplement')
|
66
66
|
end
|
67
|
-
format.html { redirect_to(
|
67
|
+
format.html { redirect_to(checked_items_url(basket_id: @basket.id), notice: t('controller.successfully_created', model: t('activerecord.models.checked_item'))) }
|
68
68
|
format.json { render json: @checked_item, status: :created, location: @checked_item }
|
69
|
-
format.js { redirect_to(
|
69
|
+
format.js { redirect_to(checked_items_url(basket_id: @basket.id, format: :js)) }
|
70
70
|
else
|
71
71
|
@checked_items = @basket.checked_items.order('created_at DESC').page(1)
|
72
72
|
format.html { render action: "index" }
|
@@ -103,7 +103,7 @@ class CheckedItemsController < ApplicationController
|
|
103
103
|
@checked_item.destroy
|
104
104
|
|
105
105
|
respond_to do |format|
|
106
|
-
format.html { redirect_to
|
106
|
+
format.html { redirect_to checked_items_url(basket_id: @checked_item.basket_id) }
|
107
107
|
format.json { head :no_content }
|
108
108
|
end
|
109
109
|
end
|
@@ -75,9 +75,9 @@ class CheckinsController < ApplicationController
|
|
75
75
|
flash[:message] << t('checkin.not_checked_out')
|
76
76
|
end
|
77
77
|
flash[:message] << message if message
|
78
|
-
format.html { redirect_to
|
78
|
+
format.html { redirect_to checkins_url(basket_id: @checkin.basket_id) }
|
79
79
|
format.json { render json: @checkin, status: :created, location: @checkin }
|
80
|
-
format.js { redirect_to
|
80
|
+
format.js { redirect_to checkins_url(basket_id: @basket.id, format: :js) }
|
81
81
|
else
|
82
82
|
@checkins = @basket.checkins.page(1)
|
83
83
|
format.html { render action: "new" }
|
@@ -6,9 +6,9 @@ class CheckoutTypesController < ApplicationController
|
|
6
6
|
# GET /checkout_types.json
|
7
7
|
def index
|
8
8
|
if @user_group
|
9
|
-
@checkout_types = @user_group.checkout_types.order('checkout_types.position')
|
9
|
+
@checkout_types = @user_group.checkout_types.order('checkout_types.position')
|
10
10
|
else
|
11
|
-
@checkout_types = CheckoutType.order(:position)
|
11
|
+
@checkout_types = CheckoutType.order(:position)
|
12
12
|
end
|
13
13
|
|
14
14
|
respond_to do |format|
|
@@ -1,13 +1,84 @@
|
|
1
|
-
class CirculationStatusesController <
|
2
|
-
respond_to :html, :json
|
1
|
+
class CirculationStatusesController < ApplicationController
|
3
2
|
load_and_authorize_resource
|
4
3
|
|
4
|
+
# GET /circulation_statuses
|
5
|
+
# GET /circulation_statuses.json
|
6
|
+
def index
|
7
|
+
@circulation_statuses = CirculationStatus.order(:position)
|
8
|
+
|
9
|
+
respond_to do |format|
|
10
|
+
format.html # index.html.erb
|
11
|
+
format.json { render json: @circulation_statuses }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# GET /circulation_statuses/1
|
16
|
+
# GET /circulation_statuses/1.json
|
17
|
+
def show
|
18
|
+
respond_to do |format|
|
19
|
+
format.html # show.html.erb
|
20
|
+
format.json { render json: @circulation_status }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# GET /circulation_statuses/new
|
25
|
+
# GET /circulation_statuses/new.json
|
26
|
+
def new
|
27
|
+
@circulation_status = CirculationStatus.new
|
28
|
+
|
29
|
+
respond_to do |format|
|
30
|
+
format.html # new.html.erb
|
31
|
+
format.json { render json: @circulation_status }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# GET /circulation_statuses/1/edit
|
36
|
+
def edit
|
37
|
+
end
|
38
|
+
|
39
|
+
# POST /circulation_statuses
|
40
|
+
# POST /circulation_statuses.json
|
41
|
+
def create
|
42
|
+
@circulation_status = CirculationStatus.new(params[:circulation_status])
|
43
|
+
|
44
|
+
respond_to do |format|
|
45
|
+
if @circulation_status.save
|
46
|
+
format.html { redirect_to @circulation_status, notice: t('controller.successfully_created', model: t('activerecord.models.circulation_status')) }
|
47
|
+
format.json { render json: @circulation_status, status: :created, location: @circulation_status }
|
48
|
+
else
|
49
|
+
format.html { render action: "new" }
|
50
|
+
format.json { render json: @circulation_status.errors, status: :unprocessable_entity }
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# PUT /circulation_statuses/1
|
56
|
+
# PUT /circulation_statuses/1.json
|
5
57
|
def update
|
6
|
-
@circulation_status = CirculationStatus.find(params[:id])
|
7
58
|
if params[:move]
|
8
59
|
move_position(@circulation_status, params[:move])
|
9
60
|
return
|
10
61
|
end
|
11
|
-
|
62
|
+
|
63
|
+
respond_to do |format|
|
64
|
+
if @circulation_status.update_attributes(params[:circulation_status])
|
65
|
+
format.html { redirect_to @circulation_status, notice: t('controller.successfully_updated', model: t('activerecord.models.circulation_status')) }
|
66
|
+
format.json { head :no_content }
|
67
|
+
else
|
68
|
+
format.html { render action: "edit" }
|
69
|
+
format.json { render json: @circulation_status.errors, status: :unprocessable_entity }
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
# DELETE /circulation_statuses/1
|
75
|
+
# DELETE /circulation_statuses/1.json
|
76
|
+
def destroy
|
77
|
+
@circulation_status.destroy
|
78
|
+
|
79
|
+
respond_to do |format|
|
80
|
+
format.html { redirect_to circulation_statuses_url }
|
81
|
+
format.json { head :no_content }
|
82
|
+
end
|
12
83
|
end
|
13
84
|
end
|
@@ -1,10 +1,80 @@
|
|
1
|
-
class LendingPoliciesController <
|
1
|
+
class LendingPoliciesController < ApplicationController
|
2
2
|
load_and_authorize_resource
|
3
3
|
before_filter :get_user_group, :get_item
|
4
|
-
before_filter :prepare_options, only: [:
|
4
|
+
before_filter :prepare_options, only: [:new, :edit]
|
5
5
|
|
6
|
+
# GET /lending_policies
|
7
|
+
# GET /lending_policies.json
|
6
8
|
def index
|
7
9
|
@lending_policies = LendingPolicy.page(params[:page])
|
10
|
+
|
11
|
+
respond_to do |format|
|
12
|
+
format.html # index.html.erb
|
13
|
+
format.json { render json: @lending_policies }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
# GET /lending_policies/1
|
18
|
+
# GET /lending_policies/1.json
|
19
|
+
def show
|
20
|
+
respond_to do |format|
|
21
|
+
format.html # show.html.erb
|
22
|
+
format.json { render json: @lending_policy }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# GET /lending_policies/new
|
27
|
+
# GET /lending_policies/new.json
|
28
|
+
def new
|
29
|
+
respond_to do |format|
|
30
|
+
format.html # new.html.erb
|
31
|
+
format.json { render json: @lending_policy }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# GET /lending_policies/1/edit
|
36
|
+
def edit
|
37
|
+
end
|
38
|
+
|
39
|
+
# POST /lending_policies
|
40
|
+
# POST /lending_policies.json
|
41
|
+
def create
|
42
|
+
respond_to do |format|
|
43
|
+
if @lending_policy.save
|
44
|
+
format.html { redirect_to @lending_policy, notice: t('controller.successfully_created', model: t('activerecord.models.lending_policy')) }
|
45
|
+
format.json { render json: @lending_policy, status: :created, location: @lending_policy }
|
46
|
+
else
|
47
|
+
prepare_options
|
48
|
+
format.html { render action: "new" }
|
49
|
+
format.json { render json: @lending_policy.errors, status: :unprocessable_entity }
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# PUT /lending_policies/1
|
55
|
+
# PUT /lending_policies/1.json
|
56
|
+
def update
|
57
|
+
respond_to do |format|
|
58
|
+
if @lending_policy.update_attributes(params[:lending_policy])
|
59
|
+
format.html { redirect_to @lending_policy, notice: t('controller.successfully_updated', model: t('activerecord.models.lending_policy')) }
|
60
|
+
format.json { head :no_content }
|
61
|
+
else
|
62
|
+
prepare_options
|
63
|
+
format.html { render action: "edit" }
|
64
|
+
format.json { render json: @lending_policy.errors, status: :unprocessable_entity }
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# DELETE /lending_policies/1
|
70
|
+
# DELETE /lending_policies/1.json
|
71
|
+
def destroy
|
72
|
+
@lending_policy.destroy
|
73
|
+
|
74
|
+
respond_to do |format|
|
75
|
+
format.html { redirect_to lending_policies_url }
|
76
|
+
format.json { head :no_content }
|
77
|
+
end
|
8
78
|
end
|
9
79
|
|
10
80
|
private
|
@@ -1,13 +1,84 @@
|
|
1
|
-
class UseRestrictionsController <
|
2
|
-
respond_to :html, :json
|
1
|
+
class UseRestrictionsController < ApplicationController
|
3
2
|
load_and_authorize_resource
|
4
3
|
|
4
|
+
# GET /use_restrictions
|
5
|
+
# GET /use_restrictions.json
|
6
|
+
def index
|
7
|
+
@use_restrictions = UseRestriction.order(:position)
|
8
|
+
|
9
|
+
respond_to do |format|
|
10
|
+
format.html # index.html.erb
|
11
|
+
format.json { render json: @use_restrictions }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# GET /use_restrictions/1
|
16
|
+
# GET /use_restrictions/1.json
|
17
|
+
def show
|
18
|
+
respond_to do |format|
|
19
|
+
format.html # show.html.erb
|
20
|
+
format.json { render json: @use_restriction }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# GET /use_restrictions/new
|
25
|
+
# GET /use_restrictions/new.json
|
26
|
+
def new
|
27
|
+
@use_restriction = UseRestriction.new
|
28
|
+
|
29
|
+
respond_to do |format|
|
30
|
+
format.html # new.html.erb
|
31
|
+
format.json { render json: @use_restriction }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# GET /use_restrictions/1/edit
|
36
|
+
def edit
|
37
|
+
end
|
38
|
+
|
39
|
+
# POST /use_restrictions
|
40
|
+
# POST /use_restrictions.json
|
41
|
+
def create
|
42
|
+
@use_restriction = UseRestriction.new(params[:use_restriction])
|
43
|
+
|
44
|
+
respond_to do |format|
|
45
|
+
if @use_restriction.save
|
46
|
+
format.html { redirect_to @use_restriction, notice: t('controller.successfully_created', model: t('activerecord.models.use_restriction')) }
|
47
|
+
format.json { render json: @use_restriction, status: :created, location: @use_restriction }
|
48
|
+
else
|
49
|
+
format.html { render action: "new" }
|
50
|
+
format.json { render json: @use_restriction.errors, status: :unprocessable_entity }
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# PUT /use_restrictions/1
|
56
|
+
# PUT /use_restrictions/1.json
|
5
57
|
def update
|
6
|
-
@use_restriction = UseRestriction.find(params[:id])
|
7
58
|
if params[:move]
|
8
59
|
move_position(@use_restriction, params[:move])
|
9
60
|
return
|
10
61
|
end
|
11
|
-
|
62
|
+
|
63
|
+
respond_to do |format|
|
64
|
+
if @use_restriction.update_attributes(params[:use_restriction])
|
65
|
+
format.html { redirect_to @use_restriction, notice: t('controller.successfully_updated', model: t('activerecord.models.use_restriction')) }
|
66
|
+
format.json { head :no_content }
|
67
|
+
else
|
68
|
+
format.html { render action: "edit" }
|
69
|
+
format.json { render json: @use_restriction.errors, status: :unprocessable_entity }
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
# DELETE /use_restrictions/1
|
75
|
+
# DELETE /use_restrictions/1.json
|
76
|
+
def destroy
|
77
|
+
@use_restriction.destroy
|
78
|
+
|
79
|
+
respond_to do |format|
|
80
|
+
format.html { redirect_to use_restrictions_url }
|
81
|
+
format.json { head :no_content }
|
82
|
+
end
|
12
83
|
end
|
13
84
|
end
|
data/app/models/checkin.rb
CHANGED
@@ -3,7 +3,7 @@ class Checkin < ActiveRecord::Base
|
|
3
3
|
default_scope order: 'checkins.id DESC'
|
4
4
|
scope :on, lambda {|date| {conditions: ['created_at >= ? AND created_at < ?', date.beginning_of_day, date.tomorrow.beginning_of_day]}}
|
5
5
|
has_one :checkout
|
6
|
-
belongs_to :item
|
6
|
+
belongs_to :item, touch: true
|
7
7
|
belongs_to :librarian, class_name: 'User'
|
8
8
|
belongs_to :basket
|
9
9
|
|
data/app/models/checkout.rb
CHANGED
@@ -10,7 +10,7 @@ class Checkout < ActiveRecord::Base
|
|
10
10
|
|
11
11
|
belongs_to :user
|
12
12
|
delegate :username, :user_number, :to => :user, :prefix => true
|
13
|
-
belongs_to :item
|
13
|
+
belongs_to :item, touch: true
|
14
14
|
belongs_to :checkin
|
15
15
|
belongs_to :librarian, class_name: 'User'
|
16
16
|
belongs_to :basket
|
@@ -1,11 +1,7 @@
|
|
1
1
|
class CirculationStatus < ActiveRecord::Base
|
2
2
|
attr_accessible :name, :display_name, :note
|
3
|
-
|
4
|
-
acts_as_list
|
3
|
+
include MasterModel
|
5
4
|
validates :name, presence: true, format: {with: /\A[0-9A-Za-z][0-9A-Za-z_\-\s,]*[0-9a-z]\Z/}
|
6
|
-
validates :display_name, presence: true
|
7
|
-
before_validation :set_display_name, on: :create
|
8
|
-
normalize_attributes :name
|
9
5
|
|
10
6
|
default_scope order: "circulation_statuses.position"
|
11
7
|
scope :available_for_checkout, where(name: 'Available On Shelf')
|
data/app/models/reserve.rb
CHANGED
@@ -172,9 +172,9 @@ class Reserve < ActiveRecord::Base
|
|
172
172
|
Reserve.transaction do
|
173
173
|
case current_state
|
174
174
|
when 'requested'
|
175
|
-
|
175
|
+
message_template_to_patron = MessageTemplate.localized_template('reservation_accepted_for_patron', user.profile.locale)
|
176
176
|
request = MessageRequest.new
|
177
|
-
request.assign_attributes({sender: sender, receiver: user, message_template:
|
177
|
+
request.assign_attributes({sender: sender, receiver: user, message_template: message_template_to_patron}, as: :admin)
|
178
178
|
request.save_message_body(manifestations: Array[manifestation], user: user)
|
179
179
|
request.transition_to!(:sent) # 受付時は即時送信
|
180
180
|
message_template_to_library = MessageTemplate.localized_template('reservation_accepted_for_library', user.profile.locale)
|
@@ -183,9 +183,9 @@ class Reserve < ActiveRecord::Base
|
|
183
183
|
request.save_message_body(manifestations: Array[manifestation], user: user)
|
184
184
|
request.transition_to!(:sent) # 受付時は即時送信
|
185
185
|
when 'canceled'
|
186
|
-
|
186
|
+
message_template_to_patron = MessageTemplate.localized_template('reservation_canceled_for_patron', user.profile.locale)
|
187
187
|
request = MessageRequest.new
|
188
|
-
request.assign_attributes({sender: sender, receiver: user, message_template:
|
188
|
+
request.assign_attributes({sender: sender, receiver: user, message_template: message_template_to_patron}, as: :admin)
|
189
189
|
request.save_message_body(manifestations: Array[manifestation], user: user)
|
190
190
|
request.transition_to!(:sent) # キャンセル時は即時送信
|
191
191
|
message_template_to_library = MessageTemplate.localized_template('reservation_canceled_for_library', user.profile.locale)
|
@@ -194,9 +194,9 @@ class Reserve < ActiveRecord::Base
|
|
194
194
|
request.save_message_body(manifestations: Array[manifestation], user: user)
|
195
195
|
request.transition_to!(:sent) # キャンセル時は即時送信
|
196
196
|
when 'expired'
|
197
|
-
|
197
|
+
message_template_to_patron = MessageTemplate.localized_template('reservation_expired_for_patron', user.profile.locale)
|
198
198
|
request = MessageRequest.new
|
199
|
-
request.assign_attributes({sender: sender, receiver: user, message_template:
|
199
|
+
request.assign_attributes({sender: sender, receiver: user, message_template: message_template_to_patron}, as: :admin)
|
200
200
|
request.save_message_body(manifestations: Array[manifestation], user: user)
|
201
201
|
request.transition_to!(:sent)
|
202
202
|
reload
|
@@ -1,11 +1,7 @@
|
|
1
1
|
class UseRestriction < ActiveRecord::Base
|
2
2
|
attr_accessible :name, :display_name, :note
|
3
|
-
|
4
|
-
acts_as_list
|
3
|
+
include MasterModel
|
5
4
|
validates :name, presence: true, format: {with: /\A[0-9A-Za-z][0-9A-Za-z_\-\s,]*[0-9a-z]\Z/}
|
6
|
-
validates :display_name, presence: true
|
7
|
-
before_validation :set_display_name, on: :create
|
8
|
-
normalize_attributes :name
|
9
5
|
|
10
6
|
default_scope {order('use_restrictions.position')}
|
11
7
|
scope :available, -> {where(name: ['Not For Loan', 'Limited Circulation, Normal Loan Period'])}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<div style="color: red"><%= flash[:message] -%></div>
|
2
2
|
|
3
3
|
<div class="search_form">
|
4
|
-
<%= form_for :checked_item, html: {method: :post}, url:
|
4
|
+
<%= form_for :checked_item, html: {method: :post}, url: checked_items_path(basket_id: @basket.id), remote: true do |f| -%>
|
5
5
|
<%= f.error_messages -%>
|
6
6
|
<p>
|
7
7
|
<%= f.label :item_identifier, t('activerecord.attributes.item.item_identifier') -%>: <%= f.search_field :item_identifier -%>
|
@@ -22,7 +22,7 @@ $(document).ready(function(){
|
|
22
22
|
|
23
23
|
<%= render 'checked_item' %>
|
24
24
|
|
25
|
-
<%= form_for(:basket, url:
|
25
|
+
<%= form_for(:basket, url: basket_path(@basket), html: { method: :put }) do |f| -%>
|
26
26
|
<div>
|
27
27
|
<%= f.submit t('checked_item.checkout'), 'data-disable-with' => t('page.saving') -%>
|
28
28
|
</div>
|
@@ -19,6 +19,6 @@
|
|
19
19
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
20
20
|
<ul>
|
21
21
|
<li><%= link_to t('page.edit'), edit_checked_item_path(@checked_item) -%></li>
|
22
|
-
<li><%= link_to t('page.back'),
|
22
|
+
<li><%= link_to t('page.back'), checked_items_path(basket_id: @checked_item.basket_id) -%></li>
|
23
23
|
</ul>
|
24
24
|
</div>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<div style="color: red"><%= flash[:message] -%></div>
|
2
2
|
|
3
3
|
<div class="search_form">
|
4
|
-
<%= form_for :checkin, html: {method: :post}, url:
|
4
|
+
<%= form_for :checkin, html: {method: :post}, url: checkins_path(basket_id: @basket.id), remote: true do |f| -%>
|
5
5
|
<%= f.error_messages %>
|
6
6
|
<p>
|
7
7
|
<%= label_tag :item_identifier, t('activerecord.attributes.item.item_identifier') -%>:
|