Skip to content

Commit

Permalink
Merge pull request #795 from scientist-softserv/i772-fix-double-rende…
Browse files Browse the repository at this point in the history
…r-error

🐛 Fix double render error
  • Loading branch information
ShanaLMoore authored Sep 15, 2023
2 parents 1d4cc3d + 4750b73 commit ea3c4e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
19 changes: 0 additions & 19 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class ApplicationController < ActionController::Base
with_themed_layout '1_column'

helper_method :current_account, :admin_host?, :home_page_theme, :show_page_theme, :search_results_theme
helper_method :current_account, :admin_host?, :home_page_theme, :show_page_theme, :search_results_theme, :render_ocr_snippets
before_action :authenticate_if_needed
before_action :set_raven_context
before_action :require_active_account!, if: :multitenant?
Expand Down Expand Up @@ -51,24 +50,6 @@ def guest_user

protected

# remove this once we've backported to `IIIFPrintHelper` and update IIIF Print
def render_ocr_snippets(options = {})
snippets = options[:value]
# rubocop:disable Rails/OutputSafety
snippets_content = [ActionController::Base.helpers.content_tag('div',
"... #{snippets.first} ...".html_safe,
class: 'ocr_snippet first_snippet')]
# rubocop:enable Rails/OutputSafety
if snippets.length > 1
snippets_content << render(partial: 'catalog/snippets_more',
locals: { snippets: snippets.drop(1),
options: options })
end
# rubocop:disable Rails/OutputSafety
snippets_content.join("\n").html_safe
# rubocop:enable Rails/OutputSafety
end

def is_hidden
current_account.persisted? && !current_account.is_public?
end
Expand Down
5 changes: 5 additions & 0 deletions app/helpers/iiif_print_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

module IiifPrintHelper
include IiifPrint::IiifPrintHelperBehavior
end

0 comments on commit ea3c4e6

Please sign in to comment.