Module: IiifPrint::IiifPrintHelperBehavior
- Included in:
- IiifPrintHelper
- Defined in:
- app/helpers/iiif_print/iiif_print_helper_behavior.rb
Instance Method Summary collapse
-
#render_ocr_snippets(options = {}) ⇒ String
print the ocr snippets.
Instance Method Details
#render_ocr_snippets(options = {}) ⇒ String
print the ocr snippets. if more than one, separate with <br/>
rubocop:disable Rails/OutputSafety
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/helpers/iiif_print/iiif_print_helper_behavior.rb', line 8 def render_ocr_snippets( = {}) snippets = [:value] return if snippets.blank? snippets_content = [content_tag('div', "... #{snippets.first} ...".html_safe, class: 'ocr_snippet first_snippet')] if snippets.length > 1 snippets_content << render(partial: 'catalog/snippets_more', locals: { snippets: snippets.drop(1), options: }) end snippets_content.join("\n").html_safe end |