Skip to content

Commit

Permalink
Refine tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
jcraigk committed Oct 6, 2023
1 parent a66f9d5 commit f1c1f23
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions app/helpers/tag_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def tooltip_for_tag_stack(tag_instances, detail: false)

tag_instances.each_with_index do |t, idx|
title += tag_notes(t, detail:)
title += transcript_or_link(t, title, detail:)
title += transcript_or_link(t, title) if detail
title += '<br>' unless idx == tag_instances.size - 1
end

Expand All @@ -74,19 +74,10 @@ def tag_notes(tag_instance, detail:)
str.strip
end

def transcript_or_link(tag_instance, title, detail:)
def transcript_or_link(tag_instance, title)
return '' if tag_instance.try(:transcript).blank?

str = ''

if detail
str += '<br><br>' if title.present?
extra = "<strong>TRANSCRIPT</strong><br><br> #{tag_instance.transcript.gsub("\n", '<br>')}"
return str + extra
end

str += '<br>' if title.present?
"#{str}[CLICK FOR TRANSCRIPT]"
str = '<br><br>' if title.present?
str += "<strong>TRANSCRIPT</strong><br><br> #{tag_instance.transcript.gsub("\n", '<br>')}"
end

def time_range(tag_instance, detail:) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
Expand Down

0 comments on commit f1c1f23

Please sign in to comment.