Module: RepresentationHelper

Defined in:
app/helpers/representation_helper.rb

Constant Summary collapse

REPRESENTATION_STATUS_CLASSES =
{
  ready_to_review: 'partial',
  approved:        'success',
  not_approved:    'warning'
}.freeze

Instance Method Summary collapse

Instance Method Details

#representation_status_tag(representation, tag: :span) ⇒ Object



8
9
10
11
12
13
# File 'app/helpers/representation_helper.rb', line 8

def representation_status_tag(representation, tag: :span)
  tag_class = REPRESENTATION_STATUS_CLASSES[representation.status.to_sym]
  (tag, class: "tag tag--#{tag_class}") do
    block_given? ? yield : representation.status.to_s.titleize
  end
end