blacklight-spotlight 3.0.0.alpha.6 → 3.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/app/assets/javascripts/spotlight/admin/blocks/browse_block.js +55 -1
  4. data/app/assets/javascripts/spotlight/admin/blocks/uploaded_items_block.js +7 -2
  5. data/app/assets/javascripts/spotlight/admin/crop.es6 +11 -0
  6. data/app/assets/javascripts/spotlight/admin/sir-trevor/block_controls.js +21 -12
  7. data/app/assets/javascripts/spotlight/admin/sir-trevor/locales.js +3 -2
  8. data/app/assets/stylesheets/spotlight/_accessibility.scss +8 -0
  9. data/app/assets/stylesheets/spotlight/_browse.scss +16 -0
  10. data/app/assets/stylesheets/spotlight/_curation.scss +9 -16
  11. data/app/assets/stylesheets/spotlight/_featured_browse_categories_block.scss +7 -4
  12. data/app/assets/stylesheets/spotlight/_header.scss +1 -1
  13. data/app/assets/stylesheets/spotlight/_item_text_block.scss +6 -0
  14. data/app/assets/stylesheets/spotlight/_nestable.scss +4 -0
  15. data/app/assets/stylesheets/spotlight/_pages.scss +3 -1
  16. data/app/assets/stylesheets/spotlight/_report_a_problem.scss +5 -2
  17. data/app/assets/stylesheets/spotlight/_spotlight.scss +1 -0
  18. data/app/assets/stylesheets/spotlight/_translations.scss +1 -0
  19. data/app/controllers/concerns/spotlight/base.rb +8 -0
  20. data/app/controllers/spotlight/admin_users_controller.rb +4 -1
  21. data/app/controllers/spotlight/appearances_controller.rb +1 -0
  22. data/app/controllers/spotlight/browse_controller.rb +1 -1
  23. data/app/controllers/spotlight/catalog_controller.rb +2 -2
  24. data/app/controllers/spotlight/exhibits_controller.rb +4 -3
  25. data/app/controllers/spotlight/featured_images_controller.rb +1 -1
  26. data/app/controllers/spotlight/pages_controller.rb +1 -5
  27. data/app/controllers/spotlight/resources/csv_upload_controller.rb +1 -1
  28. data/app/controllers/spotlight/searches_controller.rb +3 -2
  29. data/app/controllers/spotlight/sites_controller.rb +8 -2
  30. data/app/controllers/spotlight/translations_controller.rb +46 -0
  31. data/app/helpers/spotlight/crop_helper.rb +4 -1
  32. data/app/helpers/spotlight/title_helper.rb +12 -2
  33. data/app/jobs/spotlight/add_uploads_from_csv.rb +30 -5
  34. data/app/mailers/spotlight/indexing_complete_mailer.rb +3 -2
  35. data/app/models/concerns/spotlight/translatables.rb +17 -1
  36. data/app/models/spotlight/about_page.rb +3 -1
  37. data/app/models/spotlight/contact.rb +1 -1
  38. data/app/models/spotlight/custom_field.rb +3 -3
  39. data/app/models/spotlight/exhibit.rb +4 -2
  40. data/app/models/spotlight/feature_page.rb +3 -1
  41. data/app/models/spotlight/featured_image.rb +29 -12
  42. data/app/models/spotlight/home_page.rb +3 -1
  43. data/app/models/spotlight/main_navigation.rb +2 -2
  44. data/app/models/spotlight/masthead.rb +1 -1
  45. data/app/models/spotlight/page.rb +7 -3
  46. data/app/models/spotlight/page_configurations.rb +1 -0
  47. data/app/models/spotlight/page_content.rb +2 -0
  48. data/app/models/spotlight/resources/csv_upload.rb +2 -1
  49. data/app/models/spotlight/resources/iiif_manifest.rb +2 -0
  50. data/app/models/spotlight/resources/upload.rb +1 -1
  51. data/app/models/spotlight/search.rb +5 -1
  52. data/app/models/spotlight/solr_document_sidecar.rb +7 -5
  53. data/app/models/spotlight/temporary_image.rb +8 -0
  54. data/app/services/spotlight/exhibit_import_export_service.rb +454 -0
  55. data/app/services/spotlight/solr_document_builder.rb +1 -0
  56. data/app/values/custom_field_name.rb +1 -0
  57. data/app/views/catalog/_save_search.html.erb +1 -1
  58. data/app/views/layouts/spotlight/spotlight.html.erb +1 -1
  59. data/app/views/shared/_site_sidebar.html.erb +1 -1
  60. data/app/views/spotlight/about_pages/_contact.html.erb +15 -17
  61. data/app/views/spotlight/admin_users/index.html.erb +1 -1
  62. data/app/views/spotlight/appearances/edit.html.erb +1 -23
  63. data/app/views/spotlight/browse/_search.html.erb +3 -2
  64. data/app/views/spotlight/browse/_search_title.html.erb +2 -1
  65. data/app/views/spotlight/exhibits/new.html.erb +1 -1
  66. data/app/views/spotlight/feature_pages/_sidebar.html.erb +9 -5
  67. data/app/views/spotlight/indexing_complete_mailer/documents_indexed.html.erb +9 -0
  68. data/app/views/spotlight/pages/_form.html.erb +2 -2
  69. data/app/views/spotlight/pages/_page.html.erb +19 -35
  70. data/app/views/spotlight/search_configurations/_facets.html.erb +15 -34
  71. data/app/views/spotlight/search_configurations/_search_fields.html.erb +4 -19
  72. data/app/views/spotlight/search_configurations/_sort.html.erb +8 -22
  73. data/app/views/spotlight/searches/_form.html.erb +1 -0
  74. data/app/views/spotlight/searches/_search.html.erb +31 -29
  75. data/app/views/spotlight/shared/_dd3_item.html.erb +56 -0
  76. data/app/views/spotlight/shared/_honeypot_field.html.erb +4 -0
  77. data/app/views/spotlight/shared/_report_a_problem.html.erb +7 -10
  78. data/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb +1 -0
  79. data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +7 -1
  80. data/app/views/spotlight/sites/edit.html.erb +1 -1
  81. data/app/views/spotlight/sites/edit_exhibits.html.erb +1 -1
  82. data/app/views/spotlight/translations/_browse_categories.html.erb +29 -3
  83. data/app/views/spotlight/translations/_general.html.erb +7 -7
  84. data/app/views/spotlight/translations/_import.html.erb +24 -0
  85. data/app/views/spotlight/translations/_metadata.html.erb +1 -1
  86. data/app/views/spotlight/translations/_page.html.erb +5 -5
  87. data/app/views/spotlight/translations/_pages.html.erb +4 -4
  88. data/app/views/spotlight/translations/_pages_table.html.erb +5 -5
  89. data/app/views/spotlight/translations/_search_fields.html.erb +3 -3
  90. data/app/views/spotlight/translations/edit.html.erb +8 -6
  91. data/app/views/spotlight/translations/show.yaml.yamlbuilder +81 -0
  92. data/config/i18n-tasks.yml +2 -0
  93. data/config/locales/spotlight.ar.yml +47 -24
  94. data/config/locales/spotlight.en.yml +82 -67
  95. data/config/routes.rb +6 -1
  96. data/db/migrate/20200403161512_add_subtitle_to_searches.rb +7 -0
  97. data/lib/generators/spotlight/install_generator.rb +22 -1
  98. data/lib/generators/spotlight/templates/config/initializers/sir_trevor_rails.rb +10 -0
  99. data/lib/generators/spotlight/templates/config/initializers/spotlight_initializer.rb +2 -0
  100. data/lib/spotlight/engine.rb +26 -0
  101. data/lib/spotlight/upload_field_config.rb +1 -0
  102. data/lib/spotlight/version.rb +1 -1
  103. data/spec/controllers/spotlight/browse_controller_spec.rb +1 -1
  104. data/spec/controllers/spotlight/home_pages_controller_spec.rb +1 -1
  105. data/spec/controllers/spotlight/resources/csv_upload_controller_spec.rb +4 -4
  106. data/spec/controllers/spotlight/resources/upload_controller_spec.rb +2 -2
  107. data/spec/controllers/spotlight/translations_controller_spec.rb +53 -2
  108. data/spec/examples.txt +1410 -1389
  109. data/spec/factories/featured_images.rb +4 -0
  110. data/spec/features/add_contacts_spec.rb +1 -1
  111. data/spec/features/browse_category_admin_spec.rb +2 -2
  112. data/spec/features/create_exhibit_spec.rb +6 -6
  113. data/spec/features/dashboard_spec.rb +5 -5
  114. data/spec/features/exhibits/administration_spec.rb +3 -3
  115. data/spec/features/exhibits/language_create_edit_spec.rb +3 -3
  116. data/spec/features/exhibits/translation_editing_spec.rb +2 -2
  117. data/spec/features/home_page_spec.rb +9 -0
  118. data/spec/features/javascript/block_controls_spec.rb +2 -0
  119. data/spec/features/javascript/blocks/uploaded_items_block_spec.rb +4 -1
  120. data/spec/features/report_a_problem_spec.rb +5 -4
  121. data/spec/helpers/spotlight/pages_helper_spec.rb +2 -2
  122. data/spec/helpers/spotlight/title_helper_spec.rb +13 -0
  123. data/spec/i18n_spec.rb +0 -2
  124. data/spec/jobs/spotlight/add_uploads_from_csv_spec.rb +13 -1
  125. data/spec/mailers/spotlight/indexing_complete_mailer_spec.rb +11 -1
  126. data/spec/models/solr_document_spec.rb +2 -3
  127. data/spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb +1 -0
  128. data/spec/models/spotlight/exhibit_spec.rb +9 -1
  129. data/spec/models/spotlight/feature_page_spec.rb +0 -5
  130. data/spec/models/spotlight/featured_image_spec.rb +27 -0
  131. data/spec/models/spotlight/page_spec.rb +6 -1
  132. data/spec/models/spotlight/resources/upload_spec.rb +43 -79
  133. data/spec/models/spotlight/role_spec.rb +2 -2
  134. data/spec/{serializers/spotlight/exhibit_export_serializer_spec.rb → services/spotlight/exhibit_import_export_service_spec.rb} +120 -22
  135. data/spec/services/spotlight/iiif_resource_resolver_spec.rb +1 -1
  136. data/spec/test_app_templates/Gemfile.extra +0 -3
  137. data/spec/views/spotlight/feature_pages/_sidebar.html.erb_spec.rb +1 -0
  138. data/spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb +3 -3
  139. data/spec/views/spotlight/search_configurations/_search_fields.html.erb_spec.rb +1 -1
  140. data/spec/views/spotlight/search_configurations/_sort.html.erb_spec.rb +9 -10
  141. data/spec/views/spotlight/translations/_import.html.erb_spec.rb +24 -0
  142. data/vendor/assets/javascripts/leaflet-iiif.js +46 -21
  143. metadata +69 -34
  144. data/app/serializers/spotlight/exhibit_export_serializer.rb +0 -205
  145. data/app/serializers/spotlight/featured_image_representer.rb +0 -29
  146. data/app/serializers/spotlight/main_navigation_representer.rb +0 -13
  147. data/app/serializers/spotlight/page_representer.rb +0 -33
@@ -34,6 +34,7 @@ ignore_unused:
34
34
  - activerecord.attributes.spotlight/page.{display_sidebar\?,display_title} # app/views/spotlight/home_pages/_page_options.html.erb
35
35
  - activerecord.attributes.spotlight/language.locale # app/views/spotlight/exhibits/_languages.html.erb
36
36
  - activerecord.attributes.spotlight/contact.avatar # app/views/spotlight/contacts/_form.html.erb
37
+ - activerecord.attributes.spotlight/exhibit.contact_emails # app/views/spotlight/exhibits/_form.html.erb
37
38
  - activerecord.attributes.spotlight/exhibit.published # app/views/spotlight/sites/_exhibit.html.erb
38
39
  - activerecord.attributes.spotlight/masthead.display # app/views/spotlight/appearances/edit.html.erb
39
40
  - activerecord.attributes.spotlight/custom_field.is_multiple # app/views/spotlight/custom_fields/_form.html.erb
@@ -66,6 +67,7 @@ ignore_unused:
66
67
  - helpers.submit.{submit,update} # Generically used set defaults
67
68
  - helpers.submit.contact.create # app/views/spotlight/contacts/_form.html.erb
68
69
  - helpers.action.exhibit.contact.submit # helpers.action.exhibit.contact.submit
70
+ - helpers.label.contact_form.{email,name} # app/views/spotlight/shared/_report_a_problem.html.erb
69
71
 
70
72
  # TODO Look into these as its unclear
71
73
  - activerecord.models.spotlight.page
@@ -1,40 +1,63 @@
1
+ ---
1
2
  ar:
2
- activemodel:
3
- attributes:
4
- spotlight/contact_form:
5
- email: البريد الإلكتروني
6
- message: الرسالة
7
- name: الاسم
8
3
  helpers:
9
4
  action:
10
5
  cancel: إلغاء
11
6
  submit:
12
7
  contact_form:
13
- create: إرسال
14
- created: .نشكرك على رسالتك. لقد تم إرسال ملاحظاتك واقتراحاتك
8
+ create: ارسل
9
+ created: شكراً. لقد تم إرسال ملاحظاتك واقتراحاتك.
15
10
  spotlight:
16
11
  about_pages:
17
12
  contacts:
18
- header: عنوان فرعي
19
- header_links:
20
- contact: ملاحظات واقتراحات
21
- shared:
22
- report_a_problem:
23
- honeypot_field_explanation: .تجاهل هذا المربع النصي، فهو يُستخدم فقط لكشف المحتالين. إذا كتبت أي شيء في هذا المربع النصي، فلن يتم إرسال رسالتك
24
- title: عنوان
13
+ header: جهات الاتصال
14
+ breadcrumb:
15
+ label: مسار التنقل
25
16
  browse:
26
17
  search:
27
18
  item_count:
28
- one: "%{count} مادة"
29
- other: "%{count} مواد"
19
+ zero: "%{count} عنصر"
20
+ one: "%{count} عنصر"
21
+ two: "%{count} عنصرين"
22
+ few: "%{count} عناصر"
23
+ many: "%{count} عنصراً"
24
+ other: "%{count} عنصراً"
25
+
30
26
  search_box:
31
- label: البحث في فئة التصفح الحالية
32
- placeholder: ...بحث
27
+ label: ابحث في فئة التصفح الحالية
28
+ placeholder: بحث...
33
29
  reset: مسح استعلام البحث
34
- submit: البحث في فئة التصفح
30
+ submit: ابحث في فئة التصفح
35
31
  success:
36
- expand_html: يمكنك <a href="%{expand_search_url}">البحث في كل مواد المعرض عن "%{browse_query}"</a>.
37
- result_number_html: طابق استعلام البحث <strong> %{search_size} من %{parent_search_count} مادة</strong> .في هذه الفئة
32
+ expand_html: "يمكنك ايضاً <a href=\"%{expand_search_url}\">البحث في كل مواد المعرض عن \"%{browse_query}\"</a>."
33
+ result_number_html: "طابق استعلام البحث <strong> %{search_size} من %{parent_search_count} عنصر</strong> في هذه الفئة."
38
34
  zero_results:
39
- expand_html: <a href="%{clear_search_url}"> امسح استعلام المسح </a> أو حاول <a href="%{expand_search_url}">.البحث في كل المواد المعروضة لاستعلام البحث "%{browse_query}"</a>
40
- result_number: .لم يتطابق بحثك مع أي مادة في هذه الفئة
35
+ expand_html: "تستطيع أن <a href=\"%{clear_search_url}\"> تمسح استعلام البحث </a> أو محاولة <a href=\"%{expand_search_url}\"> البحث في كل المواد المعروضة لاستعلام البحث ل\"%{browse_query}\"</a>"
36
+ result_number: لم يتطابق بحثك مع أي عنصر في هذه الفئة.
37
+ header_links:
38
+ contact: ملاحظات واقتراحات
39
+ login: تسجيل الدخول
40
+ logout: تسجيل الخروج
41
+ shared:
42
+ report_a_problem:
43
+ honeypot_field_explanation: تجاهل هذا المربع النصي، فهو يُستخدم فقط لكشف المحتالين. إذا كتبت أي شيء في هذا المربع النصي، فلن يتم إرسال رسالتك.
44
+ title: تواصل معنا
45
+ sir_trevor:
46
+ blocks:
47
+ browse_block:
48
+ items:
49
+ zero: "%{count} عنصر"
50
+ one: "%{count} عنصر"
51
+ two: "%{count} عنصرين"
52
+ few: "%{count} عناصر"
53
+ many: "%{count} عنصراً"
54
+ other: "%{count} عنصراً"
55
+
56
+ link_to_search_block:
57
+ items:
58
+ zero: "%{count} عنصر"
59
+ one: "%{count} عنصر"
60
+ two: "%{count} عنصرين"
61
+ few: "%{count} عناصر"
62
+ many: "%{count} عنصراً"
63
+ other: "%{count} عنصراً"
@@ -9,6 +9,7 @@ en:
9
9
  spotlight/custom_search_field:
10
10
  field: Solr specification
11
11
  spotlight/exhibit:
12
+ contact_emails: Feedback recipients
12
13
  published: Published?
13
14
  spotlight/language:
14
15
  locale: Language
@@ -52,6 +53,9 @@ en:
52
53
  update_all: Save changes
53
54
  view: View
54
55
  label:
56
+ contact_form:
57
+ email: Your email
58
+ name: Your name
55
59
  solr_document:
56
60
  exhibit_tag_list: Tags
57
61
  spotlight/filter:
@@ -187,7 +191,6 @@ en:
187
191
  page_title: Manage users
188
192
  pending: pending
189
193
  save: Add role
190
- section: Manage exhibits
191
194
  update: Make user an administrator
192
195
  appearances:
193
196
  edit:
@@ -195,7 +198,6 @@ en:
195
198
  main_navigation:
196
199
  help: Select the menu items you want to be displayed in the main navigation menu (menu items are only displayed when published pages exist for that item). Click a menu item to change its display label. Drag and drop a menu item to change their order in the menu.
197
200
  menu: Main menu
198
- restore_default: Restore default
199
201
  site_masthead:
200
202
  heading: Exhibit masthead
201
203
  help: You can select and crop an image to use as a background in your exhibit site's masthead. To use an image as a masthead background, you should use an image that is at least 120 pixels tall and 1200 pixels wide. For best results use an image at least 1800 pixels wide. You can crop larger images using the cropping tool below.
@@ -373,10 +375,10 @@ en:
373
375
  not_validated: Not validated.
374
376
  resend: Resend confirmation?
375
377
  contact:
376
- email_delete_button: Delete contact
377
- email_delete_confirmation: Delete contact email address?
378
- email_delete_error: 'Problem deleting contact email:'
379
- email_input_aria_label: Contact email %{index}
378
+ email_delete_button: Delete recipient
379
+ email_delete_confirmation: Delete recipient email address?
380
+ email_delete_error: 'Problem deleting recipient:'
381
+ email_input_aria_label: Recipient email %{index}
380
382
  delete:
381
383
  heading: Delete exhibit
382
384
  warning_html: This action is irreversible. Be sure to back up the exhibit settings and content using the %{export_link} feature before proceeding.
@@ -394,10 +396,10 @@ en:
394
396
  heading: Filter items
395
397
  instructions: You can limit the items included in this exhibit by applying a filter to your Solr index. When you apply a filter, only items with values that match the filter will be included in your exhibit. To apply a filter, enter both a field and a value that match the names used in your Solr index.
396
398
  form:
397
- add_contact_email_button: Add new contact
399
+ add_contact_email_button: Add new recipient
398
400
  fields:
399
401
  contact_emails:
400
- help_block: Each contact email will receive feedback submissions
402
+ help_block: Each recipient will receive submissions made through the feedback form
401
403
  published:
402
404
  help_block: ''
403
405
  uneditable_non_default_language: This field is not editable in the current language. Switch to the default language to edit it.
@@ -424,7 +426,7 @@ en:
424
426
  language: Language
425
427
  public: Public
426
428
  new:
427
- header: Create a new exhibit
429
+ page_title: Create a new exhibit
428
430
  new_exhibit_form:
429
431
  fields:
430
432
  slug:
@@ -435,59 +437,6 @@ en:
435
437
  label: Title
436
438
  tags:
437
439
  all: All
438
- translations:
439
- browse_categories:
440
- default_language_column_label: English language title
441
- description_label: Description
442
- label: Browse categories
443
- translation_column_label: "%{language} translation"
444
- general:
445
- basic_settings:
446
- description: Description
447
- label: Basic Settings
448
- subtitle: Subtitle
449
- title: Title
450
- label: General
451
- main_menu:
452
- about: About
453
- browse: Browse
454
- curated_features: Curated Features
455
- home: Home
456
- label: Main Menu
457
- metadata:
458
- exhibit_specific_fields:
459
- label: Exhibit-Specific Fields
460
- label: Metadata field labels
461
- pages:
462
- about_pages:
463
- label: About Pages
464
- destroy: Delete
465
- destroy_are_you_sure: Are you sure you want to delete this page? If you delete this page all content, including any existing translations you have made in it, will be lost.
466
- edit: Edit
467
- feature_pages:
468
- label: Feature Pages
469
- help_html: Before exhibit visitors can view translated pages you must create, edit, and publish each page translation. When you create a translated page, a copy of the default language version of the page is made to serve as the initial translated page. You can then edit that translated page to replace the page title and any text fields with translated text. A translated page will not be visible to exhibit visitors until you publish it. To replace a translated page with a current copy of the default language version of the page, use the <i>Recreate</i> action.
470
- home_page:
471
- label: Home Page
472
- label: Pages
473
- new: Create one now.
474
- no_translated_page: No translated page.
475
- recreate: Recreate
476
- recreate_are_you_sure: Are you sure you want to recreate this page? If you recreate this page all content, including any existing translations you have made, will be replaced with the content of the English version of the page.
477
- table_header:
478
- actions: Actions
479
- default_published: Published
480
- language_published: Published
481
- last_updated: "%{language} title / Last update"
482
- search_fields:
483
- facet_fields:
484
- label: Facet Fields
485
- field_based_search_fields:
486
- label: Field-Based Search Fields
487
- label: Search field labels
488
- sort_fields:
489
- label: Sort Fields
490
- title: Translations
491
440
  exhibits_admin_invitation_mailer:
492
441
  invitation_instructions:
493
442
  accept: Accept invitation
@@ -540,6 +489,8 @@ en:
540
489
  body:
541
490
  one: "%{count} document has been indexed from the CSV file and added to the exhibit %{title}."
542
491
  other: "%{count} documents have been indexed from the CSV file and added to the exhibit %{title}."
492
+ error: 'Row %{index}: %{message}'
493
+ errors: Errors
543
494
  title: Your CSV file has just finished being processed.
544
495
  invitation_mailer:
545
496
  invitation_instructions:
@@ -766,10 +717,13 @@ en:
766
717
  other: "%{count} items"
767
718
  missing_description_html: "%{link} to add a description."
768
719
  shared:
720
+ dd3_item:
721
+ restore_default: Restore default
769
722
  exhibit_sidebar:
770
723
  header: Administration menu
771
724
  report_a_problem:
772
725
  honeypot_field_explanation: Ignore this text box. It is used to detect spammers. If you enter anything into this text box, your message will not be sent.
726
+ reporting_from: 'Reporting from: %{url}'
773
727
  title: Contact Us
774
728
  sir_trevor:
775
729
  blocks:
@@ -786,7 +740,6 @@ en:
786
740
  basic_settings:
787
741
  heading: Title
788
742
  page_title: Customize appearance
789
- section: Manage exhibits
790
743
  site_masthead:
791
744
  heading: Site masthead
792
745
  help: |
@@ -795,13 +748,10 @@ en:
795
748
  edit_exhibits:
796
749
  instructions: Drag and drop the exhibits below to specify the order in which they are displayed on the exhibits homepage.
797
750
  page_title: Order exhibits
798
- section: Manage exhibits
799
751
  exhibit:
800
752
  published: Published
801
753
  unpublished: Unpublished
802
- new:
803
- page_title: Create a new exhibit
804
- section: Manage exhibits
754
+ home: Exhibits
805
755
  tags:
806
756
  index:
807
757
  actions: Actions
@@ -812,6 +762,71 @@ en:
812
762
  count: Items tagged
813
763
  topbar:
814
764
  label: Utilities
765
+ translations:
766
+ browse_categories:
767
+ default_language_column_label: English language title
768
+ description_label: Description
769
+ label: Browse categories
770
+ subtitle_label: Subtitle
771
+ translation_column_label: "%{language} translation"
772
+ edit:
773
+ title: Translations
774
+ general:
775
+ basic_settings:
776
+ description: Description
777
+ label: Basic Settings
778
+ subtitle: Subtitle
779
+ title: Title
780
+ label: General
781
+ main_menu:
782
+ about: About
783
+ browse: Browse
784
+ curated_features: Curated Features
785
+ home: Home
786
+ label: Main Menu
787
+ import:
788
+ description: You can import and export Rails-based YAML files containing the translated label values for the currently selected language for use in internationalization tools such as Transifex and i18n-tools. This feature does not include importing or exporting translations for Pages.
789
+ export_current_locale: Export %{language}
790
+ export_default_locale: Export %{language}
791
+ export_label: Export a YAML file
792
+ header: Import and export translations
793
+ import_label: Import a YAML file
794
+ import_submit: Import translations
795
+ metadata:
796
+ exhibit_specific_fields:
797
+ label: Exhibit-Specific Fields
798
+ label: Metadata field labels
799
+ page:
800
+ destroy: Delete
801
+ destroy_are_you_sure: Are you sure you want to delete this page? If you delete this page all content, including any existing translations you have made in it, will be lost.
802
+ edit: Edit
803
+ new: Create one now.
804
+ no_translated_page: No translated page.
805
+ recreate: Recreate
806
+ recreate_are_you_sure: Are you sure you want to recreate this page? If you recreate this page all content, including any existing translations you have made, will be replaced with the content of the English version of the page.
807
+ pages:
808
+ about_pages:
809
+ label: About Pages
810
+ feature_pages:
811
+ label: Feature Pages
812
+ help_html: Before exhibit visitors can view translated pages you must create, edit, and publish each page translation. When you create a translated page, a copy of the default language version of the page is made to serve as the initial translated page. You can then edit that translated page to replace the page title and any text fields with translated text. A translated page will not be visible to exhibit visitors until you publish it. To replace a translated page with a current copy of the default language version of the page, use the <i>Recreate</i> action.
813
+ home_page:
814
+ label: Home Page
815
+ label: Pages
816
+ pages_table:
817
+ header:
818
+ actions: Actions
819
+ default_published: Published
820
+ language_published: Published
821
+ last_updated: "%{language} title / Last update"
822
+ search_fields:
823
+ facet_fields:
824
+ label: Facet Fields
825
+ field_based_search_fields:
826
+ label: Field-Based Search Fields
827
+ label: Search field labels
828
+ sort_fields:
829
+ label: Sort Fields
815
830
  versions:
816
831
  redo: Redo changes
817
832
  undo: Undo changes
@@ -143,7 +143,12 @@ Spotlight::Engine.routes.draw do
143
143
  end
144
144
  end
145
145
  post 'solr/update' => 'solr#update'
146
- resource :translations, only: %i[edit update]
146
+ resource :translations, only: %i[edit update show] do
147
+ collection do
148
+ post 'import'
149
+ patch 'import'
150
+ end
151
+ end
147
152
  end
148
153
 
149
154
  get '/:exhibit_id' => 'home_pages#show', as: :exhibit_root
@@ -0,0 +1,7 @@
1
+ class AddSubtitleToSearches < ActiveRecord::Migration[5.2]
2
+ def change
3
+ change_table :spotlight_searches do |t|
4
+ t.string :subtitle
5
+ end
6
+ end
7
+ end
@@ -10,6 +10,25 @@ module Spotlight
10
10
  class_option :solr_update_class, type: :string, default: 'Spotlight::SolrDocument::AtomicUpdates'
11
11
  class_option :mailer_default_url_host, type: :string, default: '' # e.g. localhost:3000
12
12
 
13
+ # we're not (yet) using webpacker, so we need to re-add sprockets functionality
14
+ def add_js
15
+ return unless Rails.version.to_i == 6
16
+
17
+ gem 'coffee-rails', '~> 4.2'
18
+ gem 'uglifier', '>= 1.3.0'
19
+
20
+ append_to_file 'app/assets/config/manifest.js', '//= link_directory ../javascripts .js'
21
+ append_to_file 'app/assets/javascripts/application.js', '//= require_tree .'
22
+ gsub_file 'app/views/layouts/application.html.erb', /pack/, 'include'
23
+ inject_into_file 'config/environments/production.rb', after: ' # config.assets.css_compressor = :sass' do
24
+ "\n config.assets.js_compressor = :uglifier"
25
+ end
26
+
27
+ # but since webpacker exists in the gemfile, we still need to run the
28
+ # install before rails will start
29
+ run 'bundle exec rails webpacker:install'
30
+ end
31
+
13
32
  def inject_spotlight_routes
14
33
  route "mount Spotlight::Engine, at: 'spotlight'"
15
34
  gsub_file 'config/routes.rb', /^\s*root.*/ do |match|
@@ -53,7 +72,9 @@ module Spotlight
53
72
  end
54
73
 
55
74
  def add_roles_to_user
56
- inject_into_class 'app/models/user.rb', User, ' include Spotlight::User'
75
+ inject_into_file 'app/models/user.rb', after: 'include Blacklight::User' do
76
+ "\n include Spotlight::User\n"
77
+ end
57
78
  end
58
79
 
59
80
  def add_controller_mixin
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Required for 0.6 and up:
4
+ # https://github.com/madebymany/sir-trevor-rails#upgrade-guide-to-v060
5
+ class SirTrevorRails::Block
6
+ def self.custom_block_types
7
+ # You can define your custom block types directly here or in your engine config.
8
+ Spotlight::Engine.config.sir_trevor_widgets
9
+ end
10
+ end
@@ -70,6 +70,8 @@
70
70
  # Spotlight::Engine.config.ga_anonymize_ip = false # false for backwards compatibility
71
71
 
72
72
  # ==> Sir Trevor Widget Configuration
73
+ # These are set by default by Spotlight's configuration,
74
+ # but you can customize them here, or in the SirTrevorRails::Block#custom_block_types method
73
75
  # Spotlight::Engine.config.sir_trevor_widgets = %w(
74
76
  # Heading Text List Quote Iframe Video Oembed Rule UploadedItems Browse
75
77
  # FeaturedPages SolrDocuments SolrDocumentsCarousel SolrDocumentsEmbed
@@ -160,6 +160,7 @@ module Spotlight
160
160
 
161
161
  # Configure the CarrierWave file storage mechanism
162
162
  config.uploader_storage = :file
163
+ config.featured_image_masthead_size = [1800, 180]
163
164
  config.featured_image_thumb_size = [400, 300]
164
165
  config.featured_image_square_size = [400, 400]
165
166
  config.contact_square_size = [70, 70]
@@ -192,6 +193,7 @@ module Spotlight
192
193
  config.ga_analytics_options = {}
193
194
  config.ga_page_analytics_options = config.ga_analytics_options.merge(limit: 5)
194
195
  config.ga_anonymize_ip = false # false for backwards compatibility
196
+ config.max_pages = 1000
195
197
 
196
198
  Blacklight::Engine.config.inject_blacklight_helpers = false
197
199
 
@@ -213,6 +215,25 @@ module Spotlight
213
215
  # add could add an available locale which could break things if unexpected.
214
216
  config.i18n.available_locales = config.i18n_locales.keys
215
217
 
218
+ # Copy of JbuilderHandler tweaked to spit out YAML for translation exports
219
+ class TranslationYamlHandler
220
+ cattr_accessor :default_format
221
+ self.default_format = :yaml
222
+
223
+ def self.call(template, source = nil)
224
+ source ||= template.source
225
+ # this juggling is required to keep line numbers right in the error
226
+ %{__already_defined = defined?(json); json||=JbuilderTemplate.new(self); #{source}
227
+ json.attributes!.to_yaml unless (__already_defined && __already_defined != "method")}
228
+ end
229
+ end
230
+
231
+ initializer :yamlbuilder do
232
+ ActiveSupport.on_load :action_view do
233
+ ActionView::Template.register_template_handler :yamlbuilder, TranslationYamlHandler
234
+ end
235
+ end
236
+
216
237
  # Query parameters for autocomplete requests
217
238
  config.autocomplete_search_field = 'autocomplete'
218
239
  config.default_autocomplete_params = { qf: 'id^1000 full_title_tesim^100 id_ng full_title_ng',
@@ -242,6 +263,9 @@ module Spotlight
242
263
  config.exhibit_themes = ['default']
243
264
 
244
265
  config.default_page_content_type = 'SirTrevor'
266
+
267
+ # Added here for backwards compatability with SirTrevor 0.6
268
+ # and apps who have customized their avaialble widgets
245
269
  config.sir_trevor_widgets = %w[
246
270
  Heading Text List Quote Iframe Video Oembed Rule UploadedItems Browse LinkToSearch
247
271
  FeaturedPages SolrDocuments SolrDocumentsCarousel SolrDocumentsEmbed
@@ -251,6 +275,8 @@ module Spotlight
251
275
  config.routes = OpenStruct.new
252
276
  config.routes.solr_documents = {}
253
277
 
278
+ config.controller_tracking_method = 'track_catalog_path'
279
+
254
280
  config.exports = {
255
281
  attachments: true,
256
282
  blacklight_configuration: true,