custom landing page logic for mobile. yay
This commit is contained in:
parent
132bdd3bc5
commit
81661c883f
4 changed files with 10 additions and 7 deletions
|
|
@ -13,7 +13,11 @@ class HomeController < ApplicationController
|
||||||
redirect_to stream_path
|
redirect_to stream_path
|
||||||
end
|
end
|
||||||
elsif is_mobile_device?
|
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
|
else
|
||||||
@landing_page = true
|
@landing_page = true
|
||||||
render :show, :layout => 'post'
|
render :show, :layout => 'post'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ desc "revert custom landing page commit after heroku san deploys"
|
||||||
task :after_deploy => :environment do
|
task :after_deploy => :environment do
|
||||||
|
|
||||||
# Perform this task only if custom landing page is not present in app/views/home/_show.html.haml
|
# 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"
|
puts "-----> resetting HEAD before custom landing page commit"
|
||||||
|
|
||||||
system("git reset HEAD^") ? true : fail
|
system("git reset HEAD^") ? true : fail
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,15 @@ desc "include custom landing page before heroku san deploys"
|
||||||
task :before_deploy => :environment do
|
task :before_deploy => :environment do
|
||||||
|
|
||||||
each_heroku_app do |stage|
|
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
|
# Perform this task only if custom landing page is not present in app/views/home/_show.html.haml
|
||||||
if home_file.present?
|
if home_file.present?
|
||||||
puts "-----> custom landing page detected..."
|
puts "-----> custom landing page(s) detected..."
|
||||||
|
puts "-----> including custom landing page(s) in a temp commit"
|
||||||
puts "-----> including custom landing page in a temp commit"
|
|
||||||
|
|
||||||
@did_not_stash = system("git stash| grep 'No local changes to save'")
|
@did_not_stash = system("git stash| grep 'No local changes to save'")
|
||||||
system("git add #{home_file} -f") ? true : fail
|
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"
|
puts "-----> done"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue