theseus/app/helpers/batches_helper.rb
2025-05-31 23:25:41 -04:00

15 lines
581 B
Ruby

module BatchesHelper
def batch_status_badge(status, addtl_class='')
clazz, text = case status.to_s
when 'awaiting_field_mapping'
['warning', 'awaiting field mapping']
when 'fields_mapped'
['info', 'ready to process']
when 'processed'
['success', 'processed']
else
['muted', status.to_s.humanize(capitalize: false)]
end
content_tag('span', text, class: "badge #{clazz} #{addtl_class}".strip)
end
end