Class: Tenon::WarningGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/tenon/warning_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.generateObject



3
4
5
# File 'lib/tenon/warning_generator.rb', line 3

def self.generate
  new.warnings
end

Instance Method Details

#warningsObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/tenon/warning_generator.rb', line 7

def warnings
  warnings = []
  warnings << "Your site needs a title.<br /><br /><a class='btn btn-comp btn-block' href='/tenon/settings'>OK</a>".html_safe if Tenon::MySettings.site_title.blank?
  warnings << "Your site needs an address.<br /><br /><a class='btn btn-comp btn-block' href='/tenon/settings'>OK</a>".html_safe if Tenon::MySettings.site_url.blank?
  warnings << "You haven't entered an email address to receive contact messages.<br /><br /><a class='btn btn-comp btn-block' href='/tenon/settings'>Correct This</a>".html_safe  if Tenon::MySettings.contact_email.blank?
  warnings << "You haven't entered an email address from which to send contact messages and other site notices.<br /><br /><a class='btn btn-comp btn-block' href='/tenon/settings'>Correct This</a>".html_safe  if Tenon::MySettings.from_email.blank?
  warnings << "You haven't entered the Google Analytics code.<br /><br /><a class='btn btn-comp btn-block' href='/tenon/settings'>Correct This</a>".html_safe if Tenon::MySettings.google_analytics.blank?
  warnings << 'You have not included a custom favicon.' unless favicon && favicon.size > 0
  warnings
end