mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 17:40:43 +08:00
New User Education goes through a server side ComposerMessages check. Composer message for users
who don't have avatars.
This commit is contained in:
13
app/controllers/composer_messages_controller.rb
Normal file
13
app/controllers/composer_messages_controller.rb
Normal file
@ -0,0 +1,13 @@
|
||||
require_dependency 'composer_messages_finder'
|
||||
|
||||
class ComposerMessagesController < ApplicationController
|
||||
|
||||
before_filter :ensure_logged_in
|
||||
|
||||
def index
|
||||
finder = ComposerMessagesFinder.new(current_user, params.slice(:composerAction, :topic_id, :post_id))
|
||||
render_json_dump([finder.find].compact)
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -1,25 +0,0 @@
|
||||
class EducationController < ApplicationController
|
||||
|
||||
before_filter :ensure_logged_in
|
||||
|
||||
def show
|
||||
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 = ""
|
||||
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
|
||||
|
||||
private
|
||||
MISSING_KEY = '_MISSING_KEY_'.freeze
|
||||
|
||||
end
|
@ -177,11 +177,6 @@ class PostsController < ApplicationController
|
||||
render_serialized(post.replies, PostSerializer)
|
||||
end
|
||||
|
||||
# Returns the "you're creating a post education"
|
||||
def education_text
|
||||
|
||||
end
|
||||
|
||||
def bookmark
|
||||
post = find_post_from_params
|
||||
if current_user
|
||||
|
Reference in New Issue
Block a user