Module: Spotlight::JobTrackersHelper

Defined in:
app/helpers/spotlight/job_trackers_helper.rb

Overview

HTML <meta> tag helpers

Instance Method Summary collapse

Instance Method Details

#job_status_icon(job_tracker) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/helpers/spotlight/job_trackers_helper.rb', line 6

def job_status_icon(job_tracker)
   :span, title: t(job_tracker.status || 'missing', scope: 'spotlight.job_trackers.status') do
    if job_tracker.enqueued? || job_tracker.in_progress?
      ''
    elsif job_tracker.completed?
      ''
    elsif job_tracker.failed?
      '🟥'
    else
      ''
    end
  end
end

#job_tracker_event_table_row_class(event) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'app/helpers/spotlight/job_trackers_helper.rb', line 20

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