rename site settings for trust levels as numbers
This commit is contained in:
parent
229566fc32
commit
fcca64c0cf
|
@ -158,8 +158,8 @@ window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
|
|||
post_count += c.get('post_count');
|
||||
}
|
||||
});
|
||||
if (topic_count < 5 || post_count < Discourse.SiteSettings.basic_requires_read_posts) {
|
||||
notices.push(I18n.t("too_few_topics_notice", {posts: Discourse.SiteSettings.basic_requires_read_posts}));
|
||||
if (topic_count < 5 || post_count < Discourse.SiteSettings.tl1_requires_read_posts) {
|
||||
notices.push(I18n.t("too_few_topics_notice", {posts: Discourse.SiteSettings.tl1_requires_read_posts}));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ class LeaderRequirements
|
|||
end
|
||||
|
||||
def min_days_visited
|
||||
SiteSetting.leader_requires_days_visited
|
||||
SiteSetting.tl3_requires_days_visited
|
||||
end
|
||||
|
||||
def num_topics_replied_to
|
||||
|
@ -63,7 +63,7 @@ class LeaderRequirements
|
|||
end
|
||||
|
||||
def min_topics_replied_to
|
||||
SiteSetting.leader_requires_topics_replied_to
|
||||
SiteSetting.tl3_requires_topics_replied_to
|
||||
end
|
||||
|
||||
def topics_viewed_query
|
||||
|
@ -75,7 +75,7 @@ class LeaderRequirements
|
|||
end
|
||||
|
||||
def min_topics_viewed
|
||||
(LeaderRequirements.num_topics_in_time_period.to_i * (SiteSetting.leader_requires_topics_viewed.to_f / 100.0)).round
|
||||
(LeaderRequirements.num_topics_in_time_period.to_i * (SiteSetting.tl3_requires_topics_viewed.to_f / 100.0)).round
|
||||
end
|
||||
|
||||
def posts_read
|
||||
|
@ -83,7 +83,7 @@ class LeaderRequirements
|
|||
end
|
||||
|
||||
def min_posts_read
|
||||
(LeaderRequirements.num_posts_in_time_period.to_i * (SiteSetting.leader_requires_posts_read.to_f / 100.0)).round
|
||||
(LeaderRequirements.num_posts_in_time_period.to_i * (SiteSetting.tl3_requires_posts_read.to_f / 100.0)).round
|
||||
end
|
||||
|
||||
def topics_viewed_all_time
|
||||
|
@ -91,7 +91,7 @@ class LeaderRequirements
|
|||
end
|
||||
|
||||
def min_topics_viewed_all_time
|
||||
SiteSetting.leader_requires_topics_viewed_all_time
|
||||
SiteSetting.tl3_requires_topics_viewed_all_time
|
||||
end
|
||||
|
||||
def posts_read_all_time
|
||||
|
@ -99,7 +99,7 @@ class LeaderRequirements
|
|||
end
|
||||
|
||||
def min_posts_read_all_time
|
||||
SiteSetting.leader_requires_posts_read_all_time
|
||||
SiteSetting.tl3_requires_posts_read_all_time
|
||||
end
|
||||
|
||||
def num_flagged_posts
|
||||
|
@ -112,7 +112,7 @@ class LeaderRequirements
|
|||
end
|
||||
|
||||
def max_flagged_posts
|
||||
SiteSetting.leader_requires_max_flagged
|
||||
SiteSetting.tl3_requires_max_flagged
|
||||
end
|
||||
|
||||
def num_flagged_by_users
|
||||
|
@ -125,7 +125,7 @@ class LeaderRequirements
|
|||
end
|
||||
|
||||
def max_flagged_by_users
|
||||
SiteSetting.leader_requires_max_flagged
|
||||
SiteSetting.tl3_requires_max_flagged
|
||||
end
|
||||
|
||||
def num_likes_given
|
||||
|
@ -133,7 +133,7 @@ class LeaderRequirements
|
|||
end
|
||||
|
||||
def min_likes_given
|
||||
SiteSetting.leader_requires_likes_given
|
||||
SiteSetting.tl3_requires_likes_given
|
||||
end
|
||||
|
||||
def num_likes_received
|
||||
|
@ -141,7 +141,7 @@ class LeaderRequirements
|
|||
end
|
||||
|
||||
def min_likes_received
|
||||
SiteSetting.leader_requires_likes_received
|
||||
SiteSetting.tl3_requires_likes_received
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ class Post < ActiveRecord::Base
|
|||
return raw if cook_method == Post.cook_methods[:raw_html]
|
||||
|
||||
# Default is to cook posts
|
||||
cooked = if !self.user || SiteSetting.leader_links_no_follow || !self.user.has_trust_level?(:leader)
|
||||
cooked = if !self.user || SiteSetting.tl3_links_no_follow || !self.user.has_trust_level?(:leader)
|
||||
post_analyzer.cook(*args)
|
||||
else
|
||||
# At trust level 3, we don't apply nofollow to links
|
||||
|
|
|
@ -65,7 +65,7 @@ class UserProfile < ActiveRecord::Base
|
|||
|
||||
def cooked
|
||||
if self.bio_raw.present?
|
||||
PrettyText.cook(self.bio_raw, omit_nofollow: user.has_trust_level?(:leader) && !SiteSetting.leader_links_no_follow)
|
||||
PrettyText.cook(self.bio_raw, omit_nofollow: user.has_trust_level?(:leader) && !SiteSetting.tl3_links_no_follow)
|
||||
else
|
||||
nil
|
||||
end
|
||||
|
|
|
@ -835,29 +835,29 @@ en:
|
|||
default_invitee_trust_level: "Default trust level (0-4) for invited users."
|
||||
default_trust_level: "Default trust level (0-4) for all new users."
|
||||
|
||||
basic_requires_topics_entered: "How many topics a new user must enter before promotion to basic (1) trust level."
|
||||
basic_requires_read_posts: "How many posts a new user must read before promotion to basic (1) trust level."
|
||||
basic_requires_time_spent_mins: "How many minutes a new user must read posts before promotion to basic (1) trust level."
|
||||
tl1_requires_topics_entered: "How many topics a new user must enter before promotion to trust level 1."
|
||||
tl1_requires_read_posts: "How many posts a new user must read before promotion to trust level 1."
|
||||
tl1_requires_time_spent_mins: "How many minutes a new user must read posts before promotion to trust level 1."
|
||||
|
||||
regular_requires_topics_entered: "How many topics a basic user must enter before promotion to regular (2) trust level."
|
||||
regular_requires_read_posts: "How many posts a basic user must read before promotion to regular (2) trust level."
|
||||
regular_requires_time_spent_mins: "How many minutes a basic user must read posts before promotion to regular (2) trust level."
|
||||
regular_requires_days_visited: "How many days a basic user must visit the site before promotion to regular (2) trust level."
|
||||
regular_requires_likes_received: "How many likes a basic user must receive before promotion to regular (2) trust level."
|
||||
regular_requires_likes_given: "How many likes a basic user must cast before promotion to regular (2) trust level."
|
||||
regular_requires_topic_reply_count: "How many topics a basic user must reply to before promotion to regular (2) trust level."
|
||||
tl2_requires_topics_entered: "How many topics a user must enter before promotion to trust level 2."
|
||||
tl2_requires_read_posts: "How many posts a user must read before promotion to trust level 2."
|
||||
tl2_requires_time_spent_mins: "How many minutes a user must read posts before promotion to trust level 2."
|
||||
tl2_requires_days_visited: "How many days a user must visit the site before promotion to trust level 2."
|
||||
tl2_requires_likes_received: "How many likes a user must receive before promotion to trust level 2."
|
||||
tl2_requires_likes_given: "How many likes a user must cast before promotion to trust level 2."
|
||||
tl2_requires_topic_reply_count: "How many topics user must reply to before promotion to trust level 2."
|
||||
|
||||
leader_requires_days_visited: "Minimum number of days that a user needs to have visited the site in the last 100 days to qualify for promotion to veteran (3) trust level. (0 to 100)"
|
||||
leader_requires_topics_replied_to: "Minimum number of topics a user needs to have replied to in the last 100 days to qualify for promotion to veteran (3) trust level. (0 or higher)"
|
||||
leader_requires_topics_viewed: "The percentage of topics created in the last 100 days that a user needs to have viewed to qualify for promotion to veteran (3) trust level. (0 to 100)"
|
||||
leader_requires_posts_read: "The percentage of posts created in the last 100 days that a user needs to have viewed to qualify for promotion to veteran (3) trust level. (0 to 100)"
|
||||
leader_requires_topics_viewed_all_time: "The minimum total number of topics a user must have viewed to qualify for veteran (3) trust level."
|
||||
leader_requires_posts_read_all_time: "The minimum total number of posts a user must have read to qualify for veteran (3) trust level."
|
||||
leader_requires_max_flagged: "User must not have had more than x posts flagged by x different users in the last 100 days to qualify for promotion to veteran (3) trust level, where x is this setting's value. (0 or higher)"
|
||||
leader_promotion_min_duration: "The minimum number of days that a promotion to veteran lasts before a user can be demoted."
|
||||
leader_requires_likes_given: "The minimum number of likes that must be given in the last 100 days to qualify for promotion to veteran (3) trust level."
|
||||
leader_requires_likes_received: "The minimum number of likes that must be received in the last 100 days to qualify for promotion to veteran (3) trust level."
|
||||
leader_links_no_follow: "Do not remove rel=nofollow from veteran links."
|
||||
tl3_requires_days_visited: "Minimum number of days that a user needs to have visited the site in the last 100 days to qualify for promotion to trust level 3. (0 to 100)"
|
||||
tl3_requires_topics_replied_to: "Minimum number of topics a user needs to have replied to in the last 100 days to qualify for promotion to trust level 3. (0 or higher)"
|
||||
tl3_requires_topics_viewed: "The percentage of topics created in the last 100 days that a user needs to have viewed to qualify for promotion to trust level 3. (0 to 100)"
|
||||
tl3_requires_posts_read: "The percentage of posts created in the last 100 days that a user needs to have viewed to qualify for promotion to trust level 3. (0 to 100)"
|
||||
tl3_requires_topics_viewed_all_time: "The minimum total number of topics a user must have viewed to qualify for trust level 3."
|
||||
tl3_requires_posts_read_all_time: "The minimum total number of posts a user must have read to qualify for trust level 3."
|
||||
tl3_requires_max_flagged: "User must not have had more than x posts flagged by x different users in the last 100 days to qualify for promotion to trust level 3, where x is this setting's value. (0 or higher)"
|
||||
tl3_promotion_min_duration: "The minimum number of days that a promotion to trust level 3 lasts before a user can be demoted back to trust level 2."
|
||||
tl3_requires_likes_given: "The minimum number of likes that must be given in the last 100 days to qualify for promotion to trust level 3."
|
||||
tl3_requires_likes_received: "The minimum number of likes that must be received in the last 100 days to qualify for promotion to veteran (3) trust level."
|
||||
tl3_links_no_follow: "Do not remove rel=nofollow from veteran links."
|
||||
|
||||
min_trust_to_create_topic: "The minimum trust level required to create a new topic."
|
||||
|
||||
|
|
|
@ -472,52 +472,52 @@ trust:
|
|||
min_trust_to_edit_wiki_post:
|
||||
default: 1
|
||||
enum: 'TrustLevelSetting'
|
||||
basic_requires_topics_entered: 5
|
||||
basic_requires_read_posts:
|
||||
tl1_requires_topics_entered: 5
|
||||
tl1_requires_read_posts:
|
||||
default: 30
|
||||
client: true
|
||||
basic_requires_time_spent_mins: 10
|
||||
regular_requires_topics_entered: 20
|
||||
regular_requires_read_posts: 100
|
||||
regular_requires_time_spent_mins: 60
|
||||
regular_requires_days_visited: 15
|
||||
regular_requires_likes_received: 1
|
||||
regular_requires_likes_given: 1
|
||||
regular_requires_topic_reply_count: 3
|
||||
leader_requires_days_visited:
|
||||
tl1_requires_time_spent_mins: 10
|
||||
tl2_requires_topics_entered: 20
|
||||
tl2_requires_read_posts: 100
|
||||
tl2_requires_time_spent_mins: 60
|
||||
tl2_requires_days_visited: 15
|
||||
tl2_requires_likes_received: 1
|
||||
tl2_requires_likes_given: 1
|
||||
tl2_requires_topic_reply_count: 3
|
||||
tl3_requires_days_visited:
|
||||
default: 50
|
||||
min: 0
|
||||
max: 100
|
||||
leader_requires_topics_replied_to:
|
||||
tl3_requires_topics_replied_to:
|
||||
default: 10
|
||||
min: 0
|
||||
leader_requires_topics_viewed:
|
||||
tl3_requires_topics_viewed:
|
||||
default: 25
|
||||
min: 0
|
||||
max: 100
|
||||
leader_requires_posts_read:
|
||||
tl3_requires_posts_read:
|
||||
default: 25
|
||||
min: 0
|
||||
max: 100
|
||||
leader_requires_topics_viewed_all_time:
|
||||
tl3_requires_topics_viewed_all_time:
|
||||
default: 200
|
||||
min: 0
|
||||
leader_requires_posts_read_all_time:
|
||||
tl3_requires_posts_read_all_time:
|
||||
default: 500
|
||||
min: 0
|
||||
leader_requires_max_flagged:
|
||||
tl3_requires_max_flagged:
|
||||
default: 5
|
||||
min: 0
|
||||
leader_promotion_min_duration:
|
||||
tl3_promotion_min_duration:
|
||||
default: 14
|
||||
min: 0
|
||||
leader_requires_likes_given:
|
||||
tl3_requires_likes_given:
|
||||
default: 30
|
||||
min: 0
|
||||
leader_requires_likes_received:
|
||||
tl3_requires_likes_received:
|
||||
default: 20
|
||||
min: 0
|
||||
leader_links_no_follow: false
|
||||
tl3_links_no_follow: false
|
||||
|
||||
security:
|
||||
use_https: false
|
||||
|
|
|
@ -81,22 +81,22 @@ class Promotion
|
|||
|
||||
def self.regular_met?(user)
|
||||
stat = user.user_stat
|
||||
return false if stat.topics_entered < SiteSetting.regular_requires_topics_entered
|
||||
return false if stat.posts_read_count < SiteSetting.regular_requires_read_posts
|
||||
return false if (stat.time_read / 60) < SiteSetting.regular_requires_time_spent_mins
|
||||
return false if stat.days_visited < SiteSetting.regular_requires_days_visited
|
||||
return false if stat.likes_received < SiteSetting.regular_requires_likes_received
|
||||
return false if stat.likes_given < SiteSetting.regular_requires_likes_given
|
||||
return false if stat.topic_reply_count < SiteSetting.regular_requires_topic_reply_count
|
||||
return false if stat.topics_entered < SiteSetting.tl2_requires_topics_entered
|
||||
return false if stat.posts_read_count < SiteSetting.tl2_requires_read_posts
|
||||
return false if (stat.time_read / 60) < SiteSetting.tl2_requires_time_spent_mins
|
||||
return false if stat.days_visited < SiteSetting.tl2_requires_days_visited
|
||||
return false if stat.likes_received < SiteSetting.tl2_requires_likes_received
|
||||
return false if stat.likes_given < SiteSetting.tl2_requires_likes_given
|
||||
return false if stat.topic_reply_count < SiteSetting.tl2_requires_topic_reply_count
|
||||
|
||||
true
|
||||
end
|
||||
|
||||
def self.basic_met?(user)
|
||||
stat = user.user_stat
|
||||
return false if stat.topics_entered < SiteSetting.basic_requires_topics_entered
|
||||
return false if stat.posts_read_count < SiteSetting.basic_requires_read_posts
|
||||
return false if (stat.time_read / 60) < SiteSetting.basic_requires_time_spent_mins
|
||||
return false if stat.topics_entered < SiteSetting.tl1_requires_topics_entered
|
||||
return false if stat.posts_read_count < SiteSetting.tl1_requires_read_posts
|
||||
return false if (stat.time_read / 60) < SiteSetting.tl1_requires_time_spent_mins
|
||||
return true
|
||||
end
|
||||
|
||||
|
|
|
@ -38,9 +38,9 @@ describe Promotion do
|
|||
|
||||
before do
|
||||
stat = user.user_stat
|
||||
stat.topics_entered = SiteSetting.basic_requires_topics_entered
|
||||
stat.posts_read_count = SiteSetting.basic_requires_read_posts
|
||||
stat.time_read = SiteSetting.basic_requires_time_spent_mins * 60
|
||||
stat.topics_entered = SiteSetting.tl1_requires_topics_entered
|
||||
stat.posts_read_count = SiteSetting.tl1_requires_read_posts
|
||||
stat.time_read = SiteSetting.tl1_requires_time_spent_mins * 60
|
||||
@result = promotion.review
|
||||
end
|
||||
|
||||
|
@ -76,13 +76,13 @@ describe Promotion do
|
|||
|
||||
before do
|
||||
stat = user.user_stat
|
||||
stat.topics_entered = SiteSetting.regular_requires_topics_entered
|
||||
stat.posts_read_count = SiteSetting.regular_requires_read_posts
|
||||
stat.time_read = SiteSetting.regular_requires_time_spent_mins * 60
|
||||
stat.days_visited = SiteSetting.regular_requires_days_visited * 60
|
||||
stat.likes_received = SiteSetting.regular_requires_likes_received
|
||||
stat.likes_given = SiteSetting.regular_requires_likes_given
|
||||
stat.topic_reply_count = SiteSetting.regular_requires_topic_reply_count
|
||||
stat.topics_entered = SiteSetting.tl2_requires_topics_entered
|
||||
stat.posts_read_count = SiteSetting.tl2_requires_read_posts
|
||||
stat.time_read = SiteSetting.tl2_requires_time_spent_mins * 60
|
||||
stat.days_visited = SiteSetting.tl2_requires_days_visited * 60
|
||||
stat.likes_received = SiteSetting.tl2_requires_likes_received
|
||||
stat.likes_given = SiteSetting.tl2_requires_likes_given
|
||||
stat.topic_reply_count = SiteSetting.tl2_requires_topic_reply_count
|
||||
|
||||
@result = promotion.review
|
||||
end
|
||||
|
|
|
@ -190,9 +190,9 @@ describe Admin::UsersController do
|
|||
it "raises an error when demoting a user below their current trust level" do
|
||||
StaffActionLogger.any_instance.expects(:log_trust_level_change).never
|
||||
stat = @another_user.user_stat
|
||||
stat.topics_entered = SiteSetting.basic_requires_topics_entered + 1
|
||||
stat.posts_read_count = SiteSetting.basic_requires_read_posts + 1
|
||||
stat.time_read = SiteSetting.basic_requires_time_spent_mins * 60
|
||||
stat.topics_entered = SiteSetting.tl1_requires_topics_entered + 1
|
||||
stat.posts_read_count = SiteSetting.tl1_requires_read_posts + 1
|
||||
stat.time_read = SiteSetting.tl1_requires_time_spent_mins * 60
|
||||
stat.save!
|
||||
@another_user.update_attributes(trust_level: TrustLevel.levels[:basic])
|
||||
xhr :put, :trust_level, user_id: @another_user.id, level: TrustLevel.levels[:newuser]
|
||||
|
|
|
@ -15,49 +15,49 @@ describe LeaderRequirements do
|
|||
|
||||
describe "requirements" do
|
||||
it "min_days_visited uses site setting" do
|
||||
SiteSetting.stubs(:leader_requires_days_visited).returns(66)
|
||||
SiteSetting.stubs(:tl3_requires_days_visited).returns(66)
|
||||
leader_requirements.min_days_visited.should == 66
|
||||
end
|
||||
|
||||
it "min_topics_replied_to uses site setting" do
|
||||
SiteSetting.stubs(:leader_requires_topics_replied_to).returns(12)
|
||||
SiteSetting.stubs(:tl3_requires_topics_replied_to).returns(12)
|
||||
leader_requirements.min_topics_replied_to.should == 12
|
||||
end
|
||||
|
||||
it "min_topics_viewed depends on site setting and number of topics created" do
|
||||
SiteSetting.stubs(:leader_requires_topics_viewed).returns(75)
|
||||
SiteSetting.stubs(:tl3_requires_topics_viewed).returns(75)
|
||||
described_class.stubs(:num_topics_in_time_period).returns(31)
|
||||
leader_requirements.min_topics_viewed.should == 23
|
||||
end
|
||||
|
||||
it "min_posts_read depends on site setting and number of posts created" do
|
||||
SiteSetting.stubs(:leader_requires_posts_read).returns(66)
|
||||
SiteSetting.stubs(:tl3_requires_posts_read).returns(66)
|
||||
described_class.stubs(:num_posts_in_time_period).returns(1234)
|
||||
leader_requirements.min_posts_read.should == 814
|
||||
end
|
||||
|
||||
it "min_topics_viewed_all_time depends on site setting" do
|
||||
SiteSetting.stubs(:leader_requires_topics_viewed_all_time).returns(75)
|
||||
SiteSetting.stubs(:tl3_requires_topics_viewed_all_time).returns(75)
|
||||
leader_requirements.min_topics_viewed_all_time.should == 75
|
||||
end
|
||||
|
||||
it "min_posts_read_all_time depends on site setting" do
|
||||
SiteSetting.stubs(:leader_requires_posts_read_all_time).returns(1001)
|
||||
SiteSetting.stubs(:tl3_requires_posts_read_all_time).returns(1001)
|
||||
leader_requirements.min_posts_read_all_time.should == 1001
|
||||
end
|
||||
|
||||
it "max_flagged_posts depends on site setting" do
|
||||
SiteSetting.stubs(:leader_requires_max_flagged).returns(3)
|
||||
SiteSetting.stubs(:tl3_requires_max_flagged).returns(3)
|
||||
leader_requirements.max_flagged_posts.should == 3
|
||||
end
|
||||
|
||||
it "min_likes_given depends on site setting" do
|
||||
SiteSetting.stubs(:leader_requires_likes_given).returns(30)
|
||||
SiteSetting.stubs(:tl3_requires_likes_given).returns(30)
|
||||
leader_requirements.min_likes_given.should == 30
|
||||
end
|
||||
|
||||
it "min_likes_received depends on site setting" do
|
||||
SiteSetting.stubs(:leader_requires_likes_received).returns(20)
|
||||
SiteSetting.stubs(:tl3_requires_likes_received).returns(20)
|
||||
leader_requirements.min_likes_received.should == 20
|
||||
end
|
||||
end
|
||||
|
|
|
@ -759,15 +759,15 @@ describe Post do
|
|||
post.cooked.should =~ /nofollow/
|
||||
end
|
||||
|
||||
it "when leader_links_no_follow is false, should not add nofollow for trust level 3 and higher" do
|
||||
SiteSetting.stubs(:leader_links_no_follow).returns(false)
|
||||
it "when tl3_links_no_follow is false, should not add nofollow for trust level 3 and higher" do
|
||||
SiteSetting.stubs(:tl3_links_no_follow).returns(false)
|
||||
post.user.trust_level = 3
|
||||
post.save
|
||||
(post.cooked =~ /nofollow/).should be_false
|
||||
end
|
||||
|
||||
it "when leader_links_no_follow is true, should add nofollow for trust level 3 and higher" do
|
||||
SiteSetting.stubs(:leader_links_no_follow).returns(true)
|
||||
it "when tl3_links_no_follow is true, should add nofollow for trust level 3 and higher" do
|
||||
SiteSetting.stubs(:tl3_links_no_follow).returns(true)
|
||||
post.user.trust_level = 3
|
||||
post.save
|
||||
(post.cooked =~ /nofollow/).should be_true
|
||||
|
|
|
@ -98,8 +98,8 @@ describe UserProfile do
|
|||
expect(user_profile.bio_processed).to eq("<p>I love http://discourse.org</p>")
|
||||
end
|
||||
|
||||
context 'leader_links_no_follow is false' do
|
||||
before { SiteSetting.stubs(:leader_links_no_follow).returns(false) }
|
||||
context 'tl3_links_no_follow is false' do
|
||||
before { SiteSetting.stubs(:tl3_links_no_follow).returns(false) }
|
||||
|
||||
it 'includes the link without nofollow if the user is trust level 3 or higher' do
|
||||
user.trust_level = TrustLevel.levels[:leader]
|
||||
|
@ -123,8 +123,8 @@ describe UserProfile do
|
|||
end
|
||||
end
|
||||
|
||||
context 'leader_links_no_follow is true' do
|
||||
before { SiteSetting.stubs(:leader_links_no_follow).returns(true) }
|
||||
context 'tl3_links_no_follow is true' do
|
||||
before { SiteSetting.stubs(:tl3_links_no_follow).returns(true) }
|
||||
|
||||
it 'includes the link with nofollow if the user is trust level 3 or higher' do
|
||||
user.trust_level = TrustLevel.levels[:leader]
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
/*jshint maxlen:10000000 */
|
||||
Discourse.SiteSettingsOriginal = {"title":"Discourse Meta","logo_url":"/assets/logo.png","logo_small_url":"/assets/logo-single.png","mobile_logo_url":"","favicon_url":"//meta.discourse.org/uploads/default/2499/79d53726406d87af.ico","allow_user_locale":false,"suggested_topics":7,"track_external_right_clicks":false,"ga_universal_tracking_code":"","ga_universal_domain_name":"auto","ga_tracking_code":"UA-33736483-2","ga_domain_name":"","top_menu":"latest|new|unread|starred|categories|top","post_menu":"like|share|flag|edit|bookmark|delete|admin|reply","post_menu_hidden_items":"edit|delete|admin","share_links":"twitter|facebook|google+|email","category_colors":"BF1E2E|F1592A|F7941D|9EB83B|3AB54A|12A89D|25AAE2|0E76BD|652D90|92278F|ED207B|8C6238|231F20|808281|B3B5B4|283890","enable_mobile_theme":true,"relative_date_duration":14,"category_featured_topics":4,"fixed_category_positions":false,"show_subcategory_list":false,"posts_per_page":20,"enable_badges":true,"invite_only":false,"login_required":false,"must_approve_users":false,"enable_local_logins":true,"allow_new_registrations":true,"enable_google_logins":true,"enable_google_oauth2_logins":false,"enable_yahoo_logins":true,"enable_twitter_logins":true,"enable_facebook_logins":true,"enable_github_logins":true,"enable_sso":false,"min_username_length":3,"max_username_length":20,"min_password_length":8,"enable_names":true,"invites_shown":30,"delete_user_max_post_age":60,"delete_all_posts_max":15,"min_post_length":20,"min_private_message_post_length":10,"max_post_length":32000,"min_topic_title_length":15,"max_topic_title_length":255,"min_private_message_title_length":2,"allow_uncategorized_topics":true,"min_title_similar_length":10,"min_body_similar_length":15,"edit_history_visible_to_public":true,"delete_removed_posts_after":24,"traditional_markdown_linebreaks":false,"suppress_reply_directly_below":true,"suppress_reply_directly_above":true,"newuser_max_images":0,"newuser_max_attachments":0,"display_name_on_posts":true,"short_progress_text_threshold":10000,"default_code_lang":"lang-auto","autohighlight_all_code":false,"email_in":false,"max_image_size_kb":3072,"max_attachment_size_kb":1024,"authorized_extensions":".jpg|.jpeg|.png|.gif|.svg|.txt|.ico|.yml","max_image_width":690,"max_image_height":500,"allow_profile_backgrounds":true,"allow_uploaded_avatars":true,"allow_animated_avatars":false,"basic_requires_read_posts":30,"enable_long_polling":true,"polling_interval":3000,"anon_polling_interval":30000,"flush_timings_secs":5,"tos_url":"","privacy_policy_url":"","tos_accept_required":false,"faq_url":"","allow_restore":false,"maximum_backups":7,"version_checks":true,"suppress_uncategorized_badge":true,"min_search_term_length":3,"topic_views_heat_low":1000,"topic_views_heat_medium":2000,"topic_views_heat_high":5000,"global_notice":"","show_create_topics_notice":true,"available_locales":"cs|da|de|en|es|fr|he|id|it|ja|ko|nb_NO|nl|pl_PL|pt|pt_BR|ru|sv|uk|zh_CN|zh_TW"};
|
||||
Discourse.SiteSettingsOriginal = {"title":"Discourse Meta","logo_url":"/assets/logo.png","logo_small_url":"/assets/logo-single.png","mobile_logo_url":"","favicon_url":"//meta.discourse.org/uploads/default/2499/79d53726406d87af.ico","allow_user_locale":false,"suggested_topics":7,"track_external_right_clicks":false,"ga_universal_tracking_code":"","ga_universal_domain_name":"auto","ga_tracking_code":"UA-33736483-2","ga_domain_name":"","top_menu":"latest|new|unread|starred|categories|top","post_menu":"like|share|flag|edit|bookmark|delete|admin|reply","post_menu_hidden_items":"edit|delete|admin","share_links":"twitter|facebook|google+|email","category_colors":"BF1E2E|F1592A|F7941D|9EB83B|3AB54A|12A89D|25AAE2|0E76BD|652D90|92278F|ED207B|8C6238|231F20|808281|B3B5B4|283890","enable_mobile_theme":true,"relative_date_duration":14,"category_featured_topics":4,"fixed_category_positions":false,"show_subcategory_list":false,"posts_per_page":20,"enable_badges":true,"invite_only":false,"login_required":false,"must_approve_users":false,"enable_local_logins":true,"allow_new_registrations":true,"enable_google_logins":true,"enable_google_oauth2_logins":false,"enable_yahoo_logins":true,"enable_twitter_logins":true,"enable_facebook_logins":true,"enable_github_logins":true,"enable_sso":false,"min_username_length":3,"max_username_length":20,"min_password_length":8,"enable_names":true,"invites_shown":30,"delete_user_max_post_age":60,"delete_all_posts_max":15,"min_post_length":20,"min_private_message_post_length":10,"max_post_length":32000,"min_topic_title_length":15,"max_topic_title_length":255,"min_private_message_title_length":2,"allow_uncategorized_topics":true,"min_title_similar_length":10,"min_body_similar_length":15,"edit_history_visible_to_public":true,"delete_removed_posts_after":24,"traditional_markdown_linebreaks":false,"suppress_reply_directly_below":true,"suppress_reply_directly_above":true,"newuser_max_images":0,"newuser_max_attachments":0,"display_name_on_posts":true,"short_progress_text_threshold":10000,"default_code_lang":"lang-auto","autohighlight_all_code":false,"email_in":false,"max_image_size_kb":3072,"max_attachment_size_kb":1024,"authorized_extensions":".jpg|.jpeg|.png|.gif|.svg|.txt|.ico|.yml","max_image_width":690,"max_image_height":500,"allow_profile_backgrounds":true,"allow_uploaded_avatars":true,"allow_animated_avatars":false,"tl1_requires_read_posts":30,"enable_long_polling":true,"polling_interval":3000,"anon_polling_interval":30000,"flush_timings_secs":5,"tos_url":"","privacy_policy_url":"","tos_accept_required":false,"faq_url":"","allow_restore":false,"maximum_backups":7,"version_checks":true,"suppress_uncategorized_badge":true,"min_search_term_length":3,"topic_views_heat_low":1000,"topic_views_heat_medium":2000,"topic_views_heat_high":5000,"global_notice":"","show_create_topics_notice":true,"available_locales":"cs|da|de|en|es|fr|he|id|it|ja|ko|nb_NO|nl|pl_PL|pt|pt_BR|ru|sv|uk|zh_CN|zh_TW"};
|
||||
Discourse.SiteSettings = jQuery.extend(true, {}, Discourse.SiteSettingsOriginal);
|
||||
|
|
Loading…
Reference in New Issue