Sha256: 8ef70f4e5e3eba33c9ce481419a7162eae5093fb2455cd32c3dc23a8850ea272
Contents?: true
Size: 1.7 KB
Versions: 6
Compression:
Stored size: 1.7 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 admin_warn = I18n.t(:admin_warn, scope: "mod.admin.set.self.admin_info") # 'ADMINISTRATOR WARNING' alert :warning, true do "<h5>#{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." I18n.t(:email_off, scope: "mod.admin.set.self.admin_info", path: "config/application.rb") end def warning_list_with_auto_scope warnings # 'ADMINISTRATOR WARNING' admin_warn = tr(:admin_warn) "<h5>#{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
6 entries across 6 versions & 1 rubygems