add global notice for S3 deprecation warning

This commit is contained in:
Régis Hanol 2015-03-30 11:26:45 +02:00
parent 8760f7d817
commit b861669ceb
3 changed files with 13 additions and 7 deletions

View File

@ -4,7 +4,7 @@ export default Ember.Component.extend(StringBuffer, {
rerenderTriggers: ['site.isReadOnly'],
renderString: function(buffer) {
var notices = [];
let notices = [];
if (this.site.get("isReadOnly")) {
notices.push([I18n.t("read_only_mode.enabled"), 'alert-read-only']);
@ -14,8 +14,12 @@ export default Ember.Component.extend(StringBuffer, {
notices.push([I18n.t("emails_are_disabled"), 'alert-emails-disabled']);
}
if (this.siteSettings.enable_s3_uploads) {
notices.push([I18n.t("s3_deprecation_warning"), 'alert-s3-deprecation']);
}
if (Discourse.User.currentProp('admin') && this.siteSettings.show_create_topics_notice) {
var topic_count = 0,
let topic_count = 0,
post_count = 0;
_.each(this.site.get('categories'), function(c) {
if (!c.get('read_restricted')) {
@ -24,7 +28,7 @@ export default Ember.Component.extend(StringBuffer, {
}
});
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}), 'alert-too-few-topics']);
notices.push([I18n.t("too_few_topics_notice", { posts: this.siteSettings.tl1_requires_read_posts }), 'alert-too-few-topics']);
}
}
@ -33,9 +37,7 @@ export default Ember.Component.extend(StringBuffer, {
}
if (notices.length > 0) {
buffer.push(_.map(notices, function(arr) {
return "<div class='row'><div class='alert alert-info " + arr[1] + "'>" + arr[0] + "</div></div>";
}).join(""));
buffer.push(_.map(notices, n => "<div class='row'><div class='alert alert-info " + n[1] + "'>" + n[0] + "</div></div>").join(""));
}
}
});

View File

@ -105,6 +105,8 @@ en:
emails_are_disabled: "All outgoing email has been globally disabled by an administrator. No email notifications of any kind will be sent."
s3_deprecation_warning: "WARNING! Amazon S3 will soon be deprecated for image/attachment storage. Please, follow the <a href='https://meta.discourse.org/t/warning-amazon-s3-is-deprecated-in-1-3-for-image-attachment-storage/26594'>instructions</a> to migrate to local storage."
edit: 'edit the title and category of this topic'
not_implemented: "That feature hasn't been implemented yet, sorry!"
no_value: "No"

View File

@ -509,7 +509,9 @@ files:
prevent_anons_from_downloading_files:
default: false
client: true
enable_s3_uploads: false
enable_s3_uploads:
default: false
client: true
s3_use_iam_profile: false
s3_access_key_id: ''
s3_secret_access_key: ''