diff --git a/app/helpers/tag_helper.rb b/app/helpers/tag_helper.rb index aeb83bb2..7b81b2b0 100644 --- a/app/helpers/tag_helper.rb +++ b/app/helpers/tag_helper.rb @@ -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 += '
' unless idx == tag_instances.size - 1 end @@ -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 += '

' if title.present? - extra = "TRANSCRIPT

#{tag_instance.transcript.gsub("\n", '
')}" - return str + extra - end - - str += '
' if title.present? - "#{str}[CLICK FOR TRANSCRIPT]" + str = '

' if title.present? + str += "TRANSCRIPT

#{tag_instance.transcript.gsub("\n", '
')}" end def time_range(tag_instance, detail:) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity