mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-23 13:26:22 -04:00
add classes to global-notices so they can be found with selectors
This commit is contained in:
parent
8fd339b994
commit
96a16743c3
1 changed files with 6 additions and 6 deletions
|
@ -7,11 +7,11 @@ export default Ember.Component.extend(StringBuffer, {
|
||||||
var notices = [];
|
var notices = [];
|
||||||
|
|
||||||
if (this.site.get("isReadOnly")) {
|
if (this.site.get("isReadOnly")) {
|
||||||
notices.push(I18n.t("read_only_mode.enabled"));
|
notices.push([I18n.t("read_only_mode.enabled"), 'alert-read-only']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.siteSettings.disable_emails) {
|
if (this.siteSettings.disable_emails) {
|
||||||
notices.push(I18n.t("emails_are_disabled"));
|
notices.push([I18n.t("emails_are_disabled"), 'alert-emails-disabled']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Discourse.User.currentProp('admin') && this.siteSettings.show_create_topics_notice) {
|
if (Discourse.User.currentProp('admin') && this.siteSettings.show_create_topics_notice) {
|
||||||
|
@ -24,17 +24,17 @@ export default Ember.Component.extend(StringBuffer, {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (topic_count < 5 || post_count < this.siteSettings.tl1_requires_read_posts) {
|
if (topic_count < 5 || post_count < this.siteSettings.tl1_requires_read_posts) {
|
||||||
notices.push(I18n.t("too_few_topics_notice", {posts: this.siteSettings.tl1_requires_read_posts}));
|
notices.push([I18n.t("too_few_topics_notice", {posts: this.siteSettings.tl1_requires_read_posts}), 'alert-too-few-topics']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_.isEmpty(this.siteSettings.global_notice)) {
|
if (!_.isEmpty(this.siteSettings.global_notice)) {
|
||||||
notices.push(this.siteSettings.global_notice);
|
notices.push([this.siteSettings.global_notice, 'alert-global-notice']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notices.length > 0) {
|
if (notices.length > 0) {
|
||||||
buffer.push(_.map(notices, function(text) {
|
buffer.push(_.map(notices, function(arr) {
|
||||||
return "<div class='row'><div class='alert alert-info'>" + text + "</div></div>";
|
return "<div class='row'><div class='alert alert-info " + arr[1] + "'>" + arr[0] + "</div></div>";
|
||||||
}).join(""));
|
}).join(""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue