Module: Card::Set::Self::AdminInfo::HtmlFormat

Extended by:
AbstractFormat
Defined in:
tmpsets/set/mod002-admin/self/admin_info.rb

Instance Method Summary collapse

Instance Method Details

#email_warningObject



41
42
43
44
45
46
47
# File 'tmpsets/set/mod002-admin/self/admin_info.rb', line 41

def email_warning
  # "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

#howto_add_new_recaptcha_keysObject



80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'tmpsets/set/mod002-admin/self/admin_info.rb', line 80

def howto_add_new_recaptcha_keys
  instructions(
    I18n.t(:howto_add_keys, scope: "mod.admin.set.self.admin_info"),
    [
      I18n.t(:howto_register,
             scope: "mod.admin.set.self.admin_info",
             recaptcha_link: link_to_resource("http://google.com/recaptcha")),
      I18n.t(:howto_add,
             scope: "mod.admin.set.self.admin_info",
             recaptcha_settings: link_to_card(:recaptcha_settings))
    ]
  )
end

#howto_turn_captcha_offObject



94
95
96
97
98
99
100
101
102
103
104
105
# File 'tmpsets/set/mod002-admin/self/admin_info.rb', line 94

def howto_turn_captcha_off
  instructions(
    I18n.t(:howto_turn_off, scope: "mod.admin.set.self.admin_info"),
    [
      I18n.t(:howto_go,
             scope: "mod.admin.set.self.admin_info",
             captcha_card: link_to_card(:captcha)),
      I18n.t(:howto_update,
             scope: "mod.admin.set.self.admin_info")
    ]
  )
end

#instructions(title, steps) ⇒ Object



75
76
77
78
# File 'tmpsets/set/mod002-admin/self/admin_info.rb', line 75

def instructions title, steps
  steps = list_tag steps, ordered: true
  "#{title}#{steps}"
end

#recaptcha_warningObject



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'tmpsets/set/mod002-admin/self/admin_info.rb', line 49

def recaptcha_warning
  warning =
    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.)
      I18n.t(:captcha_temp, scope: "mod.admin.set.self.admin_info")
    else
      # %(You are configured to use [[*captcha]], but for that to work
      #   you need new recaptcha keys.)
      process_content(I18n.t(:captcha_keys,
                             scope: "mod.admin.set.self.admin_info"))
    end
  # 'Instructions'
  instructions = I18n.t(:instructions,
                        scope: "mod.admin.set.self.admin_info")
  <<-HTML
    <p>
      #{warning}
    </p>
    <h5>#{instructions}</h5>
    #{howto_add_new_recaptcha_keys}
    #{howto_turn_captcha_off}
  HTML
end

#warning_list(warnings) ⇒ Object



29
30
31
32
33
# File 'tmpsets/set/mod002-admin/self/admin_info.rb', line 29

def warning_list warnings
  # 'ADMINISTRATOR WARNING'
  admin_warn = I18n.t(:admin_warn, scope: "mod.admin.set.self.admin_info")
  "<h5>#{admin_warn}</h5>" + warnings.join("\n")
end

#warning_list_with_auto_scope(warnings) ⇒ Object



35
36
37
38
39
# File 'tmpsets/set/mod002-admin/self/admin_info.rb', line 35

def warning_list_with_auto_scope warnings
  # 'ADMINISTRATOR WARNING'
  admin_warn = tr(:admin_warn)
  "<h5>#{admin_warn}</h5>" + warnings.join("\n")
end