diff --git a/Changelog.md b/Changelog.md index 3e38ebf72..c343a24b0 100644 --- a/Changelog.md +++ b/Changelog.md @@ -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 diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 34428cd4e..e9e84e5c5 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -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 diff --git a/app/views/home/show.html.haml b/app/views/home/show.html.haml index 4680012ac..acfe230c6 100644 --- a/app/views/home/show.html.haml +++ b/app/views/home/show.html.haml @@ -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'