Replace MultisiteI18n hack with SiteContent and admin editing.

This commit is contained in:
Robin Ward
2013-04-05 16:47:20 -04:00
parent 52f79e8096
commit a14f62766e
8 changed files with 16 additions and 82 deletions

View File

@@ -6,11 +6,16 @@ class EducationController < ApplicationController
raise Discourse::InvalidAccess.new unless params[:id] =~ /^[a-z0-9\-\_]+$/
raise Discourse::NotFound.new if I18n.t("education.#{params[:id]}", default: MISSING_KEY) == MISSING_KEY
education_posts_text = I18n.t('education.until_posts', count: SiteSetting.educate_until_posts)
markdown_content = MultisiteI18n.t("education.#{params[:id]}",
site_name: SiteSetting.title,
education_posts_text: education_posts_text)
markdown_content = ""
if params[:id] == 'new-topic'
markdown_content = SiteContent.content_for(:education_new_topic, education_posts_text: education_posts_text)
else
markdown_content = SiteContent.content_for(:education_new_reply, education_posts_text: education_posts_text)
end
render text: PrettyText.cook(markdown_content)
end