mirror of
https://github.com/System-End/theseus.git
synced 2026-04-19 21:05:10 +00:00
22 lines
808 B
Ruby
22 lines
808 B
Ruby
module LettersHelper
|
|
def letter_status_badge(status, addtl_class='nil')
|
|
|
|
clazz, text = case status.to_s
|
|
when 'queued'
|
|
['bg-muted', 'queued']
|
|
when 'pending'
|
|
['pending', 'ready to print']
|
|
when "printed"
|
|
["info", "printed"]
|
|
when "mailed"
|
|
["success", "mailed"]
|
|
when "received"
|
|
["success", "received"]
|
|
when "canceled", "failed"
|
|
"bg-error-bg text-error-fg border border-error-border"
|
|
else
|
|
"bg-smoke text-slate border border-muted"
|
|
end
|
|
content_tag('span', text, :class => "badge #{clazz} #{addtl_class}".strip)
|
|
end
|
|
end
|