Module: Card::Set::Self::Admin::HtmlFormat

Extended by:
AbstractFormat
Defined in:
platypus/tmp/set/gem-card/mod001-core/self/admin.rb,
platypus/tmp/set/gem-defaults/mod032-recaptcha/self/admin.rb

Instance Method Summary collapse

Instance Method Details



31
32
33
# File 'platypus/tmp/set/gem-defaults/mod032-recaptcha/self/admin.rb', line 31

def add_recaptcha_keys_link
  Card[:recaptcha_settings]&.format&.edit_link link_text: t(:recaptcha_link_text)
end

#no_email_delivery_messageObject



82
83
84
85
86
# File 'platypus/tmp/set/gem-card/mod001-core/self/admin.rb', line 82

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

#recaptcha_config_issues_messageObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'platypus/tmp/set/gem-defaults/mod032-recaptcha/self/admin.rb', line 15

def recaptcha_config_issues_message
  wrap_with :p do
    if Card::Env.localhost?
      # %(Your captcha is currently working with temporary settings.
      #   This is fine for a local installation, but you will need new
      #   recaptcha keys if you want to make this site public.)
      t :recaptcha_captcha_temp, recaptcha_link: add_recaptcha_keys_link
    else
      # %(You are configured to use [[*captcha]], but for that to work
      #   you need new recaptcha keys.)
      t :recaptcha_captcha_keys, recaptcha_link: add_recaptcha_keys_link,
                                 captcha_link: link_to_card(:captcha)
    end
  end
end

#view: coreObject



65
66
67
# File 'platypus/tmp/set/gem-card/mod001-core/self/admin.rb', line 65

view :core, cache: :never do
  task_table basket[:tasks]
end

#view: warningObject



69
70
71
72
73
74
75
# File 'platypus/tmp/set/gem-card/mod001-core/self/admin.rb', line 69

view :warning do
  warnings = basket[:warnings].map do |warning|
    card.send("#{warning}?") ? send("#{warning}_message") : nil
  end
  warnings.compact!
  warnings.empty? ? "" : warning_alert(warnings)
end

#warning_alert(warnings) ⇒ Object



77
78
79
80
# File 'platypus/tmp/set/gem-card/mod001-core/self/admin.rb', line 77

def warning_alert warnings
  # 'ADMINISTRATOR WARNING'
  alert(:warning, true) { haml :warning_alert, warnings: warnings }
end