Sha256: d191c1969174ab7a388cc7eddb66fbd55bb92fd0311a8b57368793914f8ed4db

Contents?: true

Size: 860 Bytes

Versions: 2

Compression:

Stored size: 860 Bytes

Contents

- flash  = self.flash
- format = (format || TheNotification.config.default_type).to_s
- flash_types = %w[ notice alert error errors ]

- if format == 'html'
  - flash_types.each do |level|
    - msg = flash.try(:[], level) || flash.try(:[], level.to_sym)
    - if msg.present?
      .alert.flash_msgs class=flash_class(level)
        = content_tag :p, msg
- else
  - if flash.present?
    = javascript_tag defer: :defer, type: "text/javascript" do
      | window.the_notifications = window.the_notifications || {};
      | window.the_notifications['flash'] = window.the_notifications['flash'] || {};

  - flash_types.each do |level|
    - msg = flash.try(:[], level) || flash.try(:[], level.to_sym)
    - if msg.present?
      = javascript_tag defer: :defer, type: "text/javascript" do
        | window.the_notifications['flash']['#{ level }'] = '#{ j msg }';

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
the_notification-0.5.1 app/views/the_notification/_flash.html.slim
the_notification-0.5.0 app/views/the_notification/_flash.html.slim