enju_library 0.2.0.beta.7 → 0.2.0.beta.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d99cafa9e33418200cd2fe5c0a2eb1931cd99d71
4
- data.tar.gz: bee9a19cc682a7949f26ec9f9032b69b8d306601
3
+ metadata.gz: 622c32ce548424d47ce882631aed7e4612cd8b64
4
+ data.tar.gz: e63bb53a0a5b5add1d9d8439e85d900276347b57
5
5
  SHA512:
6
- metadata.gz: 287f324b2805c9eb09cbf23687325371353884505943007c45556f6519f40a1294670be410de42752aba844c8ed07f0f93d659c7007e73fa177b0d638197433b
7
- data.tar.gz: cc6bdfe17d275dec87fe4a11e5e3dcf9fb90cfd88d8d9741fd181a6d03d1b5c52931dded794beca4d946ac0ea31158e0a939e0dce8dd7fda20a6bd0533db5b75
6
+ metadata.gz: 610b738cfdd85d596678390aa44fce50a84f03b89ac5404767b0ac254a886f71a0b03b592799ae95f382163803ac6a24c9c9c3dce914820ad10f0b7f67ec7457
7
+ data.tar.gz: 5f1521f4965ffb4c85446488e5d53b11ede7189508c2be36954671fd67ce2b992161c73ec5a4b366a2141f3a0817098509cbb73f20761f84ca8ffaf2507fdb86
@@ -62,6 +62,9 @@ class LibraryGroupsController < ApplicationController
62
62
  {
63
63
  :colors_attributes => [:id, :property, :code]
64
64
  },
65
+ {
66
+ :user_attributes => [:email]
67
+ },
65
68
  *LibraryGroup.globalize_attribute_names,
66
69
  )
67
70
  end
@@ -2,7 +2,7 @@ class Notifier < ActionMailer::Base
2
2
  def message_notification(message_id)
3
3
  message = Message.find(message_id)
4
4
  I18n.locale = message.receiver.profile.locale.try(:to_sym) || I18n.default_locale
5
- from = "#{LibraryGroup.system_name(message.receiver.profile.locale)} <#{LibraryGroup.site_config.email}>"
5
+ from = "#{LibraryGroup.system_name(message.receiver.profile.locale)} <#{LibraryGroup.site_config.user.email}>"
6
6
  if message.subject
7
7
  subject = message.subject
8
8
  else
@@ -21,7 +21,7 @@ class Notifier < ActionMailer::Base
21
21
  def manifestation_info(user_id, manifestation_id)
22
22
  user = User.find(user_id)
23
23
  manifestation = Manifestation.find(manifestation_id)
24
- from = "#{LibraryGroup.system_name(user.profile.locale)} <#{LibraryGroup.site_config.email}>"
24
+ from = "#{LibraryGroup.system_name(user.profile.locale)} <#{LibraryGroup.site_config.user.email}>"
25
25
  subject = "#{manifestation.original_title} : #{LibraryGroup.system_name(user.profile.locale)}"
26
26
  @user = user
27
27
  @manifestation = manifestation
@@ -5,17 +5,17 @@ class LibraryGroup < ActiveRecord::Base
5
5
  has_many :libraries
6
6
  has_many :colors
7
7
  belongs_to :country
8
+ belongs_to :user
8
9
 
9
10
  validates :url, presence: true, url: true
10
11
  validates :max_number_of_results, numericality: {
11
- greater_than_or_equal_to: 0
12
+ greater_than_or_equal_to: 1
12
13
  }
13
14
  accepts_nested_attributes_for :colors, update_only: true
15
+ accepts_nested_attributes_for :user, update_only: true
14
16
  store :settings, accessors: [
15
- :max_number_of_results, :family_name_first,
16
- :pub_year_facet_range_interval,
17
- :book_jacket_source, :book_jacket_unknown_resource,
18
- :screenshot_generator, :erms_url
17
+ :book_jacket_unknown_resource,
18
+ :erms_url
19
19
  ], coder: JSON
20
20
 
21
21
  translates :login_banner, :footer_banner
@@ -78,5 +78,5 @@ end
78
78
  # url :string default("http://localhost:3000/")
79
79
  # settings :text
80
80
  # html_snippet :text
81
- # email :string
81
+ # user_id :integer
82
82
  #
@@ -13,7 +13,9 @@
13
13
 
14
14
  <div class="field">
15
15
  <%= f.label :email -%><br />
16
- <%= f.email_field :email, class: 'resource_email' -%>
16
+ <%= f.fields_for :user do |user_form| %>
17
+ <%= user_form.email_field :email, class: 'resource_email' -%>
18
+ <% end %>
17
19
  </div>
18
20
 
19
21
  <div class="field">
@@ -40,10 +42,12 @@
40
42
  <%= f.number_field :max_number_of_results -%>
41
43
  </div>
42
44
 
43
- <div class="field">
44
- <%= f.label :book_jacket_source -%>
45
- <%= f.select :book_jacket_source, [['Google', 'google']] -%><br />
46
- </div>
45
+ <% if defined?(EnjuManifestationViewer) %>
46
+ <div class="field">
47
+ <%= f.label :book_jacket_source -%>
48
+ <%= f.select :book_jacket_source, [['Google', 'google']] -%><br />
49
+ </div>
50
+ <% end %>
47
51
 
48
52
  <div class="field">
49
53
  <%= f.label :color -%><br />
@@ -14,7 +14,7 @@
14
14
  <tr class="line<%= cycle("0", "1") -%>">
15
15
  <td><%= link_to h(library_group.display_name.localize), library_group -%></td>
16
16
  <td><%= library_group.name -%></td>
17
- <td><%= library_group.email -%></td>
17
+ <td><%= library_group.user.email -%></td>
18
18
  <td>
19
19
  <%= link_to t('page.edit'), edit_library_group_path(library_group) if policy(library_group).update? -%>
20
20
  </td>
@@ -15,7 +15,7 @@
15
15
 
16
16
  <p>
17
17
  <strong><%= t('activerecord.attributes.library_group.email') -%>:</strong>
18
- <%= @library_group.email -%>
18
+ <%= @library_group.user.email -%>
19
19
  </p>
20
20
 
21
21
  <p>
@@ -38,10 +38,12 @@
38
38
  <%= @library_group.max_number_of_results -%>
39
39
  </p>
40
40
 
41
- <p>
42
- <strong><%= t('activerecord.attributes.library_group.book_jacket_source') -%>:</strong>
43
- <%= @library_group.book_jacket_source -%>
44
- </p>
41
+ <% if defined?(EnjuManifestationViewer) %>
42
+ <p>
43
+ <strong><%= t('activerecord.attributes.library_group.book_jacket_source') -%>:</strong>
44
+ <%= @library_group.book_jacket_source -%>
45
+ </p>
46
+ <% end %>
45
47
 
46
48
  <div>
47
49
  <strong><%= t('activerecord.attributes.library_group.color') -%>:</strong>
@@ -0,0 +1,5 @@
1
+ class AddMaxNumberOfResultsToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_column :library_groups, :max_number_of_results, :integer, default: 500
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddFamilyNameFirstToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_column :library_groups, :family_name_first, :boolean, default: true
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddPubYearFacetRangeIntervalToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_column :library_groups, :pub_year_facet_range_interval, :integer, default: 10
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddUserIdToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_reference :library_groups, :user, index: true, foreign_key: true
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module EnjuLibrary
2
- VERSION = "0.2.0.beta.7"
2
+ VERSION = "0.2.0.beta.8"
3
3
  end
@@ -18,7 +18,7 @@ namespace :enju_library do
18
18
  Rake::Task['statesman:backfill_most_recent'].invoke('UserExportFile')
19
19
  Rake::Task['statesman:backfill_most_recent'].invoke('UserImportFile')
20
20
  library_group = LibraryGroup.site_config
21
- library_group.email = User.find(1).try(:email)
21
+ library_group.user = User.find(1)
22
22
  login_ja = <<"EOS"
23
23
  このシステムはオープンソース図書館システム Next-L Enju です。このメッセージは管理者によって変更することができます。
24
24
  EOS
@@ -27,11 +27,11 @@ Next-L Enju, an open-source integrated library system. You can edit this message
27
27
  EOS
28
28
  footer_ja = <<"EOS"
29
29
  [Next-L Enju Leaf #{EnjuLeaf::VERSION}](https://github.com/next-l/enju_leaf), オープンソース統合図書館システム
30
- Developed by Kosuke Tanabe and [Project Next-L](http://www.next-l.jp) \| [このシステムについて](/page/about) \| [不具合を報告する](https://github.com/next-l/enju_leaf/issues) \| [マニュアル](https://next-l.github.com/manual/1.2/)
30
+ Developed by [Kosuke Tanabe](https://github.com/nabeta) and [Project Next-L](http://www.next-l.jp) \| [このシステムについて](/page/about) \| [不具合を報告する](https://github.com/next-l/enju_leaf/issues) \| [マニュアル](https://next-l.github.com/manual/1.2/)
31
31
  EOS
32
32
  footer_en = <<"EOS"
33
33
  [Next-L Enju Leaf #{EnjuLeaf::VERSION}](https://github.com/next-l/enju_leaf), an open source integrated library system
34
- Developed by Kosuke Tanabe and [Project Next-L](http://www.next-l.jp) \| [About this system](/page/about) \| [Report bugs](https://github.com/next-l/enju_leaf/issues) \| [Manual](https://next-l.github.com/manual/1.2/)
34
+ Developed by [Kosuke Tanabe](https://github.com/nabeta) and [Project Next-L](http://www.next-l.jp) \| [About this system](/page/about) \| [Report bugs](https://github.com/next-l/enju_leaf/issues) \| [Manual](https://next-l.github.com/manual/1.2/)
35
35
  EOS
36
36
  library_group.login_banner_ja = login_ja if library_group.login_banner_ja.blank?
37
37
  library_group.login_banner_en = login_en if library_group.login_banner_en.blank?
@@ -0,0 +1,5 @@
1
+ class AddBookJacketSourceToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_column :library_groups, :book_jacket_source, :string
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddScreenshotGeneratorToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_column :library_groups, :screenshot_generator, :string
4
+ end
5
+ end
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20160813130535) do
14
+ ActiveRecord::Schema.define(version: 20160813203039) do
15
15
 
16
16
  create_table "accepts", force: :cascade do |t|
17
17
  t.integer "basket_id"
@@ -746,9 +746,9 @@ ActiveRecord::Schema.define(version: 20160813130535) do
746
746
  add_index "library_group_translations", ["locale"], name: "index_library_group_translations_on_locale"
747
747
 
748
748
  create_table "library_groups", force: :cascade do |t|
749
- t.string "name", null: false
749
+ t.string "name", null: false
750
750
  t.text "display_name"
751
- t.string "short_name", null: false
751
+ t.string "short_name", null: false
752
752
  t.text "my_networks"
753
753
  t.text "login_banner"
754
754
  t.text "note"
@@ -757,14 +757,20 @@ ActiveRecord::Schema.define(version: 20160813130535) do
757
757
  t.datetime "created_at"
758
758
  t.datetime "updated_at"
759
759
  t.text "admin_networks"
760
- t.boolean "allow_bookmark_external_url", default: false, null: false
761
- t.string "url", default: "http://localhost:3000/"
760
+ t.boolean "allow_bookmark_external_url", default: false, null: false
761
+ t.string "url", default: "http://localhost:3000/"
762
762
  t.text "settings"
763
763
  t.text "html_snippet"
764
- t.string "email"
764
+ t.string "book_jacket_source"
765
+ t.integer "max_number_of_results", default: 500
766
+ t.boolean "family_name_first", default: true
767
+ t.string "screenshot_generator"
768
+ t.integer "pub_year_facet_range_interval", default: 10
769
+ t.integer "user_id"
765
770
  end
766
771
 
767
772
  add_index "library_groups", ["short_name"], name: "index_library_groups_on_short_name"
773
+ add_index "library_groups", ["user_id"], name: "index_library_groups_on_user_id"
768
774
 
769
775
  create_table "licenses", force: :cascade do |t|
770
776
  t.string "name", null: false
@@ -14,6 +14,8 @@ one:
14
14
  ::/0"
15
15
  settings:
16
16
  "{\"max_number_of_results\":200,\"family_name_first\":true}"
17
+ user_id: 1
18
+ pub_year_facet_range_interval: 10
17
19
 
18
20
  # == Schema Information
19
21
  #
@@ -35,5 +37,5 @@ one:
35
37
  # url :string default("http://localhost:3000/")
36
38
  # settings :text
37
39
  # html_snippet :text
38
- # email :string
40
+ # user_id :integer
39
41
  #
@@ -35,5 +35,5 @@ end
35
35
  # url :string default("http://localhost:3000/")
36
36
  # settings :text
37
37
  # html_snippet :text
38
- # email :string
38
+ # user_id :integer
39
39
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enju_library
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.beta.7
4
+ version: 0.2.0.beta.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kosuke Tanabe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-13 00:00:00.000000000 Z
11
+ date: 2016-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: enju_seed
@@ -579,7 +579,10 @@ files:
579
579
  - db/migrate/20160610093229_add_html_snippet_to_library_group.rb
580
580
  - db/migrate/20160627232219_add_most_recent_to_user_import_file_transitions.rb
581
581
  - db/migrate/20160627232316_add_most_recent_to_user_export_file_transitions.rb
582
- - db/migrate/20160813130535_add_email_to_library_group.rb
582
+ - db/migrate/20160813191647_add_max_number_of_results_to_library_group.rb
583
+ - db/migrate/20160813191733_add_family_name_first_to_library_group.rb
584
+ - db/migrate/20160813192542_add_pub_year_facet_range_interval_to_library_group.rb
585
+ - db/migrate/20160813203039_add_user_id_to_library_group.rb
583
586
  - lib/enju_library.rb
584
587
  - lib/enju_library/engine.rb
585
588
  - lib/enju_library/version.rb
@@ -828,6 +831,8 @@ files:
828
831
  - spec/dummy/db/migrate/20160703184747_add_most_recent_to_user_checkout_stat_transitions.rb
829
832
  - spec/dummy/db/migrate/20160703184805_add_most_recent_to_user_reserve_stat_transitions.rb
830
833
  - spec/dummy/db/migrate/20160703190209_add_foreign_key_on_manifestation_id_to_reserve.rb
834
+ - spec/dummy/db/migrate/20160813191533_add_book_jacket_source_to_library_group.rb
835
+ - spec/dummy/db/migrate/20160813191820_add_screenshot_generator_to_library_group.rb
831
836
  - spec/dummy/db/schema.rb
832
837
  - spec/dummy/public/404.html
833
838
  - spec/dummy/public/422.html
@@ -1202,6 +1207,8 @@ test_files:
1202
1207
  - spec/dummy/db/migrate/20160703184747_add_most_recent_to_user_checkout_stat_transitions.rb
1203
1208
  - spec/dummy/db/migrate/20160703184805_add_most_recent_to_user_reserve_stat_transitions.rb
1204
1209
  - spec/dummy/db/migrate/20160703190209_add_foreign_key_on_manifestation_id_to_reserve.rb
1210
+ - spec/dummy/db/migrate/20160813191533_add_book_jacket_source_to_library_group.rb
1211
+ - spec/dummy/db/migrate/20160813191820_add_screenshot_generator_to_library_group.rb
1205
1212
  - spec/dummy/db/schema.rb
1206
1213
  - spec/dummy/public/404.html
1207
1214
  - spec/dummy/public/422.html
@@ -1,5 +0,0 @@
1
- class AddEmailToLibraryGroup < ActiveRecord::Migration
2
- def change
3
- add_column :library_groups, :email, :string
4
- end
5
- end