blacklight-spotlight 1.5.1 → 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -3
- data/app/assets/javascripts/spotlight/translation_progress.js +23 -0
- data/app/assets/stylesheets/spotlight/_spotlight.scss +2 -0
- data/app/assets/stylesheets/spotlight/_translations.scss +47 -0
- data/app/assets/stylesheets/spotlight/_utilities.scss +3 -0
- data/app/assets/stylesheets/spotlight/_variables.scss +5 -0
- data/app/controllers/concerns/spotlight/controller.rb +12 -1
- data/app/controllers/spotlight/about_pages_controller.rb +6 -0
- data/app/controllers/spotlight/browse_controller.rb +1 -1
- data/app/controllers/spotlight/catalog_controller.rb +6 -1
- data/app/controllers/spotlight/exhibits_controller.rb +10 -2
- data/app/controllers/spotlight/feature_pages_controller.rb +6 -0
- data/app/controllers/spotlight/filters_controller.rb +2 -2
- data/app/controllers/spotlight/home_pages_controller.rb +10 -0
- data/app/controllers/spotlight/languages_controller.rb +46 -0
- data/app/controllers/spotlight/pages_controller.rb +57 -3
- data/app/controllers/spotlight/solr_controller.rb +3 -3
- data/app/controllers/spotlight/translations_controller.rb +34 -0
- data/app/helpers/spotlight/application_helper.rb +1 -0
- data/app/helpers/spotlight/languages_helper.rb +33 -0
- data/app/helpers/spotlight/translations_helper.rb +13 -0
- data/app/models/concerns/spotlight/custom_translation_extension.rb +4 -0
- data/app/models/concerns/spotlight/translatables.rb +30 -0
- data/app/models/spotlight/ability.rb +5 -2
- data/app/models/spotlight/about_page.rb +1 -1
- data/app/models/spotlight/exhibit.rb +14 -6
- data/app/models/spotlight/feature_page.rb +1 -2
- data/app/models/spotlight/home_page.rb +1 -3
- data/app/models/spotlight/language.rb +24 -0
- data/app/models/spotlight/main_navigation.rb +12 -0
- data/app/models/spotlight/page.rb +53 -1
- data/app/models/spotlight/resources/upload.rb +6 -1
- data/app/models/spotlight/search.rb +4 -0
- data/app/services/spotlight/clone_translated_page_from_locale.rb +32 -0
- data/app/views/_user_util_links.html.erb +1 -0
- data/app/views/devise/mailer/invitation_instructions.html.erb +2 -2
- data/app/views/layouts/spotlight/spotlight.html.erb +2 -2
- data/app/views/shared/_curated_features_navbar.html.erb +2 -2
- data/app/views/spotlight/about_pages/_sidebar.html.erb +1 -1
- data/app/views/spotlight/admin_users/index.html.erb +1 -1
- data/app/views/spotlight/catalog/_edit_default.html.erb +1 -1
- data/app/views/spotlight/exhibits/_export.html.erb +1 -1
- data/app/views/spotlight/exhibits/_form.html.erb +1 -1
- data/app/views/spotlight/exhibits/_import.html.erb +2 -1
- data/app/views/spotlight/exhibits/_languages.html.erb +56 -0
- data/app/views/spotlight/exhibits/edit.html.erb +11 -5
- data/app/views/spotlight/feature_pages/_sidebar.html.erb +1 -1
- data/app/views/spotlight/filters/_form.html.erb +2 -1
- data/app/views/spotlight/resources/upload/_form.html.erb +1 -1
- data/app/views/spotlight/shared/_curation_sidebar.html.erb +5 -0
- data/app/views/spotlight/shared/_locale_picker.html.erb +14 -0
- data/app/views/spotlight/translations/_browse_categories.html.erb +67 -0
- data/app/views/spotlight/translations/_general.html.erb +176 -0
- data/app/views/spotlight/translations/_metadata.html.erb +67 -0
- data/app/views/spotlight/translations/_page.html.erb +45 -0
- data/app/views/spotlight/translations/_pages.html.erb +37 -0
- data/app/views/spotlight/translations/_pages_table.html.erb +15 -0
- data/app/views/spotlight/translations/_search_fields.html.erb +97 -0
- data/app/views/spotlight/translations/edit.html.erb +55 -0
- data/config/i18n-tasks.yml +81 -0
- data/config/locales/devise.en.yml +2 -1
- data/config/locales/spotlight.en.yml +657 -614
- data/config/routes.rb +19 -1
- data/db/migrate/20180308203409_create_spotlight_languages.rb +12 -0
- data/db/migrate/20180403130857_translation_uniqueness.rb +5 -0
- data/db/migrate/20180405044000_add_locale_to_pages.rb +6 -0
- data/db/migrate/20180406212516_add_default_locale_reference_to_spotlight_pages.rb +7 -0
- data/lib/generators/spotlight/templates/catalog_controller.rb +2 -2
- data/lib/generators/spotlight/templates/config/initializers/spotlight_initializer.rb +14 -4
- data/lib/generators/spotlight/templates/config/initializers/translation.rb +4 -2
- data/lib/migration/page_language.rb +27 -0
- data/lib/spotlight/engine.rb +32 -4
- data/lib/spotlight/upload_field_config.rb +27 -0
- data/lib/spotlight/version.rb +1 -1
- data/lib/tasks/spotlight_tasks.rake +6 -0
- data/spec/controllers/spotlight/about_pages_controller_spec.rb +67 -1
- data/spec/controllers/spotlight/feature_pages_controller_spec.rb +50 -0
- data/spec/controllers/spotlight/filters_controller_spec.rb +4 -4
- data/spec/controllers/spotlight/home_pages_controller_spec.rb +25 -0
- data/spec/controllers/spotlight/languages_controller_spec.rb +66 -0
- data/spec/controllers/spotlight/pages_controller_spec.rb +45 -0
- data/spec/controllers/spotlight/solr_controller_spec.rb +1 -1
- data/spec/controllers/spotlight/translations_controller_spec.rb +67 -0
- data/spec/examples.txt +1171 -1281
- data/spec/factories/exhibits.rb +1 -1
- data/spec/factories/language.rb +6 -0
- data/spec/factories/main_navigation.rb +7 -0
- data/spec/factories/searches.rb +1 -0
- data/spec/factories/tags.rb +1 -0
- data/spec/features/exhibits/language_create_edit_spec.rb +53 -0
- data/spec/features/exhibits/translation_editing_spec.rb +397 -0
- data/spec/features/javascript/locale_selector_spec.rb +61 -0
- data/spec/helpers/spotlight/languages_helper_spec.rb +73 -0
- data/spec/helpers/spotlight/translations_helper_spec.rb +16 -0
- data/spec/i18n_spec.rb +29 -0
- data/spec/lib/migration/page_language_spec.rb +21 -0
- data/spec/lib/spotlight/upload_field_config_spec.rb +24 -0
- data/spec/models/spotlight/ability_spec.rb +17 -4
- data/spec/models/spotlight/exhibit_spec.rb +49 -0
- data/spec/models/spotlight/language_spec.rb +41 -0
- data/spec/models/spotlight/page_spec.rb +109 -0
- data/spec/models/translation_spec.rb +11 -0
- data/spec/services/spotlight/clone_translated_page_from_locale_spec.rb +29 -0
- data/spec/spec_helper.rb +1 -13
- data/spec/support/disable_friendly_id_deprecation_warnings.rb +7 -6
- data/spec/test_app_templates/Gemfile.extra +3 -0
- data/spec/test_app_templates/catalog_controller.rb +31 -31
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +9 -6
- data/spec/views/spotlight/contacts/edit.html.erb_spec.rb +13 -0
- data/spec/views/spotlight/exhibits/_form.html.erb_spec.rb +33 -0
- data/spec/views/spotlight/exhibits/edit.html.erb_spec.rb +4 -1
- data/spec/views/spotlight/resources/_external_resources_form.html.erb_spec.rb +13 -0
- data/spec/views/spotlight/resources/new.html.erb_spec.rb +10 -4
- data/spec/views/spotlight/translations/_page.html.erb_spec.rb +75 -0
- metadata +88 -28
- data/app/assets/javascripts/spotlight/sir-trevor.js +0 -0
- data/app/views/shared/_share_follow.html.erb +0 -5
- data/config/locales/social_share_button.en.yml +0 -18
@@ -0,0 +1,11 @@
|
|
1
|
+
describe Translation, type: :model do
|
2
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
3
|
+
describe 'is unique by key, locale, and exhibit' do
|
4
|
+
it 'fails validation' do
|
5
|
+
Translation.create(exhibit_id: exhibit.id, key: 'abc', locale: 'fr', value: 'yo')
|
6
|
+
expect do
|
7
|
+
Translation.create(exhibit_id: exhibit.id, key: 'abc', locale: 'fr', value: 'lo')
|
8
|
+
end.to raise_error(ActiveRecord::RecordNotUnique)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Spotlight::CloneTranslatedPageFromLocale do
|
6
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
7
|
+
let!(:page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
|
8
|
+
let!(:language) { FactoryBot.create(:language, locale: 'es', exhibit: exhibit) }
|
9
|
+
subject(:clone) { described_class.call(locale: language.locale, page: page) }
|
10
|
+
|
11
|
+
it 'clones the exhibit home page for a particular exhibit' do
|
12
|
+
expect(Spotlight::Page.where(locale: 'es')).not_to be_present
|
13
|
+
expect { clone.save }.to change(Spotlight::Page, :count).by(1)
|
14
|
+
expect(Spotlight::Page.unscope(:order).last.locale).to eq 'es'
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'when a translated page already exists for that locale' do
|
18
|
+
let(:translated_page) { page.clone_for_locale('es') }
|
19
|
+
|
20
|
+
it 'destroys it first' do
|
21
|
+
expect(Spotlight::Page.where(locale: 'es')).not_to be_present
|
22
|
+
translated_page.save
|
23
|
+
expect(Spotlight::Page.exists?(translated_page.id)).to be true
|
24
|
+
expect { clone.save }.to change(Spotlight::Page, :count).by(0) # because it deletes one and adds one
|
25
|
+
expect(Spotlight::Page.exists?(translated_page.id)).to be false
|
26
|
+
expect(Spotlight::Page.unscope(:order).last.locale).to eq 'es'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
ENV['RAILS_ENV'] ||= 'test'
|
2
2
|
require 'factory_bot'
|
3
|
-
require 'database_cleaner'
|
4
3
|
require 'devise'
|
5
4
|
require 'engine_cart'
|
6
5
|
EngineCart.load_application!
|
@@ -60,26 +59,15 @@ RSpec.configure do |config|
|
|
60
59
|
config.infer_spec_type_from_file_location!
|
61
60
|
config.filter_rails_from_backtrace!
|
62
61
|
|
63
|
-
config.use_transactional_fixtures =
|
62
|
+
config.use_transactional_fixtures = true
|
64
63
|
config.before :all do
|
65
64
|
WebMock.disable_net_connect!(allow_localhost: true)
|
66
65
|
end
|
67
66
|
config.before :each do
|
68
|
-
DatabaseCleaner.strategy = if Capybara.current_driver == :rack_test
|
69
|
-
:transaction
|
70
|
-
else
|
71
|
-
:truncation
|
72
|
-
end
|
73
|
-
DatabaseCleaner.start
|
74
|
-
|
75
67
|
# The first user is automatically granted admin privileges; we don't want that behavior for many of our tests
|
76
68
|
Spotlight::Engine.user_class.create email: 'initial+admin@example.com', password: 'password', password_confirmation: 'password'
|
77
69
|
end
|
78
70
|
|
79
|
-
config.after do
|
80
|
-
DatabaseCleaner.clean
|
81
|
-
end
|
82
|
-
|
83
71
|
if defined? Devise::Test::ControllerHelpers
|
84
72
|
config.include Devise::Test::ControllerHelpers, type: :controller
|
85
73
|
config.include Devise::Test::ControllerHelpers, type: :view
|
@@ -1,8 +1,9 @@
|
|
1
|
-
|
2
|
-
ActiveSupport::Deprecation.behavior
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
if Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR <= 1
|
2
|
+
default_deprecation_behaviours = ActiveSupport::Deprecation.behavior
|
3
|
+
ActiveSupport::Deprecation.behavior = lambda do |message, callstack|
|
4
|
+
unless callstack.find { |l| l.path =~ %r{gems/friendly_id} } &&
|
5
|
+
message =~ /The behavior of .* inside of after callbacks will be changing/
|
6
|
+
default_deprecation_behaviours.each { |b| b.call(message, callstack) }
|
7
|
+
end
|
7
8
|
end
|
8
9
|
end
|
@@ -52,12 +52,12 @@ class CatalogController < ApplicationController
|
|
52
52
|
#
|
53
53
|
# :show may be set to false if you don't want the facet to be drawn in the
|
54
54
|
# facet bar
|
55
|
-
config.add_facet_field 'genre_ssim', label: '
|
56
|
-
config.add_facet_field 'personal_name_ssm', label: '
|
57
|
-
config.add_facet_field 'corporate_name_ssm', label: '
|
58
|
-
config.add_facet_field 'subject_geographic_ssim', label: '
|
59
|
-
config.add_facet_field 'subject_temporal_ssim', label: '
|
60
|
-
config.add_facet_field 'language_ssim', label: '
|
55
|
+
config.add_facet_field 'genre_ssim', label: I18n.t('spotlight.search.fields.facet.genre_ssim'), limit: true
|
56
|
+
config.add_facet_field 'personal_name_ssm', label: I18n.t('spotlight.search.fields.facet.personal_name_ssm'), limit: true
|
57
|
+
config.add_facet_field 'corporate_name_ssm', label: I18n.t('spotlight.search.fields.facet.corporate_name_ssm'), limit: true
|
58
|
+
config.add_facet_field 'subject_geographic_ssim', label: I18n.t('spotlight.search.fields.facet.subject_geographic_ssim')
|
59
|
+
config.add_facet_field 'subject_temporal_ssim', label: I18n.t('spotlight.search.fields.facet.subject_temporal_ssim')
|
60
|
+
config.add_facet_field 'language_ssim', label: I18n.t('spotlight.search.fields.facet.language_ssim')
|
61
61
|
|
62
62
|
# Have BL send all facet field names to Solr, which has been the default
|
63
63
|
# previously. Simply remove these lines if you'd rather use Solr request
|
@@ -66,35 +66,35 @@ class CatalogController < ApplicationController
|
|
66
66
|
|
67
67
|
# solr fields to be displayed in the index (search results) view
|
68
68
|
# The ordering of the field names is the order of the display
|
69
|
-
config.add_index_field 'language_ssm', label: '
|
70
|
-
config.add_index_field 'abstract_tesim', label: '
|
71
|
-
config.add_index_field 'note_mapuse_tesim', label: '
|
72
|
-
config.add_index_field 'note_source_tesim', label: '
|
73
|
-
config.add_index_field 'subject_geographic_tesim', label: '
|
74
|
-
config.add_index_field 'subject_temporal_tesim', label: '
|
69
|
+
config.add_index_field 'language_ssm', label: I18n.t('spotlight.search.fields.language_ssm')
|
70
|
+
config.add_index_field 'abstract_tesim', label: I18n.t('spotlight.search.fields.abstract_tesim')
|
71
|
+
config.add_index_field 'note_mapuse_tesim', label: I18n.t('spotlight.search.fields.note_mapuse_tesim')
|
72
|
+
config.add_index_field 'note_source_tesim', label: I18n.t('spotlight.search.fields.note_source_tesim')
|
73
|
+
config.add_index_field 'subject_geographic_tesim', label: I18n.t('spotlight.search.fields.subject_geographic_tesim')
|
74
|
+
config.add_index_field 'subject_temporal_tesim', label: I18n.t('spotlight.search.fields.subject_temporal_tesim')
|
75
75
|
|
76
76
|
# solr fields to be displayed in the show (single result) view
|
77
77
|
# The ordering of the field names is the order of the display
|
78
|
-
config.add_show_field 'note_phys_desc_tesim', label: '
|
79
|
-
config.add_show_field 'note_source_tesim', label: '
|
80
|
-
config.add_show_field 'note_desc_note_tesim', label: '
|
81
|
-
config.add_show_field 'note_references_tesim', label: '
|
82
|
-
config.add_show_field 'note_provenance_tesim', label: '
|
83
|
-
config.add_show_field 'note_page_num_tesim', label: '
|
84
|
-
config.add_show_field 'subject_geographic_tesim', label: '
|
85
|
-
config.add_show_field 'subject_temporal_tesim', label: '
|
86
|
-
config.add_show_field 'personal_name_ssm', label: '
|
87
|
-
config.add_show_field 'corporate_name_ssm', label: '
|
78
|
+
config.add_show_field 'note_phys_desc_tesim', label: I18n.t('spotlight.search.fields.note_phys_desc_tesim')
|
79
|
+
config.add_show_field 'note_source_tesim', label: I18n.t('spotlight.search.fields.note_source_tesim')
|
80
|
+
config.add_show_field 'note_desc_note_tesim', label: I18n.t('spotlight.search.fields.note_desc_note_tesim')
|
81
|
+
config.add_show_field 'note_references_tesim', label: I18n.t('spotlight.search.fields.note_references_tesim')
|
82
|
+
config.add_show_field 'note_provenance_tesim', label: I18n.t('spotlight.search.fields.note_provenance_tesim')
|
83
|
+
config.add_show_field 'note_page_num_tesim', label: I18n.t('spotlight.search.fields.note_page_num_tesim')
|
84
|
+
config.add_show_field 'subject_geographic_tesim', label: I18n.t('spotlight.search.fields.subject_geographic_tesim')
|
85
|
+
config.add_show_field 'subject_temporal_tesim', label: I18n.t('spotlight.search.fields.subject_temporal_tesim')
|
86
|
+
config.add_show_field 'personal_name_ssm', label: I18n.t('spotlight.search.fields.personal_name_ssm')
|
87
|
+
config.add_show_field 'corporate_name_ssm', label: I18n.t('spotlight.search.fields.corporate_name_ssm')
|
88
88
|
|
89
|
-
config.add_search_field 'all_fields', label: '
|
90
|
-
config.add_search_field 'title', label: '
|
91
|
-
config.add_search_field 'author', label: '
|
89
|
+
config.add_search_field 'all_fields', label: I18n.t('spotlight.search.fields.search.all_fields')
|
90
|
+
config.add_search_field 'title', label: I18n.t('spotlight.search.fields.search.title'), solr_parameters: { qf: 'full_title_tesim', pf: 'full_title_tesim' }
|
91
|
+
config.add_search_field 'author', label: I18n.t('spotlight.search.fields.search.author'), solr_parameters: { qf: '${qf_author}', pf: '${pf_author}' }
|
92
92
|
|
93
|
-
config.add_sort_field 'relevance', sort: 'score desc, sort_title_ssi asc', label: '
|
94
|
-
config.add_sort_field 'title', sort: 'sort_title_ssi asc', label: '
|
95
|
-
config.add_sort_field 'type', sort: 'sort_type_ssi asc', label: '
|
96
|
-
config.add_sort_field 'source', sort: 'sort_source_ssi asc', label: '
|
97
|
-
config.add_sort_field 'identifier', sort: 'id asc', label: '
|
98
|
-
config.add_sort_field 'date', sort: 'sort_date_dtsi desc', label: '
|
93
|
+
config.add_sort_field 'relevance', sort: 'score desc, sort_title_ssi asc', label: I18n.t('spotlight.search.fields.sort.relevance')
|
94
|
+
config.add_sort_field 'title', sort: 'sort_title_ssi asc', label: I18n.t('spotlight.search.fields.sort.title')
|
95
|
+
config.add_sort_field 'type', sort: 'sort_type_ssi asc', label: I18n.t('spotlight.search.fields.sort.type')
|
96
|
+
config.add_sort_field 'source', sort: 'sort_source_ssi asc', label: I18n.t('spotlight.search.fields.sort.source')
|
97
|
+
config.add_sort_field 'identifier', sort: 'id asc', label: I18n.t('spotlight.search.fields.sort.identifier')
|
98
|
+
config.add_sort_field 'date', sort: 'sort_date_dtsi desc', label: I18n.t('spotlight.search.fields.sort.date')
|
99
99
|
end
|
100
100
|
end
|
@@ -3,6 +3,10 @@ require 'rails/generators'
|
|
3
3
|
class TestAppGenerator < Rails::Generators::Base
|
4
4
|
source_root '../spec/test_app_templates'
|
5
5
|
|
6
|
+
def use_capybara3
|
7
|
+
gsub_file 'Gemfile', /gem 'capybara'/, '# gem \'capybara\''
|
8
|
+
end
|
9
|
+
|
6
10
|
def add_gems
|
7
11
|
gem 'blacklight', '~> 6.0'
|
8
12
|
gem 'blacklight-gallery', '>= 0.3.0'
|
@@ -38,12 +42,6 @@ class TestAppGenerator < Rails::Generators::Base
|
|
38
42
|
copy_file 'carrierwave.rb', 'config/initializers/carrierwave.rb'
|
39
43
|
end
|
40
44
|
|
41
|
-
def fix_up_migration_versions
|
42
|
-
Dir.glob('db/migrate/*.rb') do |f|
|
43
|
-
gsub_file f, /< ActiveRecord::Migration$/, '< ActiveRecord::Migration[4.2]'
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
45
|
def add_theme_assets
|
48
46
|
copy_file 'fixture.png', 'app/assets/images/spotlight/themes/default_preview.png'
|
49
47
|
copy_file 'fixture.png', 'app/assets/images/spotlight/themes/modern_preview.png'
|
@@ -61,4 +59,9 @@ class TestAppGenerator < Rails::Generators::Base
|
|
61
59
|
EOF
|
62
60
|
end
|
63
61
|
end
|
62
|
+
|
63
|
+
def raise_on_missing_translation
|
64
|
+
uncomment_lines 'config/environments/development.rb', /config.action_view.raise_on_missing_translations/
|
65
|
+
uncomment_lines 'config/environments/test.rb', /config.action_view.raise_on_missing_translations/
|
66
|
+
end
|
64
67
|
end
|
@@ -13,6 +13,19 @@ describe 'spotlight/contacts/edit.html.erb' do
|
|
13
13
|
assign(:contact, contact)
|
14
14
|
assign(:exhibit, exhibit)
|
15
15
|
allow(view).to receive(:current_exhibit).and_return(exhibit)
|
16
|
+
# Assumes that the second backend is the "Simple"
|
17
|
+
I18n.backend.backends.second.store_translations(
|
18
|
+
:en,
|
19
|
+
spotlight: {
|
20
|
+
contacts: {
|
21
|
+
form: {
|
22
|
+
new_field: {
|
23
|
+
placeholder: 'place'
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
)
|
16
29
|
end
|
17
30
|
|
18
31
|
it 'has an IIIF crop' do
|
@@ -0,0 +1,33 @@
|
|
1
|
+
describe 'spotlight/exhibits/_form', type: :view do
|
2
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
3
|
+
before do
|
4
|
+
assign(:exhibit, exhibit)
|
5
|
+
end
|
6
|
+
context 'when using default language' do
|
7
|
+
before do
|
8
|
+
allow(view).to receive_messages(
|
9
|
+
default_language?: true
|
10
|
+
)
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'allows an editable title' do
|
14
|
+
render
|
15
|
+
expect(rendered).to have_selector 'input[name="exhibit[title]"]'
|
16
|
+
expect(rendered).not_to have_selector 'input[name="exhibit[title]"][disabled="disabled"]'
|
17
|
+
expect(rendered).not_to have_content 'This field is not editable in the current language. Switch to the default language to edit it.'
|
18
|
+
end
|
19
|
+
end
|
20
|
+
context 'when using non-default language' do
|
21
|
+
before do
|
22
|
+
allow(view).to receive_messages(
|
23
|
+
default_language?: false
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'disables editable title with help text' do
|
28
|
+
render
|
29
|
+
expect(rendered).to have_selector 'input[name="exhibit[title]"][disabled="disabled"]'
|
30
|
+
expect(rendered).to have_content 'This field is not editable in the current language. Switch to the default language to edit it.'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -7,7 +7,10 @@ describe 'spotlight/exhibits/edit', type: :view do
|
|
7
7
|
can?: true,
|
8
8
|
import_exhibit_path: '/',
|
9
9
|
get_exhibit_path: '/',
|
10
|
-
exhibit_filters_path: '/'
|
10
|
+
exhibit_filters_path: '/',
|
11
|
+
exhibit_languages_path: '/',
|
12
|
+
add_exhibit_language_dropdown_options: [],
|
13
|
+
default_language?: true
|
11
14
|
)
|
12
15
|
end
|
13
16
|
|
@@ -7,6 +7,19 @@ describe 'spotlight/resources/_external_resources_form.html.erb', type: :view do
|
|
7
7
|
allow(view).to receive_messages(blacklight_config: blacklight_config)
|
8
8
|
allow(view).to receive(:current_exhibit).and_return(exhibit)
|
9
9
|
allow(view).to receive_messages(current_page?: true)
|
10
|
+
# Assumes that the second backend is the "Simple"
|
11
|
+
I18n.backend.backends.second.store_translations(
|
12
|
+
:en,
|
13
|
+
a: {
|
14
|
+
title: 'a_title'
|
15
|
+
},
|
16
|
+
b: {
|
17
|
+
title: 'b_title'
|
18
|
+
},
|
19
|
+
c: {
|
20
|
+
title: 'c_title'
|
21
|
+
}
|
22
|
+
)
|
10
23
|
end
|
11
24
|
|
12
25
|
it 'renders the configured partials' do
|
@@ -11,10 +11,16 @@ describe 'spotlight/resources/new.html.erb', type: :view do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'renders the configured partials' do
|
14
|
-
allow(Spotlight::Engine.config).to receive(:resource_partials).and_return(
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
allow(Spotlight::Engine.config).to receive(:resource_partials).and_return(
|
15
|
+
%w(
|
16
|
+
spotlight/resources/external_resources_form
|
17
|
+
spotlight/resources/upload/form
|
18
|
+
spotlight/resources/csv_upload/form
|
19
|
+
)
|
20
|
+
)
|
21
|
+
stub_template 'spotlight/resources/_external_resources_form.html.erb' => 'a_template'
|
22
|
+
stub_template 'spotlight/resources/upload/_form.html.erb' => 'b_template'
|
23
|
+
stub_template 'spotlight/resources/csv_upload/_form.html.erb' => 'c_template'
|
18
24
|
render
|
19
25
|
expect(rendered).to have_content 'a_template'
|
20
26
|
expect(rendered).to have_content 'b_template'
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
describe 'spotlight/translations/_page.html.erb', type: :view do
|
4
|
+
let(:exhibit) { FactoryBot.create(:exhibit) }
|
5
|
+
let(:page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
|
6
|
+
|
7
|
+
before do
|
8
|
+
allow(view).to receive_messages(
|
9
|
+
clone_exhibit_feature_page_path: '/',
|
10
|
+
clone_exhibit_home_page_path: '/',
|
11
|
+
current_exhibit: exhibit,
|
12
|
+
edit_exhibit_feature_page_path: '/',
|
13
|
+
edit_exhibit_home_page_path: '/',
|
14
|
+
exhibit_feature_page_path: '/',
|
15
|
+
f: instance_double('form', fields_for: {}), # mockform builder
|
16
|
+
page: page
|
17
|
+
)
|
18
|
+
assign(:language, 'es')
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'includes a check icon when the page is published' do
|
22
|
+
page.published = true
|
23
|
+
render
|
24
|
+
|
25
|
+
expect(rendered).to have_css('.glyphicon.glyphicon-ok')
|
26
|
+
end
|
27
|
+
|
28
|
+
context 'when there is a translated page' do
|
29
|
+
let!(:page_es) { FactoryBot.create(:feature_page, exhibit: exhibit, locale: 'es', default_locale_page: page) }
|
30
|
+
|
31
|
+
it 'links to the translated page' do
|
32
|
+
render
|
33
|
+
expect(rendered).to have_link(page_es.title)
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'includes the data attribute used by the progress tracker' do
|
37
|
+
render
|
38
|
+
expect(rendered).to have_css('[data-translation-present="true"]')
|
39
|
+
end
|
40
|
+
|
41
|
+
context 'when the default locale page has been updated more recently than the translation' do
|
42
|
+
before { page_es.update(updated_at: 10.seconds.ago) }
|
43
|
+
|
44
|
+
it 'includes an alert icon' do
|
45
|
+
render
|
46
|
+
|
47
|
+
expect(rendered).to have_css('.glyphicon.glyphicon-alert')
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
context 'when the page is a home page' do
|
52
|
+
let(:page) { exhibit.home_page }
|
53
|
+
before { page_es.update(type: 'Spotlight::HomePage') }
|
54
|
+
|
55
|
+
it 'does not render a delete link' do
|
56
|
+
render
|
57
|
+
|
58
|
+
expect(rendered).not_to have_link('Delete')
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
context 'when there is no translated page' do
|
64
|
+
it 'links to create a new one' do
|
65
|
+
render
|
66
|
+
expect(rendered).to have_content 'No translated page.'
|
67
|
+
expect(rendered).to have_link 'Create one now.'
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'does not include the data attribute used by the progress tracker' do
|
71
|
+
render
|
72
|
+
expect(rendered).not_to have_css('[data-translation-present="true"]')
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight-spotlight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2018-04-
|
14
|
+
date: 2018-04-27 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
@@ -19,14 +19,14 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - "~>"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '5.
|
22
|
+
version: '5.1'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '5.
|
29
|
+
version: '5.1'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: blacklight
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -367,14 +367,14 @@ dependencies:
|
|
367
367
|
name: paper_trail
|
368
368
|
requirement: !ruby/object:Gem::Requirement
|
369
369
|
requirements:
|
370
|
-
- - "
|
370
|
+
- - ">="
|
371
371
|
- !ruby/object:Gem::Version
|
372
372
|
version: '7.0'
|
373
373
|
type: :runtime
|
374
374
|
prerelease: false
|
375
375
|
version_requirements: !ruby/object:Gem::Requirement
|
376
376
|
requirements:
|
377
|
-
- - "
|
377
|
+
- - ">="
|
378
378
|
- !ruby/object:Gem::Version
|
379
379
|
version: '7.0'
|
380
380
|
- !ruby/object:Gem::Dependency
|
@@ -685,20 +685,6 @@ dependencies:
|
|
685
685
|
- - "~>"
|
686
686
|
- !ruby/object:Gem::Version
|
687
687
|
version: '2.0'
|
688
|
-
- !ruby/object:Gem::Dependency
|
689
|
-
name: database_cleaner
|
690
|
-
requirement: !ruby/object:Gem::Requirement
|
691
|
-
requirements:
|
692
|
-
- - "~>"
|
693
|
-
- !ruby/object:Gem::Version
|
694
|
-
version: '1.3'
|
695
|
-
type: :development
|
696
|
-
prerelease: false
|
697
|
-
version_requirements: !ruby/object:Gem::Requirement
|
698
|
-
requirements:
|
699
|
-
- - "~>"
|
700
|
-
- !ruby/object:Gem::Version
|
701
|
-
version: '1.3'
|
702
688
|
- !ruby/object:Gem::Dependency
|
703
689
|
name: solr_wrapper
|
704
690
|
requirement: !ruby/object:Gem::Requirement
|
@@ -729,6 +715,20 @@ dependencies:
|
|
729
715
|
version: '0.12'
|
730
716
|
- !ruby/object:Gem::Dependency
|
731
717
|
name: coveralls
|
718
|
+
requirement: !ruby/object:Gem::Requirement
|
719
|
+
requirements:
|
720
|
+
- - "~>"
|
721
|
+
- !ruby/object:Gem::Version
|
722
|
+
version: '0.8'
|
723
|
+
type: :development
|
724
|
+
prerelease: false
|
725
|
+
version_requirements: !ruby/object:Gem::Requirement
|
726
|
+
requirements:
|
727
|
+
- - "~>"
|
728
|
+
- !ruby/object:Gem::Version
|
729
|
+
version: '0.8'
|
730
|
+
- !ruby/object:Gem::Dependency
|
731
|
+
name: sitemap_generator
|
732
732
|
requirement: !ruby/object:Gem::Requirement
|
733
733
|
requirements:
|
734
734
|
- - ">="
|
@@ -742,7 +742,7 @@ dependencies:
|
|
742
742
|
- !ruby/object:Gem::Version
|
743
743
|
version: '0'
|
744
744
|
- !ruby/object:Gem::Dependency
|
745
|
-
name:
|
745
|
+
name: webmock
|
746
746
|
requirement: !ruby/object:Gem::Requirement
|
747
747
|
requirements:
|
748
748
|
- - ">="
|
@@ -756,7 +756,7 @@ dependencies:
|
|
756
756
|
- !ruby/object:Gem::Version
|
757
757
|
version: '0'
|
758
758
|
- !ruby/object:Gem::Dependency
|
759
|
-
name:
|
759
|
+
name: i18n-tasks
|
760
760
|
requirement: !ruby/object:Gem::Requirement
|
761
761
|
requirements:
|
762
762
|
- - ">="
|
@@ -826,13 +826,13 @@ files:
|
|
826
826
|
- app/assets/javascripts/spotlight/report_a_problem.js
|
827
827
|
- app/assets/javascripts/spotlight/search_typeahead.js
|
828
828
|
- app/assets/javascripts/spotlight/select_related_input.js
|
829
|
-
- app/assets/javascripts/spotlight/sir-trevor.js
|
830
829
|
- app/assets/javascripts/spotlight/sir-trevor/block_controls.js
|
831
830
|
- app/assets/javascripts/spotlight/sir-trevor/block_limits.js
|
832
831
|
- app/assets/javascripts/spotlight/sir-trevor/locales.js
|
833
832
|
- app/assets/javascripts/spotlight/spotlight.js
|
834
833
|
- app/assets/javascripts/spotlight/spotlight_nestable.js
|
835
834
|
- app/assets/javascripts/spotlight/tabs.js
|
835
|
+
- app/assets/javascripts/spotlight/translation_progress.js
|
836
836
|
- app/assets/javascripts/spotlight/users.js
|
837
837
|
- app/assets/javascripts/spotlight/zpr_links.js.erb
|
838
838
|
- app/assets/stylesheets/spotlight/_attachments.css
|
@@ -861,8 +861,10 @@ files:
|
|
861
861
|
- app/assets/stylesheets/spotlight/_sir-trevor_overrides.scss
|
862
862
|
- app/assets/stylesheets/spotlight/_slideshow_block.scss
|
863
863
|
- app/assets/stylesheets/spotlight/_spotlight.scss
|
864
|
+
- app/assets/stylesheets/spotlight/_translations.scss
|
864
865
|
- app/assets/stylesheets/spotlight/_upload.scss
|
865
866
|
- app/assets/stylesheets/spotlight/_uploaded_items_block.scss
|
867
|
+
- app/assets/stylesheets/spotlight/_utilities.scss
|
866
868
|
- app/assets/stylesheets/spotlight/_variables.scss
|
867
869
|
- app/assets/stylesheets/spotlight/_variables_bootstrap.scss
|
868
870
|
- app/assets/stylesheets/spotlight/typeahead.css
|
@@ -891,6 +893,7 @@ files:
|
|
891
893
|
- app/controllers/spotlight/featured_images_controller.rb
|
892
894
|
- app/controllers/spotlight/filters_controller.rb
|
893
895
|
- app/controllers/spotlight/home_pages_controller.rb
|
896
|
+
- app/controllers/spotlight/languages_controller.rb
|
894
897
|
- app/controllers/spotlight/lock_controller.rb
|
895
898
|
- app/controllers/spotlight/metadata_configurations_controller.rb
|
896
899
|
- app/controllers/spotlight/pages_controller.rb
|
@@ -904,12 +907,14 @@ files:
|
|
904
907
|
- app/controllers/spotlight/sites_controller.rb
|
905
908
|
- app/controllers/spotlight/solr_controller.rb
|
906
909
|
- app/controllers/spotlight/tags_controller.rb
|
910
|
+
- app/controllers/spotlight/translations_controller.rb
|
907
911
|
- app/controllers/spotlight/versions_controller.rb
|
908
912
|
- app/controllers/spotlight/view_configurations_controller.rb
|
909
913
|
- app/helpers/spotlight/application_helper.rb
|
910
914
|
- app/helpers/spotlight/browse_helper.rb
|
911
915
|
- app/helpers/spotlight/crop_helper.rb
|
912
916
|
- app/helpers/spotlight/crud_link_helpers.rb
|
917
|
+
- app/helpers/spotlight/languages_helper.rb
|
913
918
|
- app/helpers/spotlight/main_app_helpers.rb
|
914
919
|
- app/helpers/spotlight/meta_helper.rb
|
915
920
|
- app/helpers/spotlight/navbar_helper.rb
|
@@ -919,6 +924,7 @@ files:
|
|
919
924
|
- app/helpers/spotlight/search_configurations_helper.rb
|
920
925
|
- app/helpers/spotlight/searches_helper.rb
|
921
926
|
- app/helpers/spotlight/title_helper.rb
|
927
|
+
- app/helpers/spotlight/translations_helper.rb
|
922
928
|
- app/jobs/spotlight/add_uploads_from_csv.rb
|
923
929
|
- app/jobs/spotlight/default_thumbnail_job.rb
|
924
930
|
- app/jobs/spotlight/reindex_job.rb
|
@@ -941,6 +947,7 @@ files:
|
|
941
947
|
- app/models/concerns/spotlight/solr_document/atomic_updates.rb
|
942
948
|
- app/models/concerns/spotlight/solr_document/finder.rb
|
943
949
|
- app/models/concerns/spotlight/solr_document/uploaded_resource.rb
|
950
|
+
- app/models/concerns/spotlight/translatables.rb
|
944
951
|
- app/models/concerns/spotlight/user.rb
|
945
952
|
- app/models/sir_trevor_rails/blocks/browse_block.rb
|
946
953
|
- app/models/sir_trevor_rails/blocks/displayable.rb
|
@@ -972,6 +979,7 @@ files:
|
|
972
979
|
- app/models/spotlight/field_metadata.rb
|
973
980
|
- app/models/spotlight/filter.rb
|
974
981
|
- app/models/spotlight/home_page.rb
|
982
|
+
- app/models/spotlight/language.rb
|
975
983
|
- app/models/spotlight/lock.rb
|
976
984
|
- app/models/spotlight/main_navigation.rb
|
977
985
|
- app/models/spotlight/masthead.rb
|
@@ -995,6 +1003,7 @@ files:
|
|
995
1003
|
- app/serializers/spotlight/main_navigation_representer.rb
|
996
1004
|
- app/serializers/spotlight/page_representer.rb
|
997
1005
|
- app/services/spotlight/carrierwave_file_resolver.rb
|
1006
|
+
- app/services/spotlight/clone_translated_page_from_locale.rb
|
998
1007
|
- app/services/spotlight/iiif_resource_resolver.rb
|
999
1008
|
- app/services/spotlight/invite_users_service.rb
|
1000
1009
|
- app/services/spotlight/resources/iiif_builder.rb
|
@@ -1023,7 +1032,6 @@ files:
|
|
1023
1032
|
- app/views/shared/_header_navbar.html.erb
|
1024
1033
|
- app/views/shared/_masthead.html.erb
|
1025
1034
|
- app/views/shared/_modal.html.erb
|
1026
|
-
- app/views/shared/_share_follow.html.erb
|
1027
1035
|
- app/views/shared/_site_sidebar.html.erb
|
1028
1036
|
- app/views/spotlight/about_pages/_contact.html.erb
|
1029
1037
|
- app/views/spotlight/about_pages/_contact_properties.html.erb
|
@@ -1083,6 +1091,7 @@ files:
|
|
1083
1091
|
- app/views/spotlight/exhibits/_form.html.erb
|
1084
1092
|
- app/views/spotlight/exhibits/_import.html.erb
|
1085
1093
|
- app/views/spotlight/exhibits/_initial_resources_form.html.erb
|
1094
|
+
- app/views/spotlight/exhibits/_languages.html.erb
|
1086
1095
|
- app/views/spotlight/exhibits/_missing_exhibits.html.erb
|
1087
1096
|
- app/views/spotlight/exhibits/_new_exhibit_form.html.erb
|
1088
1097
|
- app/views/spotlight/exhibits/_tags.html.erb
|
@@ -1144,6 +1153,7 @@ files:
|
|
1144
1153
|
- app/views/spotlight/shared/_configuration_sidebar.html.erb
|
1145
1154
|
- app/views/spotlight/shared/_curation_sidebar.html.erb
|
1146
1155
|
- app/views/spotlight/shared/_exhibit_sidebar.html.erb
|
1156
|
+
- app/views/spotlight/shared/_locale_picker.html.erb
|
1147
1157
|
- app/views/spotlight/shared/_report_a_problem.html.erb
|
1148
1158
|
- app/views/spotlight/sir_trevor/_sir_trevor_block_array.html.erb
|
1149
1159
|
- app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb
|
@@ -1170,8 +1180,16 @@ files:
|
|
1170
1180
|
- app/views/spotlight/sites/edit.html.erb
|
1171
1181
|
- app/views/spotlight/sites/edit_exhibits.html.erb
|
1172
1182
|
- app/views/spotlight/tags/index.html.erb
|
1183
|
+
- app/views/spotlight/translations/_browse_categories.html.erb
|
1184
|
+
- app/views/spotlight/translations/_general.html.erb
|
1185
|
+
- app/views/spotlight/translations/_metadata.html.erb
|
1186
|
+
- app/views/spotlight/translations/_page.html.erb
|
1187
|
+
- app/views/spotlight/translations/_pages.html.erb
|
1188
|
+
- app/views/spotlight/translations/_pages_table.html.erb
|
1189
|
+
- app/views/spotlight/translations/_search_fields.html.erb
|
1190
|
+
- app/views/spotlight/translations/edit.html.erb
|
1191
|
+
- config/i18n-tasks.yml
|
1173
1192
|
- config/locales/devise.en.yml
|
1174
|
-
- config/locales/social_share_button.en.yml
|
1175
1193
|
- config/locales/spotlight.en.yml
|
1176
1194
|
- config/routes.rb
|
1177
1195
|
- db/migrate/20131119213142_create_spotlight_pages.rb
|
@@ -1230,6 +1248,10 @@ files:
|
|
1230
1248
|
- db/migrate/20171005231502_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb
|
1231
1249
|
- db/migrate/20180119193632_add_search_box_to_spotlight_searches.rb
|
1232
1250
|
- db/migrate/20180306142612_create_translations.rb
|
1251
|
+
- db/migrate/20180308203409_create_spotlight_languages.rb
|
1252
|
+
- db/migrate/20180403130857_translation_uniqueness.rb
|
1253
|
+
- db/migrate/20180405044000_add_locale_to_pages.rb
|
1254
|
+
- db/migrate/20180406212516_add_default_locale_reference_to_spotlight_pages.rb
|
1233
1255
|
- lib/blacklight/spotlight.rb
|
1234
1256
|
- lib/generators/spotlight/install_generator.rb
|
1235
1257
|
- lib/generators/spotlight/scaffold_resource_generator.rb
|
@@ -1244,8 +1266,10 @@ files:
|
|
1244
1266
|
- lib/generators/spotlight/templates/spotlight.scss
|
1245
1267
|
- lib/generators/spotlight/templates/spotlight_helper.rb
|
1246
1268
|
- lib/migration/iiif.rb
|
1269
|
+
- lib/migration/page_language.rb
|
1247
1270
|
- lib/spotlight.rb
|
1248
1271
|
- lib/spotlight/engine.rb
|
1272
|
+
- lib/spotlight/upload_field_config.rb
|
1249
1273
|
- lib/spotlight/version.rb
|
1250
1274
|
- lib/tasks/spotlight_tasks.rake
|
1251
1275
|
- spec/controllers/application_controller_spec.rb
|
@@ -1267,7 +1291,9 @@ files:
|
|
1267
1291
|
- spec/controllers/spotlight/featured_images_controller_spec.rb
|
1268
1292
|
- spec/controllers/spotlight/filters_controller_spec.rb
|
1269
1293
|
- spec/controllers/spotlight/home_pages_controller_spec.rb
|
1294
|
+
- spec/controllers/spotlight/languages_controller_spec.rb
|
1270
1295
|
- spec/controllers/spotlight/metadata_configurations_controller_spec.rb
|
1296
|
+
- spec/controllers/spotlight/pages_controller_spec.rb
|
1271
1297
|
- spec/controllers/spotlight/resources/csv_upload_controller_spec.rb
|
1272
1298
|
- spec/controllers/spotlight/resources/upload_controller_spec.rb
|
1273
1299
|
- spec/controllers/spotlight/resources_controller_spec.rb
|
@@ -1277,6 +1303,7 @@ files:
|
|
1277
1303
|
- spec/controllers/spotlight/sites_controller_spec.rb
|
1278
1304
|
- spec/controllers/spotlight/solr_controller_spec.rb
|
1279
1305
|
- spec/controllers/spotlight/tags_controller_spec.rb
|
1306
|
+
- spec/controllers/spotlight/translations_controller_spec.rb
|
1280
1307
|
- spec/controllers/spotlight/versions_controller_spec.rb
|
1281
1308
|
- spec/controllers/spotlight/view_configurations_controller_spec.rb
|
1282
1309
|
- spec/examples.txt
|
@@ -1287,6 +1314,8 @@ files:
|
|
1287
1314
|
- spec/factories/exhibit_thumbnails.rb
|
1288
1315
|
- spec/factories/exhibits.rb
|
1289
1316
|
- spec/factories/featured_images.rb
|
1317
|
+
- spec/factories/language.rb
|
1318
|
+
- spec/factories/main_navigation.rb
|
1290
1319
|
- spec/factories/pages.rb
|
1291
1320
|
- spec/factories/reindexing_log_entries.rb
|
1292
1321
|
- spec/factories/resources.rb
|
@@ -1316,6 +1345,8 @@ files:
|
|
1316
1345
|
- spec/features/exhibits/administration_spec.rb
|
1317
1346
|
- spec/features/exhibits/custom_metadata_fields_spec.rb
|
1318
1347
|
- spec/features/exhibits/edit_metadata_fields_spec.rb
|
1348
|
+
- spec/features/exhibits/language_create_edit_spec.rb
|
1349
|
+
- spec/features/exhibits/translation_editing_spec.rb
|
1319
1350
|
- spec/features/exhibits_index_spec.rb
|
1320
1351
|
- spec/features/feature_page_spec.rb
|
1321
1352
|
- spec/features/home_page_spec.rb
|
@@ -1333,6 +1364,7 @@ files:
|
|
1333
1364
|
- spec/features/javascript/edit_in_place_spec.rb
|
1334
1365
|
- spec/features/javascript/feature_page_admin_spec.rb
|
1335
1366
|
- spec/features/javascript/home_page_edit_spec.rb
|
1367
|
+
- spec/features/javascript/locale_selector_spec.rb
|
1336
1368
|
- spec/features/javascript/metadata_admin_spec.rb
|
1337
1369
|
- spec/features/javascript/multi_image_select_spec.rb
|
1338
1370
|
- spec/features/javascript/reindex_monitor_spec.rb
|
@@ -1357,6 +1389,7 @@ files:
|
|
1357
1389
|
- spec/helpers/spotlight/browse_helper_spec.rb
|
1358
1390
|
- spec/helpers/spotlight/crop_helper_spec.rb
|
1359
1391
|
- spec/helpers/spotlight/crud_link_helpers_spec.rb
|
1392
|
+
- spec/helpers/spotlight/languages_helper_spec.rb
|
1360
1393
|
- spec/helpers/spotlight/main_app_helpers_spec.rb
|
1361
1394
|
- spec/helpers/spotlight/meta_helper_spec.rb
|
1362
1395
|
- spec/helpers/spotlight/navbar_helper_spec.rb
|
@@ -1364,13 +1397,17 @@ files:
|
|
1364
1397
|
- spec/helpers/spotlight/roles_helper_spec.rb
|
1365
1398
|
- spec/helpers/spotlight/search_configurations_helper_spec.rb
|
1366
1399
|
- spec/helpers/spotlight/title_helper_spec.rb
|
1400
|
+
- spec/helpers/spotlight/translations_helper_spec.rb
|
1401
|
+
- spec/i18n_spec.rb
|
1367
1402
|
- spec/jobs/spotlight/add_uploads_from_csv_spec.rb
|
1368
1403
|
- spec/jobs/spotlight/default_thumbnail_job_spec.rb
|
1369
1404
|
- spec/jobs/spotlight/reindex_job_spec.rb
|
1370
1405
|
- spec/jobs/spotlight/rename_sidecar_field_job_spec.rb
|
1371
1406
|
- spec/lib/migration/iiif_spec.rb
|
1407
|
+
- spec/lib/migration/page_language_spec.rb
|
1372
1408
|
- spec/lib/spotlight/catalog_spec.rb
|
1373
1409
|
- spec/lib/spotlight/controller_spec.rb
|
1410
|
+
- spec/lib/spotlight/upload_field_config_spec.rb
|
1374
1411
|
- spec/mailers/spotlight/indexing_complete_mailer_spec.rb
|
1375
1412
|
- spec/models/sir_trevor_rails/blocks/browse_block_spec.rb
|
1376
1413
|
- spec/models/sir_trevor_rails/blocks/featured_pages_block_spec.rb
|
@@ -1395,6 +1432,7 @@ files:
|
|
1395
1432
|
- spec/models/spotlight/field_metadata_spec.rb
|
1396
1433
|
- spec/models/spotlight/filter_spec.rb
|
1397
1434
|
- spec/models/spotlight/home_page_spec.rb
|
1435
|
+
- spec/models/spotlight/language_spec.rb
|
1398
1436
|
- spec/models/spotlight/main_navigation_spec.rb
|
1399
1437
|
- spec/models/spotlight/masthead_spec.rb
|
1400
1438
|
- spec/models/spotlight/page_spec.rb
|
@@ -1415,12 +1453,14 @@ files:
|
|
1415
1453
|
- spec/models/spotlight/solr_document/uploaded_resource_spec.rb
|
1416
1454
|
- spec/models/spotlight/solr_document_sidecar_spec.rb
|
1417
1455
|
- spec/models/spotlight/user_spec.rb
|
1456
|
+
- spec/models/translation_spec.rb
|
1418
1457
|
- spec/presenters/spotlight/iiif_manifest_presenter_spec.rb
|
1419
1458
|
- spec/routing/spotlight/exhibit_catalog_spec.rb
|
1420
1459
|
- spec/routing/spotlight/featured_images_spec.rb
|
1421
1460
|
- spec/routing/spotlight/pages_routing_spec.rb
|
1422
1461
|
- spec/serializers/spotlight/exhibit_export_serializer_spec.rb
|
1423
1462
|
- spec/services/spotlight/carrierwave_file_resolver_spec.rb
|
1463
|
+
- spec/services/spotlight/clone_translated_page_from_locale_spec.rb
|
1424
1464
|
- spec/services/spotlight/iiif_resource_resolver_spec.rb
|
1425
1465
|
- spec/services/spotlight/invite_users_service_spec.rb
|
1426
1466
|
- spec/services/spotlight/solr_document_builder_spec.rb
|
@@ -1462,6 +1502,7 @@ files:
|
|
1462
1502
|
- spec/views/spotlight/dashboards/_reindexing_activity.html.erb_spec.rb
|
1463
1503
|
- spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
|
1464
1504
|
- spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
|
1505
|
+
- spec/views/spotlight/exhibits/_form.html.erb_spec.rb
|
1465
1506
|
- spec/views/spotlight/exhibits/edit.html.erb_spec.rb
|
1466
1507
|
- spec/views/spotlight/exhibits/index.html.erb_spec.rb
|
1467
1508
|
- spec/views/spotlight/feature_pages/_empty.html.erb_spec.rb
|
@@ -1496,6 +1537,7 @@ files:
|
|
1496
1537
|
- spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb
|
1497
1538
|
- spec/views/spotlight/sites/edit_exhibits.html.erb_spec.rb
|
1498
1539
|
- spec/views/spotlight/tags/index.html.erb_spec.rb
|
1540
|
+
- spec/views/spotlight/translations/_page.html.erb_spec.rb
|
1499
1541
|
- vendor/assets/images/sir-trevor-icons.svg
|
1500
1542
|
- vendor/assets/javascripts/Leaflet.Editable.js
|
1501
1543
|
- vendor/assets/javascripts/Path.Drag.js
|
@@ -1539,12 +1581,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1539
1581
|
requirements:
|
1540
1582
|
- - "~>"
|
1541
1583
|
- !ruby/object:Gem::Version
|
1542
|
-
version: '2.
|
1584
|
+
version: '2.3'
|
1543
1585
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1544
1586
|
requirements:
|
1545
|
-
- - "
|
1587
|
+
- - ">"
|
1546
1588
|
- !ruby/object:Gem::Version
|
1547
|
-
version:
|
1589
|
+
version: 1.3.1
|
1548
1590
|
requirements: []
|
1549
1591
|
rubyforge_project:
|
1550
1592
|
rubygems_version: 2.6.11
|
@@ -1556,6 +1598,7 @@ test_files:
|
|
1556
1598
|
- spec/uploaders/spotlight/featured_image_uploader_spec.rb
|
1557
1599
|
- spec/uploaders/spotlight/attachment_uploader_spec.rb
|
1558
1600
|
- spec/spec_helper.rb
|
1601
|
+
- spec/i18n_spec.rb
|
1559
1602
|
- spec/mailers/spotlight/indexing_complete_mailer_spec.rb
|
1560
1603
|
- spec/examples.txt
|
1561
1604
|
- spec/features/confirm_email_spec.rb
|
@@ -1582,7 +1625,9 @@ test_files:
|
|
1582
1625
|
- spec/features/exhibits/add_tags_spec.rb
|
1583
1626
|
- spec/features/exhibits/administration_spec.rb
|
1584
1627
|
- spec/features/exhibits/custom_metadata_fields_spec.rb
|
1628
|
+
- spec/features/exhibits/translation_editing_spec.rb
|
1585
1629
|
- spec/features/exhibits/edit_metadata_fields_spec.rb
|
1630
|
+
- spec/features/exhibits/language_create_edit_spec.rb
|
1586
1631
|
- spec/features/browse_category_spec.rb
|
1587
1632
|
- spec/features/create_exhibit_spec.rb
|
1588
1633
|
- spec/features/feature_page_spec.rb
|
@@ -1602,6 +1647,7 @@ test_files:
|
|
1602
1647
|
- spec/features/javascript/metadata_admin_spec.rb
|
1603
1648
|
- spec/features/javascript/roles_admin_spec.rb
|
1604
1649
|
- spec/features/javascript/multi_image_select_spec.rb
|
1650
|
+
- spec/features/javascript/locale_selector_spec.rb
|
1605
1651
|
- spec/features/javascript/about_page_admin_spec.rb
|
1606
1652
|
- spec/features/javascript/reindex_monitor_spec.rb
|
1607
1653
|
- spec/features/javascript/search_context_spec.rb
|
@@ -1618,6 +1664,7 @@ test_files:
|
|
1618
1664
|
- spec/models/spotlight/site_spec.rb
|
1619
1665
|
- spec/models/spotlight/solr_document_sidecar_spec.rb
|
1620
1666
|
- spec/models/spotlight/search_spec.rb
|
1667
|
+
- spec/models/spotlight/language_spec.rb
|
1621
1668
|
- spec/models/spotlight/contact_image_spec.rb
|
1622
1669
|
- spec/models/spotlight/resources/iiif_service_spec.rb
|
1623
1670
|
- spec/models/spotlight/resources/open_graph_spec.rb
|
@@ -1651,6 +1698,7 @@ test_files:
|
|
1651
1698
|
- spec/models/sir_trevor_rails/blocks/search_results_block_spec.rb
|
1652
1699
|
- spec/models/sir_trevor_rails/blocks/textable_spec.rb
|
1653
1700
|
- spec/models/sir_trevor_rails/blocks/solr_documents_block_spec.rb
|
1701
|
+
- spec/models/translation_spec.rb
|
1654
1702
|
- spec/models/solr_document_spec.rb
|
1655
1703
|
- spec/presenters/spotlight/iiif_manifest_presenter_spec.rb
|
1656
1704
|
- spec/serializers/spotlight/exhibit_export_serializer_spec.rb
|
@@ -1665,11 +1713,13 @@ test_files:
|
|
1665
1713
|
- spec/factories/custom_fields.rb
|
1666
1714
|
- spec/factories/exhibit_thumbnails.rb
|
1667
1715
|
- spec/factories/contact_emails.rb
|
1716
|
+
- spec/factories/language.rb
|
1668
1717
|
- spec/factories/featured_images.rb
|
1669
1718
|
- spec/factories/translation.rb
|
1670
1719
|
- spec/factories/resources.rb
|
1671
1720
|
- spec/factories/pages.rb
|
1672
1721
|
- spec/factories/reindexing_log_entries.rb
|
1722
|
+
- spec/factories/main_navigation.rb
|
1673
1723
|
- spec/factories/searches.rb
|
1674
1724
|
- spec/factories/contact_images.rb
|
1675
1725
|
- spec/factories/contacts.rb
|
@@ -1685,6 +1735,8 @@ test_files:
|
|
1685
1735
|
- spec/test_app_templates/Gemfile.extra
|
1686
1736
|
- spec/lib/spotlight/catalog_spec.rb
|
1687
1737
|
- spec/lib/spotlight/controller_spec.rb
|
1738
|
+
- spec/lib/spotlight/upload_field_config_spec.rb
|
1739
|
+
- spec/lib/migration/page_language_spec.rb
|
1688
1740
|
- spec/lib/migration/iiif_spec.rb
|
1689
1741
|
- spec/fixtures/gk446cj2442-manifest.json
|
1690
1742
|
- spec/fixtures/json-upload-fixture.json
|
@@ -1706,8 +1758,10 @@ test_files:
|
|
1706
1758
|
- spec/controllers/spotlight/contact_forms_controller_spec.rb
|
1707
1759
|
- spec/controllers/spotlight/roles_controller_spec.rb
|
1708
1760
|
- spec/controllers/spotlight/featured_images_controller_spec.rb
|
1761
|
+
- spec/controllers/spotlight/pages_controller_spec.rb
|
1709
1762
|
- spec/controllers/spotlight/resources/csv_upload_controller_spec.rb
|
1710
1763
|
- spec/controllers/spotlight/resources/upload_controller_spec.rb
|
1764
|
+
- spec/controllers/spotlight/languages_controller_spec.rb
|
1711
1765
|
- spec/controllers/spotlight/metadata_configurations_controller_spec.rb
|
1712
1766
|
- spec/controllers/spotlight/about_pages_controller_spec.rb
|
1713
1767
|
- spec/controllers/spotlight/appearances_controller_spec.rb
|
@@ -1717,6 +1771,7 @@ test_files:
|
|
1717
1771
|
- spec/controllers/spotlight/catalog_controller_spec.rb
|
1718
1772
|
- spec/controllers/spotlight/contacts_controller_spec.rb
|
1719
1773
|
- spec/controllers/spotlight/home_pages_controller_spec.rb
|
1774
|
+
- spec/controllers/spotlight/translations_controller_spec.rb
|
1720
1775
|
- spec/controllers/spotlight/dashboards_controller_spec.rb
|
1721
1776
|
- spec/controllers/spotlight/attachments_controller_spec.rb
|
1722
1777
|
- spec/controllers/spotlight/feature_pages_controller_spec.rb
|
@@ -1751,6 +1806,7 @@ test_files:
|
|
1751
1806
|
- spec/views/spotlight/home_pages/_sidebar.html.erb_spec.rb
|
1752
1807
|
- spec/views/spotlight/home_pages/_empty.html.erb_spec.rb
|
1753
1808
|
- spec/views/spotlight/sites/edit_exhibits.html.erb_spec.rb
|
1809
|
+
- spec/views/spotlight/exhibits/_form.html.erb_spec.rb
|
1754
1810
|
- spec/views/spotlight/exhibits/edit.html.erb_spec.rb
|
1755
1811
|
- spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
|
1756
1812
|
- spec/views/spotlight/exhibits/index.html.erb_spec.rb
|
@@ -1780,6 +1836,7 @@ test_files:
|
|
1780
1836
|
- spec/views/spotlight/pages/show.html.erb_spec.rb
|
1781
1837
|
- spec/views/spotlight/pages/new.html.erb_spec.rb
|
1782
1838
|
- spec/views/spotlight/pages/index.html.erb_spec.rb
|
1839
|
+
- spec/views/spotlight/translations/_page.html.erb_spec.rb
|
1783
1840
|
- spec/views/shared/_header_navbar.html.erb_spec.rb
|
1784
1841
|
- spec/views/shared/_exhibit_navbar.html.erb_spec.rb
|
1785
1842
|
- spec/views/shared/_footer.html.erb_spec.rb
|
@@ -1789,15 +1846,18 @@ test_files:
|
|
1789
1846
|
- spec/helpers/spotlight/crud_link_helpers_spec.rb
|
1790
1847
|
- spec/helpers/spotlight/application_helper_spec.rb
|
1791
1848
|
- spec/helpers/spotlight/pages_helper_spec.rb
|
1849
|
+
- spec/helpers/spotlight/translations_helper_spec.rb
|
1792
1850
|
- spec/helpers/spotlight/meta_helper_spec.rb
|
1793
1851
|
- spec/helpers/spotlight/title_helper_spec.rb
|
1794
1852
|
- spec/helpers/spotlight/main_app_helpers_spec.rb
|
1795
1853
|
- spec/helpers/spotlight/roles_helper_spec.rb
|
1854
|
+
- spec/helpers/spotlight/languages_helper_spec.rb
|
1796
1855
|
- spec/helpers/spotlight/search_configurations_helper_spec.rb
|
1797
1856
|
- spec/helpers/spotlight/browse_helper_spec.rb
|
1798
1857
|
- spec/helpers/spotlight/crop_helper_spec.rb
|
1799
1858
|
- spec/helpers/spotlight/navbar_helper_spec.rb
|
1800
1859
|
- spec/services/spotlight/invite_users_service_spec.rb
|
1860
|
+
- spec/services/spotlight/clone_translated_page_from_locale_spec.rb
|
1801
1861
|
- spec/services/spotlight/iiif_resource_resolver_spec.rb
|
1802
1862
|
- spec/services/spotlight/solr_document_builder_spec.rb
|
1803
1863
|
- spec/services/spotlight/carrierwave_file_resolver_spec.rb
|