diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index df57d3d288afbc9e85644631e4f086a95fc1cd35..d3bbdf881c30509d5322a6bf51a5d69d2e2a62da 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -13,7 +13,11 @@ class HomeController < ApplicationController redirect_to stream_path end elsif is_mobile_device? - redirect_to user_session_path + unless(File.exist?("#{Rails.root}/app/views/home/_show.mobile.erb")) + redirect_to user_session_path + else + render :show, :layout => 'post' + end else @landing_page = true render :show, :layout => 'post' diff --git a/app/views/layouts/post.html.haml b/app/views/layouts/post.haml similarity index 100% rename from app/views/layouts/post.html.haml rename to app/views/layouts/post.haml diff --git a/lib/tasks/after_deploy.rake b/lib/tasks/after_deploy.rake index b42ea45ee33952ec3a54b25eca38324075f89988..05afc38964b0251d6e73e3a47a0b82fc04916a5f 100644 --- a/lib/tasks/after_deploy.rake +++ b/lib/tasks/after_deploy.rake @@ -2,7 +2,7 @@ desc "revert custom landing page commit after heroku san deploys" task :after_deploy => :environment do # Perform this task only if custom landing page is not present in app/views/home/_show.html.haml - if File.exist?(File.join(Rails.root, "app", "views", "home", "_show.html.erb")) && system("git log | head -5 | grep 'custom\ landing\ page'") + if (File.exist?(File.join(Rails.root, "app", "views", "home", "_show.html.erb")) || File.exist?(File.join(Rails.root, "app", "views", "home", "_show.mobile.erb"))) && system("git log | head -5 | grep 'custom\ landing\ page(s)'") puts "-----> resetting HEAD before custom landing page commit" system("git reset HEAD^") ? true : fail diff --git a/lib/tasks/before_deploy.rake b/lib/tasks/before_deploy.rake index 41cd8a0fd4d64b4a43926fde02f5663e1d81c59e..fcbd7ebf491b0160fcee772c0d2a38101b3757de 100644 --- a/lib/tasks/before_deploy.rake +++ b/lib/tasks/before_deploy.rake @@ -2,16 +2,15 @@ desc "include custom landing page before heroku san deploys" task :before_deploy => :environment do each_heroku_app do |stage| - home_file = stage.config['HOME_FILE'] + home_file = stage.config['HOME_FILE_DESKTOP'] # Perform this task only if custom landing page is not present in app/views/home/_show.html.haml if home_file.present? - puts "-----> custom landing page detected..." - - puts "-----> including custom landing page in a temp commit" + puts "-----> custom landing page(s) detected..." + puts "-----> including custom landing page(s) in a temp commit" @did_not_stash = system("git stash| grep 'No local changes to save'") system("git add #{home_file} -f") ? true : fail - system("git commit -m 'adding custom landing page for heroku'") ? true : fail + system("git commit -m 'adding custom landing page(s) for heroku'") ? true : fail puts "-----> done" end