mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Admins should be able to create polls even when plugin is disabled.
This commit is contained in:
@@ -7,6 +7,7 @@ export function cook(text) {
|
||||
|
||||
const opts = {
|
||||
getURL: Discourse.getURLWithCDN,
|
||||
currentUser: Discourse.__container__.lookup('current-user:main'),
|
||||
siteSettings
|
||||
};
|
||||
|
||||
|
||||
@@ -12,7 +12,17 @@ export function registerOption(fn) {
|
||||
export function buildOptions(state) {
|
||||
setup();
|
||||
|
||||
const { siteSettings, getURL, lookupAvatar, getTopicInfo, topicId, categoryHashtagLookup } = state;
|
||||
const {
|
||||
siteSettings,
|
||||
getURL,
|
||||
lookupAvatar,
|
||||
getTopicInfo,
|
||||
topicId,
|
||||
categoryHashtagLookup,
|
||||
userId,
|
||||
getCurrentUser,
|
||||
currentUser
|
||||
} = state;
|
||||
|
||||
const features = {
|
||||
'bold-italics': true,
|
||||
@@ -34,6 +44,9 @@ export function buildOptions(state) {
|
||||
getTopicInfo,
|
||||
topicId,
|
||||
categoryHashtagLookup,
|
||||
userId,
|
||||
getCurrentUser,
|
||||
currentUser,
|
||||
mentionLookup: state.mentionLookup,
|
||||
};
|
||||
|
||||
|
||||
@@ -197,12 +197,16 @@ class Post < ActiveRecord::Base
|
||||
if cook_method == Post.cook_methods[:email]
|
||||
cooked = EmailCook.new(raw).cook
|
||||
else
|
||||
cooked = if !self.user || SiteSetting.tl3_links_no_follow || !self.user.has_trust_level?(TrustLevel[3])
|
||||
cloned = args.dup
|
||||
cloned[1] ||= {}
|
||||
|
||||
post_user = self.user
|
||||
cloned[1][:user_id] = post_user.id if post_user
|
||||
|
||||
cooked = if !post_user || SiteSetting.tl3_links_no_follow || !post_user.has_trust_level?(TrustLevel[3])
|
||||
post_analyzer.cook(*args)
|
||||
else
|
||||
# At trust level 3, we don't apply nofollow to links
|
||||
cloned = args.dup
|
||||
cloned[1] ||= {}
|
||||
cloned[1][:omit_nofollow] = true
|
||||
post_analyzer.cook(*cloned)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user