Module: JobsHelper

Defined in:
frontend/app/helpers/jobs_helper.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) badge_class_for_status(status)



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'frontend/app/helpers/jobs_helper.rb', line 16

def badge_class_for_status(status)
  if status === "running"
    "badge badge-info"
  elsif status === "completed"
    "text-success"
  elsif status === "queued"
    "badge badge-warning"
  elsif status === "failed"
    "badge badge-important"
  elsif status === "canceled"
    "text-error"
  else
    ""
  end
end

- (Object) file_label(job_type)



5
6
7
8
9
10
11
12
13
# File 'frontend/app/helpers/jobs_helper.rb', line 5

def file_label(job_type)
  if job_type == "print_to_pdf_job"
    I18n.t("actions.download_pdf")
  elsif job_type == "report_job" 
    I18n.t("actions.download_report")
  else
    "File"
  end
end