Sha256: 53778edf787759ba46f5e45db328f3a66b790b0720e86ac1e2e2e4fb48a77a00

Contents?: true

Size: 745 Bytes

Versions: 7

Compression:

Stored size: 745 Bytes

Contents

# frozen_string_literal: true

module Spotlight
  # HTML <meta> tag helpers
  module JobTrackersHelper
    def job_status_icon(job_tracker)
      content_tag :span, title: t(job_tracker.status || 'missing', scope: 'spotlight.job_trackers.status') do # rubocop:disable Rails/ContentTag
        if job_tracker.enqueued? || job_tracker.in_progress?
          '⏱'
        elsif job_tracker.completed?
          '✅'
        elsif job_tracker.failed?
          '🟥'
        else
          ''
        end
      end
    end

    def job_tracker_event_table_row_class(event)
      case event.type
      when 'error'
        'table-danger'
      when 'info', 'summary'
        ''
      else
        "table-#{event.type}"
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
blacklight-spotlight-3.1.0 app/helpers/spotlight/job_trackers_helper.rb
blacklight-spotlight-3.0.3 app/helpers/spotlight/job_trackers_helper.rb
blacklight-spotlight-3.0.2 app/helpers/spotlight/job_trackers_helper.rb
blacklight-spotlight-3.0.1 app/helpers/spotlight/job_trackers_helper.rb
blacklight-spotlight-3.0.0 app/helpers/spotlight/job_trackers_helper.rb
blacklight-spotlight-3.0.0.rc6 app/helpers/spotlight/job_trackers_helper.rb
blacklight-spotlight-3.0.0.rc5 app/helpers/spotlight/job_trackers_helper.rb