Sha256: ccac47f1b9652050bb574053bcb9f11a13ec8a637d6c1f633c43031d3b4a06ec

Contents?: true

Size: 664 Bytes

Versions: 19

Compression:

Stored size: 664 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

19 entries across 19 versions & 1 rubygems

Version Path
headmin-0.6.3 app/helpers/headmin/notification_helper.rb
headmin-0.6.2 app/helpers/headmin/notification_helper.rb
headmin-0.6.1 app/helpers/headmin/notification_helper.rb
headmin-0.6.0 app/helpers/headmin/notification_helper.rb
headmin-0.5.9 app/helpers/headmin/notification_helper.rb
headmin-0.5.8 app/helpers/headmin/notification_helper.rb
headmin-0.5.7 app/helpers/headmin/notification_helper.rb
headmin-0.5.6 app/helpers/headmin/notification_helper.rb
headmin-0.5.5 app/helpers/headmin/notification_helper.rb
headmin-0.5.4 app/helpers/headmin/notification_helper.rb
headmin-0.5.3 app/helpers/headmin/notification_helper.rb
headmin-0.5.2 app/helpers/headmin/notification_helper.rb
headmin-0.5.1 app/helpers/headmin/notification_helper.rb
headmin-0.5.0 app/helpers/headmin/notification_helper.rb
headmin-0.4.2 app/helpers/headmin/notification_helper.rb
headmin-0.4.1 app/helpers/headmin/notification_helper.rb
headmin-0.4.0 app/helpers/headmin/notification_helper.rb
headmin-0.3.4 app/helpers/headmin/notification_helper.rb
headmin-0.3.3 app/helpers/headmin/notification_helper.rb