diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8ffc2f2e5..09f259778 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -9,7 +9,6 @@ class ApplicationController < ActionController::Base before_filter :set_started_at_session before_filter :api_check before_filter :set_safe_mode - before_filter :check_desktop_mode # before_filter :secure_cookies_check layout "default" force_ssl :if => :ssl_login? @@ -22,12 +21,6 @@ class ApplicationController < ActionController::Base protected - def check_desktop_mode - if params[:dm] - cookies[:dm] = "1" - end - end - def show_moderation_notice? CurrentUser.can_approve_posts? && (cookies[:moderated].blank? || Time.at(cookies[:moderated].to_i) < 20.hours.ago) end diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb index 328777124..0af587503 100644 --- a/app/controllers/static_controller.rb +++ b/app/controllers/static_controller.rb @@ -1,4 +1,6 @@ class StaticController < ApplicationController + before_filter :check_desktop_mode, only: :site_map + def terms_of_service end @@ -14,4 +16,18 @@ class StaticController < ApplicationController def error end + + def site_map + end + + private + + def check_desktop_mode + if params[:dm] + cookies[:dm] = "1" + redirect_to :back + return false + end + end + end diff --git a/app/views/static/_footer.html.erb b/app/views/static/_footer.html.erb index bd2346501..c8e3e0242 100644 --- a/app/views/static/_footer.html.erb +++ b/app/views/static/_footer.html.erb @@ -10,6 +10,6 @@ <% end %> – - <%= link_to "Desktop version", posts_path(:dm => "1"), :rel => "nofollow" %> + <%= link_to "Desktop version", site_map_path(:dm => "1"), :rel => "nofollow" %>