mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 23:06:57 +08:00
Merge pull request #959 from chrishunt/chrishunt/login-required-fixes
'login required' site setting improvements
This commit is contained in:
commit
2509d0f4fa
|
@ -139,7 +139,11 @@ Discourse.LoginController = Discourse.Controller.extend(Discourse.ModalFunctiona
|
|||
}
|
||||
// Reload the page if we're authenticated
|
||||
if (options.authenticated) {
|
||||
window.location.reload();
|
||||
if (window.location.pathname === '/login') {
|
||||
window.location.pathname = '/';
|
||||
} else {
|
||||
window.location.reload();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ class SiteContent < ActiveRecord::Base
|
|||
add_content_type :education_new_reply, default_18n_key: 'education.new-reply'
|
||||
add_content_type :tos_user_content_license, default_18n_key: 'terms_of_service.user_content_license'
|
||||
add_content_type :tos_miscellaneous, default_18n_key: 'terms_of_service.miscellaneous'
|
||||
add_content_type :login_required_welcome_message, default_18n_key: 'login_required.welcome_message'
|
||||
|
||||
def site_content_type
|
||||
@site_content_type ||= SiteContent.content_types.find {|t| t.content_type == content_type.to_sym}
|
||||
|
|
|
@ -1,13 +1 @@
|
|||
<ul class="nav-pills">
|
||||
<li><a class='active' href="<%=login_path%>">Welcome</a></li>
|
||||
<li><a href="<%=faq_path%>">FAQ</a></li>
|
||||
<li><a href="<%=tos_path%>">Terms of Service</a></li>
|
||||
<li><a href="<%=privacy_path%>">Privacy</a></li>
|
||||
</ul>
|
||||
|
||||
<h2><a href="#welcome">Welcome to <%= SiteSetting.title %></a></h2>
|
||||
|
||||
<p>
|
||||
We are excited to have you participate in <%= SiteSetting.title %>. Please
|
||||
create an account or login to continue.
|
||||
</p>
|
||||
<%= markdown_content(:login_required_welcome_message) %>
|
||||
|
|
|
@ -405,6 +405,12 @@ en:
|
|||
welcome_invite:
|
||||
title: "Welcome: Invited User"
|
||||
description: "A private message automatically sent to all new invited users when they accept the invitation from another user to participate."
|
||||
|
||||
login_required_welcome_message:
|
||||
title: "Login Required: Welcome Message"
|
||||
description: "Welcome message that is displayed to logged out users when
|
||||
the 'login required' setting is enabled."
|
||||
|
||||
tos_user_content_license:
|
||||
title: "Terms of Service: Content License"
|
||||
description: "The text for the Content License section of the Terms of Service."
|
||||
|
@ -978,6 +984,11 @@ en:
|
|||
search_title: "Search for this topic"
|
||||
search_google: "Search Google"
|
||||
|
||||
login_required:
|
||||
welcome_message: |
|
||||
#[Welcome to %{title}](#welcome)
|
||||
We are excited to have you participate in %{title}. Please create an account or login to continue.
|
||||
|
||||
terms_of_service:
|
||||
user_content_license: |
|
||||
User contributions are licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License](http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_US). Without limiting any of those representations or warranties, %{company_short_name} has the right (though not the obligation) to, in %{company_short_name}’s sole discretion (i) refuse or remove any content that, in %{company_short_name}’s reasonable opinion, violates any %{company_short_name} policy or is in any way harmful or objectionable, or (ii) terminate or deny access to and use of the Website to any individual or entity for any reason, in %{company_short_name}’s sole discretion. %{company_short_name} will have no obligation to provide a refund of any amounts previously paid.
|
||||
|
|
Loading…
Reference in New Issue
Block a user