Sha256: 0cbcdb4af342ecd4898da24bef8dabaa87b3a09833e065812bbd6df42d19807e

Contents?: true

Size: 724 Bytes

Versions: 14

Compression:

Stored size: 724 Bytes

Contents

module Headmin
  module NotificationHelper
    def notification_color(name)
      color = {
          notice: {
              background: 'bg-success',
              text: 'text-white'
          },
          error: {
              text: 'text-dark',
              background: 'bg-danger'
          },
          alert: {
              text: 'text-dark',
              background: 'bg-warning'
          },
          timedout: {
              text: 'text-dark',
              background: 'bg-warning'
          },
          fallback: {
              text: 'text-light',
              background: 'bg-info',
          }
      }

      name = name.to_sym
      color.key?(name) ? color[name] : color[:fallback]
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
headmin-0.2.9 app/helpers/headmin/notification_helper.rb
headmin-0.3.2 app/helpers/headmin/notification_helper.rb
headmin-0.3.1 app/helpers/headmin/notification_helper.rb
headmin-0.2.8 app/helpers/headmin/notification_helper.rb
headmin-0.2.7 app/helpers/headmin/notification_helper.rb
headmin-0.2.6 app/helpers/headmin/notification_helper.rb
headmin-0.2.5 app/helpers/headmin/notification_helper.rb
headmin-0.2.4 app/helpers/headmin/notification_helper.rb
headmin-0.2.3 app/helpers/headmin/notification_helper.rb
headmin-0.2.2 app/helpers/headmin/notification_helper.rb
headmin-0.2.1 app/helpers/headmin/notification_helper.rb
headmin-0.2.0 app/helpers/headmin/notification_helper.rb
headmin-0.1.2 app/helpers/headmin/notification_helper.rb
headmin-0.1.1 app/helpers/headmin/notification_helper.rb