Sha256: 0cb238b4e79db86a58f6903ba643a30628fd7aca411ea86191491d0c21381d76

Contents?: true

Size: 753 Bytes

Versions: 44

Compression:

Stored size: 753 Bytes

Contents

card_reader :contextual_class
card_reader :disappear
card_reader :message

def deliver context
  success.flash alert_message(context)
end

def alert_message context
  mcard = message.present? ? message_card : self
  format(:html).alert_message context, mcard
end

format :html do
  def alert_message context, message_card
    mformat = subformat message_card
    alert card.alert_class, true, card.disappear? do
      mformat.contextual_content context, view: alert_view(mformat)
    end
  end

  def alert_view format
    format.respond_to?(:notify) ? format.notify : :core
  end
end

def disappear?
  disappear.present? ? disappear_card.checked? : true
end

def alert_class
  contextual_class.present? ? contextual_class_card.item_name : :success
end

Version data entries

44 entries across 44 versions & 2 rubygems

Version Path
card-mod-follow-0.14.2 set/type/notification_template.rb
card-mod-follow-0.14.1 set/type/notification_template.rb
card-mod-follow-0.14.0 set/type/notification_template.rb
card-mod-follow-0.13.4 set/type/notification_template.rb
card-mod-follow-0.13.3 set/type/notification_template.rb
card-mod-follow-0.13.2 set/type/notification_template.rb
card-mod-follow-0.13.1 set/type/notification_template.rb
card-mod-follow-0.13.0 set/type/notification_template.rb
card-mod-follow-0.11.7 set/type/notification_template.rb
card-mod-follow-0.12.0 set/type/notification_template.rb
card-mod-follow-0.11.6 set/type/notification_template.rb
card-mod-follow-0.11.5 set/type/notification_template.rb
card-mod-follow-0.11.4 set/type/notification_template.rb
card-mod-follow-0.11.3 set/type/notification_template.rb
card-mod-follow-0.11.2 set/type/notification_template.rb
card-mod-follow-0.11.1 set/type/notification_template.rb
card-mod-follow-0.11.0 set/type/notification_template.rb
card-1.100.0 mod/standard/set/type/notification_template.rb
card-1.99.6 mod/standard/set/type/notification_template.rb
card-1.99.5 mod/standard/set/type/notification_template.rb