blacklight-spotlight 3.1.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/spotlight/pages_controller.rb +1 -5
- data/app/helpers/spotlight/job_trackers_helper.rb +1 -1
- data/app/models/sir_trevor_rails/blocks/featured_pages_block.rb +2 -2
- data/app/models/spotlight/page.rb +8 -0
- data/app/views/layouts/spotlight/base.html.erb +3 -1
- data/app/views/spotlight/sir_trevor/blocks/_iframe_block.html.erb +1 -1
- data/config/locales/spotlight.en.yml +1 -1
- data/lib/spotlight/version.rb +1 -1
- data/lib/tasks/spotlight_tasks.rake +4 -1
- data/spec/examples.txt +1502 -1500
- data/spec/models/sir_trevor_rails/blocks/featured_pages_block_spec.rb +19 -1
- data/spec/views/spotlight/pages/show.html.erb_spec.rb +1 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56b89965ba03cecc57a91706bab8ab9d93033988608116063650459bebd4182c
|
4
|
+
data.tar.gz: 9600146cf5c35a2d763c144d936ffd7e5bfc27a0f519e356dfba500696cbb8f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40df9ad1c5506195ee5601834532b10e0551e362ad546e6594e88e1f4f00bd59b23b58b788b2c0541de8f907d1cfee87ef5d37131a75a208fa0e903817061a2b
|
7
|
+
data.tar.gz: 8cb8bc71aa03bd906b2bdea4c51b0783d5c7be866ce0dd6ac25ac34f54c65ae106f271bd84762061c10adb795082c5cc0f358d51fcff24b947e1060b7704707d
|
@@ -3,9 +3,6 @@
|
|
3
3
|
module Spotlight
|
4
4
|
##
|
5
5
|
# Base CRUD controller for pages
|
6
|
-
# rubocop:disable Metrics/ClassLength
|
7
|
-
# Disableing class length because this is a base
|
8
|
-
# controller that gives other controllers their behavior
|
9
6
|
class PagesController < Spotlight::ApplicationController
|
10
7
|
before_action :authenticate_user!, except: [:show]
|
11
8
|
before_action :load_locale_specific_page, only: %i[destroy edit show update]
|
@@ -32,7 +29,7 @@ module Spotlight
|
|
32
29
|
|
33
30
|
respond_to do |format|
|
34
31
|
format.html
|
35
|
-
format.json { render json: @pages.
|
32
|
+
format.json { render json: @pages.for_default_locale.published.to_json(methods: [:thumbnail_image_url]) }
|
36
33
|
end
|
37
34
|
end
|
38
35
|
|
@@ -208,5 +205,4 @@ module Spotlight
|
|
208
205
|
end
|
209
206
|
end
|
210
207
|
end
|
211
|
-
# rubocop:enable Metrics/ClassLength
|
212
208
|
end
|
@@ -4,7 +4,7 @@ module Spotlight
|
|
4
4
|
# HTML <meta> tag helpers
|
5
5
|
module JobTrackersHelper
|
6
6
|
def job_status_icon(job_tracker)
|
7
|
-
content_tag :span, title: t(job_tracker.status || 'missing', scope: 'spotlight.job_trackers.status') do
|
7
|
+
content_tag :span, title: t(job_tracker.status || 'missing', scope: 'spotlight.job_trackers.status') do
|
8
8
|
if job_tracker.enqueued? || job_tracker.in_progress?
|
9
9
|
'⏱'
|
10
10
|
elsif job_tracker.completed?
|
@@ -12,7 +12,7 @@ module SirTrevorRails
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def pages
|
15
|
-
@pages ||= parent.exhibit.pages.published.where(slug: item_ids).sort do |a, b|
|
15
|
+
@pages ||= parent.exhibit.pages.for_default_locale.published.where(slug: item_ids).sort do |a, b|
|
16
16
|
ordered_items.index(a.slug) <=> ordered_items.index(b.slug)
|
17
17
|
end
|
18
18
|
end
|
@@ -28,7 +28,7 @@ module SirTrevorRails
|
|
28
28
|
|
29
29
|
result[:data][:item].transform_values! do |v|
|
30
30
|
begin
|
31
|
-
v['thumbnail_image_url'] = parent.exhibit.pages.find(v['id']).thumbnail_image_url
|
31
|
+
v['thumbnail_image_url'] = parent.exhibit.pages.for_default_locale.find(v['id']).thumbnail_image_url
|
32
32
|
rescue ActiveRecord::RecordNotFound
|
33
33
|
v = nil
|
34
34
|
end
|
@@ -46,6 +46,12 @@ module Spotlight
|
|
46
46
|
|
47
47
|
after_update :update_translated_pages_weights_and_parent_page
|
48
48
|
|
49
|
+
def title
|
50
|
+
return super if I18n.locale == I18n.default_locale
|
51
|
+
|
52
|
+
translated_page_for(I18n.locale)&.title || super
|
53
|
+
end
|
54
|
+
|
49
55
|
def content_changed!
|
50
56
|
@content = nil
|
51
57
|
end
|
@@ -133,6 +139,8 @@ module Spotlight
|
|
133
139
|
end
|
134
140
|
|
135
141
|
def translated_page_for(locale)
|
142
|
+
return self if locale == self.locale
|
143
|
+
|
136
144
|
translated_pages.for_locale(locale).first
|
137
145
|
end
|
138
146
|
|
@@ -24,7 +24,9 @@
|
|
24
24
|
<body class="<%= render_body_class %>">
|
25
25
|
<%= render partial: 'shared/body_preamble' %>
|
26
26
|
<div id="skip-link">
|
27
|
-
|
27
|
+
<% if should_render_spotlight_search_bar? %>
|
28
|
+
<%= link_to t('blacklight.skip_links.search_field'), '#search_field', class: 'element-invisible element-focusable rounded-bottom py-2 px-3', data: { turbolinks: 'false' } %>
|
29
|
+
<% end %>
|
28
30
|
<%= link_to t('blacklight.skip_links.main_content'), '#main-container', class: 'element-invisible element-focusable rounded-bottom py-2 px-3', data: { turbolinks: 'false' } %>
|
29
31
|
<%= content_for(:skip_links) %>
|
30
32
|
</div>
|
@@ -1 +1 @@
|
|
1
|
-
<%= sanitize iframe_block.code, tags: %w(iframe), attributes: %w(id width height marginwidth marginheight src frameborder allowfullscreen sandbox seamless srcdoc scrolling) %>
|
1
|
+
<%= sanitize iframe_block.code, tags: %w(iframe), attributes: %w(id aria-label title width height marginwidth marginheight src frameborder allowfullscreen sandbox seamless srcdoc scrolling) %>
|
data/lib/spotlight/version.rb
CHANGED
@@ -21,7 +21,10 @@ namespace :spotlight do
|
|
21
21
|
print 'Exhibit title: '
|
22
22
|
title = $stdin.gets.chomp
|
23
23
|
|
24
|
-
|
24
|
+
print 'Exhibit URL slug: '
|
25
|
+
slug = @stdin.gets.chomp
|
26
|
+
|
27
|
+
exhibit = Spotlight::Exhibit.create!({ title: title, slug: slug })
|
25
28
|
|
26
29
|
puts 'Who can admin this exhibit?'
|
27
30
|
|