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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43ae415d2c7916d8d10576cb4e6f6e6ca35c4efc
4
- data.tar.gz: 2c2cd4dcfc3dd1715278b4b441bb73d7422dc7d7
3
+ metadata.gz: a94a8fc6ca5f6bada67b337668886e4c21179433
4
+ data.tar.gz: 3c77b8a345eae6e32a70cfacbdedf5c566292c84
5
5
  SHA512:
6
- metadata.gz: c8e071bad6eb78a01366fcaffd2c653185773b2d04b1e6b5d8b9c3fad6e12c9167dad62184fa1cdee1ecbf6c894f4d8a7421df2e1e8dfd5f7149581c574a3c0b
7
- data.tar.gz: a105c67e432856dcb48cde413e792064f7b4623e11c22e5651d7b7c7ff4efe58dc8671d1502336d00993a23f87e94ae0d8fbce635e69f87b3c59ff23fcfc6a88
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]
@@ -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サーバの再起動が必要です"
@@ -0,0 +1,5 @@
1
+ class AddSettingsToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_column :library_groups, :settings, :text
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module EnjuLibrary
2
- VERSION = "0.1.0.pre40"
2
+ VERSION = "0.1.0.pre41"
3
3
  end
@@ -5,6 +5,5 @@ class EnjuLibrary::SetupGenerator < Rails::Generators::Base
5
5
  def copy_setup_files
6
6
  directory("db/fixtures", "db/fixtures/enju_library")
7
7
  return if file == 'fixture'
8
- rake("enju_library_engine:install:migrations")
9
8
  end
10
9
  end
@@ -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