Sha256: d27edb6f15b64724fb45c70417c0d8bae2512843d1b99ac8d39ddd09b882ceea
Contents?: true
Size: 778 Bytes
Versions: 11
Compression:
Stored size: 778 Bytes
Contents
# frozen_string_literal: true module GoodJob module ApplicationHelper def relative_time(timestamp) text = timestamp.future? ? "in #{time_ago_in_words(timestamp)}" : "#{time_ago_in_words(timestamp)} ago" tag.time(text, datetime: timestamp, title: timestamp) end def status_badge(status) classes = case status when :finished "badge rounded-pill bg-success" when :queued, :scheduled, :retried "badge rounded-pill bg-secondary" when :running "badge rounded-pill bg-primary" when :discarded "badge rounded-pill bg-danger" end content_tag :span, status.to_s, class: classes end end end
Version data entries
11 entries across 11 versions & 1 rubygems