Module: SpreeCmCommissioner::Admin::GuestHelper

Defined in:
app/helpers/spree_cm_commissioner/admin/guest_helper.rb

Instance Method Summary collapse

Instance Method Details

#badge_color_base_on_check_in_method(check_in_method) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'app/helpers/spree_cm_commissioner/admin/guest_helper.rb', line 50

def badge_color_base_on_check_in_method(check_in_method)
  case check_in_method
  when 'manual'
    'badge-primary'
  when 'scan'
    'badge-warning'
  when 'sensor'
    'badge-success'
  when 'nfc'
    'badge-secondary'
  else
    'badge-info'
  end
end

#badge_color_base_on_check_in_type(check_in_type) ⇒ Object



39
40
41
42
43
44
45
46
47
48
# File 'app/helpers/spree_cm_commissioner/admin/guest_helper.rb', line 39

def badge_color_base_on_check_in_type(check_in_type)
  case check_in_type
  when 'pre_check_in'
    'badge-danger'
  when 'walk_in'
    'badge-warning'
  else
    'badge-info'
  end
end

#badge_color_base_on_entry_type(entry_type) ⇒ Object



30
31
32
33
34
35
36
37
# File 'app/helpers/spree_cm_commissioner/admin/guest_helper.rb', line 30

def badge_color_base_on_entry_type(entry_type)
  case entry_type
  when 1
    'badge-success'
  else
    'badge-secondary'
  end
end

#badge_color_base_on_id_card_status(id_card) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/helpers/spree_cm_commissioner/admin/guest_helper.rb', line 17

def badge_color_base_on_id_card_status(id_card)
  case id_card
  when 'national_id_card'
    'badge-primary'
  when 'student_id_card'
    'badge-warning'
  when 'passport'
    'badge-success'
  else
    ''
  end
end

#badge_color_based_on_gender(gender) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/helpers/spree_cm_commissioner/admin/guest_helper.rb', line 4

def badge_color_based_on_gender(gender)
  case gender
  when 'male'
    'badge-primary'
  when 'female'
    'badge-danger'
  when 'other'
    'badge-secondary'
  else
    ''
  end
end