Module: ActivityHelper

Defined in:
app/helpers/activity_helper.rb

Instance Method Summary collapse

Instance Method Details

#activity_row_style(status) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'app/helpers/activity_helper.rb', line 15

def activity_row_style(status)
  case status
  when :working
    "table-info"
  when :completed
    "table-success"
  when :failed
    "table-danger"
  end
end

#status_icon(status) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
# File 'app/helpers/activity_helper.rb', line 2

def status_icon(status)
  case status
  when :queued
    Icon(icon: "hourglass", label: translate("activity_helper.status_icon.queued"))
  when :working
    Icon(icon: "gear", label: translate("activity_helper.status_icon.working"), effect: "icon-spin")
  when :completed
    Icon(icon: "check2-circle", label: translate("activity_helper.status_icon.completed"))
  when :failed
    Icon(icon: "exclamation-diamond", label: translate("activity_helper.status_icon.error"))
  end
end