move custom splash page login into the controller, fixes #3991

This commit is contained in:
Jonne Haß 2013-02-21 13:45:21 +01:00
parent 125cbef69c
commit 0fd3bcb397
3 changed files with 12 additions and 10 deletions

View file

@ -8,6 +8,7 @@
* exec foreman in ./script/server to replace the process so that we can Ctrl+C it again.
* Include our custom fileuploader on the mobile site too. [#3994](https://github.com/diaspora/diaspora/pull/3994)
* Move custom splash page logic into the controller [#3991](https://github.com/diaspora/diaspora/issues/3991)
# 0.0.3.0

View file

@ -4,16 +4,22 @@
class HomeController < ApplicationController
def show
partial_dir = Rails.root.join('app', 'views', 'home')
if user_signed_in?
redirect_to stream_path
elsif is_mobile_device?
unless(File.exist?(Rails.root.join('app', 'views', 'home', '_show.mobile.erb')))
redirect_to user_session_path
if partial_dir.join('_show.mobile.haml').exist? ||
partial_dir.join('_show.mobile.erb').exist?
render :show, layout: 'post'
else
render :show, :layout => 'post'
redirect_to user_session_path
end
elsif partial_dir.join("_show.html.haml").exist? ||
partial_dir.join("_show.html.erb").exist?
render :show, layout: 'post'
else
render :show, :layout => 'post'
render file: Rails.root.join("public", "default.html"),
layout: 'post'
end
end

View file

@ -6,9 +6,4 @@
- content_for :page_title do
= pod_name
- begin
= render :partial => 'home/show'
- rescue
:erb
<%= File.open(Rails.root.join('public', 'default.html')).read %>
= render :partial => 'home/show'