enju_library 0.1.0.pre43 → 0.1.0.pre44
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/accepts_controller.rb +2 -2
- data/app/controllers/withdraws_controller.rb +126 -0
- data/app/models/accept.rb +2 -3
- data/app/models/basket.rb +3 -3
- data/app/models/bookstore.rb +6 -7
- data/app/models/budget_type.rb +3 -4
- data/app/models/color.rb +4 -4
- data/app/models/enju_library/ability.rb +4 -2
- data/app/models/library.rb +11 -12
- data/app/models/library_group.rb +6 -5
- data/app/models/request_status_type.rb +3 -4
- data/app/models/request_type.rb +3 -4
- data/app/models/search_engine.rb +4 -5
- data/app/models/shelf.rb +3 -4
- data/app/models/subscribe.rb +2 -3
- data/app/models/subscription.rb +2 -3
- data/app/models/withdraw.rb +27 -0
- data/app/views/accepts/new.html.erb +1 -1
- data/app/views/libraries/show.html.erb +21 -17
- data/app/views/library_groups/_form.html.erb +5 -0
- data/app/views/library_groups/show.html.erb +9 -4
- data/app/views/withdraws/_form.html.erb +11 -0
- data/app/views/withdraws/_list.html.erb +31 -0
- data/app/views/withdraws/edit.html.erb +13 -0
- data/app/views/withdraws/index.html.erb +50 -0
- data/app/views/withdraws/index.js.erb +1 -0
- data/app/views/withdraws/index.txt.csv +4 -0
- data/app/views/withdraws/new.html.erb +15 -0
- data/app/views/withdraws/show.html.erb +31 -0
- data/config/locales/translation_en.yml +11 -0
- data/config/locales/translation_ja.yml +11 -0
- data/config/routes.rb +3 -2
- data/db/migrate/20150924115059_create_withdraws.rb +13 -0
- data/lib/enju_library/version.rb +1 -1
- data/spec/controllers/accepts_controller_spec.rb +3 -3
- data/spec/controllers/withdraws_controller_spec.rb +132 -0
- data/spec/dummy/app/assets/javascripts/application.js +4 -6
- data/spec/dummy/db/schema.rb +12 -1
- data/spec/factories/accepts.rb +2 -2
- data/spec/factories/budget_types.rb +3 -3
- data/spec/factories/withdraw.rb +21 -0
- data/spec/fixtures/baskets.yml +2 -3
- data/spec/fixtures/bookstores.yml +6 -7
- data/spec/fixtures/budget_types.yml +3 -4
- data/spec/fixtures/colors.yml +4 -4
- data/spec/fixtures/libraries.yml +10 -10
- data/spec/fixtures/library_groups.yml +7 -5
- data/spec/fixtures/request_status_types.yml +3 -3
- data/spec/fixtures/request_types.yml +3 -3
- data/spec/fixtures/search_engines.yml +4 -5
- data/spec/fixtures/shelves.yml +3 -3
- data/spec/fixtures/subscribes.yml +2 -3
- data/spec/fixtures/subscriptions.yml +2 -3
- data/spec/fixtures/withdraws.yml +20 -0
- data/spec/models/accept_spec.rb +2 -3
- data/spec/models/basket_spec.rb +2 -3
- data/spec/models/bookstore_spec.rb +6 -7
- data/spec/models/budget_type_spec.rb +3 -4
- data/spec/models/library_group_spec.rb +6 -5
- data/spec/models/library_spec.rb +10 -11
- data/spec/models/request_status_type_spec.rb +3 -4
- data/spec/models/request_type_spec.rb +3 -4
- data/spec/models/search_engine_spec.rb +4 -5
- data/spec/models/shelf_spec.rb +3 -4
- data/spec/models/subscribe_spec.rb +2 -3
- data/spec/models/subscription_spec.rb +2 -3
- data/spec/models/withdraw_spec.rb +21 -0
- data/spec/rails_helper.rb +79 -0
- data/spec/routing/withdraws_routing_spec.rb +27 -0
- data/spec/spec_helper.rb +82 -51
- data/spec/views/libraries/show.html.erb_spec.rb +14 -0
- data/spec/views/withdraws/edit.html.erb_spec.rb +14 -0
- data/spec/views/withdraws/index.html.erb_spec.rb +26 -0
- data/spec/views/withdraws/new.html.erb_spec.rb +31 -0
- data/spec/views/withdraws/show.html.erb_spec.rb +11 -0
- metadata +43 -26
- data/spec/support/vcr.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 752e1b1865d6fab37bcfc7716c40d081f496bdd8
|
4
|
+
data.tar.gz: f794648175585896e9bebba01a9a51e51b812ae6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9126d3c31b219ce771b2d982ce9711ed29c4ebcd3508c91d911eb43440be6d012855b0f3d7807e6f258140aebf52e0c2dd44b9b2b40d46a3cd82082be158d24
|
7
|
+
data.tar.gz: 909755817fabc00e07348ff1d4b3723b983ee4720c4d91f74eb346526a5cc5f7f02b883c24c87de5052115bfe89daa2da8181ff076d9c179d608da0e70d9bd05
|
@@ -18,9 +18,9 @@ class AcceptsController < ApplicationController
|
|
18
18
|
@accepts = Accept.order('accepts.created_at DESC').where(item_id: item.id).page(params[:page])
|
19
19
|
else
|
20
20
|
if @basket
|
21
|
-
@accepts = @basket.accepts.page(params[:page])
|
21
|
+
@accepts = @basket.accepts.order('accepts.created_at DESC').page(params[:page])
|
22
22
|
else
|
23
|
-
@accepts = Accept.page(params[:page])
|
23
|
+
@accepts = Accept.order('accepts.created_at DESC').page(params[:page])
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -0,0 +1,126 @@
|
|
1
|
+
class WithdrawsController < ApplicationController
|
2
|
+
load_and_authorize_resource except: :index
|
3
|
+
authorize_resource only: :index
|
4
|
+
before_filter :get_basket, only: [:index, :create]
|
5
|
+
|
6
|
+
# GET /withdraws
|
7
|
+
# GET /withdraws.json
|
8
|
+
def index
|
9
|
+
if params[:format] == 'txt'
|
10
|
+
@withdraws = Withdraw.order('withdraws.created_at DESC').page(params[:page]).per(65534)
|
11
|
+
else
|
12
|
+
if params[:withdraw]
|
13
|
+
@query = params[:withdraw][:item_identifier].to_s.strip
|
14
|
+
item = Item.where(item_identifier: @query).first if @query.present?
|
15
|
+
end
|
16
|
+
|
17
|
+
if item
|
18
|
+
@withdraws = Withdraw.order('withdraws.created_at DESC').where(item_id: item.id).page(params[:page])
|
19
|
+
else
|
20
|
+
if @basket
|
21
|
+
@withdraws = @basket.withdraws.order('withdraws.created_at DESC').page(params[:page])
|
22
|
+
else
|
23
|
+
@withdraws = Withdraw.order('withdraws.created_at DESC').page(params[:page])
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
respond_to do |format|
|
29
|
+
format.html # index.html.erb
|
30
|
+
format.json { render json: @withdraws }
|
31
|
+
format.js { @withdraw = Withdraw.new }
|
32
|
+
format.txt
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# GET /withdraws/1
|
37
|
+
# GET /withdraws/1.json
|
38
|
+
def show
|
39
|
+
respond_to do |format|
|
40
|
+
format.html # show.html.erb
|
41
|
+
format.json { render json: @withdraw }
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# GET /new
|
46
|
+
# GET /new.json
|
47
|
+
def new
|
48
|
+
@basket = Basket.new
|
49
|
+
@basket.user = current_user
|
50
|
+
@basket.save!
|
51
|
+
@withdraw = Withdraw.new
|
52
|
+
@withdraws = []
|
53
|
+
|
54
|
+
respond_to do |format|
|
55
|
+
format.html # new.html.erb
|
56
|
+
format.json { render json: @withdraw }
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# GET /withdraws/new
|
61
|
+
# GET /withdraws/1/edit
|
62
|
+
def edit
|
63
|
+
end
|
64
|
+
|
65
|
+
# POST /withdraws
|
66
|
+
# POST /withdraws.json
|
67
|
+
def create
|
68
|
+
unless @basket
|
69
|
+
access_denied; return
|
70
|
+
end
|
71
|
+
@withdraw.basket = @basket
|
72
|
+
@withdraw.librarian = current_user
|
73
|
+
|
74
|
+
flash[:message] = ''
|
75
|
+
if @withdraw.item_identifier.blank?
|
76
|
+
flash[:message] << t('withdraw.enter_item_identifier') if @withdraw.item_identifier.blank?
|
77
|
+
else
|
78
|
+
item = Item.where(item_identifier: @withdraw.item_identifier.to_s.strip).first
|
79
|
+
end
|
80
|
+
@withdraw.item = item
|
81
|
+
|
82
|
+
respond_to do |format|
|
83
|
+
if @withdraw.save
|
84
|
+
flash[:message] << t('withdraw.successfully_withdrawn', model: t('activerecord.models.withdraw'))
|
85
|
+
format.html { redirect_to withdraws_url(basket_id: @basket.id) }
|
86
|
+
format.json { render json: @withdraw, status: :created, location: @withdraw }
|
87
|
+
format.js { redirect_to withdraws_url(basket_id: @basket.id, format: :js) }
|
88
|
+
else
|
89
|
+
@withdraws = @basket.withdraws.page(params[:page])
|
90
|
+
format.html { render action: "index" }
|
91
|
+
format.json { render json: @withdraw.errors, status: :unprocessable_entity }
|
92
|
+
format.js { render action: "index" }
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
# PUT /withdraws/1
|
98
|
+
# PUT /withdraws/1.json
|
99
|
+
def update
|
100
|
+
respond_to do |format|
|
101
|
+
if @withdraw.update_attributes(withdraw_params)
|
102
|
+
format.html { redirect_to @withdraw, notice: t('controller.successfully_updated', model: t('activerecord.models.withdraw')) }
|
103
|
+
format.json { head :no_content }
|
104
|
+
else
|
105
|
+
format.html { render action: "edit" }
|
106
|
+
format.json { render json: @withdraw.errors, status: :unprocessable_entity }
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
# DELETE /withdraws/1
|
112
|
+
# DELETE /withdraws/1.json
|
113
|
+
def destroy
|
114
|
+
@withdraw.destroy
|
115
|
+
|
116
|
+
respond_to do |format|
|
117
|
+
format.html { redirect_to withdraws_url, notice: t('controller.successfully_deleted', model: t('activerecord.models.withdraw')) }
|
118
|
+
format.json { head :no_content }
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
private
|
123
|
+
def withdraw_params
|
124
|
+
params.require(:withdraw).permit(:item_identifier, :librarian_id, :item_id)
|
125
|
+
end
|
126
|
+
end
|
data/app/models/accept.rb
CHANGED
data/app/models/basket.rb
CHANGED
@@ -3,6 +3,7 @@ class Basket < ActiveRecord::Base
|
|
3
3
|
scope :will_expire, lambda {|date| where('created_at < ?', date)}
|
4
4
|
belongs_to :user, validate: true
|
5
5
|
has_many :accepts
|
6
|
+
has_many :withdraws
|
6
7
|
|
7
8
|
enju_circulation_basket_model if defined?(EnjuCirculation)
|
8
9
|
|
@@ -35,7 +36,6 @@ end
|
|
35
36
|
# user_id :integer
|
36
37
|
# note :text
|
37
38
|
# lock_version :integer default(0), not null
|
38
|
-
# created_at :datetime
|
39
|
-
# updated_at :datetime
|
39
|
+
# created_at :datetime
|
40
|
+
# updated_at :datetime
|
40
41
|
#
|
41
|
-
|
data/app/models/bookstore.rb
CHANGED
@@ -19,15 +19,14 @@ end
|
|
19
19
|
#
|
20
20
|
# id :integer not null, primary key
|
21
21
|
# name :text not null
|
22
|
-
# zip_code :string
|
22
|
+
# zip_code :string
|
23
23
|
# address :text
|
24
24
|
# note :text
|
25
|
-
# telephone_number :string
|
26
|
-
# fax_number :string
|
27
|
-
# url :string
|
25
|
+
# telephone_number :string
|
26
|
+
# fax_number :string
|
27
|
+
# url :string
|
28
28
|
# position :integer
|
29
29
|
# deleted_at :datetime
|
30
|
-
# created_at :datetime
|
31
|
-
# updated_at :datetime
|
30
|
+
# created_at :datetime
|
31
|
+
# updated_at :datetime
|
32
32
|
#
|
33
|
-
|
data/app/models/budget_type.rb
CHANGED
@@ -15,11 +15,10 @@ end
|
|
15
15
|
# Table name: budget_types
|
16
16
|
#
|
17
17
|
# id :integer not null, primary key
|
18
|
-
# name :string
|
18
|
+
# name :string
|
19
19
|
# display_name :text
|
20
20
|
# note :text
|
21
21
|
# position :integer
|
22
|
-
# created_at :datetime
|
23
|
-
# updated_at :datetime
|
22
|
+
# created_at :datetime
|
23
|
+
# updated_at :datetime
|
24
24
|
#
|
25
|
-
|
data/app/models/color.rb
CHANGED
@@ -14,9 +14,9 @@ end
|
|
14
14
|
#
|
15
15
|
# id :integer not null, primary key
|
16
16
|
# library_group_id :integer
|
17
|
-
# property :string
|
18
|
-
# code :string
|
17
|
+
# property :string
|
18
|
+
# code :string
|
19
19
|
# position :integer
|
20
|
-
# created_at :datetime
|
21
|
-
# updated_at :datetime
|
20
|
+
# created_at :datetime
|
21
|
+
# updated_at :datetime
|
22
22
|
#
|
@@ -24,7 +24,8 @@ module EnjuLibrary
|
|
24
24
|
BudgetType,
|
25
25
|
SearchEngine,
|
26
26
|
Subscribe,
|
27
|
-
Subscription
|
27
|
+
Subscription,
|
28
|
+
Withdraw
|
28
29
|
]
|
29
30
|
can :update, [
|
30
31
|
LibraryGroup,
|
@@ -40,7 +41,8 @@ module EnjuLibrary
|
|
40
41
|
can :manage, [
|
41
42
|
Accept,
|
42
43
|
Subscribe,
|
43
|
-
Subscription
|
44
|
+
Subscription,
|
45
|
+
Withdraw
|
44
46
|
]
|
45
47
|
can :read, [
|
46
48
|
Bookstore,
|
data/app/models/library.rb
CHANGED
@@ -69,7 +69,7 @@ class Library < ActiveRecord::Base
|
|
69
69
|
else
|
70
70
|
"#{street.to_s.localize(locale)} #{locality.to_s.localize(locale)} #{region.to_s.localize(locale)}"
|
71
71
|
end
|
72
|
-
rescue
|
72
|
+
rescue Psych::SyntaxError
|
73
73
|
nil
|
74
74
|
end
|
75
75
|
|
@@ -98,29 +98,28 @@ end
|
|
98
98
|
# Table name: libraries
|
99
99
|
#
|
100
100
|
# id :integer not null, primary key
|
101
|
-
# name :string
|
101
|
+
# name :string not null
|
102
102
|
# display_name :text
|
103
|
-
# short_display_name :string
|
104
|
-
# zip_code :string
|
103
|
+
# short_display_name :string not null
|
104
|
+
# zip_code :string
|
105
105
|
# street :text
|
106
106
|
# locality :text
|
107
107
|
# region :text
|
108
|
-
# telephone_number_1 :string
|
109
|
-
# telephone_number_2 :string
|
110
|
-
# fax_number :string
|
108
|
+
# telephone_number_1 :string
|
109
|
+
# telephone_number_2 :string
|
110
|
+
# fax_number :string
|
111
111
|
# note :text
|
112
112
|
# call_number_rows :integer default(1), not null
|
113
|
-
# call_number_delimiter :string
|
113
|
+
# call_number_delimiter :string default("|"), not null
|
114
114
|
# library_group_id :integer default(1), not null
|
115
115
|
# users_count :integer default(0), not null
|
116
116
|
# position :integer
|
117
117
|
# country_id :integer
|
118
|
-
# created_at :datetime
|
119
|
-
# updated_at :datetime
|
118
|
+
# created_at :datetime
|
119
|
+
# updated_at :datetime
|
120
120
|
# deleted_at :datetime
|
121
121
|
# opening_hour :text
|
122
|
-
# isil :string
|
122
|
+
# isil :string
|
123
123
|
# latitude :float
|
124
124
|
# longitude :float
|
125
125
|
#
|
126
|
-
|
data/app/models/library_group.rb
CHANGED
@@ -75,16 +75,17 @@ end
|
|
75
75
|
# Table name: library_groups
|
76
76
|
#
|
77
77
|
# id :integer not null, primary key
|
78
|
-
# name :string
|
78
|
+
# name :string not null
|
79
79
|
# display_name :text
|
80
|
-
# short_name :string
|
80
|
+
# short_name :string not null
|
81
81
|
# my_networks :text
|
82
82
|
# login_banner :text
|
83
83
|
# note :text
|
84
84
|
# country_id :integer
|
85
85
|
# position :integer
|
86
|
-
# created_at :datetime
|
87
|
-
# updated_at :datetime
|
86
|
+
# created_at :datetime
|
87
|
+
# updated_at :datetime
|
88
88
|
# admin_networks :text
|
89
|
-
# url :string
|
89
|
+
# url :string default("http://localhost:3000/")
|
90
|
+
# settings :text
|
90
91
|
#
|
@@ -15,11 +15,10 @@ end
|
|
15
15
|
# Table name: request_status_types
|
16
16
|
#
|
17
17
|
# id :integer not null, primary key
|
18
|
-
# name :string
|
18
|
+
# name :string not null
|
19
19
|
# display_name :text
|
20
20
|
# note :text
|
21
21
|
# position :integer
|
22
|
-
# created_at :datetime
|
23
|
-
# updated_at :datetime
|
22
|
+
# created_at :datetime
|
23
|
+
# updated_at :datetime
|
24
24
|
#
|
25
|
-
|
data/app/models/request_type.rb
CHANGED
@@ -14,11 +14,10 @@ end
|
|
14
14
|
# Table name: request_types
|
15
15
|
#
|
16
16
|
# id :integer not null, primary key
|
17
|
-
# name :string
|
17
|
+
# name :string not null
|
18
18
|
# display_name :text
|
19
19
|
# note :text
|
20
20
|
# position :integer
|
21
|
-
# created_at :datetime
|
22
|
-
# updated_at :datetime
|
21
|
+
# created_at :datetime
|
22
|
+
# updated_at :datetime
|
23
23
|
#
|
24
|
-
|
data/app/models/search_engine.rb
CHANGED
@@ -33,16 +33,15 @@ end
|
|
33
33
|
# Table name: search_engines
|
34
34
|
#
|
35
35
|
# id :integer not null, primary key
|
36
|
-
# name :string
|
36
|
+
# name :string not null
|
37
37
|
# display_name :text
|
38
|
-
# url :string
|
38
|
+
# url :string not null
|
39
39
|
# base_url :text not null
|
40
40
|
# http_method :text not null
|
41
41
|
# query_param :text not null
|
42
42
|
# additional_param :text
|
43
43
|
# note :text
|
44
44
|
# position :integer
|
45
|
-
# created_at :datetime
|
46
|
-
# updated_at :datetime
|
45
|
+
# created_at :datetime
|
46
|
+
# updated_at :datetime
|
47
47
|
#
|
48
|
-
|
data/app/models/shelf.rb
CHANGED
@@ -52,15 +52,14 @@ end
|
|
52
52
|
# Table name: shelves
|
53
53
|
#
|
54
54
|
# id :integer not null, primary key
|
55
|
-
# name :string
|
55
|
+
# name :string not null
|
56
56
|
# display_name :text
|
57
57
|
# note :text
|
58
58
|
# library_id :integer default(1), not null
|
59
59
|
# items_count :integer default(0), not null
|
60
60
|
# position :integer
|
61
|
-
# created_at :datetime
|
62
|
-
# updated_at :datetime
|
61
|
+
# created_at :datetime
|
62
|
+
# updated_at :datetime
|
63
63
|
# deleted_at :datetime
|
64
64
|
# closed :boolean default(FALSE), not null
|
65
65
|
#
|
66
|
-
|
data/app/models/subscribe.rb
CHANGED
data/app/models/subscription.rb
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
class Withdraw < ActiveRecord::Base
|
2
|
+
belongs_to :basket
|
3
|
+
belongs_to :item, touch: true
|
4
|
+
belongs_to :librarian, class_name: 'User'
|
5
|
+
|
6
|
+
enju_circulation_withdraw_model if defined?(EnjuCirculation)
|
7
|
+
|
8
|
+
validates_uniqueness_of :item_id, message: I18n.t('withdraw.already_withdrawn')
|
9
|
+
validates_presence_of :item_id, message: I18n.t('withdraw.item_not_found')
|
10
|
+
validates_presence_of :basket_id
|
11
|
+
|
12
|
+
attr_accessor :item_identifier
|
13
|
+
|
14
|
+
paginates_per 10
|
15
|
+
end
|
16
|
+
|
17
|
+
# == Schema Information
|
18
|
+
#
|
19
|
+
# Table name: withdraws
|
20
|
+
#
|
21
|
+
# id :integer not null, primary key
|
22
|
+
# basket_id :integer
|
23
|
+
# item_id :integer
|
24
|
+
# librarian_id :integer
|
25
|
+
# created_at :datetime not null
|
26
|
+
# updated_at :datetime not null
|
27
|
+
#
|
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
<%- unless @library.web? -%>
|
14
14
|
<p>
|
15
|
-
<%= t('library.address') -%>: <%= @library.zip_code -%> <%= @library.address
|
15
|
+
<%= t('library.address') -%>: <%= @library.zip_code -%> <%= @library.address -%>
|
16
16
|
<br />
|
17
17
|
<%= t('activerecord.attributes.library.telephone_number_1') -%>: <%= @library.telephone_number_1 -%>
|
18
18
|
<%= t('activerecord.attributes.library.telephone_number_2') -%>: <%= @library.telephone_number_2 -%>
|
@@ -29,7 +29,9 @@
|
|
29
29
|
<div id="tabs">
|
30
30
|
<ul>
|
31
31
|
<li title="active" class="selected"><a href="#tab1"><em><%= t('library.map') -%></em></a></li>
|
32
|
-
|
32
|
+
<% if current_user.try(:has_role?, 'Librarian') %>
|
33
|
+
<li><a href="#tab2"><em><%= t('library.staff') -%></em></a></li>
|
34
|
+
<% end %>
|
33
35
|
<li><a href="#tab3"><em><%= t('activerecord.models.shelf') -%></em></a></li>
|
34
36
|
<% if defined?(EnjuEvent) %>
|
35
37
|
<li><a href="#tab4"><em><%= t('activerecord.models.event') -%></em></a></li>
|
@@ -41,21 +43,23 @@
|
|
41
43
|
<div id="tab1">
|
42
44
|
<%= render 'libraries/map', library: @library if @library.latitude and @library.longitude -%>
|
43
45
|
</div>
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
46
|
+
<% if current_user.try(:has_role?, 'Librarian') %>
|
47
|
+
<div id="tab2">
|
48
|
+
<%- if @library.profiles.librarians.exists? -%>
|
49
|
+
<ul>
|
50
|
+
<%- @library.profiles.librarians.each do |librarian| -%>
|
51
|
+
<li>
|
52
|
+
<%= link_to librarian.user.username, librarian -%>
|
53
|
+
<%- unless librarian.note.blank? -%>
|
54
|
+
<br />
|
55
|
+
<%= librarian.note -%>
|
56
|
+
<%- end -%>
|
57
|
+
</li>
|
58
|
+
<%- end -%>
|
59
|
+
</ul>
|
60
|
+
<%- end -%>
|
61
|
+
</div>
|
62
|
+
<%- end -%>
|
59
63
|
<div id="tab3">
|
60
64
|
<p><%= link_to t('shelf.update_display_order'), shelves_path(library_id: @library.name) %>
|
61
65
|
<table class="table table-striped index">
|
@@ -31,6 +31,11 @@
|
|
31
31
|
<%= f.number_field :max_number_of_results -%>
|
32
32
|
</div>
|
33
33
|
|
34
|
+
<div class="field">
|
35
|
+
<%= f.label :book_jacket_source -%>
|
36
|
+
<%= f.select :book_jacket_source, [['Google', 'google']] -%><br />
|
37
|
+
</div>
|
38
|
+
|
34
39
|
<div class="field">
|
35
40
|
<%= f.label :color -%><br />
|
36
41
|
<%= f.fields_for :colors do |color_form| %>
|
@@ -23,15 +23,20 @@
|
|
23
23
|
<%= @library_group.url -%>
|
24
24
|
</p>
|
25
25
|
|
26
|
-
<
|
26
|
+
<p>
|
27
27
|
<strong><%= t('activerecord.attributes.library_group.login_banner') -%>:</strong>
|
28
28
|
<%= markdown_helper(@library_group.login_banner) -%>
|
29
|
-
</
|
29
|
+
</p>
|
30
30
|
|
31
|
-
<
|
31
|
+
<p>
|
32
32
|
<strong><%= t('activerecord.attributes.library_group.max_number_of_results') -%>:</strong>
|
33
33
|
<%= @library_group.max_number_of_results -%>
|
34
|
-
</
|
34
|
+
</p>
|
35
|
+
|
36
|
+
<p>
|
37
|
+
<strong><%= t('activerecord.attributes.library_group.book_jacket_source') -%>:</strong>
|
38
|
+
<%= @library_group.book_jacket_source -%>
|
39
|
+
</p>
|
35
40
|
|
36
41
|
<div>
|
37
42
|
<strong><%= t('activerecord.attributes.library_group.color') -%>:</strong>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<div style="color: red"><%= flash[:message] -%></div>
|
2
|
+
|
3
|
+
<div class="search_form">
|
4
|
+
<%= form_for(:withdraw, url: withdraws_path(basket_id: @basket.id), remote: true) do |f| %>
|
5
|
+
<%= f.error_messages %>
|
6
|
+
<p>
|
7
|
+
<%= label_tag :item_identifier, t('activerecord.attributes.item.item_identifier') -%>:
|
8
|
+
<%= f.search_field :item_identifier, class: 'resource_item_identifier', value: nil -%>
|
9
|
+
<%= f.submit t('withdraw.withdraw'), 'data-disable-with' => t('page.saving') -%>
|
10
|
+
</p>
|
11
|
+
<%- end -%>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<table class="index">
|
15
|
+
<tr>
|
16
|
+
<th><%= t('activerecord.models.item') -%></th>
|
17
|
+
</tr>
|
18
|
+
<%- @withdraws.each_with_index do |withdraw, i| -%>
|
19
|
+
<tr class="line<%= cycle("0", "1") -%>">
|
20
|
+
<td>
|
21
|
+
<%= render 'manifestations/show_index', manifestation: withdraw.item.manifestation %>
|
22
|
+
<%= link_to withdraw.item.item_identifier, withdraw.item -%> / <%= withdraw.item.call_number %>
|
23
|
+
(<%= link_to withdraw.item.shelf.library.display_name.localize, withdraw.item.shelf.library %> /
|
24
|
+
<%= link_to withdraw.item.shelf.display_name.localize, withdraw.item.shelf %>)<br />
|
25
|
+
<%=l withdraw.created_at %>
|
26
|
+
</td>
|
27
|
+
</tr>
|
28
|
+
<%- end -%>
|
29
|
+
</table>
|
30
|
+
|
31
|
+
<%= javascript_tag("$(function(){$('#withdraw_item_identifier').focus()})") %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all ui-widget-content">
|
2
|
+
<h1 class="title"><%= t('page.editing', model: t('activerecord.models.withdraw')) -%></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'), @withdraw -%></li>
|
11
|
+
<li><%= link_to t('page.back'), withdraws_path -%></li>
|
12
|
+
</ul>
|
13
|
+
</div>
|