enju_leaf 1.1.0.rc20 → 1.1.0.rc21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/unknown_resource.png +0 -0
- data/app/controllers/my_accounts_controller.rb +0 -11
- data/app/controllers/page_controller.rb +12 -0
- data/app/controllers/profiles_controller.rb +23 -5
- data/app/controllers/user_import_files_controller.rb +1 -0
- data/app/helpers/page_helper.rb +14 -0
- data/app/models/profile.rb +7 -1
- data/app/models/user_export_file.rb +1 -0
- data/app/models/user_import_file.rb +20 -10
- data/app/views/page/_menu.html.erb +40 -51
- data/app/views/page/advanced_search.html.erb +14 -3
- data/app/views/page/configuration.html.erb +3 -0
- data/app/views/page/statistics.html.erb +0 -14
- data/app/views/page/system_information.html.erb +13 -1
- data/app/views/profiles/_edit_profile.html.erb +2 -2
- data/app/views/user_import_files/_results.html.erb +22 -0
- data/app/views/user_import_files/show.html.erb +8 -12
- data/app/views/user_import_results/_list.html.erb +22 -0
- data/app/views/user_import_results/_list_lines.html.erb +24 -0
- data/app/views/user_import_results/index.html.erb +5 -30
- data/app/views/user_import_results/show.html.erb +1 -1
- data/config/locales/devise.ja.yml +3 -3
- data/config/locales/translation_en.yml +5 -1
- data/config/locales/translation_ja.yml +5 -1
- data/lib/enju_leaf/calculate_stat.rb +3 -0
- data/lib/enju_leaf/engine.rb +0 -1
- data/lib/enju_leaf/helper.rb +22 -7
- data/lib/enju_leaf/import_file.rb +4 -0
- data/lib/enju_leaf/master_model.rb +1 -0
- data/lib/enju_leaf/user.rb +52 -20
- data/lib/enju_leaf/version.rb +1 -1
- data/lib/generators/enju_leaf/setup/setup_generator.rb +1 -1
- data/spec/controllers/my_accounts_controller_spec.rb +2 -2
- data/spec/controllers/profiles_controller_spec.rb +19 -5
- data/spec/controllers/user_import_files_controller_spec.rb +8 -1
- data/spec/controllers/user_import_results_controller_spec.rb +21 -1
- data/spec/dummy/app/assets/javascripts/application.js +4 -6
- data/spec/dummy/config/initializers/kaminari_config.rb +10 -0
- data/spec/fixtures/user_import_files.yml +2 -0
- data/spec/models/user_import_file_spec.rb +32 -24
- data/spec/models/user_spec.rb +29 -1
- data/spec/rails_helper.rb +82 -0
- data/spec/spec_helper.rb +86 -51
- data/spec/views/page/configuration.html.erb_spec.rb +1 -1
- data/spec/views/user_import_results/index.html.erb_spec.rb +32 -0
- metadata +20 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 814060a69ff014c4f6109974273e83e7afa7bda6
|
4
|
+
data.tar.gz: a69228eb3e3734622b2d34c7b2c47feb2fae2268
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fa95c3a8e7b904e9b949752723aa12d33b0035e7f4f99997c1c5775a914462293aa89ca84c16792798b80681964a4471b71c7c73b5fb79a102074c2ef94e172
|
7
|
+
data.tar.gz: c2d52a9face2180054eff01c1d85ee74a4ae3fb7b9c94dfda0662bf29cd4d3e0faea9cd5a0040989adbe2e0ef976538b0cd49700e5de38665c51bae11aab265f
|
Binary file
|
@@ -12,17 +12,6 @@ class MyAccountsController < ApplicationController
|
|
12
12
|
|
13
13
|
def edit
|
14
14
|
@profile = current_user.profile
|
15
|
-
if defined?(EnjuCirculation)
|
16
|
-
if params[:mode] == 'feed_token'
|
17
|
-
if params[:disable] == 'true'
|
18
|
-
@profile.delete_checkout_icalendar_token
|
19
|
-
else
|
20
|
-
@profile.reset_checkout_icalendar_token
|
21
|
-
end
|
22
|
-
render partial: 'feed_token'
|
23
|
-
return
|
24
|
-
end
|
25
|
-
end
|
26
15
|
prepare_options
|
27
16
|
end
|
28
17
|
|
@@ -5,6 +5,7 @@ class PageController < ApplicationController
|
|
5
5
|
before_filter :check_librarian, except: [:index, :advanced_search, :about, :add_on, :msie_accelerator, :opensearch, :statistics, :routing_error]
|
6
6
|
helper_method :get_libraries
|
7
7
|
|
8
|
+
# トップページを表示します。
|
8
9
|
def index
|
9
10
|
if user_signed_in?
|
10
11
|
session[:user_return_to] = nil
|
@@ -42,51 +43,62 @@ class PageController < ApplicationController
|
|
42
43
|
end
|
43
44
|
end
|
44
45
|
|
46
|
+
# Internet Explorer用のアクセラレータを表示します。
|
45
47
|
def msie_accelerator
|
46
48
|
respond_to do |format|
|
47
49
|
format.xml { render layout: false }
|
48
50
|
end
|
49
51
|
end
|
50
52
|
|
53
|
+
# OpenSearch Descriptionファイルを表示します。
|
51
54
|
def opensearch
|
52
55
|
respond_to do |format|
|
53
56
|
format.xml { render layout: false }
|
54
57
|
end
|
55
58
|
end
|
56
59
|
|
60
|
+
# 詳細検索画面を表示します。
|
57
61
|
def advanced_search
|
58
62
|
get_libraries
|
59
63
|
@title = t('page.advanced_search')
|
60
64
|
end
|
61
65
|
|
66
|
+
# 統計画面を表示します。
|
62
67
|
def statistics
|
63
68
|
@title = t('page.statistics')
|
64
69
|
end
|
65
70
|
|
71
|
+
# システム設定画面を表示します。
|
66
72
|
def configuration
|
67
73
|
@title = t('page.configuration')
|
68
74
|
end
|
69
75
|
|
76
|
+
# システム情報画面を表示します。
|
70
77
|
def system_information
|
71
78
|
@specs = Bundler.load.specs.sort!
|
72
79
|
end
|
73
80
|
|
81
|
+
# インポート画面を表示します。
|
74
82
|
def import
|
75
83
|
@title = t('page.import')
|
76
84
|
end
|
77
85
|
|
86
|
+
# エクスポート画面を表示します。
|
78
87
|
def export
|
79
88
|
@title = t('page.export')
|
80
89
|
end
|
81
90
|
|
91
|
+
# 「このシステムについて」を表示します。
|
82
92
|
def about
|
83
93
|
@title = t('page.about_this_system')
|
84
94
|
end
|
85
95
|
|
96
|
+
# 「アドオン」を表示します。
|
86
97
|
def add_on
|
87
98
|
@title = t('page.add_on')
|
88
99
|
end
|
89
100
|
|
101
|
+
# ルーティングエラー画面を表示します。
|
90
102
|
def routing_error
|
91
103
|
render_404
|
92
104
|
end
|
@@ -7,6 +7,13 @@ class ProfilesController < ApplicationController
|
|
7
7
|
# GET /profiles
|
8
8
|
# GET /profiles.json
|
9
9
|
def index
|
10
|
+
if params[:username].present?
|
11
|
+
profile = User.where(username: params[:username]).first.try(:profile)
|
12
|
+
if profile
|
13
|
+
redirect_to profile
|
14
|
+
return
|
15
|
+
end
|
16
|
+
end
|
10
17
|
query = flash[:query] = params[:query].to_s
|
11
18
|
@query = query.dup
|
12
19
|
@count = {}
|
@@ -73,6 +80,17 @@ class ProfilesController < ApplicationController
|
|
73
80
|
|
74
81
|
# GET /profiles/1/edit
|
75
82
|
def edit
|
83
|
+
if defined?(EnjuCirculation)
|
84
|
+
if params[:mode] == 'feed_token'
|
85
|
+
if params[:disable] == 'true'
|
86
|
+
@profile.delete_checkout_icalendar_token
|
87
|
+
else
|
88
|
+
@profile.reset_checkout_icalendar_token
|
89
|
+
end
|
90
|
+
render partial: 'feed_token', locals: {profile: @profile}
|
91
|
+
return
|
92
|
+
end
|
93
|
+
end
|
76
94
|
if @profile.user == current_user
|
77
95
|
redirect_to edit_my_account_url
|
78
96
|
return
|
@@ -154,9 +172,9 @@ class ProfilesController < ApplicationController
|
|
154
172
|
]
|
155
173
|
attrs += [
|
156
174
|
:library_id, :expired_at, :birth_date,
|
157
|
-
:user_group_id, :required_role_id, :note, :
|
175
|
+
:user_group_id, :required_role_id, :note, :user_number, {
|
158
176
|
:user_attributes => [
|
159
|
-
:id, :username, :email, :current_password,
|
177
|
+
:id, :username, :email, :current_password, :locked,
|
160
178
|
{:user_has_role_attributes => [:id, :role_id]}
|
161
179
|
]
|
162
180
|
}
|
@@ -168,14 +186,14 @@ class ProfilesController < ApplicationController
|
|
168
186
|
attrs = [
|
169
187
|
:full_name, :full_name_transcription,
|
170
188
|
:keyword_list, :locale,
|
171
|
-
:save_checkout_history, # EnjuCirculation
|
189
|
+
:save_checkout_history, :checkout_icalendar_token, # EnjuCirculation
|
172
190
|
:save_search_history, # EnjuSearchLog
|
173
191
|
]
|
174
192
|
attrs += [
|
175
193
|
:library_id, :expired_at, :birth_date,
|
176
|
-
:user_group_id, :required_role_id, :note, :
|
194
|
+
:user_group_id, :required_role_id, :note, :user_number, {
|
177
195
|
:user_attributes => [
|
178
|
-
:id, :email, :current_password, :auto_generated_password,
|
196
|
+
:id, :email, :current_password, :auto_generated_password, :locked,
|
179
197
|
{:user_has_role_attributes => [:id, :role_id]}
|
180
198
|
]
|
181
199
|
}
|
data/app/helpers/page_helper.rb
CHANGED
@@ -1,2 +1,16 @@
|
|
1
1
|
module PageHelper
|
2
|
+
def check_all_button( param, label )
|
3
|
+
html = <<-EOF
|
4
|
+
<button type="button" id="check_all_#{ param }">#{ label }</button>
|
5
|
+
<script>
|
6
|
+
$(function(){
|
7
|
+
$("#check_all_#{ param }").click(function(e){
|
8
|
+
var checkboxes = $("input##{ param }");
|
9
|
+
checkboxes.prop("checked", !checkboxes.prop("checked"));
|
10
|
+
});
|
11
|
+
});
|
12
|
+
</script>
|
13
|
+
EOF
|
14
|
+
html.html_safe
|
15
|
+
end
|
2
16
|
end
|
data/app/models/profile.rb
CHANGED
@@ -20,7 +20,7 @@ class Profile < ActiveRecord::Base
|
|
20
20
|
|
21
21
|
normalize_attribute :user_number
|
22
22
|
|
23
|
-
attr_accessor :birth_date
|
23
|
+
attr_accessor :birth_date
|
24
24
|
|
25
25
|
searchable do
|
26
26
|
text :user_number, :full_name, :full_name_transcription, :note
|
@@ -49,11 +49,15 @@ class Profile < ActiveRecord::Base
|
|
49
49
|
before_save :set_expired_at, :set_date_of_birth
|
50
50
|
accepts_nested_attributes_for :user
|
51
51
|
|
52
|
+
# 既定のユーザ権限を設定します。
|
53
|
+
# @return [void]
|
52
54
|
def set_role_and_agent
|
53
55
|
self.required_role = Role.where(name: 'Librarian').first unless required_role
|
54
56
|
self.locale = I18n.default_locale.to_s unless locale
|
55
57
|
end
|
56
58
|
|
59
|
+
# ユーザの有効期限を設定します。
|
60
|
+
# @return [Time]
|
57
61
|
def set_expired_at
|
58
62
|
if expired_at.blank?
|
59
63
|
if user_group.valid_period_for_new_user > 0
|
@@ -62,6 +66,8 @@ class Profile < ActiveRecord::Base
|
|
62
66
|
end
|
63
67
|
end
|
64
68
|
|
69
|
+
# ユーザの誕生日を設定します。
|
70
|
+
# @return [Time]
|
65
71
|
def set_date_of_birth
|
66
72
|
self.date_of_birth = Time.zone.parse(birth_date) if birth_date
|
67
73
|
rescue ArgumentError
|
@@ -27,6 +27,7 @@ class UserExportFile < ActiveRecord::Base
|
|
27
27
|
delegate :can_transition_to?, :transition_to!, :transition_to, :current_state,
|
28
28
|
to: :state_machine
|
29
29
|
|
30
|
+
# エクスポートの処理を実行します。
|
30
31
|
def export!
|
31
32
|
transition_to!(:started)
|
32
33
|
tempfile = Tempfile.new(['user_export_file_', '.txt'])
|
@@ -43,6 +43,7 @@ class UserImportFile < ActiveRecord::Base
|
|
43
43
|
delegate :can_transition_to?, :transition_to!, :transition_to, :current_state,
|
44
44
|
to: :state_machine
|
45
45
|
|
46
|
+
# 利用者情報をTSVファイルを用いて作成します。
|
46
47
|
def import
|
47
48
|
transition_to!(:started)
|
48
49
|
num = { user_imported: 0, user_found: 0, failed: 0 }
|
@@ -79,14 +80,11 @@ class UserImportFile < ActiveRecord::Base
|
|
79
80
|
new_user.role = Role.find(2) # User
|
80
81
|
end
|
81
82
|
new_user.username = username
|
82
|
-
new_user.assign_attributes(set_user_params(
|
83
|
+
new_user.assign_attributes(set_user_params(row))
|
83
84
|
profile = Profile.new
|
84
85
|
profile.assign_attributes(set_profile_params(row))
|
85
86
|
|
86
87
|
if new_user.save
|
87
|
-
if profile.locked
|
88
|
-
new_user.lock_access!
|
89
|
-
end
|
90
88
|
new_user.profile = profile
|
91
89
|
if profile.save
|
92
90
|
num[:user_imported] += 1
|
@@ -115,6 +113,7 @@ class UserImportFile < ActiveRecord::Base
|
|
115
113
|
raise e
|
116
114
|
end
|
117
115
|
|
116
|
+
# 利用者情報をTSVファイルを用いて更新します。
|
118
117
|
def modify
|
119
118
|
transition_to!(:started)
|
120
119
|
num = { user_updated: 0, user_not_found: 0, failed: 0 }
|
@@ -136,7 +135,7 @@ class UserImportFile < ActiveRecord::Base
|
|
136
135
|
username = row['username']
|
137
136
|
new_user = User.where(username: username).first
|
138
137
|
if new_user.try(:profile)
|
139
|
-
new_user.assign_attributes(set_user_params(
|
138
|
+
new_user.assign_attributes(set_user_params(row))
|
140
139
|
new_user.profile.assign_attributes(set_profile_params(row))
|
141
140
|
Profile.transaction do
|
142
141
|
if new_user.save and new_user.profile.save
|
@@ -155,6 +154,7 @@ class UserImportFile < ActiveRecord::Base
|
|
155
154
|
rows.close
|
156
155
|
transition_to!(:completed)
|
157
156
|
Sunspot.commit
|
157
|
+
send_message
|
158
158
|
num
|
159
159
|
rescue => e
|
160
160
|
self.error_message = "line #{row_num}: #{e.message}"
|
@@ -163,6 +163,7 @@ class UserImportFile < ActiveRecord::Base
|
|
163
163
|
raise e
|
164
164
|
end
|
165
165
|
|
166
|
+
# 利用者情報をTSVファイルを用いて削除します。
|
166
167
|
def remove
|
167
168
|
transition_to!(:started)
|
168
169
|
row_num = 1
|
@@ -185,6 +186,7 @@ class UserImportFile < ActiveRecord::Base
|
|
185
186
|
end
|
186
187
|
end
|
187
188
|
transition_to!(:completed)
|
189
|
+
send_message
|
188
190
|
rescue => e
|
189
191
|
self.error_message = "line #{row_num}: #{e.message}"
|
190
192
|
save
|
@@ -201,6 +203,8 @@ class UserImportFile < ActiveRecord::Base
|
|
201
203
|
:pending
|
202
204
|
end
|
203
205
|
|
206
|
+
# インポート作業用のファイルを読み込みます。
|
207
|
+
# @param [File] tempfile 作業用のファイル
|
204
208
|
def open_import_file(tempfile)
|
205
209
|
file = CSV.open(tempfile.path, 'r:utf-8', col_sep: "\t")
|
206
210
|
header_columns = %w(
|
@@ -231,6 +235,7 @@ class UserImportFile < ActiveRecord::Base
|
|
231
235
|
rows
|
232
236
|
end
|
233
237
|
|
238
|
+
# 未処理のインポート作業用のファイルを一括で処理します。
|
234
239
|
def self.import
|
235
240
|
UserImportFile.not_imported.each do |file|
|
236
241
|
file.import_start
|
@@ -240,7 +245,9 @@ class UserImportFile < ActiveRecord::Base
|
|
240
245
|
end
|
241
246
|
|
242
247
|
private
|
243
|
-
|
248
|
+
# ユーザ情報のパラメータを設定します。
|
249
|
+
# @param [Hash] row 利用者情報のハッシュ
|
250
|
+
def set_user_params(row)
|
244
251
|
params = {}
|
245
252
|
params[:email] = row['email'] if row['email'].present?
|
246
253
|
|
@@ -249,9 +256,16 @@ class UserImportFile < ActiveRecord::Base
|
|
249
256
|
else
|
250
257
|
params[:password] = Devise.friendly_token[0..7]
|
251
258
|
end
|
259
|
+
|
260
|
+
if %w(t true).include?(row['locked'].to_s.downcase.strip)
|
261
|
+
params[:locked] = '1'
|
262
|
+
end
|
263
|
+
|
252
264
|
params
|
253
265
|
end
|
254
266
|
|
267
|
+
# 利用者情報のパラメータを設定します。
|
268
|
+
# @param [Hash] row 利用者情報のハッシュ
|
255
269
|
def set_profile_params(row)
|
256
270
|
params = {}
|
257
271
|
user_group = UserGroup.where(name: row['user_group']).first
|
@@ -280,10 +294,6 @@ class UserImportFile < ActiveRecord::Base
|
|
280
294
|
|
281
295
|
params[:note] = row['note'] if row['note']
|
282
296
|
|
283
|
-
if %w(t true).include?(row['locked'].to_s.downcase.strip)
|
284
|
-
params[:locked] = true
|
285
|
-
end
|
286
|
-
|
287
297
|
if I18n.available_locales.include?(row['locale'].to_s.to_sym)
|
288
298
|
params[:locale] = row['locale']
|
289
299
|
end
|
@@ -28,10 +28,11 @@
|
|
28
28
|
<li><%= link_to t('page.checkout_history'), checkouts_path -%></li>
|
29
29
|
<li><%= link_to t('page.listing', model: t('activerecord.models.reserve')), reserves_path -%></li>
|
30
30
|
<%- end -%>
|
31
|
+
<li><%= link_to t('page.catalog_search'), manifestations_path %></li>
|
31
32
|
</ul>
|
32
33
|
<% end %>
|
33
34
|
</li>
|
34
|
-
<%- if user_signed_in? -%>
|
35
|
+
<%- if user_signed_in? and (current_user.has_role?('Librarian') or defined?(EnjuBookmark)) -%>
|
35
36
|
<li>
|
36
37
|
<a href="#acquisition_menu"><%= t('page.acquisition') -%></a>
|
37
38
|
<ul>
|
@@ -40,27 +41,23 @@
|
|
40
41
|
<% if defined?(EnjuNdl) %>
|
41
42
|
<li><%= link_to t('enju_ndl.import_from_ndl_search'), ndl_books_path -%></li>
|
42
43
|
<% end %>
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
44
|
+
<% if defined?(EnjuNii) %>
|
45
|
+
<li><%= link_to t('enju_nii.import_from_cinii_books'), cinii_books_path -%></li>
|
46
|
+
<% end %>
|
47
|
+
<% if defined?(EnjuLoc) %>
|
48
|
+
<li><%= link_to t('enju_loc.import_from_loc_search'), loc_search_index_path -%></li>
|
49
|
+
<% end %>
|
49
50
|
<li><%= link_to t('page.add_resource_manually'), new_manifestation_path -%></li>
|
50
51
|
<li><%= link_to t('page.serial'), manifestations_path(serial: true) -%></li>
|
51
52
|
<li><%= link_to t('page.import_from_file'), new_resource_import_file_path -%></li>
|
52
53
|
<li><%= link_to t('activerecord.models.accept'), new_accept_path -%></li>
|
53
|
-
|
54
|
-
|
55
|
-
<% end %>
|
56
|
-
<% if defined?(EnjuBookmark) %>
|
57
|
-
<li><%= link_to t('page.listing', model: t('activerecord.models.bookmark')), bookmarks_path -%></li>
|
58
|
-
<% end %>
|
59
|
-
<%- else -%>
|
60
|
-
<% if defined?(EnjuBookmark) %>
|
61
|
-
<li><%= link_to t('page.listing', model: t('activerecord.models.bookmark')), bookmarks_path -%></li>
|
54
|
+
<% if defined?(EnjuIr) %>
|
55
|
+
<li><%= link_to t('activemodel.models.resource'), resources_path -%></li>
|
62
56
|
<% end %>
|
63
57
|
<%- end -%>
|
58
|
+
<% if defined?(EnjuBookmark) %>
|
59
|
+
<li><%= link_to t('page.listing', model: t('activerecord.models.bookmark')), bookmarks_path -%></li>
|
60
|
+
<% end %>
|
64
61
|
</ul>
|
65
62
|
</li>
|
66
63
|
<% end %>
|
@@ -103,41 +100,33 @@
|
|
103
100
|
</ul>
|
104
101
|
</li>
|
105
102
|
<% end %>
|
106
|
-
|
107
|
-
<
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
<%= t('page.configuration') -%>
|
112
|
-
<% end %>
|
113
|
-
</a>
|
114
|
-
<ul>
|
115
|
-
<%- if user_signed_in? -%>
|
116
|
-
<%- if current_user.has_role?('Librarian') -%>
|
117
|
-
<li><%= link_to t('user.management'), profiles_path -%></li>
|
118
|
-
<li><%= link_to t('page.agent_management'), agents_path -%></li>
|
119
|
-
<li><%= link_to t('page.import'), page_import_path -%></li>
|
120
|
-
<li><%= link_to t('page.export'), page_export_path -%></li>
|
121
|
-
<% if defined?(EnjuPurchaseRequest) %>
|
122
|
-
<li><%= link_to t('activerecord.models.order_list'), order_lists_path -%></li>
|
123
|
-
<% end %>
|
124
|
-
<li><%= link_to t('page.statistics'), page_statistics_path -%></li>
|
125
|
-
<% if defined?(EnjuSearchLog) %>
|
126
|
-
<li><%= link_to t('activerecord.models.search_history'), search_histories_path %></li>
|
127
|
-
<% end %>
|
128
|
-
<% if @library_group.settings[:erms_url] %>
|
129
|
-
<li><%= link_to t('page.electronic_resource_management'), @library_group.settings[:erms_url] -%></li>
|
130
|
-
<% end %>
|
131
|
-
<li><%= link_to t('page.configuration'), page_configuration_path -%></li>
|
103
|
+
<%- if current_user.try(:has_role?, 'Librarian') -%>
|
104
|
+
<li>
|
105
|
+
<a href="#configuration_menu">
|
106
|
+
<% if current_user.try(:has_role?, 'Librarian') %>
|
107
|
+
<%= t('page.management') -%>
|
132
108
|
<% else %>
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
<li><%= link_to t('page.
|
139
|
-
|
140
|
-
|
141
|
-
|
109
|
+
<%= t('page.configuration') -%>
|
110
|
+
<% end %>
|
111
|
+
</a>
|
112
|
+
<ul>
|
113
|
+
<li><%= link_to t('user.management'), profiles_path -%></li>
|
114
|
+
<li><%= link_to t('page.agent_management'), agents_path -%></li>
|
115
|
+
<li><%= link_to t('page.import'), page_import_path -%></li>
|
116
|
+
<li><%= link_to t('page.export'), page_export_path -%></li>
|
117
|
+
<% if defined?(EnjuPurchaseRequest) %>
|
118
|
+
<li><%= link_to t('activerecord.models.order_list'), order_lists_path -%></li>
|
119
|
+
<% end %>
|
120
|
+
<li><%= link_to t('page.statistics'), page_statistics_path -%></li>
|
121
|
+
<% if defined?(EnjuSearchLog) %>
|
122
|
+
<li><%= link_to t('activerecord.models.search_history'), search_histories_path %></li>
|
123
|
+
<% end %>
|
124
|
+
<% if @library_group.settings[:erms_url] %>
|
125
|
+
<li><%= link_to t('page.electronic_resource_management'), @library_group.settings[:erms_url] -%></li>
|
126
|
+
<% end %>
|
127
|
+
<li><%= link_to t('page.configuration'), page_configuration_path -%></li>
|
128
|
+
</ul>
|
129
|
+
</li>
|
130
|
+
<% end %>
|
142
131
|
</ul>
|
143
132
|
</div>
|
@@ -10,6 +10,7 @@
|
|
10
10
|
<% @libraries.sort_by{|l| l.position }.each do |library| %>
|
11
11
|
<label><%= check_box_tag "library_adv[]", library.name %><%= library.display_name.localize %></label>
|
12
12
|
<% end %>
|
13
|
+
<div class="check_all"><%= check_all_button "library_adv_", t('advanced_search.check_all') %></div>
|
13
14
|
</td>
|
14
15
|
</tr>
|
15
16
|
<tr>
|
@@ -50,15 +51,25 @@
|
|
50
51
|
<td><label><%= t('activerecord.attributes.item.item_identifier') -%>:</label></td>
|
51
52
|
<td><%= text_field_tag 'item_identifier' -%></td>
|
52
53
|
</tr>
|
54
|
+
<% if defined?(EnjuSubject) %>
|
55
|
+
<tr>
|
56
|
+
<td><label><%= t('activerecord.models.classification') %>:</label></td>
|
57
|
+
<td>
|
58
|
+
<%- types = ClassificationType.all.select{|t| ! t.classifications.empty? } -%>
|
59
|
+
<%= select_tag 'classification_type', options_from_collection_for_select( types, :id, Proc.new{|e| e.display_name.localize } ) -%>
|
60
|
+
<%= text_field_tag 'classification' -%>
|
61
|
+
</td>
|
62
|
+
</tr>
|
63
|
+
<% end %>
|
53
64
|
<tr>
|
54
65
|
<td><label><%= t('activerecord.attributes.manifestation.date_of_publication') -%>:</label></td>
|
55
|
-
<td><%= t('advanced_search.from') -%> <%= text_field_tag 'pub_date_from', nil, class: '
|
56
|
-
<%= t('advanced_search.to') -%> <%= text_field_tag '
|
66
|
+
<td><%= t('advanced_search.from') -%> <%= text_field_tag 'pub_date_from', nil, class: 'wide_date_text_field', placeholder: "#{t('page.example')}: 1978, 1978-04-12" -%>
|
67
|
+
<%= t('advanced_search.to') -%> <%= text_field_tag 'pub_date_until', nil, class: 'wide_date_text_field', placeholder: "#{t('page.example')}: 2011, 2011-04-12"-%></td>
|
57
68
|
</tr>
|
58
69
|
<tr>
|
59
70
|
<td><label><%= t('activerecord.attributes.item.acquired_at') -%>:</label></td>
|
60
71
|
<td><%= t('advanced_search.from') -%> <%= text_field_tag 'acquired_from', nil, class: 'wide_date_text_field', placeholder: "#{t('page.example')}: 2005, 2005-04-01" -%>
|
61
|
-
<%= t('advanced_search.to') -%> <%= text_field_tag '
|
72
|
+
<%= t('advanced_search.to') -%> <%= text_field_tag 'acquired_until', nil, class: 'wide_date_text_field', placeholder: "#{t('page.example')}: 2011, 2011-03-31"-%></td>
|
62
73
|
</tr>
|
63
74
|
<tr>
|
64
75
|
<td><label><%= t('page.number_of_pages') -%>:</label></td>
|
@@ -51,6 +51,9 @@
|
|
51
51
|
<ul>
|
52
52
|
<li><%= link_to t('item.all_item'), items_path %></li>
|
53
53
|
<li><%= link_to t('activerecord.models.resource_import_file'), resource_import_files_path -%></li>
|
54
|
+
<% if respond_to? :new_withdraw_path %>
|
55
|
+
<li><%= link_to t('activerecord.models.withdraw'), new_withdraw_path -%></li>
|
56
|
+
<% end %>
|
54
57
|
</ul>
|
55
58
|
</li>
|
56
59
|
<li><%= link_to t('activerecord.models.identifier_type'), identifier_types_path -%>
|
@@ -5,33 +5,27 @@
|
|
5
5
|
<tr>
|
6
6
|
<th><%= t('page.model') -%></th>
|
7
7
|
<th><%= t('page.number_of_record') -%></th>
|
8
|
-
<th><%= t('page.note') -%></th>
|
9
8
|
</tr>
|
10
9
|
<tr>
|
11
10
|
<td><%= link_to t('activerecord.models.agent'), agents_path -%></td>
|
12
11
|
<td><%= Agent.count -%></td>
|
13
|
-
<td></td>
|
14
12
|
</tr>
|
15
13
|
<tr>
|
16
14
|
<td><%= link_to t('activerecord.models.profile'), profiles_path -%></td>
|
17
15
|
<td><%= Profile.count -%></td>
|
18
|
-
<td></td>
|
19
16
|
</tr>
|
20
17
|
<tr>
|
21
18
|
<td><%= link_to t('activerecord.models.manifestation'), manifestations_path -%></td>
|
22
19
|
<td><%= Manifestation.count -%></td>
|
23
|
-
<td></td>
|
24
20
|
</tr>
|
25
21
|
<tr>
|
26
22
|
<td><%= link_to t('activerecord.models.item'), items_path -%></td>
|
27
23
|
<td><%= Item.count -%></td>
|
28
|
-
<td></td>
|
29
24
|
</tr>
|
30
25
|
<% if defined?(EnjuSearchLog) %>
|
31
26
|
<tr>
|
32
27
|
<td><%= link_to t('activerecord.models.search_history'), search_histories_path -%></td>
|
33
28
|
<td><%= SearchHistory.count -%></td>
|
34
|
-
<td></td>
|
35
29
|
</tr>
|
36
30
|
<% end %>
|
37
31
|
<% if defined?(EnjuBookmark) %>
|
@@ -41,19 +35,16 @@
|
|
41
35
|
<%= Bookmark.count -%>
|
42
36
|
(<%= link_to t('activerecord.attributes.bookmark_stat_has_manifestation.bookmarks_count'), bookmark_stats_path -%>)
|
43
37
|
</td>
|
44
|
-
<td></td>
|
45
38
|
</tr>
|
46
39
|
<tr>
|
47
40
|
<td><%= link_to t('activerecord.models.tag'), tags_path -%></td>
|
48
41
|
<td><%= Tag.count -%></td>
|
49
|
-
<td></td>
|
50
42
|
</tr>
|
51
43
|
<% end %>
|
52
44
|
<% if defined?(EnjuSubject) %>
|
53
45
|
<tr>
|
54
46
|
<td><%= link_to t('activerecord.models.subject'), subjects_path -%></td>
|
55
47
|
<td><%= Subject.count -%></td>
|
56
|
-
<td></td>
|
57
48
|
</tr>
|
58
49
|
<% end %>
|
59
50
|
<% if defined?(EnjuCirculation) %>
|
@@ -64,7 +55,6 @@
|
|
64
55
|
(<%= link_to t('activerecord.attributes.checkout_stat_has_user.checkouts_count'), user_checkout_stats_path -%>)
|
65
56
|
(<%= link_to t('activerecord.attributes.checkout_stat_has_manifestation.checkouts_count'), manifestation_checkout_stats_path -%>)
|
66
57
|
</td>
|
67
|
-
<td></td>
|
68
58
|
</tr>
|
69
59
|
<tr>
|
70
60
|
<td><%= link_to t('activerecord.models.reserve'), reserves_path -%></td>
|
@@ -73,26 +63,22 @@
|
|
73
63
|
(<%= link_to t('activerecord.attributes.reserve_stat_has_user.reserves_count'), user_reserve_stats_path -%>)
|
74
64
|
(<%= link_to t('activerecord.attributes.reserve_stat_has_manifestation.reserves_count'), manifestation_reserve_stats_path -%>)
|
75
65
|
</td>
|
76
|
-
<td></td>
|
77
66
|
</tr>
|
78
67
|
<% end %>
|
79
68
|
<% if defined?(EnjuPurchaseRequest) %>
|
80
69
|
<tr>
|
81
70
|
<td><%= link_to t('activerecord.models.purchase_request'), purchase_requests_path -%></td>
|
82
71
|
<td><%= PurchaseRequest.count -%></td>
|
83
|
-
<td></td>
|
84
72
|
</tr>
|
85
73
|
<% end %>
|
86
74
|
<% if defined?(EnjuQuestion) %>
|
87
75
|
<tr>
|
88
76
|
<td><%= link_to t('activerecord.models.question'), questions_path -%></td>
|
89
77
|
<td><%= Question.count -%></td>
|
90
|
-
<td></td>
|
91
78
|
</tr>
|
92
79
|
<tr>
|
93
80
|
<td><%= link_to t('activerecord.models.answer'), answers_path -%></td>
|
94
81
|
<td><%= Answer.count -%></td>
|
95
|
-
<td></td>
|
96
82
|
</tr>
|
97
83
|
<% end %>
|
98
84
|
</table>
|
@@ -3,14 +3,26 @@
|
|
3
3
|
<div id="content_list">
|
4
4
|
|
5
5
|
<ul>
|
6
|
+
<li>Ruby: <%= RUBY_DESCRIPTION %></li>
|
6
7
|
<li>Environment: <%= Rails.env %></li>
|
7
8
|
<li>Gems:
|
8
9
|
<ul>
|
9
|
-
<% @specs.each do |spec| %>
|
10
|
+
<% @specs.sort_by{|e| e.name }.each do |spec| %>
|
10
11
|
<li><%= spec.name %>: <%= spec.version.to_s %></li>
|
11
12
|
<% end %>
|
12
13
|
</ul>
|
13
14
|
</li>
|
15
|
+
<li>Languages:
|
16
|
+
<ul>
|
17
|
+
<% @available_languages.each do |language| %>
|
18
|
+
<li><%= language.iso_639_1 %>: <%= language.native_name || language.name %>
|
19
|
+
<% if language.iso_639_1 == I18n.locale.to_s %>
|
20
|
+
(<%= t('page.default_locale') %>)
|
21
|
+
<% end %>
|
22
|
+
</li>
|
23
|
+
<% end %>
|
24
|
+
</ul>
|
25
|
+
</li>
|
14
26
|
</ul>
|
15
27
|
|
16
28
|
</div>
|
@@ -7,8 +7,8 @@
|
|
7
7
|
<%= f.hidden_field :checkout_icalendar_token -%>
|
8
8
|
<%- end -%>
|
9
9
|
<br />
|
10
|
-
<input onclick="$.ajax({data:'authenticity_token=' + encodeURIComponent('<%= form_authenticity_token %>'), success:function(request){$('#feed_token').html(request);}, type:'get', url:'<%=
|
11
|
-
<input onclick="$.ajax({data:'authenticity_token=' + encodeURIComponent('<%= form_authenticity_token %>'), success:function(request){$('#feed_token').html(request);}, type:'get', url:'<%=
|
10
|
+
<input onclick="$.ajax({data:'authenticity_token=' + encodeURIComponent('<%= form_authenticity_token %>'), success:function(request){$('#feed_token').html(request);}, type:'get', url:'<%= edit_profile_path(profile, mode: 'feed_token') %>'});" type="button" value="<%= t('page.reset') %>" />
|
11
|
+
<input onclick="$.ajax({data:'authenticity_token=' + encodeURIComponent('<%= form_authenticity_token %>'), success:function(request){$('#feed_token').html(request);}, type:'get', url:'<%= edit_profile_path(profile, disable: true, mode: 'feed_token') %>'});" type="button" value="<%= t('page.delete') %>" />
|
12
12
|
</div>
|
13
13
|
<br />
|
14
14
|
</div>
|