enju_leaf 1.1.0.rc18 → 1.1.0.rc19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/app/controllers/my_accounts_controller.rb +1 -1
- data/app/controllers/page_controller.rb +5 -5
- data/app/controllers/profiles_controller.rb +0 -1
- data/app/controllers/user_import_files_controller.rb +2 -1
- data/app/models/identity.rb +9 -0
- data/app/models/profile.rb +2 -0
- data/app/models/user_import_file.rb +0 -1
- data/app/views/devise/registrations/edit.html.erb +8 -14
- data/app/views/my_accounts/_edit_credential.html.erb +6 -21
- data/app/views/my_accounts/_edit_credential.html.slim +63 -0
- data/app/views/my_accounts/edit.html.erb +1 -0
- data/app/views/my_accounts/show.html.erb +2 -1
- data/app/views/my_accounts/show.html.slim +59 -0
- data/app/views/page/500_nosolr.html.erb +66 -0
- data/app/views/page/{_msie_acceralator.html.erb → _msie_accelerator.html.erb} +0 -0
- data/app/views/page/add_on.html.slim +7 -0
- data/app/views/page/{msie_acceralator.builder → msie_accelerator.builder} +0 -0
- data/app/views/profiles/_edit_credential.html.slim +67 -0
- data/app/views/profiles/_edit_profile.html.slim +40 -0
- data/app/views/profiles/new.html.erb +0 -5
- data/app/views/roles/index.html.erb +6 -2
- data/app/views/roles/show.html.erb +3 -1
- data/app/views/user_groups/index.html.erb +3 -1
- data/app/views/user_groups/show.html.erb +6 -2
- data/app/views/user_import_files/index.html.slim +52 -0
- data/app/views/user_import_files/new.html.slim +64 -0
- data/config/locales/devise.ja.yml +1 -1
- data/config/locales/translation_en.yml +11 -9
- data/config/locales/translation_ja.yml +2 -0
- data/config/routes.rb +6 -1
- data/db/migrate/20140110122216_create_user_import_files.rb +1 -1
- data/db/migrate/20150421023923_create_identities.rb +15 -0
- data/lib/enju_leaf/controller.rb +1 -1
- data/lib/enju_leaf/user.rb +8 -8
- data/lib/enju_leaf/version.rb +1 -1
- data/lib/enju_leaf.rb +13 -2
- data/lib/generators/enju_leaf/quick_install/quick_install_generator.rb +12 -8
- data/lib/generators/enju_leaf/setup/setup_generator.rb +14 -14
- data/lib/generators/enju_leaf/setup/templates/config/initializers/resque.rb +3 -0
- data/lib/generators/enju_leaf/setup/templates/db/seeds.rb +2 -7
- data/lib/generators/enju_leaf/setup/templates/solr/conf/schema.xml +32 -12
- data/lib/generators/enju_leaf/setup/templates/solr/conf/solrconfig.xml +599 -853
- data/spec/controllers/my_accounts_controller_spec.rb +6 -6
- data/spec/controllers/page_controller_spec.rb +2 -2
- data/spec/dummy/db/schema.rb +14 -1
- data/spec/factories/user.rb +0 -3
- data/spec/fixtures/library_groups.yml +1 -0
- data/spec/models/user_import_file_spec.rb +1 -1
- data/spec/models/user_spec.rb +0 -17
- metadata +27 -25
- data/lib/generators/enju_leaf/setup/templates/config/resque.yml +0 -3
- data/lib/generators/enju_leaf/setup/templates/solr/conf/admin-extra.html +0 -31
- data/lib/generators/enju_leaf/setup/templates/solr/conf/elevate.xml +0 -36
- data/lib/generators/enju_leaf/setup/templates/solr/conf/mapping-ISOLatin1Accent.txt +0 -246
- data/lib/generators/enju_leaf/setup/templates/solr/conf/protwords.txt +0 -21
- data/lib/generators/enju_leaf/setup/templates/solr/conf/scripts.conf +0 -24
- data/lib/generators/enju_leaf/setup/templates/solr/conf/spellings.txt +0 -2
- data/lib/generators/enju_leaf/setup/templates/solr/conf/stopwords.txt +0 -58
- data/lib/generators/enju_leaf/setup/templates/solr/conf/synonyms.txt +0 -31
@@ -0,0 +1,64 @@
|
|
1
|
+
.row
|
2
|
+
#submenu.col-md-3
|
3
|
+
.panel.panel-default
|
4
|
+
.panel-heading
|
5
|
+
h2.panel-title
|
6
|
+
= t('activerecord.models.user_import_file')
|
7
|
+
ul.list-group
|
8
|
+
li.list-group-item
|
9
|
+
= back_to_index(flash[:page_info])
|
10
|
+
#content_list.col-md-9
|
11
|
+
.panel.panel-default
|
12
|
+
.panel-heading
|
13
|
+
h1.panel-title
|
14
|
+
= t('page.new', model: t('activerecord.models.user_import_file'))
|
15
|
+
.panel-body
|
16
|
+
= form_for(@user_import_file, html: { multipart: true }) do |f|
|
17
|
+
= f.error_messages
|
18
|
+
.form-group
|
19
|
+
= f.label t('page.file')
|
20
|
+
br
|
21
|
+
= f.file_field :user_import
|
22
|
+
.form-group
|
23
|
+
= f.label :edit_mode
|
24
|
+
br
|
25
|
+
.radio-inline
|
26
|
+
= f.radio_button :edit_mode, 'create', checked: 'checked'
|
27
|
+
= f.label :edit_mode, t('page.create'), value: 'create'
|
28
|
+
.radio-inline
|
29
|
+
= f.radio_button :edit_mode, 'update'
|
30
|
+
= f.label :edit_mode, t('page.update'), value: 'update'
|
31
|
+
.radio-inline
|
32
|
+
= f.radio_button :edit_mode, 'update_relationship'
|
33
|
+
= f.label :edit_mode, t('resource_import_file.update_relationship'), value: 'update_relationship'
|
34
|
+
.radio-inline
|
35
|
+
= f.radio_button :edit_mode, 'destroy'
|
36
|
+
= f.label :edit_mode, t('page.destroy'), value: 'destroy'
|
37
|
+
.form-group
|
38
|
+
= f.label :user_encoding
|
39
|
+
br
|
40
|
+
.radio-inline
|
41
|
+
= f.radio_button :user_encoding, 'auto_detect', checked: 'checked'
|
42
|
+
= f.label :user_encoding, t('import.auto_detect'), value: 'auto_detect'
|
43
|
+
.radio-inline
|
44
|
+
= f.radio_button :user_encoding, 'utf-8'
|
45
|
+
= f.label :user_encoding, 'UTF-8', value: 'utf-8'
|
46
|
+
.radio-inline
|
47
|
+
= f.radio_button :user_encoding, 'shift_jis'
|
48
|
+
= f.label :user_encoding, 'Shift_JIS', value: 'shift_jis'
|
49
|
+
.radio-inline
|
50
|
+
= f.radio_button :user_encoding, 'euc-jp'
|
51
|
+
= f.label :user_encoding, 'EUC-JP', value: 'euc-jp'
|
52
|
+
.form-group
|
53
|
+
= f.label :default_user_group_id
|
54
|
+
= f.select(:default_user_group_id, @user_groups.collect{|u| [u.display_name.localize, u.id]}, {}, {class: 'form-control'})
|
55
|
+
br
|
56
|
+
= t('user_import_file.default_user_group')
|
57
|
+
.form-group
|
58
|
+
= f.label :default_library_id
|
59
|
+
= f.select(:default_library_id, @libraries.collect{|l| [l.display_name.localize, l.id]}, {}, {class: 'form-control'})
|
60
|
+
br
|
61
|
+
= t('user_import_file.default_library')
|
62
|
+
.form-group
|
63
|
+
= f.hidden_field :mode, value: 'import'
|
64
|
+
= f.submit t('page.start_import'), class: 'btn btn-default'
|
@@ -37,7 +37,7 @@ ja:
|
|
37
37
|
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
|
38
38
|
signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
|
39
39
|
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
|
40
|
-
updated: "
|
40
|
+
updated: "アカウントは正常に更新されました。"
|
41
41
|
sessions:
|
42
42
|
signed_in: "ログインしました。"
|
43
43
|
signed_out: "ログアウトしました。"
|
@@ -185,7 +185,7 @@ en:
|
|
185
185
|
sort_by: "Sort by"
|
186
186
|
bookmarklet: "Bookmarklet"
|
187
187
|
add_file: "Add a file"
|
188
|
-
telephone_number: "
|
188
|
+
telephone_number: "Telephone number"
|
189
189
|
about_this_system: "About this system"
|
190
190
|
report_bugs: "Report bugs"
|
191
191
|
new_resource: "New resources"
|
@@ -239,9 +239,9 @@ en:
|
|
239
239
|
local_record: "Local record"
|
240
240
|
search_catalog_at: "Search catalog at %{library_name}"
|
241
241
|
add_on: "Add-ons"
|
242
|
-
asc: "
|
243
|
-
desc: "
|
244
|
-
|
242
|
+
asc: "ascendant"
|
243
|
+
desc: "descendant"
|
244
|
+
error_occurred: "An error occurred."
|
245
245
|
did_you_mean: "Did you mean"
|
246
246
|
calendar: "Calendar"
|
247
247
|
related: "Related"
|
@@ -286,6 +286,8 @@ en:
|
|
286
286
|
cannot_parse_yaml_header: "has an invalid YAML header. You must add a space after the header's colon."
|
287
287
|
notice: Notice
|
288
288
|
system_information: System information
|
289
|
+
nosolr_error: 'There is an error on connecting to the search server.'
|
290
|
+
nosolr_error_description: 'This error may be caused by a delay when the sever is still waiting for launching the search server. In that case, please wait for a while, and go back to this page later.'
|
289
291
|
title:
|
290
292
|
index: "index"
|
291
293
|
show: "show"
|
@@ -315,11 +317,11 @@ en:
|
|
315
317
|
from_file: "from file"
|
316
318
|
from_isbn: "from ISBN"
|
317
319
|
will_be_imported:
|
318
|
-
one: "Resource will be
|
319
|
-
other: "Resource will be
|
320
|
+
one: "Resource will be imported in a %{minute} minute."
|
321
|
+
other: "Resource will be imported in %{minute} minutes."
|
320
322
|
auto_detect: "Auto detect"
|
321
323
|
successfully_created: "%{model} was created successfully. When the task is completed, its status on the list will be updated to 'completed'."
|
322
|
-
following_column_were_ignored: "The
|
324
|
+
following_column_were_ignored: "The following column(s) were ignored: %{column}"
|
323
325
|
dummy: This row is treated as a dummy input.
|
324
326
|
export:
|
325
327
|
export_completed: Export completed.
|
@@ -347,7 +349,7 @@ en:
|
|
347
349
|
set_auto_generated_password: "Set auto-generated password"
|
348
350
|
history: "History"
|
349
351
|
account_management: "Account management"
|
350
|
-
checkout_history_icalendar_url: "checkout
|
352
|
+
checkout_history_icalendar_url: "checkout history iCalendar URL"
|
351
353
|
reset_checkout_icalendar_url: "Reset checkout iCalendar URL"
|
352
354
|
you_have_to_save_profile_to_activate_feed_url: "You have to save your profile to activate this url."
|
353
355
|
you_have_to_save_profile_to_deactivate_feed_url: "You have to save your profile to deactivate this url."
|
@@ -373,7 +375,7 @@ en:
|
|
373
375
|
you_should_specify_work: "You should specify a work in the series statement."
|
374
376
|
state:
|
375
377
|
pending: "Pending"
|
376
|
-
canceled: "
|
378
|
+
canceled: "Canceled"
|
377
379
|
completed: "Completed"
|
378
380
|
started: "Started"
|
379
381
|
failed: "Failed"
|
@@ -271,6 +271,8 @@ ja:
|
|
271
271
|
cannot_parse_yaml_header: "のYAMLヘッダを読み込めません。ヘッダのコロンの後には、半角スペースを含める必要があります。"
|
272
272
|
notice: 注意
|
273
273
|
system_information: システムの基本的な情報の表示
|
274
|
+
nosolr_error: '検索サーバに不具合があるようです'
|
275
|
+
nosolr_error_description: '検索サーバーの起動に時間がかかっている場合もこのエラーとなります。少し時間を置いてアクセスするとエラーが解消される場合もありますのでお試しください。'
|
274
276
|
title:
|
275
277
|
index: "一覧"
|
276
278
|
show: "表示"
|
data/config/routes.rb
CHANGED
@@ -25,6 +25,11 @@ Rails.application.routes.draw do
|
|
25
25
|
resources :accepts, :except => [:edit, :update]
|
26
26
|
end
|
27
27
|
|
28
|
+
as :user do
|
29
|
+
get 'users/edit' => 'devise/registrations#edit', as: 'edit_user_registration'
|
30
|
+
put 'users' => 'devise/registrations#update', as: 'user_registration'
|
31
|
+
end
|
32
|
+
|
28
33
|
root :to => "page#index"
|
29
34
|
|
30
35
|
get '/page/about' => 'page#about'
|
@@ -33,7 +38,7 @@ Rails.application.routes.draw do
|
|
33
38
|
get '/page/add_on' => 'page#add_on'
|
34
39
|
get '/page/export' => 'page#export'
|
35
40
|
get '/page/import' => 'page#import'
|
36
|
-
get '/page/
|
41
|
+
get '/page/msie_accelerator' => 'page#msie_accelerator'
|
37
42
|
get '/page/opensearch' => 'page#opensearch'
|
38
43
|
get '/page/statistics' => 'page#statistics'
|
39
44
|
get '/page/system_information' => 'page#system_information'
|
@@ -6,7 +6,7 @@ class CreateUserImportFiles < ActiveRecord::Migration
|
|
6
6
|
t.datetime :executed_at
|
7
7
|
t.string :user_import_file_name
|
8
8
|
t.string :user_import_content_type
|
9
|
-
t.
|
9
|
+
t.integer :user_import_file_size
|
10
10
|
t.datetime :user_import_updated_at
|
11
11
|
t.string :user_import_fingerprint
|
12
12
|
t.string :edit_mode
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreateIdentities < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :identities do |t|
|
4
|
+
t.string :name
|
5
|
+
t.string :email
|
6
|
+
t.string :password_digest
|
7
|
+
t.integer :profile_id
|
8
|
+
|
9
|
+
t.timestamps null: false
|
10
|
+
end
|
11
|
+
add_index :identities, :name
|
12
|
+
add_index :identities, :email
|
13
|
+
add_index :identities, :profile_id
|
14
|
+
end
|
15
|
+
end
|
data/lib/enju_leaf/controller.rb
CHANGED
@@ -10,7 +10,7 @@ module EnjuLeaf
|
|
10
10
|
def set_error_template
|
11
11
|
rescue_from CanCan::AccessDenied, with: :render_403
|
12
12
|
#rescue_from ActiveRecord::RecordNotFound, with: :render_404
|
13
|
-
rescue_from Errno::ECONNREFUSED, with: :
|
13
|
+
rescue_from Errno::ECONNREFUSED, with: :render_500_nosolr
|
14
14
|
#rescue_from ActionView::MissingTemplate, with: :render_404_invalid_format
|
15
15
|
end
|
16
16
|
end
|
data/lib/enju_leaf/user.rb
CHANGED
@@ -49,8 +49,8 @@ module EnjuLeaf
|
|
49
49
|
within: Devise::password_length
|
50
50
|
end
|
51
51
|
|
52
|
-
validates_presence_of :email, :email_confirmation, on: :create, if: proc{|user| !user.operator.try(:has_role?, 'Librarian')}
|
53
|
-
validates_confirmation_of :email, on: :create #, if: proc{|user| !user.operator.try(:has_role?, 'Librarian')}
|
52
|
+
#validates_presence_of :email, :email_confirmation, on: :create, if: proc{|user| !user.operator.try(:has_role?, 'Librarian')}
|
53
|
+
#validates_confirmation_of :email, on: :create #, if: proc{|user| !user.operator.try(:has_role?, 'Librarian')}
|
54
54
|
|
55
55
|
before_validation :set_lock_information
|
56
56
|
before_destroy :check_role_before_destroy
|
@@ -63,7 +63,7 @@ module EnjuLeaf
|
|
63
63
|
normalize_attributes :username
|
64
64
|
normalize_attributes :email, with: :strip
|
65
65
|
|
66
|
-
attr_accessor :
|
66
|
+
attr_accessor :password_not_verified,
|
67
67
|
:update_own_account, :auto_generated_password,
|
68
68
|
:locked, :current_password #, :agent_id
|
69
69
|
|
@@ -136,7 +136,9 @@ module EnjuLeaf
|
|
136
136
|
|
137
137
|
module InstanceMethods
|
138
138
|
def password_required?
|
139
|
-
|
139
|
+
if Devise.mappings[:user].modules.include?(:database_authenticatable)
|
140
|
+
!persisted? || !password.nil? || !password_confirmation.nil?
|
141
|
+
end
|
140
142
|
end
|
141
143
|
|
142
144
|
def has_role?(role_in_question)
|
@@ -161,7 +163,7 @@ module EnjuLeaf
|
|
161
163
|
end
|
162
164
|
|
163
165
|
def set_confirmation
|
164
|
-
if
|
166
|
+
if respond_to?(:confirm!)
|
165
167
|
reload
|
166
168
|
confirm!
|
167
169
|
end
|
@@ -206,9 +208,7 @@ module EnjuLeaf
|
|
206
208
|
end
|
207
209
|
|
208
210
|
def send_confirmation_instructions
|
209
|
-
|
210
|
-
Devise::Mailer.confirmation_instructions(self).deliver if self.email.present?
|
211
|
-
end
|
211
|
+
Devise::Mailer.confirmation_instructions(self).deliver if self.email.present?
|
212
212
|
end
|
213
213
|
|
214
214
|
def deletable_by?(current_user)
|
data/lib/enju_leaf/version.rb
CHANGED
data/lib/enju_leaf.rb
CHANGED
@@ -67,9 +67,7 @@ module EnjuLeaf
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def render_500
|
70
|
-
Rails.logger.fatal("please confirm that the Solr is running.")
|
71
70
|
return if performed?
|
72
|
-
#flash[:notice] = t('page.connection_failed')
|
73
71
|
respond_to do |format|
|
74
72
|
format.html {render file: "#{Rails.root}/public/500", layout: false, status: 500}
|
75
73
|
format.mobile {render file: "#{Rails.root}/public/500", layout: false, status: 500}
|
@@ -79,6 +77,19 @@ module EnjuLeaf
|
|
79
77
|
end
|
80
78
|
end
|
81
79
|
|
80
|
+
def render_500_nosolr
|
81
|
+
Rails.logger.fatal("please confirm that the Solr is running.")
|
82
|
+
return if performed?
|
83
|
+
#flash[:notice] = t('page.connection_failed')
|
84
|
+
respond_to do |format|
|
85
|
+
format.html {render template: "page/500_nosolr", layout: false, status: 500}
|
86
|
+
format.mobile {render template: "page/500_nosolr", layout: false, status: 500}
|
87
|
+
format.xml {render template: 'page/500', status: 500}
|
88
|
+
format.json { render text: '{"error": "server_error"}' }
|
89
|
+
format.xml {render template: 'page/500.xml', status: 500}
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
82
93
|
def set_locale
|
83
94
|
if params[:locale]
|
84
95
|
unless I18n.available_locales.include?(params[:locale].to_s.intern)
|
@@ -3,10 +3,12 @@ class EnjuLeaf::QuickInstallGenerator < Rails::Generators::Base
|
|
3
3
|
|
4
4
|
def quick_install
|
5
5
|
environment = ENV['RAILS_ENV'] || 'development'
|
6
|
+
gsub_file 'config/schedule.rb', /^set :environment, :development$/,
|
7
|
+
"set :environment, :#{environment}"
|
6
8
|
rake("enju_leaf_engine:install:migrations")
|
7
9
|
rake("enju_biblio_engine:install:migrations")
|
8
10
|
rake("enju_library_engine:install:migrations")
|
9
|
-
if !ENV['
|
11
|
+
if !ENV['ENJU_SKIP_CONFIG']
|
10
12
|
generate("enju_biblio:setup")
|
11
13
|
generate("enju_library:setup")
|
12
14
|
generate("enju_circulation:setup")
|
@@ -18,13 +20,15 @@ class EnjuLeaf::QuickInstallGenerator < Rails::Generators::Base
|
|
18
20
|
rake("enju_subject:setup", env: environment)
|
19
21
|
rake("assets:precompile", env: environment) if environment == 'production'
|
20
22
|
rake("db:seed", env: environment)
|
21
|
-
if ENV['
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
if !ENV['ENJU_SKIP_SOLR']
|
24
|
+
if ENV['OS'] == 'Windows_NT'
|
25
|
+
rake("sunspot:solr:run", env: environment)
|
26
|
+
else
|
27
|
+
rake("sunspot:solr:start", env: environment)
|
28
|
+
sleep 5
|
29
|
+
rake("environment sunspot:reindex", env: environment)
|
30
|
+
rake("sunspot:solr:stop", env: environment)
|
31
|
+
end
|
28
32
|
end
|
29
33
|
end
|
30
34
|
end
|
@@ -4,9 +4,10 @@ class EnjuLeaf::SetupGenerator < Rails::Generators::Base
|
|
4
4
|
|
5
5
|
def copy_setup_files
|
6
6
|
directory("db/fixtures", "db/fixtures/enju_leaf")
|
7
|
+
directory("solr", "example/solr")
|
7
8
|
copy_file("Procfile", "Procfile")
|
8
|
-
copy_file("config/resque.yml", "config/resque.yml")
|
9
9
|
copy_file("config/schedule.rb", "config/schedule.rb")
|
10
|
+
copy_file("config/initializers/resque.rb", "config/initializers/resque.rb")
|
10
11
|
inject_into_file 'config/application.rb', after: /# config.i18n.default_locale = :de$\n/ do
|
11
12
|
<<"EOS"
|
12
13
|
config.i18n.available_locales = [:en, :ja]
|
@@ -32,6 +33,12 @@ EOS
|
|
32
33
|
end
|
33
34
|
generate("devise:install")
|
34
35
|
generate("devise", "User")
|
36
|
+
gsub_file 'app/models/user.rb', /, :registerable,$/, ', #:registerable,'
|
37
|
+
gsub_file 'app/models/user.rb', /, :trackable, :validatable$/, <<EOS
|
38
|
+
, :trackable, #:validatable,
|
39
|
+
:lockable, :lock_strategy => :none, :unlock_strategy => :none
|
40
|
+
enju_leaf_user_model
|
41
|
+
EOS
|
35
42
|
generate("sunspot_rails:install")
|
36
43
|
generate("kaminari:config")
|
37
44
|
generate("simple_form:install")
|
@@ -48,19 +55,13 @@ EOS
|
|
48
55
|
/\/\/= require turbolinks$/,
|
49
56
|
""
|
50
57
|
end
|
51
|
-
gsub_file 'config/routes.rb', /devise_for :users$/, "devise_for :users,
|
58
|
+
gsub_file 'config/routes.rb', /devise_for :users$/, "devise_for :users, skip: [:registration]"
|
52
59
|
gsub_file 'config/initializers/devise.rb', '# config.email_regexp = /\A[^@]+@[^@]+\z/', 'config.email_regexp = /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\Z/i'
|
53
|
-
gsub_file 'config/initializers/devise.rb', '# config.authentication_keys = [
|
60
|
+
gsub_file 'config/initializers/devise.rb', '# config.authentication_keys = [:email]', 'config.authentication_keys = [:username]'
|
54
61
|
gsub_file 'config/initializers/devise.rb', '# config.secret_key', 'config.secret_key'
|
55
62
|
gsub_file 'config/initializers/devise.rb',
|
56
63
|
"# config.navigational_formats = ['*/*', :html]",
|
57
64
|
"config.navigational_formats = ['*/*', :html, :mobile]"
|
58
|
-
gsub_file 'app/models/user.rb', /, :registerable,$/, ', #:registerable,'
|
59
|
-
gsub_file 'app/models/user.rb', /, :trackable, :validatable$/, <<EOS
|
60
|
-
, :trackable, #:validatable,
|
61
|
-
:lockable, :lock_strategy => :none, :unlock_strategy => :none
|
62
|
-
enju_leaf_user_model
|
63
|
-
EOS
|
64
65
|
|
65
66
|
inject_into_class "app/controllers/application_controller.rb", ApplicationController do
|
66
67
|
<<"EOS"
|
@@ -70,12 +71,13 @@ EOS
|
|
70
71
|
|
71
72
|
mobylette_config do |config|
|
72
73
|
config[:skip_xhr_requests] = false
|
73
|
-
config[:skip_user_agents] = ENV['ENJU_SKIP_MOBILE_AGENTS'].to_s.split.map{|
|
74
|
+
config[:skip_user_agents] = ENV['ENJU_SKIP_MOBILE_AGENTS'].to_s.split(',').map{|a|
|
75
|
+
a.to_sym
|
76
|
+
}
|
74
77
|
end
|
75
|
-
|
76
78
|
EOS
|
77
79
|
end
|
78
|
-
|
80
|
+
|
79
81
|
inject_into_file "app/helpers/application_helper.rb", after: /module ApplicationHelper$\n/ do
|
80
82
|
<<"EOS"
|
81
83
|
include EnjuLeaf::EnjuLeafHelper
|
@@ -107,8 +109,6 @@ EOS
|
|
107
109
|
end
|
108
110
|
remove_file "public/index.html"
|
109
111
|
remove_file "app/views/layouts/application.html.erb"
|
110
|
-
gsub_file 'config/schedule.rb', /^set :environment, :development$/,
|
111
|
-
"set :environment, :#{environment}"
|
112
112
|
gsub_file 'config/environments/production.rb',
|
113
113
|
/config.serve_static_assets = false$/,
|
114
114
|
"config.serve_static_assets = true"
|
@@ -6,7 +6,7 @@ end
|
|
6
6
|
email = 'admin@example.jp'
|
7
7
|
password = 'adminpassword'
|
8
8
|
|
9
|
-
# Don't edit!
|
9
|
+
# Don't edit the following lines!
|
10
10
|
|
11
11
|
Sunspot.session = Sunspot::Rails::StubSessionProxy.new(Sunspot.session)
|
12
12
|
#unless solr = Sunspot.commit rescue nil
|
@@ -28,21 +28,18 @@ end
|
|
28
28
|
system_user = User.new
|
29
29
|
system_user.username = 'system'
|
30
30
|
system_user.password = SecureRandom.urlsafe_base64(32)
|
31
|
-
system_user.email =
|
31
|
+
system_user.email = 'root@library.example.jp'
|
32
32
|
system_user.role = Role.where(name: 'Administrator').first
|
33
33
|
system_user.save!
|
34
34
|
system_profile = new_profile
|
35
35
|
system_profile.user = system_user
|
36
36
|
system_profile.save!
|
37
|
-
system_profile.index
|
38
37
|
|
39
38
|
user = User.new
|
40
39
|
user.username = username
|
41
40
|
user.email = email
|
42
|
-
user.email_confirmation = email
|
43
41
|
user.password = password
|
44
42
|
user.password_confirmation = password
|
45
|
-
user.operator = user
|
46
43
|
#user.confirm!
|
47
44
|
user.role = Role.where(name: 'Administrator').first
|
48
45
|
user.save!
|
@@ -50,6 +47,4 @@ profile = new_profile
|
|
50
47
|
profile.user_number = '0'
|
51
48
|
profile.user = user
|
52
49
|
profile.save!
|
53
|
-
profile.index
|
54
|
-
Sunspot.commit
|
55
50
|
puts 'Administrator account created.'
|
@@ -15,10 +15,10 @@
|
|
15
15
|
See the License for the specific language governing permissions and
|
16
16
|
limitations under the License.
|
17
17
|
-->
|
18
|
-
<!--
|
18
|
+
<!--
|
19
19
|
This is the Solr schema file. This file should be named "schema.xml" and
|
20
20
|
should be in the conf directory under the solr home
|
21
|
-
(i.e. ./solr/conf/schema.xml by default)
|
21
|
+
(i.e. ./solr/conf/schema.xml by default)
|
22
22
|
or located where the classloader for the Solr webapp can find it.
|
23
23
|
|
24
24
|
This example schema is the recommended starting point for users.
|
@@ -60,15 +60,11 @@
|
|
60
60
|
<fieldType name="rand" class="solr.RandomSortField" omitNorms="true"/>
|
61
61
|
<!-- *** This fieldType is used by Sunspot! *** -->
|
62
62
|
<fieldType name="text" class="solr.TextField" omitNorms="false">
|
63
|
-
<analyzer
|
64
|
-
<tokenizer class="solr.StandardTokenizerFactory"/>
|
65
|
-
<filter class="solr.StandardFilterFactory"/>
|
66
|
-
<filter class="solr.LowerCaseFilterFactory"/>
|
67
|
-
</analyzer>
|
68
|
-
<analyzer type="query" class="org.apache.lucene.analysis.cjk.CJKAnalyzer">
|
63
|
+
<analyzer>
|
69
64
|
<tokenizer class="solr.StandardTokenizerFactory"/>
|
70
65
|
<filter class="solr.StandardFilterFactory"/>
|
71
66
|
<filter class="solr.LowerCaseFilterFactory"/>
|
67
|
+
<filter class="solr.PorterStemFilterFactory"/>
|
72
68
|
</analyzer>
|
73
69
|
</fieldType>
|
74
70
|
<!-- *** This fieldType is used by Sunspot! *** -->
|
@@ -88,8 +84,22 @@
|
|
88
84
|
<!-- *** This fieldType is used by Sunspot! *** -->
|
89
85
|
<fieldType name="tfloat" class="solr.TrieFloatField" omitNorms="true"/>
|
90
86
|
<!-- *** This fieldType is used by Sunspot! *** -->
|
91
|
-
<fieldType name="tdate" class="solr.TrieDateField"
|
87
|
+
<fieldType name="tdate" class="solr.TrieDateField"
|
88
|
+
omitNorms="true"/>
|
92
89
|
|
90
|
+
<!-- Special field type for spell correction. Be careful about
|
91
|
+
adding filters here, as they apply *before* your values go in
|
92
|
+
the spellcheck. For example, the lowercase filter here means
|
93
|
+
all spelling suggestions will be lower case (without it,
|
94
|
+
though, you'd have duplicate suggestions for lower and proper
|
95
|
+
cased words). -->
|
96
|
+
<fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100" omitNorms="true">
|
97
|
+
<analyzer>
|
98
|
+
<tokenizer class="solr.StandardTokenizerFactory"/>
|
99
|
+
<filter class="solr.StandardFilterFactory"/>
|
100
|
+
<filter class="solr.LowerCaseFilterFactory"/>
|
101
|
+
</analyzer>
|
102
|
+
</fieldType>
|
93
103
|
<!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
|
94
104
|
<fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
|
95
105
|
</types>
|
@@ -112,9 +122,9 @@
|
|
112
122
|
given field.
|
113
123
|
When using MoreLikeThis, fields used for similarity should be
|
114
124
|
stored for best performance.
|
115
|
-
termPositions: Store position information with the term vector.
|
125
|
+
termPositions: Store position information with the term vector.
|
116
126
|
This will increase storage costs.
|
117
|
-
termOffsets: Store offset information with the term vector. This
|
127
|
+
termOffsets: Store offset information with the term vector. This
|
118
128
|
will increase storage costs.
|
119
129
|
default: a value that should be used if no value is specified
|
120
130
|
when adding a document.
|
@@ -240,7 +250,11 @@
|
|
240
250
|
<dynamicField name="*_llm" stored="false" type="location" multiValued="true" indexed="true"/>
|
241
251
|
<dynamicField name="*_lls" stored="true" type="location" multiValued="false" indexed="true"/>
|
242
252
|
<dynamicField name="*_llms" stored="true" type="location" multiValued="true" indexed="true"/>
|
253
|
+
<field name="textSpell" stored="false" type="textSpell" multiValued="true" indexed="true"/>
|
254
|
+
<!-- required by Solr 4 -->
|
255
|
+
<field name="_version_" type="string" indexed="true" stored="true" multiValued="false" />
|
243
256
|
</fields>
|
257
|
+
|
244
258
|
<!-- Field to use to determine and enforce document uniqueness.
|
245
259
|
Unless this field is marked with required="false", it will be a required field
|
246
260
|
-->
|
@@ -251,5 +265,11 @@
|
|
251
265
|
<solrQueryParser defaultOperator="AND"/>
|
252
266
|
<!-- copyField commands copy one field to another at the time a document
|
253
267
|
is added to the index. It's used either to index the same field differently,
|
254
|
-
or to add multiple fields to the same field for easier/faster
|
268
|
+
or to add multiple fields to the same field for easier/faster
|
269
|
+
searching. -->
|
270
|
+
|
271
|
+
<!-- Use copyField to copy the fields you want to run spell checking
|
272
|
+
on into one field. For example: -->
|
273
|
+
<copyField source="*_text" dest="textSpell" />
|
274
|
+
<copyField source="*_s" dest="textSpell" />
|
255
275
|
</schema>
|