move custom splash page login into the controller, fixes #3991
This commit is contained in:
parent
125cbef69c
commit
0fd3bcb397
3 changed files with 12 additions and 10 deletions
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
* exec foreman in ./script/server to replace the process so that we can Ctrl+C it again.
|
* 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)
|
* 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
|
# 0.0.3.0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,16 +4,22 @@
|
||||||
|
|
||||||
class HomeController < ApplicationController
|
class HomeController < ApplicationController
|
||||||
def show
|
def show
|
||||||
|
partial_dir = Rails.root.join('app', 'views', 'home')
|
||||||
if user_signed_in?
|
if user_signed_in?
|
||||||
redirect_to stream_path
|
redirect_to stream_path
|
||||||
elsif is_mobile_device?
|
elsif is_mobile_device?
|
||||||
unless(File.exist?(Rails.root.join('app', 'views', 'home', '_show.mobile.erb')))
|
if partial_dir.join('_show.mobile.haml').exist? ||
|
||||||
redirect_to user_session_path
|
partial_dir.join('_show.mobile.erb').exist?
|
||||||
|
render :show, layout: 'post'
|
||||||
else
|
else
|
||||||
render :show, :layout => 'post'
|
redirect_to user_session_path
|
||||||
end
|
end
|
||||||
|
elsif partial_dir.join("_show.html.haml").exist? ||
|
||||||
|
partial_dir.join("_show.html.erb").exist?
|
||||||
|
render :show, layout: 'post'
|
||||||
else
|
else
|
||||||
render :show, :layout => 'post'
|
render file: Rails.root.join("public", "default.html"),
|
||||||
|
layout: 'post'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,4 @@
|
||||||
- content_for :page_title do
|
- content_for :page_title do
|
||||||
= pod_name
|
= pod_name
|
||||||
|
|
||||||
- begin
|
= render :partial => 'home/show'
|
||||||
= render :partial => 'home/show'
|
|
||||||
|
|
||||||
- rescue
|
|
||||||
:erb
|
|
||||||
<%= File.open(Rails.root.join('public', 'default.html')).read %>
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue