From e565ae25280129fd963ba980e0ab0d118c763383 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 10 Jul 2014 12:58:34 -0400 Subject: [PATCH] FEATURE: /guidelines route will always show our FAQ, ignoring the faq_url site setting --- .../controllers/static_controller.js | 2 +- app/controllers/static_controller.rb | 4 ++++ app/views/static/faq.cs.html.erb | 7 ++++++- app/views/static/faq.en.html.erb | 7 ++++++- app/views/static/faq.fr.html.erb | 7 ++++++- app/views/static/faq.ko.html.erb | 7 ++++++- app/views/static/faq.pl_PL.html.erb | 7 ++++++- app/views/static/faq.pt_BR.html.erb | 7 ++++++- app/views/static/faq.ru.html.erb | 7 ++++++- app/views/static/faq.uk.html.erb | 7 ++++++- app/views/static/faq.zh_CN.html.erb | 7 ++++++- app/views/static/privacy.cs.html.erb | 5 ++++- app/views/static/privacy.en.html.erb | 5 ++++- app/views/static/privacy.fr.html.erb | 5 ++++- app/views/static/privacy.ko.html.erb | 5 ++++- app/views/static/privacy.pl_PL.html.erb | 5 ++++- app/views/static/privacy.pt_BR.html.erb | 5 ++++- app/views/static/privacy.ru.html.erb | 5 ++++- app/views/static/privacy.uk.html.erb | 5 ++++- app/views/static/privacy.zh_CN.html.erb | 5 ++++- app/views/static/tos.cs.html.erb | 5 ++++- app/views/static/tos.en.html.erb | 5 ++++- app/views/static/tos.fr.html.erb | 5 ++++- app/views/static/tos.ko.html.erb | 5 ++++- app/views/static/tos.pl_PL.html.erb | 5 ++++- app/views/static/tos.pt_BR.html.erb | 5 ++++- app/views/static/tos.ru.html.erb | 5 ++++- app/views/static/tos.uk.html.erb | 5 ++++- app/views/static/tos.zh_CN.html.erb | 5 ++++- config/locales/client.en.yml | 2 ++ config/locales/server.en.yml | 2 ++ config/routes.rb | 2 +- spec/fixtures/images/logo-dev.png | Bin 5394 -> 5506 bytes spec/fixtures/images/logo.png | Bin 2506 -> 2680 bytes test/javascripts/fixtures/static_fixtures.js | 1 + 35 files changed, 137 insertions(+), 29 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/static_controller.js b/app/assets/javascripts/discourse/controllers/static_controller.js index 246a486d7..52d89f0a9 100644 --- a/app/assets/javascripts/discourse/controllers/static_controller.js +++ b/app/assets/javascripts/discourse/controllers/static_controller.js @@ -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', diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb index cee9f184c..8953b256d 100644 --- a/app/controllers/static_controller.rb +++ b/app/controllers/static_controller.rb @@ -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 diff --git a/app/views/static/faq.cs.html.erb b/app/views/static/faq.cs.html.erb index fd6970531..96031001c 100644 --- a/app/views/static/faq.cs.html.erb +++ b/app/views/static/faq.cs.html.erb @@ -1,5 +1,10 @@ diff --git a/app/views/static/faq.en.html.erb b/app/views/static/faq.en.html.erb index 01dfbbad6..709147069 100644 --- a/app/views/static/faq.en.html.erb +++ b/app/views/static/faq.en.html.erb @@ -1,5 +1,10 @@ diff --git a/app/views/static/faq.fr.html.erb b/app/views/static/faq.fr.html.erb index 878672b19..0aaace4a0 100644 --- a/app/views/static/faq.fr.html.erb +++ b/app/views/static/faq.fr.html.erb @@ -1,5 +1,10 @@ diff --git a/app/views/static/faq.ko.html.erb b/app/views/static/faq.ko.html.erb index 2858cc1f7..564c18ed3 100644 --- a/app/views/static/faq.ko.html.erb +++ b/app/views/static/faq.ko.html.erb @@ -1,5 +1,10 @@ diff --git a/app/views/static/faq.pl_PL.html.erb b/app/views/static/faq.pl_PL.html.erb index b4821d015..844e2b690 100644 --- a/app/views/static/faq.pl_PL.html.erb +++ b/app/views/static/faq.pl_PL.html.erb @@ -1,6 +1,11 @@
diff --git a/app/views/static/faq.pt_BR.html.erb b/app/views/static/faq.pt_BR.html.erb index c2b88918f..684437f71 100644 --- a/app/views/static/faq.pt_BR.html.erb +++ b/app/views/static/faq.pt_BR.html.erb @@ -1,5 +1,10 @@ diff --git a/app/views/static/faq.ru.html.erb b/app/views/static/faq.ru.html.erb index efb7060f7..7a1f156d3 100644 --- a/app/views/static/faq.ru.html.erb +++ b/app/views/static/faq.ru.html.erb @@ -1,5 +1,10 @@ diff --git a/app/views/static/faq.uk.html.erb b/app/views/static/faq.uk.html.erb index a38c4657c..090c178b7 100644 --- a/app/views/static/faq.uk.html.erb +++ b/app/views/static/faq.uk.html.erb @@ -1,5 +1,10 @@ diff --git a/app/views/static/faq.zh_CN.html.erb b/app/views/static/faq.zh_CN.html.erb index 7d22b6d49..817a68a37 100644 --- a/app/views/static/faq.zh_CN.html.erb +++ b/app/views/static/faq.zh_CN.html.erb @@ -1,5 +1,10 @@ diff --git a/app/views/static/privacy.cs.html.erb b/app/views/static/privacy.cs.html.erb index b52f833d5..b65ed12d2 100644 --- a/app/views/static/privacy.cs.html.erb +++ b/app/views/static/privacy.cs.html.erb @@ -1,5 +1,8 @@ diff --git a/app/views/static/privacy.en.html.erb b/app/views/static/privacy.en.html.erb index 4465bfabe..92d71881b 100644 --- a/app/views/static/privacy.en.html.erb +++ b/app/views/static/privacy.en.html.erb @@ -1,5 +1,8 @@ diff --git a/app/views/static/privacy.fr.html.erb b/app/views/static/privacy.fr.html.erb index c5943b651..d16a0285a 100644 --- a/app/views/static/privacy.fr.html.erb +++ b/app/views/static/privacy.fr.html.erb @@ -1,5 +1,8 @@ diff --git a/app/views/static/privacy.ko.html.erb b/app/views/static/privacy.ko.html.erb index 98406cfe9..8542330cd 100644 --- a/app/views/static/privacy.ko.html.erb +++ b/app/views/static/privacy.ko.html.erb @@ -1,5 +1,8 @@ diff --git a/app/views/static/privacy.pl_PL.html.erb b/app/views/static/privacy.pl_PL.html.erb index 0f477a5c1..889a5dcfa 100644 --- a/app/views/static/privacy.pl_PL.html.erb +++ b/app/views/static/privacy.pl_PL.html.erb @@ -1,6 +1,9 @@
diff --git a/app/views/static/privacy.pt_BR.html.erb b/app/views/static/privacy.pt_BR.html.erb index 9e43ca46d..c7dbadee6 100644 --- a/app/views/static/privacy.pt_BR.html.erb +++ b/app/views/static/privacy.pt_BR.html.erb @@ -1,5 +1,8 @@ diff --git a/app/views/static/privacy.ru.html.erb b/app/views/static/privacy.ru.html.erb index 2bc726cac..be23d81ef 100644 --- a/app/views/static/privacy.ru.html.erb +++ b/app/views/static/privacy.ru.html.erb @@ -1,5 +1,8 @@ diff --git a/app/views/static/privacy.uk.html.erb b/app/views/static/privacy.uk.html.erb index 04ce28f0f..65e22b509 100644 --- a/app/views/static/privacy.uk.html.erb +++ b/app/views/static/privacy.uk.html.erb @@ -1,5 +1,8 @@ diff --git a/app/views/static/privacy.zh_CN.html.erb b/app/views/static/privacy.zh_CN.html.erb index 9ee00d86f..19ff81cba 100644 --- a/app/views/static/privacy.zh_CN.html.erb +++ b/app/views/static/privacy.zh_CN.html.erb @@ -1,5 +1,8 @@ diff --git a/app/views/static/tos.cs.html.erb b/app/views/static/tos.cs.html.erb index 5fbfcf7c1..5d81fa850 100644 --- a/app/views/static/tos.cs.html.erb +++ b/app/views/static/tos.cs.html.erb @@ -1,5 +1,8 @@ diff --git a/app/views/static/tos.en.html.erb b/app/views/static/tos.en.html.erb index 22c88d209..1f4feca0a 100644 --- a/app/views/static/tos.en.html.erb +++ b/app/views/static/tos.en.html.erb @@ -1,5 +1,8 @@ diff --git a/app/views/static/tos.fr.html.erb b/app/views/static/tos.fr.html.erb index 129037d3c..38cfcd860 100644 --- a/app/views/static/tos.fr.html.erb +++ b/app/views/static/tos.fr.html.erb @@ -1,5 +1,8 @@ diff --git a/app/views/static/tos.ko.html.erb b/app/views/static/tos.ko.html.erb index e08dfba54..1555922e2 100644 --- a/app/views/static/tos.ko.html.erb +++ b/app/views/static/tos.ko.html.erb @@ -1,5 +1,8 @@ diff --git a/app/views/static/tos.pl_PL.html.erb b/app/views/static/tos.pl_PL.html.erb index 7306d0328..f92906ae7 100644 --- a/app/views/static/tos.pl_PL.html.erb +++ b/app/views/static/tos.pl_PL.html.erb @@ -1,6 +1,9 @@
diff --git a/app/views/static/tos.pt_BR.html.erb b/app/views/static/tos.pt_BR.html.erb index 7dda67802..8dbaee97c 100644 --- a/app/views/static/tos.pt_BR.html.erb +++ b/app/views/static/tos.pt_BR.html.erb @@ -1,5 +1,8 @@ diff --git a/app/views/static/tos.ru.html.erb b/app/views/static/tos.ru.html.erb index dee0d8aea..5515cede5 100644 --- a/app/views/static/tos.ru.html.erb +++ b/app/views/static/tos.ru.html.erb @@ -1,5 +1,8 @@ diff --git a/app/views/static/tos.uk.html.erb b/app/views/static/tos.uk.html.erb index 025fb2341..d139c3660 100644 --- a/app/views/static/tos.uk.html.erb +++ b/app/views/static/tos.uk.html.erb @@ -1,5 +1,8 @@ diff --git a/app/views/static/tos.zh_CN.html.erb b/app/views/static/tos.zh_CN.html.erb index 20cb14604..3f3f926ca 100644 --- a/app/views/static/tos.zh_CN.html.erb +++ b/app/views/static/tos.zh_CN.html.erb @@ -1,5 +1,8 @@ diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index dcde683ae..63b8c6714 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -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" diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 14e33964d..81d826280 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1631,3 +1631,5 @@ en: color_schemes: base_theme_name: "Base" + + guidelines: "Guidelines" diff --git a/config/routes.rb b/config/routes.rb index 8d968fb7f..47d870954 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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" diff --git a/spec/fixtures/images/logo-dev.png b/spec/fixtures/images/logo-dev.png index 90aaf71f981a99782eac9d8d0b59935784a6f677..faa984ea5e2e9667939020c1bf9347160458eab2 100644 GIT binary patch delta 131 zcmbQF)ucVan1_KW$=lt9;eUJonf)6LZ-`{8mbgZgq$HN4S|t~y0x1R~149#C19M$N zgAhX_D-#PVQ!`xy6DtFQ<6=u@FfcG6H00)|WTsW(*09Z6Mg^#W!PC{xWt~$(699=~ BCBy&# delta 20 bcmZqDo}@Lwc%$Pr5l#kAS3j3^P6l{6l1dvMU2ix}&cn1H;CC?mvmF3=9kk$sR$z3=CCj3=9n|3=F@3LJcn%7)lKo z7+xhXFj&oCU=S~uvn$Ysfq}6zz$e5Ns9>U_^uz$3i2PA2iP+XuS z$S;^dAfRFY`SlJ81@9C3@6R`QE+``blw(Ztc6Vv&-u&NX^LfTk?AfX%t`Q|Ei6yC4 z$wjF^iowXh&_vh3T-VSb#L&pf#L~*xQrE!5%D_P4^R^Q}0}vW=^HVa@DsgMbT*p@e P)WG2B>gTe~DWM4fV>U}% delta 61 zcmV-D0K)(H6v`8jBLV@2v0;h