Skip to content

Commit

Permalink
use sir-trevor fork that supports Rails 6
Browse files Browse the repository at this point in the history
  • Loading branch information
dunn committed Jan 30, 2020
1 parent e7bc9cb commit 86c110d
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 14 deletions.
2 changes: 2 additions & 0 deletions app/models/spotlight/page_content.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'spotlight/page_content/sir_trevor'

module Spotlight
# Factory for picking the right page content renderer
module PageContent
Expand Down
2 changes: 1 addition & 1 deletion app/views/spotlight/pages/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</div>
<div class="form-group">
<%= f.label :content, class: 'sr-only' %>
<%= f.text_area_without_bootstrap :content, value: { data: f.object.content.as_json }.to_json, class: content_editor_class(f.object), data: { 'block-types': Spotlight::Engine.config.sir_trevor_widgets } %>
<%= f.text_area_without_bootstrap :content, value: { data: f.object.content.as_json }.to_json, class: content_editor_class(f.object), data: { 'block-types': SirTrevorRails::Block.custom_block_types } %>
</div>
</div>

Expand Down
1 change: 0 additions & 1 deletion blacklight-spotlight.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ these collections.)
s.add_dependency 'roar', '~> 1.1'
s.add_dependency 'roar-rails'
s.add_dependency 'signet'
s.add_dependency 'sir_trevor_rails', '~> 0.5'
s.add_dependency 'sprockets', '< 4'
s.add_dependency 'sprockets-es6'
s.add_dependency 'tophat'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# frozen_string_literal: true

# Required for 0.6 and up:
# https://github.com/madebymany/sir-trevor-rails#upgrade-guide-to-v060
class SirTrevorRails::Block
def self.custom_block_types
%w[
Browse
FeaturedPages
Heading
Iframe
LinkToSearch
List
Oembed
Quote
Rule
SearchResults
SolrDocuments
SolrDocumentsCarousel
SolrDocumentsEmbed
SolrDocumentsFeatures
SolrDocumentsGrid
Text
UploadedItems
Video
]
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,6 @@
# Spotlight::Engine.config.ga_page_analytics_options = config.ga_analytics_options.merge(limit: 5)
# Spotlight::Engine.config.ga_anonymize_ip = false # false for backwards compatibility

# ==> Sir Trevor Widget Configuration
# Spotlight::Engine.config.sir_trevor_widgets = %w(
# Heading Text List Quote Iframe Video Oembed Rule UploadedItems Browse
# FeaturedPages SolrDocuments SolrDocumentsCarousel SolrDocumentsEmbed
# SolrDocumentsFeatures SolrDocumentsGrid SearchResults
# )
#
# Page configurations made available to widgets
# Spotlight::Engine.config.page_configurations = {
# 'my-local-config': ->(context) { context.my_custom_data_path(context.current_exhibit) }
Expand Down
5 changes: 0 additions & 5 deletions lib/spotlight/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,6 @@ def self.blacklight_config
config.exhibit_themes = ['default']

config.default_page_content_type = 'SirTrevor'
config.sir_trevor_widgets = %w[
Heading Text List Quote Iframe Video Oembed Rule UploadedItems Browse LinkToSearch
FeaturedPages SolrDocuments SolrDocumentsCarousel SolrDocumentsEmbed
SolrDocumentsFeatures SolrDocumentsGrid SearchResults
]

config.routes = OpenStruct.new
config.routes.solr_documents = {}
Expand Down
1 change: 1 addition & 0 deletions spec/test_app_templates/Gemfile.extra
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
gem 'acts-as-taggable-on', github: 'mbleigh/acts-as-taggable-on'
gem 'blacklight-oembed', '>= 0.1', github: 'sul-dlss/blacklight-oembed'
gem 'bootstrap_form', github: 'dunn/bootstrap_form'
gem 'sir_trevor_rails', github: 'cbeer/sir-trevor-rails', branch: 'rails6'
gem 'thor'

0 comments on commit 86c110d

Please sign in to comment.