enju_library 0.1.0.pre40 → 0.1.0.pre41
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/library_groups_controller.rb +2 -0
- data/app/models/library_group.rb +18 -0
- data/app/views/library_groups/_form.html.erb +5 -0
- data/app/views/library_groups/show.html.erb +5 -0
- data/config/locales/translation_en.yml +3 -0
- data/config/locales/translation_ja.yml +3 -0
- data/db/migrate/20150221063719_add_settings_to_library_group.rb +5 -0
- data/lib/enju_library/version.rb +1 -1
- data/lib/generators/enju_library/setup/setup_generator.rb +0 -1
- data/lib/generators/enju_library/setup/templates/db/fixtures/library_groups.yml +1 -0
- data/lib/tasks/enju_library_tasks.rake +7 -0
- data/spec/dummy/app/helpers/application_helper.rb +0 -21
- data/spec/dummy/db/schema.rb +334 -333
- data/spec/fixtures/library_groups.yml +5 -1
- metadata +27 -16
- data/spec/dummy/app/models/setting.rb +0 -4
- data/spec/dummy/config/application.yml +0 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a94a8fc6ca5f6bada67b337668886e4c21179433
|
4
|
+
data.tar.gz: 3c77b8a345eae6e32a70cfacbdedf5c566292c84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfbf92ceb07f554b5ed71cfe4bdfae02053a545cc5f072a3bcc97796a8c06b751ed45636c240b6d5943b9854f019035e987247872a812568656e007eb7cf7e59
|
7
|
+
data.tar.gz: 64c36bf84ee802cc52aa294f89f32f78182eb79b013d5a80d5d0353e87edf1b9a495f7489b8e70ef774bce298307ffe95b6c474cb17117a2297cea3093f0cef0
|
@@ -47,6 +47,8 @@ class LibraryGroupsController < ApplicationController
|
|
47
47
|
params.require(:library_group).permit(
|
48
48
|
:name, :display_name, :short_name, :my_networks,
|
49
49
|
:login_banner, :note, :country_id, :admin_networks, :url,
|
50
|
+
:max_number_of_results,
|
51
|
+
:book_jacket_source, :screenshot_generator, :erms_url,
|
50
52
|
:allow_bookmark_external_url, # EnjuBookmark
|
51
53
|
{
|
52
54
|
:colors_attributes => [:id, :property, :code]
|
data/app/models/library_group.rb
CHANGED
@@ -8,7 +8,25 @@ class LibraryGroup < ActiveRecord::Base
|
|
8
8
|
belongs_to :country
|
9
9
|
|
10
10
|
validates :url, presence: true, url: true
|
11
|
+
validates :max_number_of_results, numericality: {
|
12
|
+
greater_than_or_equal_to: 0
|
13
|
+
}
|
11
14
|
accepts_nested_attributes_for :colors, update_only: true
|
15
|
+
if Rails::VERSION::MAJOR >= 4
|
16
|
+
store :settings, accessors: [
|
17
|
+
:max_number_of_results, :family_name_first,
|
18
|
+
:pub_year_facet_range_interval,
|
19
|
+
:book_jacket_source, :book_jacket_unknown_resource,
|
20
|
+
:screenshot_generator, :erms_url
|
21
|
+
], coder: JSON
|
22
|
+
else
|
23
|
+
store :settings, accessors: [
|
24
|
+
:max_number_of_results, :family_name_first,
|
25
|
+
:pub_year_facet_range_interval,
|
26
|
+
:book_jacket_source, :book_jacket_unknown_resource,
|
27
|
+
:screenshot_generator, :erms_url
|
28
|
+
]
|
29
|
+
end
|
12
30
|
|
13
31
|
def self.site_config
|
14
32
|
LibraryGroup.find(1)
|
@@ -26,6 +26,11 @@
|
|
26
26
|
<%= f.text_area :login_banner -%>
|
27
27
|
</div>
|
28
28
|
|
29
|
+
<div class="field">
|
30
|
+
<%= f.label :max_number_of_results -%><br />
|
31
|
+
<%= f.number_field :max_number_of_results -%>
|
32
|
+
</div>
|
33
|
+
|
29
34
|
<div class="field">
|
30
35
|
<%= f.label :color -%><br />
|
31
36
|
<%= f.fields_for :colors do |color_form| %>
|
@@ -28,6 +28,11 @@
|
|
28
28
|
<%= markdown_helper(@library_group.login_banner) -%>
|
29
29
|
</div>
|
30
30
|
|
31
|
+
<div>
|
32
|
+
<strong><%= t('activerecord.attributes.library_group.max_number_of_results') -%>:</strong>
|
33
|
+
<%= @library_group.max_number_of_results -%>
|
34
|
+
</div>
|
35
|
+
|
31
36
|
<div>
|
32
37
|
<strong><%= t('activerecord.attributes.library_group.color') -%>:</strong>
|
33
38
|
<ul>
|
@@ -54,6 +54,7 @@ en:
|
|
54
54
|
post_to_union_catalog: Post to union catalog
|
55
55
|
url: URL
|
56
56
|
color: Color
|
57
|
+
max_number_of_results: Max number of results
|
57
58
|
bookstore:
|
58
59
|
name: Name
|
59
60
|
zip_code: Zip code
|
@@ -105,3 +106,5 @@ en:
|
|
105
106
|
address: "Address"
|
106
107
|
shelf:
|
107
108
|
update_display_order: Update display order
|
109
|
+
page:
|
110
|
+
restart_required: "Web server restart required"
|
@@ -54,6 +54,7 @@ ja:
|
|
54
54
|
post_to_union_catalog: 総合目録に登録する
|
55
55
|
url: URL
|
56
56
|
color: 色
|
57
|
+
max_number_of_results: 検索結果の最大件数
|
57
58
|
bookstore:
|
58
59
|
name: 名前
|
59
60
|
zip_code: 郵便番号
|
@@ -105,3 +106,5 @@ ja:
|
|
105
106
|
address: "住所"
|
106
107
|
shelf:
|
107
108
|
update_display_order: "表示順序を変更する"
|
109
|
+
page:
|
110
|
+
restart_required: "Webサーバの再起動が必要です"
|
data/lib/enju_library/version.rb
CHANGED
@@ -10,3 +10,4 @@ library_group_00001:
|
|
10
10
|
login_banner: Next-L Enju, an open-source integrated library system. You can edit this message after logging in as Administrator.
|
11
11
|
admin_networks: "0.0.0.0/0\r\n\
|
12
12
|
::/0"
|
13
|
+
settings: "{\"max_number_of_results\":500, \"family_name_first\":true, \"skip_mobile_agents\":\"ipad\"}"
|
@@ -13,6 +13,13 @@ namespace :enju_library do
|
|
13
13
|
task :upgrade => :environment do
|
14
14
|
LibraryGroup.transaction do
|
15
15
|
update_color
|
16
|
+
library_group = LibraryGroup.find(1)
|
17
|
+
library_group.settings[:skip_mobile_agents] = ''
|
18
|
+
library_group.settings[:max_number_of_results] = 500
|
19
|
+
library_group.settings[:family_name_first] = true
|
20
|
+
library_group.settings[:book_jacket_source] = 'google'
|
21
|
+
library_group.settings[:screenshot_generator] = 'mozshot'
|
22
|
+
library_group.save!
|
16
23
|
end
|
17
24
|
puts 'enju_library: The upgrade completed successfully.'
|
18
25
|
end
|
@@ -1,25 +1,4 @@
|
|
1
1
|
module ApplicationHelper
|
2
2
|
include EnjuLeaf::EnjuLeafHelper
|
3
3
|
include EnjuBiblio::BiblioHelper
|
4
|
-
|
5
|
-
def back_to_index(options = {})
|
6
|
-
if options == nil
|
7
|
-
options = {}
|
8
|
-
else
|
9
|
-
options.reject!{|key, value| value.blank?}
|
10
|
-
options.delete(:page) if options[:page].to_i == 1
|
11
|
-
end
|
12
|
-
unless controller_name == 'test'
|
13
|
-
link_to t('page.listing', :model => t("activerecord.models.#{controller_name.singularize}")), url_for(params.merge(:controller => controller_name, :action => :index, :id => nil, :only_path => true).merge(options))
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def markdown_helper(string)
|
18
|
-
return unless string
|
19
|
-
markdown = Redcarpet::Markdown.new(
|
20
|
-
Redcarpet::Render::HTML,
|
21
|
-
:autolink => true, :safe_links_only => true
|
22
|
-
)
|
23
|
-
markdown.render(string.to_s).html_safe
|
24
|
-
end
|
25
4
|
end
|