Add contact_email to site settings

This commit is contained in:
Neil Lalonde 2013-04-24 11:15:37 -04:00
parent 155348ca4c
commit db2de1eff0
3 changed files with 11 additions and 1 deletions

View file

@ -49,7 +49,8 @@ class AdminDashboardData
twitter_config_check,
github_config_check,
failing_emails_check,
default_logo_check ].compact
default_logo_check,
contact_email_check ].compact
end
def rails_env_check
@ -106,4 +107,9 @@ class AdminDashboardData
I18n.t('dashboard.default_logo_warning')
end
end
def contact_email_check
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
end

View file

@ -12,6 +12,7 @@ class SiteSetting < ActiveRecord::Base
client_setting(:title, "Discourse")
client_setting(:logo_url, '/assets/d-logo-sketch.png')
client_setting(:logo_small_url, '/assets/d-logo-sketch-small.png')
setting(:contact_email, '')
setting(:company_full_name, 'My Unconfigured Forum Ltd.')
setting(:company_short_name, 'Unconfigured Forum')
setting(:company_domain, 'www.example.com')

View file

@ -348,6 +348,8 @@ en:
github_config_warning: 'The server is configured to allow signup and log in with GitHub (enable_github_logins), but the client id and secret values are not set. Go to <a href="/admin/site_settings">the Site Settings</a> and update the settings. <a href="https://github.com/discourse/discourse/wiki/The-Discourse-Admin-Quick-Start-Guide" target="_blank">See this guide to learn more</a>.'
failing_emails_warning: "There are %{num_failed_jobs} email jobs that failed. Check your config/production.rb file and ensure that the config.action_mailer settings are correct."
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>."
content_types:
education_new_reply:
@ -385,6 +387,7 @@ en:
discourse_org_access_key: "The access key used to access the Discourse Hub nickname registry at discourse.org"
educate_until_posts: "Show pop-up composer education panel until the user has made this many posts"
title: "Title of this site, will be used in the title tag and elsewhere"
contact_email: "The email address of someone who can be contacted about the site. Important notices from Discourse.org regarding critical updates will be sent to this address."
company_full_name: "The full name of the company that runs this site, used in legal documents like the /tos"
company_short_name: "The short name of the company that runs this site, used in legal documents like the /tos"
company_domain: "The domain name owned by the company that runs this site, used in legal documents like the /tos"