mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
allow login required screen to be customized
This commit is contained in:
@@ -27,6 +27,10 @@ class StaticController < ApplicationController
|
|||||||
file = "static/#{page}.en"
|
file = "static/#{page}.en"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not lookup_context.find_all("#{file}.html").any?
|
||||||
|
file = "static/#{page}"
|
||||||
|
end
|
||||||
|
|
||||||
if lookup_context.find_all("#{file}.html").any?
|
if lookup_context.find_all("#{file}.html").any?
|
||||||
render file, layout: !request.xhr?, formats: [:html]
|
render file, layout: !request.xhr?, formats: [:html]
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class SiteContent < ActiveRecord::Base
|
|||||||
add_content_type :login_required_welcome_message, default_18n_key: 'login_required.welcome_message'
|
add_content_type :login_required_welcome_message, default_18n_key: 'login_required.welcome_message'
|
||||||
add_content_type :privacy_policy, allow_blank: true
|
add_content_type :privacy_policy, allow_blank: true
|
||||||
add_content_type :faq, allow_blank: true
|
add_content_type :faq, allow_blank: true
|
||||||
|
add_content_type :login_required, default_18n_key: 'login_required.welcome_message'
|
||||||
|
|
||||||
def site_content_type
|
def site_content_type
|
||||||
@site_content_type ||= SiteContent.content_types.find {|t| t.content_type == content_type.to_sym}
|
@site_content_type ||= SiteContent.content_types.find {|t| t.content_type == content_type.to_sym}
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
<%= markdown_content(:login_required_welcome_message) %>
|
|
||||||
1
app/views/static/login.html.erb
Normal file
1
app/views/static/login.html.erb
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%= PrettyText.cook(SiteContent.content_for(:login_required)).html_safe %>
|
||||||
@@ -436,6 +436,9 @@ en:
|
|||||||
tos_miscellaneous:
|
tos_miscellaneous:
|
||||||
title: "Terms of Service: Miscellaneous"
|
title: "Terms of Service: Miscellaneous"
|
||||||
description: "The text for the Miscellaneous section of the Terms of Service."
|
description: "The text for the Miscellaneous section of the Terms of Service."
|
||||||
|
login_required:
|
||||||
|
title: "Login Required: Homepage"
|
||||||
|
description: "The text displayed for unauthorized users when login is required on the site."
|
||||||
|
|
||||||
site_settings:
|
site_settings:
|
||||||
default_locale: "The default language of this Discourse instance (ISO 639-1 Code)"
|
default_locale: "The default language of this Discourse instance (ISO 639-1 Code)"
|
||||||
|
|||||||
Reference in New Issue
Block a user