FEATURE: /guidelines route will always show our FAQ, ignoring the faq_url site setting

This commit is contained in:
Neil Lalonde 2014-07-10 12:58:34 -04:00
parent 70177fabf5
commit e565ae2528
35 changed files with 137 additions and 29 deletions

View file

@ -11,7 +11,7 @@ Discourse.StaticController = Em.ObjectController.extend({
});
Discourse.StaticController.reopenClass({
PAGES: ['faq', 'tos', 'privacy', 'login'],
PAGES: ['faq', 'tos', 'privacy', 'login', 'guidelines'],
CONFIGS: {
'faq': 'faq_url',
'tos': 'tos_url',

View file

@ -20,6 +20,9 @@ class StaticController < ApplicationController
return redirect_to(url) unless url.blank?
end
# The /guidelines route ALWAYS shows our FAQ, ignoring the faq_url site setting.
page = 'faq' if page == 'guidelines'
# Don't allow paths like ".." or "/" or anything hacky like that
page.gsub!(/[^a-z0-9\_\-]/, '')
@ -35,6 +38,7 @@ class StaticController < ApplicationController
end
if lookup_context.find_all("#{file}.html").any?
@faq_overriden = !SiteSetting.faq_url.blank?
render file, layout: !request.xhr?, formats: [:html]
return
end

View file

@ -1,5 +1,10 @@
<ul class="nav-pills">
<li><a class="active" href="<%=faq_path%>">FAQ</a></li>
<% if @faq_overriden %>
<li><a class="active" href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<% else %>
<li><a class="active" href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<% end %>
<li><a href="<%=tos_path%>">Podmínky používání</a></li>
<li><a href="<%=privacy_path%>">Ochrana soukromí</a></li>
</ul>

View file

@ -1,5 +1,10 @@
<ul class="nav-pills">
<li><a class="active" href="<%=faq_path%>">FAQ</a></li>
<% if @faq_overriden %>
<li><a class="active" href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<% else %>
<li><a class="active" href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<% end %>
<li><a href="<%=tos_path%>">Terms of Service</a></li>
<li><a href="<%=privacy_path%>">Privacy</a></li>
</ul>

View file

@ -1,5 +1,10 @@
<ul class="nav-pills">
<li><a class="active" href="<%=faq_path%>">FAQ</a></li>
<% if @faq_overriden %>
<li><a class="active" href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<% else %>
<li><a class="active" href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<% end %>
<li><a href="<%=tos_path%>">Conditions générales d'utilisation</a></li>
<li><a href="<%=privacy_path%>">Protection des données</a></li>
</ul>

View file

@ -1,5 +1,10 @@
<ul class="nav-pills">
<li><a class="active" href="<%=faq_path%>">자주하는 질문</a></li>
<% if @faq_overriden %>
<li><a class="active" href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<% else %>
<li><a class="active" href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<% end %>
<li><a href="<%=tos_path%>">서비스 이용약관</a></li>
<li><a href="<%=privacy_path%>">개인정보 취급방침</a></li>
</ul>

View file

@ -1,6 +1,11 @@
<div>
<ul class="nav-pills">
<li><a class="active" href="&quot;FAQ&lt;/a"></a></li>
<% if @faq_overriden %>
<li><a class="active" href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<% else %>
<li><a class="active" href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<% end %>
<li><a href="tos">Warunki Korzystania</a></li>
<li><a href="&quot;Polityka" prywatno></a></li>
</ul>

View file

@ -1,5 +1,10 @@
<ul class="nav-pills">
<li><a class="active" href="<%=faq_path%>">FAQ</a></li>
<% if @faq_overriden %>
<li><a class="active" href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<% else %>
<li><a class="active" href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<% end %>
<li><a href="<%=tos_path%>">Termos de Serviço</a></li>
<li><a href="<%=privacy_path%>">Privacidade</a></li>
</ul>

View file

@ -1,5 +1,10 @@
<ul class="nav-pills">
<li><a class="active" href="<%=faq_path%>">FAQ</a></li>
<% if @faq_overriden %>
<li><a class="active" href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<% else %>
<li><a class="active" href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<% end %>
<li><a href="<%=tos_path%>">Условия предоставления услуг</a></li>
<li><a href="<%=privacy_path%>">Конфиденциальность</a></li>
</ul>

View file

@ -1,5 +1,10 @@
<ul class="nav-pills">
<li><a class="active" href="<%=faq_path%>">Часті запитання</a></li>
<% if @faq_overriden %>
<li><a class="active" href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<% else %>
<li><a class="active" href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<% end %>
<li><a href="<%=tos_path%>">Умови Використання</a></li>
<li><a href="<%=privacy_path%>">Приватність</a></li>
</ul>

View file

@ -1,5 +1,10 @@
<ul class="nav-pills">
<li><a class="active" href="/faq">常见问答FAQ</a></li>
<% if @faq_overriden %>
<li><a class="active" href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<% else %>
<li><a class="active" href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<% end %>
<li><a href="/tos">服务条款</a></li>
<li><a href="/privacy">隐私条款</a></li>
</ul>

View file

@ -1,5 +1,8 @@
<ul class="nav-pills">
<li><a href="<%=faq_path%>">FAQ</a></li>
<% if @faq_overriden %>
<li><a href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<% end %>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<li><a href="<%=tos_path%>">Podmínky používání</a></li>
<li><a class="active" href="<%=privacy_path%>">Ochrana soukromí</a></li>
</ul>

View file

@ -1,5 +1,8 @@
<ul class="nav-pills">
<li><a href="<%=faq_path%>">FAQ</a></li>
<% if @faq_overriden %>
<li><a href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<% end %>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<li><a href="<%=tos_path%>">Terms of Service</a></li>
<li><a class="active" href="<%=privacy_path%>">Privacy</a></li>
</ul>

View file

@ -1,5 +1,8 @@
<ul class="nav-pills">
<li><a href="<%=faq_path%>">FAQ</a></li>
<% if @faq_overriden %>
<li><a href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<% end %>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<li><a href="<%=tos_path%>">Conditions générales d'utilisation</a></li>
<li><a class="active" href="<%=privacy_path%>">Protection des données</a></li>
</ul>

View file

@ -1,5 +1,8 @@
<ul class="nav-pills">
<li><a href="<%=faq_path%>">자주하는 질문</a></li>
<% if @faq_overriden %>
<li><a href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<% end %>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<li><a href="<%=tos_path%>">서비스 이용약관</a></li>
<li><a class="active" href="<%=privacy_path%>">개인정보 취급방침</a></li>
</ul>

View file

@ -1,6 +1,9 @@
<div>
<ul class="nav-pills">
<li><a href="&quot;FAQ&lt;/a"></a></li>
<% if @faq_overriden %>
<li><a href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<% end %>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<li><a href="tos">Warunki Korzystania</a></li>
<li><a class="active" href="&quot;Privacy&lt;/a"></a></li>
</ul>

View file

@ -1,5 +1,8 @@
<ul class="nav-pills">
<li><a href="<%=faq_path%>">FAQ</a></li>
<% if @faq_overriden %>
<li><a href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<% end %>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<li><a href="<%=tos_path%>">Termos de Serviço</a></li>
<li><a class="active" href="<%=privacy_path%>">Privacidade</a></li>
</ul>

View file

@ -1,5 +1,8 @@
<ul class="nav-pills">
<li><a href="<%=faq_path%>">FAQ</a></li>
<% if @faq_overriden %>
<li><a href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<% end %>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<li><a href="<%=tos_path%>">Условия предоставления услуг</a></li>
<li><a class="active" href="<%=privacy_path%>">Конфиденциальность</a></li>
</ul>

View file

@ -1,5 +1,8 @@
<ul class="nav-pills">
<li><a href="<%=faq_path%>">Часті запитання</a></li>
<% if @faq_overriden %>
<li><a href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<% end %>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<li><a href="<%=tos_path%>">Умови Використання</a></li>
<li><a class="active" href="<%=privacy_path%>">Приватність</a></li>
</ul>

View file

@ -1,5 +1,8 @@
<ul class="nav-pills">
<li><a href="/faq">常见问答FAQ</a></li>
<% if @faq_overriden %>
<li><a href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<% end %>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<li><a href="/tos">服务条款</a></li>
<li><a class="active" href="/privacy">隐私条款</a></li>
</ul>

View file

@ -1,5 +1,8 @@
<ul class="nav-pills">
<li><a href="<%=faq_path%>">FAQ</a></li>
<% if @faq_overriden %>
<li><a href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<% end %>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<li><a class="active" href="<%=tos_path%>">Podmínky používání</a></li>
<li><a href="<%=privacy_path%>">Ochrana soukromí</a></li>
</ul>

View file

@ -1,5 +1,8 @@
<ul class="nav-pills">
<li><a href="<%=faq_path%>">FAQ</a></li>
<% if @faq_overriden %>
<li><a href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<% end %>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<li><a class="active" href="<%=tos_path%>">Terms of Service</a></li>
<li><a href="<%=privacy_path%>">Privacy</a></li>
</ul>

View file

@ -1,5 +1,8 @@
<ul class="nav-pills">
<li><a href="<%=faq_path%>">FAQ</a></li>
<% if @faq_overriden %>
<li><a href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<% end %>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<li><a class="active" href="<%=tos_path%>">Conditions générales d'utilisation</a></li>
<li><a href="<%=privacy_path%>">Protection des données</a></li>
</ul>

View file

@ -1,5 +1,8 @@
<ul class="nav-pills">
<li><a href="<%=faq_path%>">자주하는 질문</a></li>
<% if @faq_overriden %>
<li><a href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<% end %>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<li><a class="active" href="<%=tos_path%>">서비스 이용약관</a></li>
<li><a href="<%=privacy_path%>">개인정보 취급방침</a></li>
</ul>

View file

@ -1,6 +1,9 @@
<div>
<ul class="tx_dqsymbolnav-pillstx_dqsymbol">
<li><a href="&quot;FAQ&lt;/a"></a></li>
<% if @faq_overriden %>
<li><a href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<% end %>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<li><a class="active" href="&quot;Terms" of service></a></li>
<li><a href="&quot;Privacy&lt;/a"></a></li>
</ul>

View file

@ -1,5 +1,8 @@
<ul class="nav-pills">
<li><a href="<%=faq_path%>">FAQ</a></li>
<% if @faq_overriden %>
<li><a href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<% end %>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<li><a class="active" href="<%=tos_path%>">Terms of Service</a></li>
<li><a href="<%=privacy_path%>">Privacy</a></li>
</ul>

View file

@ -1,5 +1,8 @@
<ul class="nav-pills">
<li><a href="<%=faq_path%>">FAQ</a></li>
<% if @faq_overriden %>
<li><a href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<% end %>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<li><a class="active" href="<%=tos_path%>">Условия предоставления услуг</a></li>
<li><a href="<%=privacy_path%>">Конфиденциальность</a></li>
</ul>

View file

@ -1,5 +1,8 @@
<ul class="nav-pills">
<li><a href="<%=faq_path%>">Часті Питання</a></li>
<% if @faq_overriden %>
<li><a href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<% end %>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<li><a class="active" href="<%=tos_path%>">Умови використання</a></li>
<li><a href="<%=privacy_path%>">Приватність</a></li>
</ul>

View file

@ -1,5 +1,8 @@
<ul class="nav-pills">
<li><a href="/faq">常见问答FAQ</a></li>
<% if @faq_overriden %>
<li><a href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
<% end %>
<li><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
<li><a class="active" href="/tos">服务条款</a></li>
<li><a href="/privacy">隐私条款</a></li>
</ul>

View file

@ -107,6 +107,8 @@ en:
links: Links
faq: "FAQ"
privacy_policy: "Privacy Policy"
privacy: "Privacy"
terms_of_service: "Terms of Service"
mobile_view: "Mobile View"
desktop_view: "Desktop View"
you: "You"

View file

@ -1631,3 +1631,5 @@ en:
color_schemes:
base_theme_name: "Base"
guidelines: "Guidelines"

View file

@ -176,7 +176,7 @@ Discourse::Application.routes.draw do
post "login" => "static#enter"
get "login" => "static#show", id: "login"
get "faq" => "static#show", id: "faq"
get "guidelines" => "static#show", id: "faq"
get "guidelines" => "static#show", id: "guidelines"
get "tos" => "static#show", id: "tos"
get "privacy" => "static#show", id: "privacy"
get "signup" => "list#latest"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

File diff suppressed because one or more lines are too long