enju_library 0.2.0.beta.9 → 0.2.0.beta.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/library_group.rb +8 -2
- data/app/views/libraries/index.html.erb +2 -2
- data/app/views/libraries/show.html.erb +1 -1
- data/app/views/library_groups/_form.html.erb +1 -1
- data/app/views/user_import_results/index.html.erb +2 -2
- data/config/locales/translation_en.yml +3 -0
- data/config/locales/translation_ja.yml +3 -0
- data/db/migrate/059_create_libraries.rb +7 -9
- data/db/migrate/069_create_shelves.rb +3 -4
- data/db/migrate/080_create_library_groups.rb +2 -3
- data/db/migrate/120_create_baskets.rb +2 -3
- data/db/migrate/20081006090811_create_subscriptions.rb +4 -7
- data/db/migrate/20081006093246_create_subscribes.rb +4 -5
- data/db/migrate/20120319173203_create_accepts.rb +3 -6
- data/db/migrate/20140110122216_create_user_import_files.rb +1 -1
- data/db/migrate/20140110131010_create_user_import_results.rb +2 -2
- data/db/migrate/20140524074813_create_user_import_file_transitions.rb +1 -2
- data/db/migrate/20140709113413_create_user_export_files.rb +1 -1
- data/db/migrate/20140709113905_create_user_export_file_transitions.rb +1 -1
- data/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +1 -1
- data/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +1 -1
- data/db/migrate/20140821151023_create_colors.rb +1 -3
- data/db/migrate/20150924115059_create_withdraws.rb +3 -5
- data/db/migrate/20151213070943_add_translation_table_to_library_group.rb +19 -6
- data/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +15 -2
- data/lib/enju_library/version.rb +1 -1
- data/spec/controllers/budget_types_controller_spec.rb +2 -1
- data/spec/dummy/config/application.rb +1 -0
- data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +2 -2
- data/spec/dummy/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb +5 -0
- data/spec/dummy/db/migrate/20151125004028_add_profile_id_to_agent.rb +6 -0
- data/spec/dummy/db/migrate/20160801080612_add_most_recent_to_import_request_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160801080619_add_most_recent_to_resource_import_file_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160801080637_add_most_recent_to_resource_export_file_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160801080643_add_most_recent_to_agent_import_file_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160811102604_add_picture_width_to_picture_file.rb +6 -0
- data/spec/dummy/db/migrate/20160820004638_add_attachment_attachment_to_carrier_types.rb +11 -0
- data/spec/dummy/db/schema.rb +28 -6
- data/spec/models/user_import_file_spec.rb +0 -1
- data/spec/models/withdraw_spec.rb +6 -0
- data/spec/views/library_groups/edit.html.erb_spec.rb +5 -1
- metadata +348 -318
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abcddb43d158f905d8828446e2f61d5a9bf74a7e
|
4
|
+
data.tar.gz: 86049349dac62af10b3735b6dbc4b5605dda2f29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1658860672bcc6c4ad687f4a9bbe83424a146739c34402e5cd2beb35e66cead01e4c506d7a3ac26f055ad85294daee6385b561471ff1a50647dcbd7055246934
|
7
|
+
data.tar.gz: c017b6438e20daf3a1cccc333b8e876106b2fdfe8fd0cb351c96ea028ae6b3e2679f316a913c96038f35f2b28f09db222e39599722968b6b7738cd575fc4817b
|
data/app/models/library_group.rb
CHANGED
@@ -18,8 +18,14 @@ class LibraryGroup < ActiveRecord::Base
|
|
18
18
|
:erms_url
|
19
19
|
], coder: JSON
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
if defined?(Globalize::Accessors)
|
22
|
+
translates :login_banner, :footer_banner
|
23
|
+
globalize_accessors
|
24
|
+
end
|
25
|
+
|
26
|
+
if defined?(AwesomeHstoreTranslate)
|
27
|
+
translates :login_banner, :footer_banner, accessors: I18n.available_locales
|
28
|
+
end
|
23
29
|
|
24
30
|
def self.site_config
|
25
31
|
LibraryGroup.order(:created_at).first
|
@@ -41,8 +41,8 @@
|
|
41
41
|
<tr class="line<%= cycle("0", "1") -%>">
|
42
42
|
<td>
|
43
43
|
<%- if policy(library).update? and params[:query].blank? -%>
|
44
|
-
<%= library.first? ? image_tag('icons/stop.png', size: '16x16') : link_to(image_tag('icons/arrow_up.png', size: '16x16', alt: t('page.asc')), {action: 'update', move: 'higher', id: library.name}, method: :put) -%>
|
45
|
-
<%= library.last? ? image_tag('icons/stop.png', size: '16x16') : link_to(image_tag('icons/arrow_down.png', size: '16x16', alt: t('page.desc')), {action: 'update', move: 'lower', id: library.name}, method: :put) -%>
|
44
|
+
<%= library.first? ? image_tag('icons/stop.png', size: '16x16') : link_to(image_tag('icons/arrow_up.png', size: '16x16', class: 'enju_icon', alt: t('page.asc')), {action: 'update', move: 'higher', id: library.name}, method: :put) -%>
|
45
|
+
<%= library.last? ? image_tag('icons/stop.png', size: '16x16') : link_to(image_tag('icons/arrow_down.png', size: '16x16', class: 'enju_icon', alt: t('page.desc')), {action: 'update', move: 'lower', id: library.name}, method: :put) -%>
|
46
46
|
<%- end -%>
|
47
47
|
</td>
|
48
48
|
<td><%= library.name -%></td>
|
@@ -73,7 +73,7 @@
|
|
73
73
|
<td>
|
74
74
|
<%= link_to shelf.display_name.localize, shelf_path(shelf, library_id: @library.name) -%>
|
75
75
|
<%- shelf.picture_files.each do |picture_file| -%>
|
76
|
-
<%= link_to image_tag('icons/picture.png', size: '16x16', alt: t('page.picture')), picture_file_path(picture_file, format: :download), rel: "shelf_#{h(shelf.id)}" -%>
|
76
|
+
<%= link_to image_tag('icons/picture.png', size: '16x16', class: 'enju_icon', alt: t('page.picture')), picture_file_path(picture_file, format: :download), rel: "shelf_#{h(shelf.id)}" -%>
|
77
77
|
<%- end -%>
|
78
78
|
<script type="text/javascript">
|
79
79
|
$(document).ready(function(){
|
@@ -45,7 +45,7 @@
|
|
45
45
|
<% if defined?(EnjuManifestationViewer) %>
|
46
46
|
<div class="field">
|
47
47
|
<%= f.label :book_jacket_source -%>
|
48
|
-
<%= f.select :book_jacket_source, [['
|
48
|
+
<%= f.select :book_jacket_source, [[t('book_jacket.google'), 'google'], [t('book_jacket.hanmotocom'), 'hanmotocom']] -%><br />
|
49
49
|
</div>
|
50
50
|
<% end %>
|
51
51
|
|
@@ -14,10 +14,10 @@
|
|
14
14
|
<ul>
|
15
15
|
<li>
|
16
16
|
<% if @user_import_file %>
|
17
|
-
<%= link_to((image_tag 'icons/page_white_excel.png', size: '16x16',
|
17
|
+
<%= link_to((image_tag 'icons/page_white_excel.png', size: '16x16', class: 'enju_icon', alt: 'TSV'), user_import_results_path(user_import_file_id: @user_import_file.id, format: :txt, locale: @locale.to_s)) -%>
|
18
18
|
(<%= link_to 'TSV', user_import_results_path(user_import_file_id: @user_import_file.id, format: :txt, locale: @locale.to_s) -%>)
|
19
19
|
<% else %>
|
20
|
-
<%= link_to((image_tag 'icons/page_white_excel.png', size: '16x16',
|
20
|
+
<%= link_to((image_tag 'icons/page_white_excel.png', size: '16x16', class: 'enju_icon', alt: 'TSV'), user_import_results_path(format: :txt, locale: @locale.to_s)) -%>
|
21
21
|
(<%= link_to 'TSV', user_import_results_path(format: :txt, locale: @locale.to_s) -%>)
|
22
22
|
<% end %>
|
23
23
|
</li>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
class CreateLibraries < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :libraries do |t|
|
4
|
-
t.string :name, :null
|
4
|
+
t.string :name, index: true, null: false
|
5
5
|
t.text :display_name
|
6
|
-
t.string :short_display_name, :
|
6
|
+
t.string :short_display_name, null: false
|
7
7
|
t.string :zip_code
|
8
8
|
t.text :street
|
9
9
|
t.text :locality
|
@@ -12,17 +12,15 @@ class CreateLibraries < ActiveRecord::Migration
|
|
12
12
|
t.string :telephone_number_2
|
13
13
|
t.string :fax_number
|
14
14
|
t.text :note
|
15
|
-
t.integer :call_number_rows, :
|
16
|
-
t.string :call_number_delimiter, :
|
17
|
-
t.
|
18
|
-
t.integer :users_count, :
|
15
|
+
t.integer :call_number_rows, default: 1, null: false
|
16
|
+
t.string :call_number_delimiter, default: "|", null: false
|
17
|
+
t.references :library_group, index: true, null: false
|
18
|
+
t.integer :users_count, default: 0, null: false
|
19
19
|
t.integer :position
|
20
|
-
t.
|
20
|
+
t.references :country
|
21
21
|
|
22
22
|
t.timestamps
|
23
23
|
t.datetime :deleted_at
|
24
24
|
end
|
25
|
-
add_index :libraries, :library_group_id
|
26
|
-
add_index :libraries, :name, :unique => true
|
27
25
|
end
|
28
26
|
end
|
@@ -1,15 +1,14 @@
|
|
1
1
|
class CreateShelves < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :shelves do |t|
|
4
|
-
t.string :name, :
|
4
|
+
t.string :name, null: false
|
5
5
|
t.text :display_name
|
6
6
|
t.text :note
|
7
|
-
t.
|
8
|
-
t.integer :items_count, :
|
7
|
+
t.references :library, index: true, null: false
|
8
|
+
t.integer :items_count, default: 0, null: false
|
9
9
|
t.integer :position
|
10
10
|
t.timestamps
|
11
11
|
t.datetime :deleted_at
|
12
12
|
end
|
13
|
-
add_index :shelves, :library_id
|
14
13
|
end
|
15
14
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
class CreateLibraryGroups < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :library_groups do |t|
|
4
|
-
t.string :name, :
|
4
|
+
t.string :name, null: false
|
5
5
|
t.text :display_name
|
6
|
-
t.string :short_name, :null
|
6
|
+
t.string :short_name, index: true, null: false
|
7
7
|
t.text :my_networks
|
8
8
|
t.text :login_banner
|
9
9
|
t.text :note
|
@@ -12,6 +12,5 @@ class CreateLibraryGroups < ActiveRecord::Migration
|
|
12
12
|
|
13
13
|
t.timestamps
|
14
14
|
end
|
15
|
-
add_index :library_groups, :short_name
|
16
15
|
end
|
17
16
|
end
|
@@ -1,12 +1,11 @@
|
|
1
1
|
class CreateBaskets < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :baskets do |t|
|
4
|
-
t.
|
4
|
+
t.references :user, index: true
|
5
5
|
t.text :note
|
6
|
-
t.integer :lock_version, :
|
6
|
+
t.integer :lock_version, default: 0, null: false
|
7
7
|
|
8
8
|
t.timestamps
|
9
9
|
end
|
10
|
-
add_index :baskets, :user_id
|
11
10
|
end
|
12
11
|
end
|
@@ -1,17 +1,14 @@
|
|
1
1
|
class CreateSubscriptions < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :subscriptions do |t|
|
4
|
-
t.text :title, :
|
4
|
+
t.text :title, null: false
|
5
5
|
t.text :note
|
6
|
-
|
7
|
-
t.
|
8
|
-
t.integer :order_list_id
|
6
|
+
t.references :user, index: true
|
7
|
+
t.references :order_list, index: true
|
9
8
|
t.datetime :deleted_at
|
10
|
-
t.integer :subscribes_count, :
|
9
|
+
t.integer :subscribes_count, default: 0, null: false
|
11
10
|
|
12
11
|
t.timestamps
|
13
12
|
end
|
14
|
-
add_index :subscriptions, :user_id
|
15
|
-
add_index :subscriptions, :order_list_id
|
16
13
|
end
|
17
14
|
end
|
@@ -1,14 +1,13 @@
|
|
1
1
|
class CreateSubscribes < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :subscribes do |t|
|
4
|
-
t.
|
5
|
-
t.integer :work_id, :
|
6
|
-
t.datetime :start_at, :
|
7
|
-
t.datetime :end_at, :
|
4
|
+
t.references :subscription, index: true, null: false
|
5
|
+
t.integer :work_id, null: false
|
6
|
+
t.datetime :start_at, null: false
|
7
|
+
t.datetime :end_at, null: false
|
8
8
|
|
9
9
|
t.timestamps
|
10
10
|
end
|
11
|
-
add_index :subscribes, :subscription_id
|
12
11
|
add_index :subscribes, :work_id
|
13
12
|
end
|
14
13
|
end
|
@@ -1,14 +1,11 @@
|
|
1
1
|
class CreateAccepts < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :accepts do |t|
|
4
|
-
t.
|
5
|
-
t.
|
6
|
-
t.
|
4
|
+
t.references :basket, index: true
|
5
|
+
t.references :item, index: true
|
6
|
+
t.references :librarian, index: true
|
7
7
|
|
8
8
|
t.timestamps
|
9
9
|
end
|
10
|
-
|
11
|
-
add_index :accepts, :basket_id
|
12
|
-
add_index :accepts, :item_id
|
13
10
|
end
|
14
11
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class CreateUserImportResults < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :user_import_results do |t|
|
4
|
-
t.
|
5
|
-
t.
|
4
|
+
t.references :user_import_file, index: true
|
5
|
+
t.references :user, index: true
|
6
6
|
t.text :body
|
7
7
|
|
8
8
|
t.timestamps
|
@@ -8,11 +8,10 @@ class CreateUserImportFileTransitions < ActiveRecord::Migration
|
|
8
8
|
t.text :metadata, default: "{}"
|
9
9
|
end
|
10
10
|
t.integer :sort_key
|
11
|
-
t.
|
11
|
+
t.references :user_import_file, index: true
|
12
12
|
t.timestamps
|
13
13
|
end
|
14
14
|
|
15
|
-
add_index :user_import_file_transitions, :user_import_file_id
|
16
15
|
add_index :user_import_file_transitions, [:sort_key, :user_import_file_id], unique: true, name: "index_user_import_file_transitions_on_sort_key_and_file_id"
|
17
16
|
end
|
18
17
|
end
|
@@ -1,14 +1,12 @@
|
|
1
1
|
class CreateColors < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :colors do |t|
|
4
|
-
t.
|
4
|
+
t.references :library_group, index: true
|
5
5
|
t.string :property
|
6
6
|
t.string :code
|
7
7
|
t.integer :position
|
8
8
|
|
9
9
|
t.timestamps
|
10
10
|
end
|
11
|
-
|
12
|
-
add_index :colors, :library_group_id
|
13
11
|
end
|
14
12
|
end
|
@@ -1,13 +1,11 @@
|
|
1
1
|
class CreateWithdraws < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :withdraws do |t|
|
4
|
-
t.
|
5
|
-
t.
|
6
|
-
t.
|
4
|
+
t.references :basket, index: true
|
5
|
+
t.references :item, index: true
|
6
|
+
t.references :librarian, index: true
|
7
7
|
|
8
8
|
t.timestamps null: false
|
9
9
|
end
|
10
|
-
add_index :withdraws, :basket_id
|
11
|
-
add_index :withdraws, :item_id
|
12
10
|
end
|
13
11
|
end
|
@@ -1,13 +1,26 @@
|
|
1
|
+
# This migration comes from enju_library_engine (originally 20151213070943)
|
1
2
|
class AddTranslationTableToLibraryGroup < ActiveRecord::Migration
|
2
3
|
def up
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
if defined?(Globalize)
|
5
|
+
LibraryGroup.create_translation_table!({
|
6
|
+
login_banner: :text
|
7
|
+
}, {
|
8
|
+
migrate_data: true
|
9
|
+
})
|
10
|
+
end
|
11
|
+
|
12
|
+
if defined?(AwesomeHstoreTranslate)
|
13
|
+
add_column :library_groups, :login_banner, :hstore
|
14
|
+
end
|
8
15
|
end
|
9
16
|
|
10
17
|
def down
|
11
|
-
|
18
|
+
if defined?(Globalize)
|
19
|
+
LibraryGroup.drop_translation_table! migrate_data: true
|
20
|
+
end
|
21
|
+
|
22
|
+
if defined?(AwesomeHstoreTranslate)
|
23
|
+
remove_column :library_groups, :login_banner
|
24
|
+
end
|
12
25
|
end
|
13
26
|
end
|
@@ -1,9 +1,22 @@
|
|
1
|
+
# This migration comes from enju_library_engine (originally 20151213072705)
|
1
2
|
class AddFooterBannerToLibraryGroup < ActiveRecord::Migration
|
2
3
|
def up
|
3
|
-
|
4
|
+
if defined?(Globalize)
|
5
|
+
LibraryGroup.add_translation_fields! footer_banner: :text
|
6
|
+
end
|
7
|
+
|
8
|
+
if defined?(AwesomeHstoreTranslate)
|
9
|
+
add_column :library_groups, :footer_banner, :hstore
|
10
|
+
end
|
4
11
|
end
|
5
12
|
|
6
13
|
def down
|
7
|
-
|
14
|
+
if defined?(Globalize)
|
15
|
+
remove_column :library_group_translations, :footer_banner
|
16
|
+
end
|
17
|
+
|
18
|
+
if defined?(AwesomeHstoreTranslate)
|
19
|
+
remove_column :library_groups, :footer_banner
|
20
|
+
end
|
8
21
|
end
|
9
22
|
end
|
data/lib/enju_library/version.rb
CHANGED
@@ -126,7 +126,8 @@ describe BudgetTypesController do
|
|
126
126
|
position = budget_type.position
|
127
127
|
put :update, :id => budget_type.id, :move => 'higher'
|
128
128
|
response.should redirect_to budget_types_url
|
129
|
-
|
129
|
+
budget_type.reload
|
130
|
+
budget_type.position.should eq position - 1
|
130
131
|
end
|
131
132
|
end
|
132
133
|
|
@@ -8,7 +8,7 @@ class AddDcndlSchema < ActiveRecord::Migration
|
|
8
8
|
add_column :manifestations, :valid_until, :timestamp
|
9
9
|
add_column :manifestations, :date_submitted, :timestamp
|
10
10
|
add_column :manifestations, :date_accepted, :timestamp
|
11
|
-
add_column :manifestations, :
|
11
|
+
add_column :manifestations, :date_captured, :timestamp
|
12
12
|
rename_column :manifestations, :copyright_date, :date_copyrighted
|
13
13
|
end
|
14
14
|
|
@@ -21,7 +21,7 @@ class AddDcndlSchema < ActiveRecord::Migration
|
|
21
21
|
remove_column :manifestations, :valid_until
|
22
22
|
remove_column :manifestations, :date_submitted
|
23
23
|
remove_column :manifestations, :date_accepted
|
24
|
-
remove_column :manifestations, :
|
24
|
+
remove_column :manifestations, :date_captured
|
25
25
|
rename_column :manifestations, :date_copyrighted, :copyright_date
|
26
26
|
end
|
27
27
|
end
|