Module: PartyTopicsHelper

Defined in:
app/helpers/party_topics_helper.rb

Instance Method Summary collapse

Instance Method Details

#party_topic_state_label(party_topic) ⇒ Object



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

def party_topic_state_label(party_topic)
  css_class = {
    assigned: :danger,
    reviewed: :info,
    certified: :success,
    cancelled: :secondary,
    requested: :warning
  }[party_topic.state.to_sym]
  label_value = party_topic.human_state_name.titleize
  if party_topic.state.to_sym == :certified
    label_value = fa_icon('diploma', text: label_value)
  end
  (:span, label_value, class: "badge bg-#{css_class}")
end