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 246a486d718..52d89f0a97e 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 cee9f184c1f..8953b256d60 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 fd69705319f..96031001c24 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 01dfbbad6c7..709147069d5 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 878672b1930..0aaace4a0a5 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 2858cc1f715..564c18ed3f1 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 b4821d015cf..844e2b690f6 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 c2b88918fdb..684437f718e 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 efb7060f75b..7a1f156d337 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 a38c4657c9b..090c178b7b2 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 7d22b6d494b..817a68a374f 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 b52f833d59a..b65ed12d2e6 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 4465bfabee3..92d71881bde 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 c5943b651d5..d16a0285a61 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 98406cfe935..8542330cd6d 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 0f477a5c1ab..889a5dcfafc 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 9e43ca46d7a..c7dbadee6ec 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 2bc726cac34..be23d81ef91 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 04ce28f0f5a..65e22b509ca 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 9ee00d86f82..19ff81cba6a 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 5fbfcf7c1bc..5d81fa8507f 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 22c88d209c7..1f4feca0aee 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 129037d3cce..38cfcd86062 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 e08dfba5467..1555922e289 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 7306d03281c..f92906ae761 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 7dda678028a..8dbaee97c85 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 dee0d8aeade..5515cede5bc 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 025fb2341d6..d139c3660fa 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 20cb14604f4..3f3f926ca84 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 dcde683ae37..63b8c671419 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 14e33964d72..81d82628064 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 8d968fb7f92..47d87095454 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