blacklight-spotlight 3.0.0.alpha.2 → 3.0.0.alpha.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (350) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +4 -4
  3. data/app/assets/javascripts/spotlight/admin/appearance.js +3 -3
  4. data/app/assets/javascripts/spotlight/admin/blocks/resources_block.js +18 -16
  5. data/app/assets/javascripts/spotlight/admin/blocks/uploaded_items_block.js +19 -20
  6. data/app/assets/javascripts/spotlight/admin/exhibits.js +6 -1
  7. data/app/assets/javascripts/spotlight/admin/multi_image_selector.js +1 -1
  8. data/app/assets/javascripts/spotlight/admin/search_typeahead.js +1 -1
  9. data/app/assets/javascripts/spotlight/admin/sir-trevor/locales.js +1 -1
  10. data/app/assets/javascripts/spotlight/admin/spotlight_nestable.js +6 -1
  11. data/app/assets/javascripts/spotlight/admin/tabs.js +2 -2
  12. data/app/assets/stylesheets/spotlight/_blacklight_configuration.scss +1 -35
  13. data/app/assets/stylesheets/spotlight/_bootstrap_overrides.scss +17 -10
  14. data/app/assets/stylesheets/spotlight/_browse.scss +11 -18
  15. data/app/assets/stylesheets/spotlight/_catalog.scss +13 -4
  16. data/app/assets/stylesheets/spotlight/_curation.scss +21 -14
  17. data/app/assets/stylesheets/spotlight/_exhibit_navbar.scss +10 -0
  18. data/app/assets/stylesheets/spotlight/_exhibits_index.scss +4 -48
  19. data/app/assets/stylesheets/spotlight/_header.scss +3 -1
  20. data/app/assets/stylesheets/spotlight/_item_text_block.scss +3 -3
  21. data/app/assets/stylesheets/spotlight/_multi_image_selector.scss +6 -7
  22. data/app/assets/stylesheets/spotlight/_nestable.scss +12 -1
  23. data/app/assets/stylesheets/spotlight/_pages.scss +7 -19
  24. data/app/assets/stylesheets/spotlight/_spotlight.scss +1 -0
  25. data/app/assets/stylesheets/spotlight/_translations.scss +5 -0
  26. data/app/controllers/concerns/spotlight/base.rb +2 -2
  27. data/app/controllers/concerns/spotlight/controller.rb +2 -2
  28. data/app/controllers/concerns/spotlight/search_helper.rb +2 -0
  29. data/app/controllers/spotlight/about_pages_controller.rb +1 -1
  30. data/app/controllers/spotlight/appearances_controller.rb +9 -9
  31. data/app/controllers/spotlight/browse_controller.rb +1 -1
  32. data/app/controllers/spotlight/catalog_controller.rb +5 -9
  33. data/app/controllers/spotlight/concerns/application_controller.rb +3 -3
  34. data/app/controllers/spotlight/contacts_controller.rb +1 -1
  35. data/app/controllers/spotlight/custom_fields_controller.rb +1 -1
  36. data/app/controllers/spotlight/custom_search_fields_controller.rb +1 -1
  37. data/app/controllers/spotlight/exhibits_controller.rb +4 -4
  38. data/app/controllers/spotlight/feature_pages_controller.rb +3 -5
  39. data/app/controllers/spotlight/filters_controller.rb +1 -3
  40. data/app/controllers/spotlight/home_pages_controller.rb +1 -1
  41. data/app/controllers/spotlight/metadata_configurations_controller.rb +1 -1
  42. data/app/controllers/spotlight/pages_controller.rb +7 -7
  43. data/app/controllers/spotlight/resources/upload_controller.rb +1 -1
  44. data/app/controllers/spotlight/resources_controller.rb +1 -1
  45. data/app/controllers/spotlight/roles_controller.rb +1 -1
  46. data/app/controllers/spotlight/search_configurations_controller.rb +3 -3
  47. data/app/controllers/spotlight/searches_controller.rb +12 -12
  48. data/app/controllers/spotlight/sites_controller.rb +5 -5
  49. data/app/controllers/spotlight/translations_controller.rb +1 -1
  50. data/app/helpers/spotlight/application_helper.rb +3 -3
  51. data/app/helpers/spotlight/main_app_helpers.rb +6 -6
  52. data/app/helpers/spotlight/masthead_helper.rb +19 -0
  53. data/app/helpers/spotlight/search_configurations_helper.rb +9 -7
  54. data/app/helpers/spotlight/searches_helper.rb +1 -1
  55. data/app/jobs/spotlight/add_uploads_from_csv.rb +0 -1
  56. data/app/jobs/spotlight/reindex_job.rb +4 -4
  57. data/app/models/concerns/spotlight/access_controls_enforcement_search_builder.rb +1 -1
  58. data/app/models/concerns/spotlight/exhibit_analytics.rb +2 -2
  59. data/app/models/concerns/spotlight/solr_document.rb +5 -1
  60. data/app/models/concerns/spotlight/solr_document/uploaded_resource.rb +2 -2
  61. data/app/models/spotlight/ability.rb +2 -2
  62. data/app/models/spotlight/about_page.rb +1 -1
  63. data/app/models/spotlight/analytics/ga.rb +1 -1
  64. data/app/models/spotlight/blacklight_configuration.rb +20 -18
  65. data/app/models/spotlight/contact.rb +1 -1
  66. data/app/models/spotlight/custom_field.rb +7 -7
  67. data/app/models/spotlight/exhibit.rb +11 -2
  68. data/app/models/spotlight/feature_page.rb +1 -1
  69. data/app/models/spotlight/featured_image.rb +1 -4
  70. data/app/models/spotlight/home_page.rb +1 -1
  71. data/app/models/spotlight/page.rb +2 -2
  72. data/app/models/spotlight/reindexing_log_entry.rb +3 -3
  73. data/app/models/spotlight/resource.rb +3 -5
  74. data/app/models/spotlight/resources/iiif_manifest.rb +1 -1
  75. data/app/models/spotlight/resources/upload.rb +0 -1
  76. data/app/models/spotlight/role.rb +1 -1
  77. data/app/models/spotlight/search.rb +3 -3
  78. data/app/serializers/spotlight/exhibit_export_serializer.rb +10 -10
  79. data/app/serializers/spotlight/featured_image_representer.rb +1 -1
  80. data/app/serializers/spotlight/main_navigation_representer.rb +1 -1
  81. data/app/serializers/spotlight/page_representer.rb +1 -1
  82. data/app/uploaders/spotlight/attachment_uploader.rb +0 -1
  83. data/app/views/catalog/_image_default.html.erb +3 -3
  84. data/app/views/catalog/_save_search.html.erb +2 -2
  85. data/app/views/layouts/spotlight/spotlight.html.erb +2 -2
  86. data/app/views/shared/_breadcrumbs.html.erb +1 -1
  87. data/app/views/shared/_exhibit_navbar.html.erb +3 -3
  88. data/app/views/shared/_header_navbar.html.erb +1 -1
  89. data/app/views/shared/_masthead.html.erb +12 -15
  90. data/app/views/spotlight/about_pages/_contact.html.erb +12 -12
  91. data/app/views/spotlight/about_pages/_contact_properties.html.erb +16 -12
  92. data/app/views/spotlight/about_pages/_contacts.html.erb +1 -1
  93. data/app/views/spotlight/about_pages/_contacts_form.html.erb +2 -2
  94. data/app/views/spotlight/about_pages/_sidebar.html.erb +1 -1
  95. data/app/views/spotlight/appearances/edit.html.erb +27 -31
  96. data/app/views/spotlight/browse/_search.html.erb +1 -1
  97. data/app/views/spotlight/browse/_search_box.html.erb +2 -2
  98. data/app/views/spotlight/browse/_sort_and_per_page.html.erb +1 -1
  99. data/app/views/spotlight/browse/index.html.erb +3 -2
  100. data/app/views/spotlight/catalog/_admin_thumbnail_default.html.erb +1 -1
  101. data/app/views/spotlight/catalog/_document_admin_table.html.erb +1 -1
  102. data/app/views/spotlight/contacts/_form.html.erb +2 -2
  103. data/app/views/spotlight/custom_fields/form_group/_text.html.erb +15 -6
  104. data/app/views/spotlight/custom_fields/form_group/_vocab.html.erb +15 -6
  105. data/app/views/spotlight/custom_search_fields/edit.html.erb +5 -5
  106. data/app/views/spotlight/custom_search_fields/new.html.erb +5 -5
  107. data/app/views/spotlight/dashboards/_analytics.html.erb +1 -1
  108. data/app/views/spotlight/dashboards/_page_activity.html.erb +1 -1
  109. data/app/views/spotlight/dashboards/_reindexing_activity.html.erb +1 -1
  110. data/app/views/spotlight/dashboards/_solr_document_activity.html.erb +1 -1
  111. data/app/views/spotlight/exhibits/_contact.html.erb +1 -1
  112. data/app/views/spotlight/exhibits/_delete.html.erb +2 -2
  113. data/app/views/spotlight/exhibits/_exhibit_card.html.erb +2 -2
  114. data/app/views/spotlight/exhibits/_exhibit_card_back.html.erb +21 -19
  115. data/app/views/spotlight/exhibits/_exhibit_card_front.html.erb +5 -3
  116. data/app/views/spotlight/exhibits/_exhibits.html.erb +3 -5
  117. data/app/views/spotlight/exhibits/_form.html.erb +3 -3
  118. data/app/views/spotlight/exhibits/_languages.html.erb +6 -4
  119. data/app/views/spotlight/feature_pages/_header.html.erb +5 -5
  120. data/app/views/spotlight/feature_pages/_sidebar.html.erb +1 -1
  121. data/app/views/spotlight/featured_images/_form.html.erb +2 -2
  122. data/app/views/spotlight/featured_images/_upload_form.html.erb +2 -2
  123. data/app/views/spotlight/home_pages/_edit_page_link.html.erb +1 -1
  124. data/app/views/spotlight/metadata_configurations/edit.html.erb +2 -2
  125. data/app/views/spotlight/pages/_order_pages.html.erb +1 -1
  126. data/app/views/spotlight/pages/_page.html.erb +23 -23
  127. data/app/views/spotlight/pages/_view_type_group.html.erb +1 -1
  128. data/app/views/spotlight/resources/_external_resources_form.html.erb +10 -2
  129. data/app/views/spotlight/resources/new.html.erb +2 -2
  130. data/app/views/spotlight/resources/upload/_form.html.erb +1 -1
  131. data/app/views/spotlight/roles/index.html.erb +2 -6
  132. data/app/views/spotlight/search_configurations/_default_per_page.html.erb +1 -1
  133. data/app/views/spotlight/search_configurations/_document_index_view_types.html.erb +1 -1
  134. data/app/views/spotlight/search_configurations/_facets.html.erb +22 -22
  135. data/app/views/spotlight/search_configurations/_search_fields.html.erb +11 -15
  136. data/app/views/spotlight/search_configurations/_sort.html.erb +19 -19
  137. data/app/views/spotlight/searches/_form.html.erb +3 -3
  138. data/app/views/spotlight/searches/_search.html.erb +24 -24
  139. data/app/views/spotlight/searches/index.html.erb +1 -1
  140. data/app/views/spotlight/shared/_configuration_sidebar.html.erb +2 -1
  141. data/app/views/spotlight/shared/_curation_sidebar.html.erb +1 -1
  142. data/app/views/spotlight/shared/_exhibit_sidebar.html.erb +1 -0
  143. data/app/views/spotlight/sir_trevor/blocks/_oembed_block.html.erb +3 -3
  144. data/app/views/spotlight/sir_trevor/blocks/_search_results_block.html.erb +1 -2
  145. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +6 -6
  146. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb +3 -3
  147. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb +15 -7
  148. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb +3 -3
  149. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb +7 -6
  150. data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +4 -4
  151. data/config/locales/spotlight.en.yml +13 -5
  152. data/config/locales/spotlight.es.yml +40 -0
  153. data/config/locales/spotlight.pt-BR.yml +25 -0
  154. data/config/routes.rb +14 -14
  155. data/lib/generators/spotlight/install_generator.rb +1 -1
  156. data/lib/generators/spotlight/scaffold_resource_generator.rb +1 -1
  157. data/lib/generators/spotlight/templates/config/initializers/translation.rb +5 -5
  158. data/lib/spotlight/engine.rb +12 -11
  159. data/lib/spotlight/version.rb +1 -1
  160. data/lib/tasks/spotlight_tasks.rake +2 -2
  161. data/spec/controllers/application_controller_spec.rb +1 -0
  162. data/spec/controllers/spotlight/about_pages_controller_spec.rb +10 -0
  163. data/spec/controllers/spotlight/admin_users_controller_spec.rb +4 -0
  164. data/spec/controllers/spotlight/appearances_controller_spec.rb +2 -0
  165. data/spec/controllers/spotlight/application_controller_spec.rb +1 -0
  166. data/spec/controllers/spotlight/attachments_controller_spec.rb +2 -0
  167. data/spec/controllers/spotlight/browse_controller_spec.rb +5 -4
  168. data/spec/controllers/spotlight/catalog_controller_spec.rb +18 -4
  169. data/spec/controllers/spotlight/confirmations_controller_spec.rb +1 -0
  170. data/spec/controllers/spotlight/contact_forms_controller_spec.rb +2 -0
  171. data/spec/controllers/spotlight/contacts_controller_spec.rb +3 -0
  172. data/spec/controllers/spotlight/custom_fields_controller_spec.rb +2 -0
  173. data/spec/controllers/spotlight/custom_search_fields_controller_spec.rb +2 -0
  174. data/spec/controllers/spotlight/dashboards_controller_spec.rb +1 -0
  175. data/spec/controllers/spotlight/exhibits_controller_spec.rb +4 -2
  176. data/spec/controllers/spotlight/feature_pages_controller_spec.rb +13 -1
  177. data/spec/controllers/spotlight/featured_images_controller_spec.rb +1 -0
  178. data/spec/controllers/spotlight/home_pages_controller_spec.rb +5 -2
  179. data/spec/controllers/spotlight/metadata_configurations_controller_spec.rb +2 -1
  180. data/spec/controllers/spotlight/pages_controller_spec.rb +2 -0
  181. data/spec/controllers/spotlight/resources/csv_upload_controller_spec.rb +4 -0
  182. data/spec/controllers/spotlight/resources/upload_controller_spec.rb +1 -0
  183. data/spec/controllers/spotlight/resources_controller_spec.rb +2 -0
  184. data/spec/controllers/spotlight/roles_controller_spec.rb +1 -0
  185. data/spec/controllers/spotlight/search_configurations_controller_spec.rb +2 -1
  186. data/spec/controllers/spotlight/searches_controller_spec.rb +4 -0
  187. data/spec/controllers/spotlight/sites_controller_spec.rb +1 -0
  188. data/spec/controllers/spotlight/tags_controller_spec.rb +1 -0
  189. data/spec/controllers/spotlight/translations_controller_spec.rb +2 -0
  190. data/spec/controllers/spotlight/versions_controller_spec.rb +2 -0
  191. data/spec/controllers/spotlight/view_configurations_controller_spec.rb +2 -1
  192. data/spec/examples.txt +1382 -50
  193. data/spec/factories/contact_emails.rb +1 -1
  194. data/spec/factories/contact_images.rb +1 -1
  195. data/spec/factories/contacts.rb +1 -1
  196. data/spec/factories/custom_fields.rb +1 -1
  197. data/spec/factories/custom_search_fields.rb +1 -1
  198. data/spec/factories/exhibit_thumbnails.rb +1 -1
  199. data/spec/factories/exhibits.rb +1 -1
  200. data/spec/factories/featured_images.rb +2 -2
  201. data/spec/factories/language.rb +1 -1
  202. data/spec/factories/main_navigation.rb +1 -1
  203. data/spec/factories/reindexing_log_entries.rb +6 -6
  204. data/spec/factories/resources.rb +2 -2
  205. data/spec/factories/roles.rb +1 -1
  206. data/spec/factories/searches.rb +2 -2
  207. data/spec/factories/tags.rb +2 -2
  208. data/spec/features/about_page_spec.rb +1 -0
  209. data/spec/features/add_contacts_spec.rb +2 -1
  210. data/spec/features/add_custom_field_metadata_spec.rb +3 -0
  211. data/spec/features/add_iiif_manifest_spec.rb +1 -0
  212. data/spec/features/add_items_spec.rb +1 -0
  213. data/spec/features/browse_category_admin_spec.rb +3 -1
  214. data/spec/features/browse_category_spec.rb +4 -1
  215. data/spec/features/catalog_spec.rb +1 -0
  216. data/spec/features/create_exhibit_spec.rb +1 -0
  217. data/spec/features/create_page_spec.rb +1 -0
  218. data/spec/features/edit_contact_spec.rb +1 -0
  219. data/spec/features/edit_search_fields_spec.rb +4 -3
  220. data/spec/features/exhibit_masthead_spec.rb +4 -4
  221. data/spec/features/exhibits/administration_spec.rb +11 -2
  222. data/spec/features/exhibits/edit_metadata_fields_spec.rb +3 -2
  223. data/spec/features/exhibits/language_create_edit_spec.rb +1 -0
  224. data/spec/features/exhibits/translation_editing_spec.rb +5 -3
  225. data/spec/features/exhibits_index_spec.rb +2 -2
  226. data/spec/features/feature_page_spec.rb +6 -2
  227. data/spec/features/home_page_spec.rb +3 -1
  228. data/spec/features/import_exhibit_spec.rb +1 -0
  229. data/spec/features/item_admin_spec.rb +4 -2
  230. data/spec/features/javascript/about_page_admin_spec.rb +2 -1
  231. data/spec/features/javascript/block_controls_spec.rb +3 -2
  232. data/spec/features/javascript/blocks/rule_block_spec.rb +1 -0
  233. data/spec/features/javascript/blocks/solr_documents_block_spec.rb +11 -11
  234. data/spec/features/javascript/blocks/uploaded_items_block_spec.rb +5 -7
  235. data/spec/features/javascript/edit_in_place_spec.rb +2 -1
  236. data/spec/features/javascript/feature_page_admin_spec.rb +1 -1
  237. data/spec/features/javascript/home_page_edit_spec.rb +1 -1
  238. data/spec/features/javascript/metadata_admin_spec.rb +3 -1
  239. data/spec/features/javascript/multi_image_select_spec.rb +3 -2
  240. data/spec/features/javascript/reindex_monitor_spec.rb +1 -1
  241. data/spec/features/javascript/roles_admin_spec.rb +1 -0
  242. data/spec/features/javascript/search_config_admin_spec.rb +3 -1
  243. data/spec/features/javascript/search_context_spec.rb +5 -4
  244. data/spec/features/main_navigation_spec.rb +46 -2
  245. data/spec/features/metadata_admin_spec.rb +1 -0
  246. data/spec/features/report_a_problem_spec.rb +1 -1
  247. data/spec/features/site_masthead_spec.rb +3 -3
  248. data/spec/features/slideshow_spec.rb +1 -1
  249. data/spec/helpers/spotlight/application_helper_spec.rb +10 -5
  250. data/spec/helpers/spotlight/crud_link_helpers_spec.rb +3 -0
  251. data/spec/helpers/spotlight/languages_helper_spec.rb +2 -0
  252. data/spec/helpers/spotlight/main_app_helpers_spec.rb +10 -6
  253. data/spec/helpers/spotlight/masthead_helper_spec.rb +51 -0
  254. data/spec/helpers/spotlight/meta_helper_spec.rb +1 -0
  255. data/spec/helpers/spotlight/navbar_helper_spec.rb +5 -3
  256. data/spec/helpers/spotlight/pages_helper_spec.rb +10 -3
  257. data/spec/helpers/spotlight/title_helper_spec.rb +1 -0
  258. data/spec/jobs/spotlight/add_uploads_from_csv_spec.rb +1 -0
  259. data/spec/jobs/spotlight/default_thumbnail_job_spec.rb +2 -1
  260. data/spec/lib/migration/iiif_spec.rb +1 -1
  261. data/spec/lib/migration/page_language_spec.rb +1 -0
  262. data/spec/lib/spotlight/controller_spec.rb +4 -4
  263. data/spec/mailers/spotlight/indexing_complete_mailer_spec.rb +2 -1
  264. data/spec/models/sir_trevor_rails/blocks/browse_block_spec.rb +2 -1
  265. data/spec/models/sir_trevor_rails/blocks/featured_pages_block_spec.rb +2 -1
  266. data/spec/models/sir_trevor_rails/blocks/search_results_block_spec.rb +2 -1
  267. data/spec/models/sir_trevor_rails/blocks/solr_documents_block_spec.rb +2 -1
  268. data/spec/models/sir_trevor_rails/blocks/textable_spec.rb +5 -2
  269. data/spec/models/solr_document_spec.rb +19 -10
  270. data/spec/models/spotlight/ability_spec.rb +3 -1
  271. data/spec/models/spotlight/about_page_spec.rb +6 -3
  272. data/spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb +2 -1
  273. data/spec/models/spotlight/analytics/ga_spec.rb +1 -1
  274. data/spec/models/spotlight/blacklight_configuration_spec.rb +36 -31
  275. data/spec/models/spotlight/contact_email_spec.rb +4 -3
  276. data/spec/models/spotlight/contact_form_spec.rb +3 -2
  277. data/spec/models/spotlight/contact_spec.rb +4 -3
  278. data/spec/models/spotlight/custom_field_spec.rb +17 -8
  279. data/spec/models/spotlight/custom_search_field_spec.rb +2 -0
  280. data/spec/models/spotlight/custom_translation_extension_spec.rb +2 -1
  281. data/spec/models/spotlight/exhibit_spec.rb +34 -3
  282. data/spec/models/spotlight/feature_page_spec.rb +21 -9
  283. data/spec/models/spotlight/field_metadata_spec.rb +4 -4
  284. data/spec/models/spotlight/home_page_spec.rb +8 -4
  285. data/spec/models/spotlight/language_spec.rb +1 -0
  286. data/spec/models/spotlight/masthead_spec.rb +2 -1
  287. data/spec/models/spotlight/page_configurations_spec.rb +2 -1
  288. data/spec/models/spotlight/page_spec.rb +14 -8
  289. data/spec/models/spotlight/reindexing_log_entry_spec.rb +4 -4
  290. data/spec/models/spotlight/resources/iiif_harvester_spec.rb +5 -3
  291. data/spec/models/spotlight/resources/iiif_manifest_spec.rb +6 -2
  292. data/spec/models/spotlight/resources/iiif_service_spec.rb +4 -1
  293. data/spec/models/spotlight/resources/open_graph_spec.rb +3 -2
  294. data/spec/models/spotlight/resources/upload_spec.rb +7 -2
  295. data/spec/models/spotlight/role_spec.rb +5 -0
  296. data/spec/models/spotlight/search_spec.rb +4 -1
  297. data/spec/models/spotlight/sitemap_spec.rb +2 -2
  298. data/spec/models/spotlight/solr_document/atomic_updates_spec.rb +2 -1
  299. data/spec/models/spotlight/solr_document/uploaded_resource_spec.rb +3 -1
  300. data/spec/models/spotlight/solr_document_sidecar_spec.rb +8 -7
  301. data/spec/models/spotlight/user_spec.rb +1 -0
  302. data/spec/models/translation_spec.rb +3 -2
  303. data/spec/serializers/spotlight/exhibit_export_serializer_spec.rb +24 -23
  304. data/spec/services/spotlight/clone_translated_page_from_locale_spec.rb +2 -1
  305. data/spec/services/spotlight/iiif_resource_resolver_spec.rb +3 -2
  306. data/spec/services/spotlight/solr_document_builder_spec.rb +2 -1
  307. data/spec/spec_helper.rb +4 -4
  308. data/spec/support/features/test_features_helpers.rb +1 -1
  309. data/spec/test_app_templates/Gemfile.extra +1 -1
  310. data/spec/test_app_templates/catalog_controller.rb +1 -1
  311. data/spec/test_app_templates/spotlight_test.rake +1 -1
  312. data/spec/uploaders/spotlight/attachment_uploader_spec.rb +2 -1
  313. data/spec/uploaders/spotlight/featured_image_uploader_spec.rb +2 -1
  314. data/spec/views/shared/_analytics.html.erb_spec.rb +1 -0
  315. data/spec/views/shared/_exhibit_navbar.html.erb_spec.rb +5 -5
  316. data/spec/views/shared/_masthead.html.erb_spec.rb +4 -1
  317. data/spec/views/shared/_user_util_links.html.erb_spec.rb +9 -2
  318. data/spec/views/spotlight/about_pages/_empty.html.erb_spec.rb +4 -1
  319. data/spec/views/spotlight/about_pages/index.html.erb_spec.rb +2 -0
  320. data/spec/views/spotlight/browse/_search.html.erb_spec.rb +1 -0
  321. data/spec/views/spotlight/browse/index.html.erb_spec.rb +3 -1
  322. data/spec/views/spotlight/browse/show.html.erb_spec.rb +2 -2
  323. data/spec/views/spotlight/catalog/_edit_default.html.erb_spec.rb +6 -5
  324. data/spec/views/spotlight/catalog/admin.html.erb_spec.rb +1 -0
  325. data/spec/views/spotlight/contacts/edit.html.erb_spec.rb +1 -1
  326. data/spec/views/spotlight/dashboards/_analytics.html.erb_spec.rb +1 -0
  327. data/spec/views/spotlight/dashboards/_reindexing_activity.html.erb_spec.rb +1 -1
  328. data/spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb +1 -1
  329. data/spec/views/spotlight/exhibits/_form.html.erb_spec.rb +1 -0
  330. data/spec/views/spotlight/exhibits/edit.html.erb_spec.rb +2 -1
  331. data/spec/views/spotlight/feature_pages/_empty.html.erb_spec.rb +2 -1
  332. data/spec/views/spotlight/featured_images/_form.html.erb_spec.rb +1 -1
  333. data/spec/views/spotlight/featured_images/_upload_form.html.erb_spec.rb +1 -1
  334. data/spec/views/spotlight/home_pages/_empty.html.erb_spec.rb +2 -1
  335. data/spec/views/spotlight/metadata_configurations/edit.html.erb_spec.rb +1 -0
  336. data/spec/views/spotlight/pages/_form.html.erb_spec.rb +1 -0
  337. data/spec/views/spotlight/pages/edit.html.erb_spec.rb +1 -0
  338. data/spec/views/spotlight/pages/index.html.erb_spec.rb +1 -0
  339. data/spec/views/spotlight/pages/new.html.erb_spec.rb +1 -0
  340. data/spec/views/spotlight/pages/show.html.erb_spec.rb +4 -3
  341. data/spec/views/spotlight/resources/_external_resources_form.html.erb_spec.rb +1 -1
  342. data/spec/views/spotlight/resources/new.html.erb_spec.rb +2 -2
  343. data/spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb +2 -2
  344. data/spec/views/spotlight/search_configurations/_facets.html.erb_spec.rb +1 -1
  345. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb_spec.rb +2 -1
  346. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb +17 -3
  347. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb +8 -1
  348. data/spec/views/spotlight/tags/index.html.erb_spec.rb +1 -0
  349. data/spec/views/spotlight/translations/_page.html.erb_spec.rb +1 -0
  350. metadata +158 -152
@@ -50,7 +50,7 @@ module Spotlight
50
50
  def contact_params
51
51
  params.require(:contact).permit(:name,
52
52
  contact_info: Spotlight::Contact.fields.keys,
53
- avatar_attributes: [:iiif_tilesource, :iiif_region])
53
+ avatar_attributes: %i[iiif_tilesource iiif_region])
54
54
  end
55
55
  end
56
56
  end
@@ -8,7 +8,7 @@ module Spotlight
8
8
 
9
9
  load_and_authorize_resource :exhibit, class: Spotlight::Exhibit
10
10
  load_and_authorize_resource through: :exhibit
11
- before_action :attach_breadcrumbs, only: [:new, :edit]
11
+ before_action :attach_breadcrumbs, only: %i[new edit]
12
12
 
13
13
  def new
14
14
  @custom_field.field_type ||= 'text'
@@ -7,7 +7,7 @@ module Spotlight
7
7
 
8
8
  load_and_authorize_resource :exhibit, class: Spotlight::Exhibit
9
9
  load_and_authorize_resource through: :exhibit
10
- before_action :attach_breadcrumbs, only: [:new, :edit]
10
+ before_action :attach_breadcrumbs, only: %i[new edit]
11
11
 
12
12
  # GET /custom_search_fields/new
13
13
  def new
@@ -6,7 +6,7 @@ module Spotlight
6
6
  class ExhibitsController < Spotlight::ApplicationController
7
7
  include Spotlight::SearchHelper
8
8
  before_action :authenticate_user!, except: [:index]
9
- before_action :set_tab, only: [:edit, :update]
9
+ before_action :set_tab, only: %i[edit update]
10
10
 
11
11
  load_and_authorize_resource
12
12
 
@@ -83,7 +83,7 @@ module Spotlight
83
83
  protected
84
84
 
85
85
  def current_exhibit
86
- @exhibit if @exhibit && @exhibit.persisted?
86
+ @exhibit if @exhibit&.persisted?
87
87
  end
88
88
 
89
89
  def exhibit_params
@@ -93,8 +93,8 @@ module Spotlight
93
93
  :description,
94
94
  :published,
95
95
  :tag_list,
96
- contact_emails_attributes: [:id, :email],
97
- languages_attributes: [:id, :public]
96
+ contact_emails_attributes: %i[id email],
97
+ languages_attributes: %i[id public]
98
98
  )
99
99
  end
100
100
 
@@ -26,9 +26,7 @@ module Spotlight
26
26
  end
27
27
 
28
28
  def attach_page_breadcrumbs
29
- if action_name == 'edit'
30
- add_breadcrumb t(:'spotlight.curation.sidebar.feature_pages'), exhibit_feature_pages_path(@exhibit)
31
- end
29
+ add_breadcrumb t(:'spotlight.curation.sidebar.feature_pages'), exhibit_feature_pages_path(@exhibit) if action_name == 'edit'
32
30
 
33
31
  add_breadcrumb @page.parent_page.title, [spotlight, @page.exhibit, @page.parent_page] unless @page.top_level_page?
34
32
  add_breadcrumb @page.title, action_name == 'edit' ? [:edit, @page.exhibit, @page] : [spotlight, @page.exhibit, @page]
@@ -42,12 +40,12 @@ module Spotlight
42
40
  def update_all_page_params
43
41
  params.require(:exhibit).permit(
44
42
  'feature_pages_attributes' => page_attributes,
45
- 'home_page_attributes' => [:id, :title, :display_title]
43
+ 'home_page_attributes' => %i[id title display_title]
46
44
  )
47
45
  end
48
46
 
49
47
  def allowed_page_params
50
- super.concat [:display_sidebar, :published]
48
+ super.concat %i[display_sidebar published]
51
49
  end
52
50
  end
53
51
  end
@@ -17,9 +17,7 @@ module Spotlight
17
17
  end
18
18
 
19
19
  def update
20
- unless @filter.update(filter_params)
21
- flash[:alert] = @filter.errors.full_messages.join('<br/>'.html_safe)
22
- end
20
+ flash[:alert] = @filter.errors.full_messages.join('<br/>'.html_safe) unless @filter.update(filter_params)
23
21
  redirect_to spotlight.edit_exhibit_path @exhibit, tab: 'filter'
24
22
  end
25
23
 
@@ -76,7 +76,7 @@ module Spotlight
76
76
  end
77
77
 
78
78
  def allowed_page_params
79
- super.concat [:display_title, :display_sidebar]
79
+ super.concat %i[display_title display_sidebar]
80
80
  end
81
81
  end
82
82
  end
@@ -44,7 +44,7 @@ module Spotlight
44
44
  views = @blacklight_configuration.default_blacklight_config.view.keys | [:show]
45
45
 
46
46
  @blacklight_configuration.blacklight_config.index_fields.keys.each_with_object({}) do |element, result|
47
- result[element] = ([:enabled, :label, :weight] | views)
47
+ result[element] = (%i[enabled label weight] | views)
48
48
  end
49
49
  end
50
50
  end
@@ -8,7 +8,7 @@ module Spotlight
8
8
  # controller that gives other controllers their behavior
9
9
  class PagesController < Spotlight::ApplicationController
10
10
  before_action :authenticate_user!, except: [:show]
11
- before_action :load_locale_specific_page, only: [:destroy, :edit, :show, :update]
11
+ before_action :load_locale_specific_page, only: %i[destroy edit show update]
12
12
  load_and_authorize_resource :exhibit, class: Spotlight::Exhibit
13
13
  load_and_authorize_resource through: :exhibit, instance_name: 'page', only: [:index]
14
14
 
@@ -71,7 +71,7 @@ module Spotlight
71
71
 
72
72
  # PATCH/PUT /pages/1
73
73
  def update
74
- @page.lock.delete if @page.lock
74
+ @page.lock&.delete
75
75
 
76
76
  if @page.update(page_params.merge(last_edited_by: current_user))
77
77
  redirect_to [spotlight, @page.exhibit, @page], flash: { html_safe: true }, notice: undo_notice(:updated)
@@ -146,7 +146,7 @@ module Spotlight
146
146
  end
147
147
 
148
148
  def page_attributes
149
- [:id, :published, :title, :weight, :display_sidebar, :parent_page_id]
149
+ %i[id published title weight display_sidebar parent_page_id]
150
150
  end
151
151
 
152
152
  def allowed_page_params
@@ -154,9 +154,9 @@ module Spotlight
154
154
  end
155
155
 
156
156
  def featured_image_attributes
157
- [
158
- :source, :image, :document_global_id, :iiif_region, :iiif_tilesource,
159
- :iiif_manifest_url, :iiif_canvas_id, :iiif_image_id
157
+ %i[
158
+ source image document_global_id iiif_region iiif_tilesource
159
+ iiif_manifest_url iiif_canvas_id iiif_image_id
160
160
  ]
161
161
  end
162
162
 
@@ -188,7 +188,7 @@ module Spotlight
188
188
 
189
189
  def update_all_page_params
190
190
  params.require(:exhibit).permit(
191
- pages_attributes: [:id, :published]
191
+ pages_attributes: %i[id published]
192
192
  )
193
193
  end
194
194
 
@@ -9,7 +9,7 @@ module Spotlight
9
9
  helper :all
10
10
 
11
11
  before_action :authenticate_user!
12
- before_action :set_tab, only: [:new, :create]
12
+ before_action :set_tab, only: %i[new create]
13
13
 
14
14
  load_and_authorize_resource :exhibit, class: Spotlight::Exhibit
15
15
  before_action :build_resource
@@ -5,7 +5,7 @@ module Spotlight
5
5
  # CRUD actions for exhibit resources
6
6
  class ResourcesController < Spotlight::ApplicationController
7
7
  before_action :authenticate_user!, except: [:show]
8
- before_action :set_tab, only: [:new, :create]
8
+ before_action :set_tab, only: %i[new create]
9
9
 
10
10
  load_and_authorize_resource :exhibit, class: Spotlight::Exhibit
11
11
 
@@ -34,7 +34,7 @@ module Spotlight
34
34
  protected
35
35
 
36
36
  def exhibit_params
37
- params.require(:exhibit).permit(roles_attributes: [:id, :user_key, :role, :_destroy])
37
+ params.require(:exhibit).permit(roles_attributes: %i[id user_key role _destroy])
38
38
  end
39
39
 
40
40
  def any_deleted
@@ -49,19 +49,19 @@ module Spotlight
49
49
 
50
50
  def exhibit_configuration_facet_params
51
51
  @blacklight_configuration.blacklight_config.facet_fields.keys.each_with_object({}) do |element, result|
52
- result[element] = [:show, :label, :weight, :sort]
52
+ result[element] = %i[show label weight sort]
53
53
  end
54
54
  end
55
55
 
56
56
  def exhibit_configuration_search_params
57
57
  @blacklight_configuration.blacklight_config.search_fields.keys.each_with_object({}) do |element, result|
58
- result[element] = [:enabled, :label, :weight]
58
+ result[element] = %i[enabled label weight]
59
59
  end
60
60
  end
61
61
 
62
62
  def exhibit_configuration_sort_params
63
63
  @blacklight_configuration.blacklight_config.sort_fields.keys.each_with_object({}) do |element, result|
64
- result[element] = [:enabled, :label, :weight]
64
+ result[element] = %i[enabled label weight]
65
65
  end
66
66
  end
67
67
  end
@@ -10,7 +10,7 @@ module Spotlight
10
10
  before_action :only_curators!
11
11
  before_action :create_or_load_resource, only: [:create]
12
12
  load_and_authorize_resource through: :exhibit
13
- before_action :attach_breadcrumbs, only: [:index, :edit], unless: -> { request.format.json? }
13
+ before_action :attach_breadcrumbs, only: %i[index edit], unless: -> { request.format.json? }
14
14
 
15
15
  include Spotlight::Base
16
16
  include Spotlight::SearchHelper
@@ -31,7 +31,7 @@ module Spotlight
31
31
  respond_to do |format|
32
32
  format.html
33
33
  format.json do
34
- render json: @searches.as_json(methods: [:count, :thumbnail_image_url]), root: false
34
+ render json: @searches.as_json(methods: %i[count thumbnail_image_url]), root: false
35
35
  end
36
36
  end
37
37
  end
@@ -92,14 +92,14 @@ module Spotlight
92
92
  end
93
93
 
94
94
  def attach_breadcrumbs
95
- e = @exhibit || (@search.exhibit if @search)
95
+ e = @exhibit || @search&.exhibit
96
96
  add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: e.title), e
97
97
  add_breadcrumb t(:'spotlight.curation.sidebar.header'), exhibit_dashboard_path(e)
98
98
  add_breadcrumb t(:'spotlight.curation.sidebar.browse'), exhibit_searches_path(e)
99
99
  end
100
100
 
101
101
  def batch_search_params
102
- params.require(:exhibit).permit('searches_attributes' => [:id, :published, :weight])
102
+ params.require(:exhibit).permit('searches_attributes' => %i[id published weight])
103
103
  end
104
104
 
105
105
  def search_params
@@ -118,13 +118,13 @@ module Spotlight
118
118
  end
119
119
 
120
120
  def featured_image_params
121
- [
122
- :iiif_region, :iiif_tilesource,
123
- :iiif_manifest_url, :iiif_canvas_id, :iiif_image_id,
124
- :display,
125
- :source,
126
- :image,
127
- :document_global_id
121
+ %i[
122
+ iiif_region iiif_tilesource
123
+ iiif_manifest_url iiif_canvas_id iiif_image_id
124
+ display
125
+ source
126
+ image
127
+ document_global_id
128
128
  ]
129
129
  end
130
130
 
@@ -133,7 +133,7 @@ module Spotlight
133
133
  end
134
134
 
135
135
  def blacklisted_search_session_params
136
- [:id, :commit, :counter, :total, :search_id, :page, :per_page, :authenticity_token, :utf8, :action, :controller]
136
+ %i[id commit counter total search_id page per_page authenticity_token utf8 action controller]
137
137
  end
138
138
 
139
139
  def fallback_url
@@ -40,15 +40,15 @@ module Spotlight
40
40
  :title,
41
41
  :subtitle,
42
42
  masthead_attributes: masthead_params,
43
- exhibits_attributes: [:id, :weight]
43
+ exhibits_attributes: %i[id weight]
44
44
  )
45
45
  end
46
46
 
47
47
  def masthead_params
48
- [
49
- :display,
50
- :iiif_region,
51
- :iiif_tilesource
48
+ %i[
49
+ display
50
+ iiif_region
51
+ iiif_tilesource
52
52
  ]
53
53
  end
54
54
  end
@@ -22,7 +22,7 @@ module Spotlight
22
22
  private
23
23
 
24
24
  def exhibit_params
25
- params.require(:exhibit).permit(translations_attributes: [:id, :locale, :key, :value])
25
+ params.require(:exhibit).permit(translations_attributes: %i[id locale key value])
26
26
  end
27
27
 
28
28
  def set_language
@@ -132,7 +132,7 @@ module Spotlight
132
132
 
133
133
  def uploaded_field_label(config)
134
134
  solr_field = Array(config.solr_field || config.field_name).first.to_s
135
- config.label || blacklight_config.index_fields[solr_field].try(:label) || t(".#{solr_field}")
135
+ blacklight_config.index_fields[solr_field].try(:label) || config.label || t(".#{solr_field}")
136
136
  end
137
137
 
138
138
  def available_view_fields
@@ -143,13 +143,13 @@ module Spotlight
143
143
  if current_exhibit_theme && current_exhibit.theme != 'default'
144
144
  stylesheet_link_tag "#{tag}_#{current_exhibit_theme}"
145
145
  else
146
- Rails.logger.warn "Exhibit theme '#{current_exhibit_theme}' not in white-list of available themes: #{Spotlight::Engine.config.exhibit_themes}"
146
+ Rails.logger.warn "Exhibit theme '#{current_exhibit_theme}' not in white-list of available themes: #{current_exhibit.themes}"
147
147
  stylesheet_link_tag(tag)
148
148
  end
149
149
  end
150
150
 
151
151
  def current_exhibit_theme
152
- current_exhibit.theme if current_exhibit && current_exhibit.theme.present? && Spotlight::Engine.config.exhibit_themes.include?(current_exhibit.theme)
152
+ current_exhibit.theme if current_exhibit && current_exhibit.theme.present? && current_exhibit.themes.include?(current_exhibit.theme)
153
153
  end
154
154
 
155
155
  private
@@ -5,6 +5,8 @@ module Spotlight
5
5
  # Helpers that are injected into the main application (because they used in layouts)
6
6
  module MainAppHelpers
7
7
  include Spotlight::NavbarHelper
8
+ include Spotlight::MastheadHelper
9
+
8
10
  def cache_key_for_spotlight_exhibits
9
11
  "#{Spotlight::Exhibit.count}/#{Spotlight::Exhibit.maximum(:updated_at).try(:utc)}"
10
12
  end
@@ -22,9 +24,7 @@ module Spotlight
22
24
  end
23
25
 
24
26
  def link_back_to_catalog(opts = { label: nil })
25
- if (current_search_session.try(:query_params) || {}).fetch(:controller, '').starts_with? 'spotlight'
26
- opts[:route_set] ||= spotlight
27
- end
27
+ opts[:route_set] ||= spotlight if (current_search_session.try(:query_params) || {}).fetch(:controller, '').starts_with? 'spotlight'
28
28
  super
29
29
  end
30
30
 
@@ -38,16 +38,16 @@ module Spotlight
38
38
  end
39
39
 
40
40
  def exhibit_stylesheet_link_tag(tag)
41
- if current_exhibit_theme && current_exhibit.theme != 'default'
41
+ if current_exhibit_theme && current_exhibit&.theme != 'default'
42
42
  stylesheet_link_tag "#{tag}_#{current_exhibit_theme}"
43
43
  else
44
- Rails.logger.warn "Exhibit theme '#{current_exhibit_theme}' not in white-list of available themes: #{Spotlight::Engine.config.exhibit_themes}"
44
+ Rails.logger.warn "Exhibit theme '#{current_exhibit_theme}' not in white-list of available themes: #{current_exhibit&.themes}"
45
45
  stylesheet_link_tag(tag)
46
46
  end
47
47
  end
48
48
 
49
49
  def current_exhibit_theme
50
- current_exhibit.theme if current_exhibit && current_exhibit.theme.present? && Spotlight::Engine.config.exhibit_themes.include?(current_exhibit.theme)
50
+ current_exhibit.theme if current_exhibit && current_exhibit.theme.present? && current_exhibit.themes.include?(current_exhibit.theme)
51
51
  end
52
52
  end
53
53
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spotlight
4
+ ##
5
+ # Helper module for content in mastheads
6
+ module MastheadHelper
7
+ def masthead_heading_content
8
+ return current_exhibit.title if current_exhibit
9
+
10
+ application_name
11
+ end
12
+
13
+ def masthead_subheading_content
14
+ return current_exhibit&.subtitle&.presence if current_exhibit
15
+
16
+ current_site&.subtitle&.presence
17
+ end
18
+ end
19
+ end
@@ -10,13 +10,15 @@ module Spotlight
10
10
  def translate_sort_fields(sort_config)
11
11
  sort_description = sort_config[:sort_description] if sort_config[:sort_description]
12
12
 
13
- sort_description ||= sort_config[:sort].split(',').map do |sort|
14
- sort_field, sort_order = sort.split(' ')
15
- safe_join([
16
- t(:"spotlight.search_configurations.sort.keys.#{sort_field.strip}", default: sort_field.humanize.downcase),
17
- t(:"spotlight.search_configurations.sort.keys.#{sort_order.strip}", default: '')
18
- ], ' ')
19
- end.to_sentence if sort_config[:sort]
13
+ if sort_config[:sort]
14
+ sort_description ||= sort_config[:sort].split(',').map do |sort|
15
+ sort_field, sort_order = sort.split(' ')
16
+ safe_join([
17
+ t(:"spotlight.search_configurations.sort.keys.#{sort_field.strip}", default: sort_field.humanize.downcase),
18
+ t(:"spotlight.search_configurations.sort.keys.#{sort_order.strip}", default: '')
19
+ ], ' ')
20
+ end.to_sentence
21
+ end
20
22
 
21
23
  sort_description
22
24
  end
@@ -4,7 +4,7 @@ module Spotlight
4
4
  # Saved search helpers
5
5
  module SearchesHelper
6
6
  def available_document_index_views
7
- blacklight_config.view.select { |_k, v| v.if != false }.keys
7
+ blacklight_config.view.to_h.reject { |_k, v| v.if == false }.keys
8
8
  end
9
9
  end
10
10
  end
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  module Spotlight
@@ -23,16 +23,16 @@ module Spotlight
23
23
 
24
24
  around_perform do |job, block|
25
25
  job_log_entry = log_entry(job)
26
- job_log_entry.in_progress! if job_log_entry
26
+ job_log_entry&.in_progress!
27
27
 
28
28
  begin
29
29
  block.call
30
- rescue
31
- job_log_entry.failed! if job_log_entry
30
+ rescue StandardError
31
+ job_log_entry&.failed!
32
32
  raise
33
33
  end
34
34
 
35
- job_log_entry.succeeded! if job_log_entry
35
+ job_log_entry&.succeeded!
36
36
  end
37
37
 
38
38
  def self.perform_later(exhibit_or_resources, log_entry = nil)