Skip to content
Extraits de code Groupes Projets
Valider 81661c88 rédigé par danielgrippi's avatar danielgrippi
Parcourir les fichiers

custom landing page logic for mobile. yay

parent 132bdd3b
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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'
......
Fichier déplacé
......@@ -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
......
......@@ -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
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter