Add a nag to admin dashboard if you haven't changed the title site setting from the default 'Discourse'

This commit is contained in:
Neil Lalonde 2013-04-25 17:53:31 -04:00
parent e864e4141d
commit 159c9b10d5
2 changed files with 20 additions and 14 deletions

View file

@ -20,6 +20,21 @@ class AdminDashboardData
'notify_user_private_messages'
]
def problems
[ rails_env_check,
host_names_check,
gc_checks,
sidekiq_check || queue_size_check || clockwork_check,
ram_check,
facebook_config_check,
twitter_config_check,
github_config_check,
failing_emails_check,
default_logo_check,
contact_email_check,
title_check ].compact
end
def self.fetch_all
AdminDashboardData.new
end
@ -39,20 +54,6 @@ class AdminDashboardData
)
end
def problems
[ rails_env_check,
host_names_check,
gc_checks,
sidekiq_check || queue_size_check || clockwork_check,
ram_check,
facebook_config_check,
twitter_config_check,
github_config_check,
failing_emails_check,
default_logo_check,
contact_email_check ].compact
end
def rails_env_check
I18n.t("dashboard.rails_env_warning", env: Rails.env) unless Rails.env == 'production'
end
@ -112,4 +113,8 @@ class AdminDashboardData
return I18n.t('dashboard.contact_email_missing') if !SiteSetting.contact_email.present?
return I18n.t('dashboard.contact_email_invalid') if !(SiteSetting.contact_email =~ User::EMAIL)
end
def title_check
I18n.t('dashboard.title_nag') if SiteSetting.title == SiteSetting.defaults[:title]
end
end

View file

@ -350,6 +350,7 @@ en:
default_logo_warning: "You haven't customized the logo images for your site. Update logo_url, logo_small_url, and favicon_url in the <a href='/admin/site_settings'>Site Settings</a>."
contact_email_missing: "You haven't provided a contact email for your site. Please update contact_email in the <a href='/admin/site_settings'>Site Settings</a>."
contact_email_invalid: "The site contact email is invalid. Please update contact_email in the <a href='/admin/site_settings'>Site Settings</a>."
title_nag: "The title Site Setting is still set to the default value. Please update it with your site's title in the <a href='/admin/site_settings'>Site Settings</a>."
content_types:
education_new_reply: