mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 13:31:18 +08:00
FEATURE: refactor notice code, add optional global notice.
Set the global_notice site setting to notify users of a critical event.
This commit is contained in:
@ -1,9 +1,5 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
{{#if Discourse.isReadOnly}}
|
{{Discourse.globalNotice}}
|
||||||
<div class="row">
|
|
||||||
<div class="alert alert-info">{{i18n "read_only_mode.enabled"}}</div>
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="full-width">
|
<div class="full-width">
|
||||||
|
|
||||||
|
@ -143,7 +143,25 @@ window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this.get("currentAssetVersion");
|
return this.get("currentAssetVersion");
|
||||||
}.property()
|
}.property(),
|
||||||
|
|
||||||
|
globalNotice: function(){
|
||||||
|
var notices = [];
|
||||||
|
|
||||||
|
if(this.get("isReadOnly")){
|
||||||
|
notices.push(I18n.t("read_only_mode.enabled"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!_.isEmpty(Discourse.SiteSettings.global_notice)){
|
||||||
|
notices.push(Discourse.SiteSettings.global_notice);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(notices.length > 0) {
|
||||||
|
return new Handlebars.SafeString(_.map(notices, function(text) {
|
||||||
|
return "<div class='row'><div class='alert alert-info'>" + text + "</div></div>";
|
||||||
|
}).join(""));
|
||||||
|
}
|
||||||
|
}.property("isReadOnly")
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
<div class='container'>
|
<div class='container'>
|
||||||
{{customHTML "top"}}
|
{{customHTML "top"}}
|
||||||
{{#if Discourse.isReadOnly}}
|
{{Discourse.globalNotice}}
|
||||||
<div class="alert alert-info">{{i18n "read_only_mode.enabled"}}</div>
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class='list-controls'>
|
<div class='list-controls'>
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
<div class='container'>
|
<div class='container'>
|
||||||
{{customHTML "top"}}
|
{{customHTML "top"}}
|
||||||
{{#if Discourse.isReadOnly}}
|
{{Discourse.globalNotice}}
|
||||||
<div class="alert alert-info">{{i18n "read_only_mode.enabled"}}</div>
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#if postStream.loaded}}
|
{{#if postStream.loaded}}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
<div class='container'>
|
<div class='container'>
|
||||||
{{customHTML "top"}}
|
{{customHTML "top"}}
|
||||||
{{#if Discourse.isReadOnly}}
|
{{Discourse.globalNotice}}
|
||||||
<div class="alert alert-info">{{i18n "read_only_mode.enabled"}}</div>
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#unless loading}}
|
{{#unless loading}}
|
||||||
|
@ -848,6 +848,8 @@ en:
|
|||||||
suppress_uncategorized_badge: "Don't show the badge for uncategorized topics in topic lists"
|
suppress_uncategorized_badge: "Don't show the badge for uncategorized topics in topic lists"
|
||||||
min_posts_for_search_in_topic: "Disable search within topic if topics have less than minimum number posts"
|
min_posts_for_search_in_topic: "Disable search within topic if topics have less than minimum number posts"
|
||||||
|
|
||||||
|
global_notice: "Display a global banner to all users of the site, change to blank to hide it (HTML is allowed)"
|
||||||
|
|
||||||
enable_names: "Allow users to show their full names"
|
enable_names: "Allow users to show their full names"
|
||||||
display_name_on_posts: "Also show a user's full name on their posts"
|
display_name_on_posts: "Also show a user's full name on their posts"
|
||||||
invites_shown: "Maximum invites shown on a user page"
|
invites_shown: "Maximum invites shown on a user page"
|
||||||
|
@ -476,6 +476,10 @@ uncategorized:
|
|||||||
sequential_replies_threshold: 2
|
sequential_replies_threshold: 2
|
||||||
dominating_topic_minimum_percent: 20
|
dominating_topic_minimum_percent: 20
|
||||||
|
|
||||||
|
global_notice:
|
||||||
|
default: ""
|
||||||
|
client: true
|
||||||
|
|
||||||
# Category IDs
|
# Category IDs
|
||||||
lounge_category_id:
|
lounge_category_id:
|
||||||
default: -1
|
default: -1
|
||||||
|
Reference in New Issue
Block a user