Sha256: 6b6fa98d8467b13499ac6e4c104daf329fad9a85691ab70599bdae2dcb3666ae

Contents?: true

Size: 1.51 KB

Versions: 2

Compression:

Stored size: 1.51 KB

Contents

# -*- encoding : utf-8 -*-
class Card; module Set; class Self
# Set: The card "AdminInfo"
#
module AdminInfo;
extend Card::Set
def self.source_location; "/Users/ethan/dev/decko/gem/card/mod/admin/set/self/admin_info.rb"; end
basket :warnings

# For each warning in the basket (eg :my_warning), the core view
# will run a test by appending a question mark (eg #my_warning?).
# If it fails it will generate a message by appending message
# (eg #my_warning_message).

add_to_basket :warnings, :no_email_delivery

def no_email_delivery?
  Card.config.action_mailer.perform_deliveries == false
end

def clean_html?
  false
end

module HtmlFormat; module_parent.send :register_set_format, Card::Format::HtmlFormat, self; extend Card::Set::AbstractFormat
  view :core do
    warnings = card.warnings.map do |warning|
      card.send("#{warning}?") ? send("#{warning}_message") : nil
    end
    warnings.compact!
    warnings.empty? ? "" : warning_alert(warnings)
  end

  def warning_alert warnings
    # 'ADMINISTRATOR WARNING'
    alert :warning, true do
      "<h5>#{t :admin_warn}</h5>" + list_tag(warnings)
    end
  end

  def no_email_delivery_message
    # "Email delivery is turned off."
    # "Change settings in config/application.rb to send sign up notifications."
    t :admin_email_off, path: "config/application.rb"
  end

  def warning_list_with_auto_scope warnings
    "<h5>#{t :admin_warn}</h5>" + warnings.join("\n")
  end
end
end;end;end;end;
# ~~ generated from /Users/ethan/dev/decko/gem/card/mod/admin/set/self/admin_info.rb ~~

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
card-1.101.7 tmpsets/set/mod001-admin/self/admin_info.rb
card-1.101.6 tmpsets/set/mod001-admin/self/admin_info.rb