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



91
92
93
94
95
# File 'platypus/tmp/set/gem-card/mod001-core/self/admin.rb', line 91

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

#task_row(task, mod) ⇒ Object



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

def task_row task, mod
  base = "#{mod}_task_#{task}"
  [
    link_to_card(:admin, t("#{base}_link_text"), path: { action: :update, task: task }),
    t("#{base}_description")
  ]
end

#view: coreObject



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

view :core, cache: :never do
  table_content = basket[:tasks].map do |task, task_config|
    task_row task, task_config[:mod]
  end
  table table_content, header: %w[Task Description]
end

#view: warningObject



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

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



86
87
88
89
# File 'platypus/tmp/set/gem-card/mod001-core/self/admin.rb', line 86

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