diff --git a/app/assets/javascripts/discourse/routes/application.js.es6 b/app/assets/javascripts/discourse/routes/application.js.es6
index b25208f6ceb..184646a9ccf 100644
--- a/app/assets/javascripts/discourse/routes/application.js.es6
+++ b/app/assets/javascripts/discourse/routes/application.js.es6
@@ -4,10 +4,10 @@ import showModal from 'discourse/lib/show-modal';
import OpenComposer from "discourse/mixins/open-composer";
import Category from 'discourse/models/category';
-function unlessReadOnly(method) {
+function unlessReadOnly(method, message) {
return function() {
if (this.site.get("isReadOnly")) {
- bootbox.alert(I18n.t("read_only_mode.login_disabled"));
+ bootbox.alert(message);
} else {
this[method]();
}
@@ -19,7 +19,9 @@ const ApplicationRoute = Discourse.Route.extend(OpenComposer, {
actions: {
- logout() {
+ logout: unlessReadOnly('_handleLogout', I18n.t("read_only_mode.logout_disabled")),
+
+ _handleLogout() {
if (this.currentUser) {
this.currentUser.destroySession().then(() => logout(this.siteSettings, this.keyValueStore));
}
@@ -83,9 +85,9 @@ const ApplicationRoute = Discourse.Route.extend(OpenComposer, {
return true;
},
- showLogin: unlessReadOnly('handleShowLogin'),
+ showLogin: unlessReadOnly('handleShowLogin', I18n.t("read_only_mode.login_disabled")),
- showCreateAccount: unlessReadOnly('handleShowCreateAccount'),
+ showCreateAccount: unlessReadOnly('handleShowCreateAccount', I18n.t("read_only_mode.login_disabled")),
showForgotPassword() {
showModal('forgotPassword', { title: 'forgot_password.title' });
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index d4d17f0a103..d4d246a005d 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -777,6 +777,7 @@ en:
read_only_mode:
enabled: "This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now."
login_disabled: "Login is disabled while the site is in read only mode."
+ logout_disabled: "Logout is disabled while the site is in read only mode."
too_few_topics_and_posts_notice: "Let's get this discussion started! There are currently %{currentTopics} / %{requiredTopics} topics and %{currentPosts} / %{requiredPosts} posts. New visitors need some conversations to read and respond to."
too_few_topics_notice: "Let's get this discussion started! There are currently %{currentTopics} / %{requiredTopics} topics. New visitors need some conversations to read and respond to."
too_few_posts_notice: "Let's get this discussion started! There are currently %{currentPosts} / %{requiredPosts} posts. New visitors need some conversations to read and respond to."