Also warn admins when there aren't at least 50 posts
This commit is contained in:
parent
f0620a7d21
commit
9aba666d3f
|
@ -165,10 +165,15 @@ window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
|
|||
}
|
||||
|
||||
if(Discourse.User.currentProp('admin') && Discourse.SiteSettings.show_create_topics_notice) {
|
||||
var topic_count = _.reduce(Discourse.Site.currentProp('categories'), function(sum,c) {
|
||||
return sum + (c.get('read_restricted') ? 0 : c.get('topic_count'));
|
||||
}, 0);
|
||||
if (topic_count < 5) {
|
||||
var topic_count = 0,
|
||||
post_count = 0;
|
||||
_.each(Discourse.Site.currentProp('categories'), function(c) {
|
||||
if (!c.get('read_restricted')) {
|
||||
topic_count += c.get('topic_count');
|
||||
post_count += c.get('post_count');
|
||||
}
|
||||
});
|
||||
if (topic_count < 5 || post_count < 50) {
|
||||
notices.push(I18n.t("too_few_topics_notice"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ class BasicCategorySerializer < ApplicationSerializer
|
|||
:text_color,
|
||||
:slug,
|
||||
:topic_count,
|
||||
:post_count,
|
||||
:description,
|
||||
:topic_url,
|
||||
:read_restricted,
|
||||
|
|
|
@ -446,7 +446,7 @@ en:
|
|||
read_only_mode:
|
||||
enabled: "An administrator has enabled read-only mode. You can continue to browse the site but interactions won't work properly."
|
||||
login_disabled: "Login is disabled while the site is in read only mode."
|
||||
too_few_topics_notice: "Create at least 5 public topics to get discussion started. New users won't be able to earn trust levels unless there's content for them to read."
|
||||
too_few_topics_notice: "Create at least 5 topics and 50 posts to get discussion started. New users will not be able to earn trust levels unless there's content for them to read."
|
||||
|
||||
learn_more: "learn more..."
|
||||
|
||||
|
|
Loading…
Reference in New Issue