enju_manifestation_viewer 0.3.0.beta.1 → 0.3.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/enju_manifestation_viewer/application_helper.rb +9 -10
- data/app/helpers/enju_manifestation_viewer/book_jacket_helper.rb +13 -13
- data/app/helpers/enju_manifestation_viewer/manifestation_viewer_helper.rb +5 -0
- data/lib/enju_manifestation_viewer.rb +3 -3
- data/lib/enju_manifestation_viewer/version.rb +1 -1
- data/spec/dummy/db/migrate/001_create_agents.rb +6 -6
- data/spec/dummy/db/migrate/002_devise_create_users.rb +5 -6
- data/spec/dummy/db/migrate/005_create_manifestations.rb +12 -12
- data/spec/dummy/db/migrate/006_create_items.rb +5 -5
- data/spec/dummy/db/migrate/012_create_owns.rb +2 -2
- data/spec/dummy/db/migrate/015_create_creates.rb +2 -2
- data/spec/dummy/db/migrate/041_create_roles.rb +2 -2
- data/spec/dummy/db/migrate/047_create_produces.rb +2 -2
- data/spec/dummy/db/migrate/073_create_carrier_types.rb +1 -1
- data/spec/dummy/db/migrate/077_create_user_groups.rb +1 -1
- data/spec/dummy/db/migrate/112_create_frequencies.rb +1 -1
- data/spec/dummy/db/migrate/117_create_form_of_works.rb +1 -1
- data/spec/dummy/db/migrate/124_create_bookstores.rb +1 -1
- data/spec/dummy/db/migrate/125_create_donates.rb +2 -2
- data/spec/dummy/db/migrate/130_create_request_status_types.rb +1 -1
- data/spec/dummy/db/migrate/131_create_request_types.rb +1 -1
- data/spec/dummy/db/migrate/133_create_agent_merges.rb +1 -1
- data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +2 -2
- data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +3 -3
- data/spec/dummy/db/migrate/20080905191442_create_agent_types.rb +1 -1
- data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +5 -5
- data/spec/dummy/db/migrate/20081025083323_create_countries.rb +8 -9
- data/spec/dummy/db/migrate/20081025083905_create_languages.rb +5 -6
- data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +1 -1
- data/spec/dummy/db/migrate/20090720091106_create_medium_of_performances.rb +1 -1
- data/spec/dummy/db/migrate/20090720091429_create_content_types.rb +1 -1
- data/spec/dummy/db/migrate/20090812151902_create_agent_relationship_types.rb +1 -1
- data/spec/dummy/db/migrate/20091025080447_create_licenses.rb +1 -1
- data/spec/dummy/db/migrate/20091202124834_create_versions.rb +5 -5
- data/spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb +1 -1
- data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +1 -1
- data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +2 -2
- data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +0 -1
- data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +0 -1
- data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +1 -2
- data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +1 -1
- data/spec/dummy/db/migrate/20130221154434_add_additional_attributes_to_user.rb +3 -3
- data/spec/dummy/db/migrate/20130506175834_create_identifiers.rb +3 -3
- data/spec/dummy/db/migrate/20140122054321_create_profiles.rb +1 -1
- data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +3 -4
- data/spec/dummy/db/migrate/20180107160726_add_constraints_to_most_recent_for_user_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20180107160740_add_constraints_to_most_recent_for_user_export_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20180107161311_add_constraints_to_most_recent_for_agent_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20180107161331_add_constraints_to_most_recent_for_resource_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20180107161347_add_constraints_to_most_recent_for_resource_export_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20180107161410_add_constraints_to_most_recent_for_import_request_transitions.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5f0bbe14880e5173dbc23fa6c25cd570cbff398
|
4
|
+
data.tar.gz: f070c89e7a503e71a96714656142a61e00be2947
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ee64bf311eb0b123ed91f4a9af908fa1c5be5ec430e7bb9124e029f96a8a5c3d78a756b48433547122a95b0d015595e8d4f37d33eb3d86f673c6b841e291290
|
7
|
+
data.tar.gz: 0afe868b9701a6bf98b4d171c9f229515d808fe9ac27396d60f21baa267434fc7632df699e192e97636cd18dad598e7b0a36a790047aa186c4f96c33f721c133
|
@@ -1,19 +1,18 @@
|
|
1
1
|
module EnjuManifestationViewer
|
2
2
|
module ApplicationHelper
|
3
3
|
def google_book_search_preview(isbn)
|
4
|
-
render :
|
4
|
+
render partial: 'manifestations/google_book_search', locals: {isbn: isbn}
|
5
5
|
end
|
6
6
|
|
7
7
|
def embed_content(manifestation)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
render :partial => 'manifestations/scribd', :locals => {:manifestation => manifestation}
|
8
|
+
if manifestation.youtube_id
|
9
|
+
render partial: 'manifestations/youtube', locals: {manifestation: manifestation}
|
10
|
+
elsif manifestation.nicovideo_id
|
11
|
+
render partial: 'manifestations/nicovideo', locals: {manifestation: manifestation}
|
12
|
+
elsif manifestation.flickr.present?
|
13
|
+
render partial: 'manifestations/flickr', locals: {manifestation: manifestation}
|
14
|
+
elsif manifestation.respond_to?(:ipaper_id)
|
15
|
+
render partial: 'manifestations/scribd', locals: {manifestation: manifestation}
|
17
16
|
end
|
18
17
|
end
|
19
18
|
end
|
@@ -4,30 +4,27 @@ module EnjuManifestationViewer
|
|
4
4
|
if manifestation.picture_files.exists?
|
5
5
|
link = ''
|
6
6
|
manifestation.picture_files.each_with_index do |picture_file, i|
|
7
|
-
if i == 0
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
7
|
+
link += if i == 0
|
8
|
+
link_to(show_image(picture_file, size: :thumb), picture_file_path(picture_file, format: :download), rel: "manifestation_#{manifestation.id}")
|
9
|
+
else
|
10
|
+
content_tag :span, style: "display: none" do
|
11
|
+
link_to(show_image(picture_file, size: :thumb), picture_file_path(picture_file, format: :download), rel: "manifestation_#{manifestation.id}")
|
12
|
+
end
|
13
|
+
end
|
14
14
|
end
|
15
15
|
return link.html_safe
|
16
16
|
else
|
17
17
|
link = book_jacket_tag(manifestation)
|
18
|
-
|
19
|
-
link = screenshot_tag(manifestation)
|
20
|
-
end
|
18
|
+
link ||= screenshot_tag(manifestation)
|
21
19
|
end
|
22
20
|
|
23
|
-
|
24
|
-
link = link_to image_tag('unknown_resource.png', width: '100', height: '100', alt: '*', itemprop: 'image'), manifestation
|
25
|
-
end
|
21
|
+
link ||= link_to image_tag('unknown_resource.png', width: '100', height: '100', alt: '*', itemprop: 'image'), manifestation
|
26
22
|
link
|
27
23
|
end
|
28
24
|
|
29
25
|
def screenshot_tag(manifestation, generator = LibraryGroup.site_config.screenshot_generator)
|
30
26
|
return nil unless manifestation.try(:access_address)
|
27
|
+
|
31
28
|
case generator
|
32
29
|
when "mozshot"
|
33
30
|
link_to image_tag("http://mozshot.nemui.org/shot?#{manifestation.access_address}", width: 128, height: 128, alt: manifestation.original_title, border: 0, itemprop: 'image'), manifestation.access_address
|
@@ -42,9 +39,11 @@ module EnjuManifestationViewer
|
|
42
39
|
|
43
40
|
def book_jacket_tag(manifestation, generator = LibraryGroup.site_config.book_jacket_source)
|
44
41
|
return nil unless manifestation
|
42
|
+
|
45
43
|
case generator
|
46
44
|
when "amazon"
|
47
45
|
return nil unless LibraryGroup.site_config.settings[:amazon_hostname]
|
46
|
+
|
48
47
|
book_jacket = manifestation.amazon_book_jacket
|
49
48
|
if book_jacket
|
50
49
|
link_to image_tag(book_jacket[:url], width: book_jacket[:width], height: book_jacket[:height], alt: manifestation.original_title, class: 'book_jacket', itemprop: 'image'), "http://#{LibraryGroup.site_config.settings[:amazon_hostname]}/dp/#{book_jacket[:asin]}"
|
@@ -60,6 +59,7 @@ module EnjuManifestationViewer
|
|
60
59
|
|
61
60
|
def amazon_link(asin, hostname = LibraryGroup.site_config.settings[:amazon_hostname])
|
62
61
|
return nil if asin.blank?
|
62
|
+
|
63
63
|
"http://#{hostname}/dp/#{asin}"
|
64
64
|
end
|
65
65
|
|
@@ -16,7 +16,7 @@ module EnjuManifestationViewer
|
|
16
16
|
def youtube_id
|
17
17
|
if access_address
|
18
18
|
url = ::Addressable::URI.parse(access_address)
|
19
|
-
if url.host =~ /youtube\.com$/
|
19
|
+
if url.host =~ /youtube\.com$/ && (url.path == "/watch")
|
20
20
|
return CGI.parse(url.query)["v"][0]
|
21
21
|
end
|
22
22
|
end
|
@@ -25,7 +25,7 @@ module EnjuManifestationViewer
|
|
25
25
|
def nicovideo_id
|
26
26
|
if access_address
|
27
27
|
url = ::Addressable::URI.parse(access_address)
|
28
|
-
if url.host =~ /nicovideo\.jp$/
|
28
|
+
if url.host =~ /nicovideo\.jp$/ && url.path =~ /^\/watch/
|
29
29
|
return url.path.split("/")[2]
|
30
30
|
end
|
31
31
|
end
|
@@ -35,7 +35,7 @@ module EnjuManifestationViewer
|
|
35
35
|
if access_address
|
36
36
|
url = ::Addressable::URI.parse(access_address)
|
37
37
|
paths = url.path.split('/')
|
38
|
-
if url.host =~ /^www\.flickr\.com$/
|
38
|
+
if url.host =~ /^www\.flickr\.com$/ && (paths[1] == 'photos') && paths[2]
|
39
39
|
info = {}
|
40
40
|
if paths[3] == "sets"
|
41
41
|
info[:user] = paths[2]
|
@@ -32,13 +32,13 @@ class CreateAgents < ActiveRecord::Migration[4.2]
|
|
32
32
|
t.text :region
|
33
33
|
t.datetime :date_of_birth
|
34
34
|
t.datetime :date_of_death
|
35
|
-
t.integer :language_id, :
|
36
|
-
t.integer :country_id, :
|
37
|
-
t.integer :agent_type_id, :
|
38
|
-
t.integer :lock_version, :
|
35
|
+
t.integer :language_id, default: 1, null: false
|
36
|
+
t.integer :country_id, default: 1, null: false
|
37
|
+
t.integer :agent_type_id, default: 1, null: false
|
38
|
+
t.integer :lock_version, default: 0, null: false
|
39
39
|
t.text :note
|
40
|
-
t.integer :required_role_id, :
|
41
|
-
t.integer :required_score, :
|
40
|
+
t.integer :required_role_id, default: 1, null: false
|
41
|
+
t.integer :required_score, default: 0, null: false
|
42
42
|
t.text :email
|
43
43
|
t.text :url
|
44
44
|
end
|
@@ -2,8 +2,8 @@ class DeviseCreateUsers < ActiveRecord::Migration[4.2]
|
|
2
2
|
def change
|
3
3
|
create_table(:users) do |t|
|
4
4
|
## Database authenticatable
|
5
|
-
t.string :email, :
|
6
|
-
t.string :encrypted_password, :
|
5
|
+
t.string :email, null: false, default: ""
|
6
|
+
t.string :encrypted_password, null: false, default: ""
|
7
7
|
|
8
8
|
## Recoverable
|
9
9
|
t.string :reset_password_token
|
@@ -13,7 +13,7 @@ class DeviseCreateUsers < ActiveRecord::Migration[4.2]
|
|
13
13
|
t.datetime :remember_created_at
|
14
14
|
|
15
15
|
## Trackable
|
16
|
-
t.integer :sign_in_count, :
|
16
|
+
t.integer :sign_in_count, default: 0
|
17
17
|
t.datetime :current_sign_in_at
|
18
18
|
t.datetime :last_sign_in_at
|
19
19
|
t.string :current_sign_in_ip
|
@@ -33,12 +33,11 @@ class DeviseCreateUsers < ActiveRecord::Migration[4.2]
|
|
33
33
|
## Token authenticatable
|
34
34
|
# t.string :authentication_token
|
35
35
|
|
36
|
-
|
37
36
|
t.timestamps
|
38
37
|
end
|
39
38
|
|
40
|
-
add_index :users, :email, :
|
41
|
-
add_index :users, :reset_password_token, :
|
39
|
+
add_index :users, :email, unique: true
|
40
|
+
add_index :users, :reset_password_token, unique: true
|
42
41
|
# add_index :users, :confirmation_token, :unique => true
|
43
42
|
# add_index :users, :unlock_token, :unique => true
|
44
43
|
# add_index :users, :authentication_token, :unique => true
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class CreateManifestations < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
create_table :manifestations do |t|
|
4
|
-
t.text :original_title, :
|
4
|
+
t.text :original_title, null: false
|
5
5
|
t.text :title_alternative
|
6
6
|
t.text :title_transcription
|
7
7
|
t.string :classification_number
|
@@ -11,8 +11,8 @@ class CreateManifestations < ActiveRecord::Migration[4.2]
|
|
11
11
|
t.timestamps
|
12
12
|
t.datetime :deleted_at
|
13
13
|
t.string :access_address
|
14
|
-
t.integer :language_id, :
|
15
|
-
t.integer :carrier_type_id, :
|
14
|
+
t.integer :language_id, default: 1, null: false
|
15
|
+
t.integer :carrier_type_id, default: 1, null: false
|
16
16
|
t.integer :start_page
|
17
17
|
t.integer :end_page
|
18
18
|
t.integer :height
|
@@ -25,17 +25,17 @@ class CreateManifestations < ActiveRecord::Migration[4.2]
|
|
25
25
|
t.string :serial_number_string
|
26
26
|
t.integer :edition
|
27
27
|
t.text :note
|
28
|
-
t.boolean :repository_content, :
|
29
|
-
t.integer :lock_version, :
|
30
|
-
t.integer :required_role_id, :
|
31
|
-
t.integer :required_score, :
|
32
|
-
t.integer :frequency_id, :
|
33
|
-
t.boolean :subscription_master, :
|
28
|
+
t.boolean :repository_content, default: false, null: false
|
29
|
+
t.integer :lock_version, default: 0, null: false
|
30
|
+
t.integer :required_role_id, default: 1, null: false
|
31
|
+
t.integer :required_score, default: 0, null: false
|
32
|
+
t.integer :frequency_id, default: 1, null: false
|
33
|
+
t.boolean :subscription_master, default: false, null: false
|
34
34
|
end
|
35
|
-
#add_index :manifestations, :carrier_type_id
|
36
|
-
#add_index :manifestations, :required_role_id
|
35
|
+
# add_index :manifestations, :carrier_type_id
|
36
|
+
# add_index :manifestations, :required_role_id
|
37
37
|
add_index :manifestations, :access_address
|
38
|
-
#add_index :manifestations, :frequency_id
|
38
|
+
# add_index :manifestations, :frequency_id
|
39
39
|
add_index :manifestations, :manifestation_identifier
|
40
40
|
add_index :manifestations, :updated_at
|
41
41
|
add_index :manifestations, :date_of_publication
|
@@ -5,14 +5,14 @@ class CreateItems < ActiveRecord::Migration[4.2]
|
|
5
5
|
t.string :item_identifier
|
6
6
|
t.timestamps
|
7
7
|
t.datetime :deleted_at
|
8
|
-
t.integer :shelf_id, :
|
9
|
-
t.boolean :include_supplements, :
|
8
|
+
t.integer :shelf_id, default: 1, null: false
|
9
|
+
t.boolean :include_supplements, default: false, null: false
|
10
10
|
t.text :note
|
11
11
|
t.string :url
|
12
12
|
t.integer :price
|
13
|
-
t.integer :lock_version, :
|
14
|
-
t.integer :required_role_id, :
|
15
|
-
t.integer :required_score, :
|
13
|
+
t.integer :lock_version, default: 0, null: false
|
14
|
+
t.integer :required_role_id, default: 1, null: false
|
15
|
+
t.integer :required_score, default: 0, null: false
|
16
16
|
end
|
17
17
|
add_index :items, :shelf_id
|
18
18
|
add_index :items, :item_identifier
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class CreateOwns < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
create_table :owns do |t|
|
4
|
-
t.references :agent, :
|
5
|
-
t.references :item, :
|
4
|
+
t.references :agent, null: false
|
5
|
+
t.references :item, null: false
|
6
6
|
t.integer :position
|
7
7
|
t.timestamps
|
8
8
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class CreateCreates < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
create_table :creates do |t|
|
4
|
-
t.references :agent, :
|
5
|
-
t.references :work, :
|
4
|
+
t.references :agent, null: false
|
5
|
+
t.references :work, null: false
|
6
6
|
t.integer :position
|
7
7
|
t.timestamps
|
8
8
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
class CreateRoles < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
create_table "roles" do |t|
|
4
|
-
t.column :name, :string, :
|
4
|
+
t.column :name, :string, null: false
|
5
5
|
t.column :display_name, :string
|
6
6
|
t.column :note, :text
|
7
7
|
t.column :created_at, :datetime
|
8
8
|
t.column :updated_at, :datetime
|
9
|
-
t.integer :score, :
|
9
|
+
t.integer :score, default: 0, null: false
|
10
10
|
t.integer :position
|
11
11
|
end
|
12
12
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class CreateProduces < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
create_table :produces do |t|
|
4
|
-
t.references :agent, :
|
5
|
-
t.references :manifestation, :
|
4
|
+
t.references :agent, null: false
|
5
|
+
t.references :manifestation, null: false
|
6
6
|
t.integer :position
|
7
7
|
t.timestamps
|
8
8
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class CreateRealizes < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
create_table :realizes do |t|
|
4
|
-
t.references :agent, :
|
5
|
-
t.references :expression, :
|
4
|
+
t.references :agent, null: false
|
5
|
+
t.references :expression, null: false
|
6
6
|
t.integer :position
|
7
7
|
|
8
8
|
t.timestamps
|
@@ -1,13 +1,13 @@
|
|
1
1
|
class CreateExemplifies < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
create_table :exemplifies do |t|
|
4
|
-
t.integer :manifestation_id, :
|
5
|
-
t.integer :item_id, :
|
4
|
+
t.integer :manifestation_id, null: false
|
5
|
+
t.integer :item_id, null: false
|
6
6
|
t.integer :position
|
7
7
|
|
8
8
|
t.timestamps
|
9
9
|
end
|
10
10
|
add_index :exemplifies, :manifestation_id
|
11
|
-
add_index :exemplifies, :item_id, :
|
11
|
+
add_index :exemplifies, :item_id, unique: true
|
12
12
|
end
|
13
13
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
class CreateSearchEngines < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
create_table :search_engines do |t|
|
4
|
-
t.string :name, :
|
4
|
+
t.string :name, null: false
|
5
5
|
t.text :display_name
|
6
|
-
t.string :url, :
|
7
|
-
t.text :base_url, :
|
8
|
-
t.text :http_method, :
|
9
|
-
t.text :query_param, :
|
6
|
+
t.string :url, null: false
|
7
|
+
t.text :base_url, null: false
|
8
|
+
t.text :http_method, null: false
|
9
|
+
t.text :query_param, null: false
|
10
10
|
t.text :additional_param
|
11
11
|
t.text :note
|
12
12
|
t.integer :position
|
@@ -1,22 +1,21 @@
|
|
1
1
|
class CreateCountries < ActiveRecord::Migration[4.2]
|
2
|
-
|
3
2
|
# ISO 3166 is the International Standard for country codes.
|
4
3
|
#
|
5
|
-
# ISO 3166-1:2006 Codes for the representation of names of countries and their subdivisions - Part 1:
|
6
|
-
# Country codes which is what most users know as ISO's country codes. First published in 1974, it is has since
|
7
|
-
# then become one of the world's most popular and most widely used standard solution for coding country names.
|
8
|
-
# It contains a two-letter code which is recommended as the general purpose code, a three-letter code which has
|
4
|
+
# ISO 3166-1:2006 Codes for the representation of names of countries and their subdivisions - Part 1:
|
5
|
+
# Country codes which is what most users know as ISO's country codes. First published in 1974, it is has since
|
6
|
+
# then become one of the world's most popular and most widely used standard solution for coding country names.
|
7
|
+
# It contains a two-letter code which is recommended as the general purpose code, a three-letter code which has
|
9
8
|
# better mnenomic properties and a numeric-3 code which can be useful if script independence of the codes is important.
|
10
9
|
#
|
11
10
|
# http://www.iso.org/iso/country_codes/background_on_iso_3166/what_is_iso_3166.htm
|
12
11
|
|
13
12
|
def change
|
14
13
|
create_table :countries do |t|
|
15
|
-
t.string :name,
|
14
|
+
t.string :name, size: 80, null: false
|
16
15
|
t.text :display_name
|
17
|
-
t.string :alpha_2, :
|
18
|
-
t.string :alpha_3, :
|
19
|
-
t.string :numeric_3, :
|
16
|
+
t.string :alpha_2, size: 2
|
17
|
+
t.string :alpha_3, size: 3
|
18
|
+
t.string :numeric_3, size: 3
|
20
19
|
t.text :note
|
21
20
|
t.integer :position
|
22
21
|
end
|
@@ -1,21 +1,20 @@
|
|
1
1
|
class CreateLanguages < ActiveRecord::Migration[4.2]
|
2
|
-
|
3
2
|
# ISO 639 is the set of international standards that lists short codes for language names.
|
4
3
|
# Note this doesn't include macrolanguages (dialects)
|
5
4
|
# Information on macrolanguages http://en.wikipedia.org/wiki/ISO_639_macrolanguage
|
6
5
|
|
7
6
|
def change
|
8
7
|
create_table :languages do |t|
|
9
|
-
t.string :name, :
|
8
|
+
t.string :name, null: false
|
10
9
|
t.string :native_name
|
11
10
|
t.text :display_name
|
12
|
-
t.string :iso_639_1, :
|
13
|
-
t.string :iso_639_2, :
|
14
|
-
t.string :iso_639_3, :
|
11
|
+
t.string :iso_639_1, size: 3
|
12
|
+
t.string :iso_639_2, size: 3
|
13
|
+
t.string :iso_639_3, size: 3
|
15
14
|
t.text :note
|
16
15
|
t.integer :position
|
17
16
|
end
|
18
|
-
add_index :languages, :name, :
|
17
|
+
add_index :languages, :name, unique: true
|
19
18
|
add_index :languages, :iso_639_1
|
20
19
|
add_index :languages, :iso_639_2
|
21
20
|
add_index :languages, :iso_639_3
|
@@ -10,6 +10,6 @@ class CreatePictureFiles < ActiveRecord::Migration[4.2]
|
|
10
10
|
|
11
11
|
t.timestamps
|
12
12
|
end
|
13
|
-
add_index :picture_files, [
|
13
|
+
add_index :picture_files, %i[picture_attachable_id picture_attachable_type], name: "index_picture_files_on_picture_attachable_id_and_type"
|
14
14
|
end
|
15
15
|
end
|
@@ -1,18 +1,18 @@
|
|
1
1
|
class CreateVersions < ActiveRecord::Migration[4.2]
|
2
2
|
def self.up
|
3
3
|
create_table :versions do |t|
|
4
|
-
t.string :item_type, :
|
5
|
-
t.integer :item_id, :
|
6
|
-
t.string :event, :
|
4
|
+
t.string :item_type, null: false
|
5
|
+
t.integer :item_id, null: false
|
6
|
+
t.string :event, null: false
|
7
7
|
t.string :whodunnit
|
8
8
|
t.text :object
|
9
9
|
t.datetime :created_at
|
10
10
|
end
|
11
|
-
add_index :versions, [
|
11
|
+
add_index :versions, %i[item_type item_id]
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.down
|
15
|
-
remove_index :versions, [
|
15
|
+
remove_index :versions, %i[item_type item_id]
|
16
16
|
drop_table :versions
|
17
17
|
end
|
18
18
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class AddValidPeriodForNewUserToUserGroup < ActiveRecord::Migration[4.2]
|
2
2
|
def self.up
|
3
|
-
add_column :user_groups, :valid_period_for_new_user, :integer, :
|
3
|
+
add_column :user_groups, :valid_period_for_new_user, :integer, default: 0, null: false
|
4
4
|
add_column :user_groups, :expired_at, :timestamp
|
5
5
|
end
|
6
6
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class CreateSeriesStatementMerges < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
create_table :series_statement_merges do |t|
|
4
|
-
t.integer :series_statement_id, :
|
5
|
-
t.integer :series_statement_merge_list_id, :
|
4
|
+
t.integer :series_statement_id, null: false
|
5
|
+
t.integer :series_statement_merge_list_id, null: false
|
6
6
|
|
7
7
|
t.timestamps
|
8
8
|
end
|
@@ -4,13 +4,13 @@ class AddAdditionalAttributesToUser < ActiveRecord::Migration[4.2]
|
|
4
4
|
add_column :users, :deleted_at, :datetime
|
5
5
|
add_column :users, :expired_at, :datetime
|
6
6
|
|
7
|
-
add_column :users, :failed_attempts, :integer, :
|
7
|
+
add_column :users, :failed_attempts, :integer, default: 0
|
8
8
|
add_column :users, :unlock_token, :string
|
9
9
|
add_column :users, :locked_at, :datetime
|
10
10
|
|
11
11
|
add_column :users, :confirmed_at, :datetime
|
12
12
|
|
13
|
-
add_index :users, :username, :
|
14
|
-
add_index :users, :unlock_token,
|
13
|
+
add_index :users, :username, unique: true
|
14
|
+
add_index :users, :unlock_token, unique: true
|
15
15
|
end
|
16
16
|
end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
class CreateIdentifiers < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
create_table :identifiers do |t|
|
4
|
-
t.string :body, :
|
5
|
-
t.integer :identifier_type_id, :
|
4
|
+
t.string :body, null: false
|
5
|
+
t.integer :identifier_type_id, null: false
|
6
6
|
t.integer :manifestation_id
|
7
7
|
t.boolean :primary
|
8
8
|
t.integer :position
|
9
9
|
|
10
10
|
t.timestamps
|
11
11
|
end
|
12
|
-
add_index :identifiers, [
|
12
|
+
add_index :identifiers, %i[body identifier_type_id]
|
13
13
|
add_index :identifiers, :manifestation_id
|
14
14
|
end
|
15
15
|
end
|
@@ -13,6 +13,6 @@ class CreateResourceImportFileTransitions < ActiveRecord::Migration[4.2]
|
|
13
13
|
end
|
14
14
|
|
15
15
|
add_index :resource_import_file_transitions, :resource_import_file_id, name: "index_resource_import_file_transitions_on_file_id"
|
16
|
-
add_index :resource_import_file_transitions, [
|
16
|
+
add_index :resource_import_file_transitions, %i[sort_key resource_import_file_id], unique: true, name: "index_resource_import_file_transitions_on_sort_key_and_file_id"
|
17
17
|
end
|
18
18
|
end
|
@@ -13,6 +13,6 @@ class CreateImportRequestTransitions < ActiveRecord::Migration[4.2]
|
|
13
13
|
end
|
14
14
|
|
15
15
|
add_index :import_request_transitions, :import_request_id
|
16
|
-
add_index :import_request_transitions, [
|
16
|
+
add_index :import_request_transitions, %i[sort_key import_request_id], unique: true, name: "index_import_request_transitions_on_sort_key_and_request_id"
|
17
17
|
end
|
18
18
|
end
|
@@ -13,6 +13,6 @@ class CreateAgentImportFileTransitions < ActiveRecord::Migration[4.2]
|
|
13
13
|
end
|
14
14
|
|
15
15
|
add_index :agent_import_file_transitions, :agent_import_file_id
|
16
|
-
add_index :agent_import_file_transitions, [
|
16
|
+
add_index :agent_import_file_transitions, %i[sort_key agent_import_file_id], unique: true, name: "index_agent_import_file_transitions_on_sort_key_and_file_id"
|
17
17
|
end
|
18
18
|
end
|
@@ -12,6 +12,6 @@ class CreateUserImportFileTransitions < ActiveRecord::Migration[4.2]
|
|
12
12
|
t.timestamps
|
13
13
|
end
|
14
14
|
|
15
|
-
add_index :user_import_file_transitions, [
|
15
|
+
add_index :user_import_file_transitions, %i[sort_key user_import_file_id], unique: true, name: "index_user_import_file_transitions_on_sort_key_and_file_id"
|
16
16
|
end
|
17
17
|
end
|
@@ -13,6 +13,6 @@ class CreateResourceExportFileTransitions < ActiveRecord::Migration[4.2]
|
|
13
13
|
end
|
14
14
|
|
15
15
|
add_index :resource_export_file_transitions, :resource_export_file_id, name: "index_resource_export_file_transitions_on_file_id"
|
16
|
-
add_index :resource_export_file_transitions, [
|
16
|
+
add_index :resource_export_file_transitions, %i[sort_key resource_export_file_id], unique: true, name: "index_resource_export_file_transitions_on_sort_key_and_file_id"
|
17
17
|
end
|
18
18
|
end
|
@@ -13,6 +13,6 @@ class CreateUserExportFileTransitions < ActiveRecord::Migration[4.2]
|
|
13
13
|
end
|
14
14
|
|
15
15
|
add_index :user_export_file_transitions, :user_export_file_id, name: "index_user_export_file_transitions_on_file_id"
|
16
|
-
add_index :user_export_file_transitions, [
|
16
|
+
add_index :user_export_file_transitions, %i[sort_key user_export_file_id], unique: true, name: "index_user_export_file_transitions_on_sort_key_and_file_id"
|
17
17
|
end
|
18
18
|
end
|
@@ -3,10 +3,9 @@ class AddTranslationTableToLibraryGroup < ActiveRecord::Migration[4.2]
|
|
3
3
|
def up
|
4
4
|
if defined?(Globalize)
|
5
5
|
LibraryGroup.create_translation_table!({
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
})
|
6
|
+
login_banner: :text
|
7
|
+
},
|
8
|
+
migrate_data: true)
|
10
9
|
end
|
11
10
|
|
12
11
|
if defined?(AwesomeHstoreTranslate)
|
@@ -2,7 +2,7 @@ class AddConstraintsToMostRecentForUserImportFileTransitions < ActiveRecord::Mig
|
|
2
2
|
disable_ddl_transaction!
|
3
3
|
|
4
4
|
def up
|
5
|
-
add_index :user_import_file_transitions, [
|
5
|
+
add_index :user_import_file_transitions, %i[user_import_file_id most_recent], unique: true, where: "most_recent", name: "index_user_import_file_transitions_parent_most_recent" # , algorithm: :concurrently
|
6
6
|
change_column_null :user_import_file_transitions, :most_recent, false
|
7
7
|
end
|
8
8
|
|
@@ -2,7 +2,7 @@ class AddConstraintsToMostRecentForUserExportFileTransitions < ActiveRecord::Mig
|
|
2
2
|
disable_ddl_transaction!
|
3
3
|
|
4
4
|
def up
|
5
|
-
add_index :user_export_file_transitions, [
|
5
|
+
add_index :user_export_file_transitions, %i[user_export_file_id most_recent], unique: true, where: "most_recent", name: "index_user_export_file_transitions_parent_most_recent" # , algorithm: :concurrently
|
6
6
|
change_column_null :user_export_file_transitions, :most_recent, false
|
7
7
|
end
|
8
8
|
|
@@ -2,7 +2,7 @@ class AddConstraintsToMostRecentForAgentImportFileTransitions < ActiveRecord::Mi
|
|
2
2
|
disable_ddl_transaction!
|
3
3
|
|
4
4
|
def up
|
5
|
-
add_index :agent_import_file_transitions, [
|
5
|
+
add_index :agent_import_file_transitions, %i[agent_import_file_id most_recent], unique: true, where: "most_recent", name: "index_agent_import_file_transitions_parent_most_recent" # , algorithm: :concurrently
|
6
6
|
change_column_null :agent_import_file_transitions, :most_recent, false
|
7
7
|
end
|
8
8
|
|
@@ -2,7 +2,7 @@ class AddConstraintsToMostRecentForResourceImportFileTransitions < ActiveRecord:
|
|
2
2
|
disable_ddl_transaction!
|
3
3
|
|
4
4
|
def up
|
5
|
-
add_index :resource_import_file_transitions, [
|
5
|
+
add_index :resource_import_file_transitions, %i[resource_import_file_id most_recent], unique: true, where: "most_recent", name: "index_resource_import_file_transitions_parent_most_recent" # , algorithm: :concurrently
|
6
6
|
change_column_null :resource_import_file_transitions, :most_recent, false
|
7
7
|
end
|
8
8
|
|
@@ -2,7 +2,7 @@ class AddConstraintsToMostRecentForResourceExportFileTransitions < ActiveRecord:
|
|
2
2
|
disable_ddl_transaction!
|
3
3
|
|
4
4
|
def up
|
5
|
-
add_index :resource_export_file_transitions, [
|
5
|
+
add_index :resource_export_file_transitions, %i[resource_export_file_id most_recent], unique: true, where: "most_recent", name: "index_resource_export_file_transitions_parent_most_recent" # , algorithm: :concurrently
|
6
6
|
change_column_null :resource_export_file_transitions, :most_recent, false
|
7
7
|
end
|
8
8
|
|
@@ -2,7 +2,7 @@ class AddConstraintsToMostRecentForImportRequestTransitions < ActiveRecord::Migr
|
|
2
2
|
disable_ddl_transaction!
|
3
3
|
|
4
4
|
def up
|
5
|
-
add_index :import_request_transitions, [
|
5
|
+
add_index :import_request_transitions, %i[import_request_id most_recent], unique: true, where: "most_recent", name: "index_import_request_transitions_parent_most_recent" # , algorithm: :concurrently
|
6
6
|
change_column_null :import_request_transitions, :most_recent, false
|
7
7
|
end
|
8
8
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enju_manifestation_viewer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.0.beta.
|
4
|
+
version: 0.3.0.beta.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kosuke Tanabe
|
@@ -149,6 +149,7 @@ files:
|
|
149
149
|
- app/assets/config/enju_manifestation_viewer_manifest.js
|
150
150
|
- app/helpers/enju_manifestation_viewer/application_helper.rb
|
151
151
|
- app/helpers/enju_manifestation_viewer/book_jacket_helper.rb
|
152
|
+
- app/helpers/enju_manifestation_viewer/manifestation_viewer_helper.rb
|
152
153
|
- app/views/manifestations/_flickr.html.erb
|
153
154
|
- app/views/manifestations/_google_book_search.html.erb
|
154
155
|
- app/views/manifestations/_google_book_thumbnail.html.erb
|