diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 21ee8d15b..eb0b768e2 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -32,6 +32,10 @@ class ApplicationController < ActionController::Base end end + # Overwriting the sign_out redirect path method + def after_sign_out_path_for(resource_or_scope) + logged_out_path + end ##helpers def all_aspects diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 9e0179ecd..51b38d319 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -7,7 +7,7 @@ class UsersController < ApplicationController require File.join(Rails.root, 'lib/diaspora/exporter') require File.join(Rails.root, 'lib/collect_user_photos') - before_filter :authenticate_user!, :except => [:new, :create, :public, :user_photo] + before_filter :authenticate_user!, :except => [:new, :create, :public, :user_photo, :logged_out] respond_to :html @@ -103,6 +103,12 @@ class UsersController < ApplicationController render "users/getting_started" end + def go_mobile + if user_signed_in? + redirect_to root_path + end + end + def getting_started_completed user = current_user user.update_attributes(:getting_started => false) diff --git a/app/views/users/logged_out.haml b/app/views/users/logged_out.haml new file mode 100644 index 000000000..4595bf96e --- /dev/null +++ b/app/views/users/logged_out.haml @@ -0,0 +1,37 @@ +-# Copyright (c) 2010-2011, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + +#grey_header + .container{:style => 'text-align:center;'} + %h2 + = t('.signed_out') + + %h1 + = t('.go_mobile') + +.container{:style => 'text-align:center;'} + %br + %br + %br + %br + %br + %br + %br + %br + %br + + = image_tag 'mobile.jpg', :width => 150, :height => 294 + + %br + %br + %br + + %h4 + = t('.simply_visit') + %strong + = link_to AppConfig[:pod_url], root_url + = t('.on_your_mobile_device') + + %p.dull + = t('.works_on_modern') diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index ed138b60b..a8f04bca5 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -814,6 +814,12 @@ en: users: + logged_out: + signed_out: "You've signed out of Diaspora*" + go_mobile: "Now go mobile." + simply_visit: "Simply visit" + on_your_mobile_device: "on your mobile device to access Diaspora* mobile." + works_on_modern: "Works on all modern smartphones" edit: export_data: "Export Data" close_account: "Close Account" diff --git a/config/routes.rb b/config/routes.rb index 4c72ff89b..64a68efd6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -170,7 +170,9 @@ Diaspora::Application.routes.draw do mount Resque::Server.new, :at => '/resque-jobs' end - # Startpage + # Logout Page (go mobile) + get 'logged_out' => 'users#logged_out', :as => 'logged_out' + # Startpage root :to => 'home#show' end diff --git a/features/logs_in_and_out.feature b/features/logs_in_and_out.feature index baff416dd..77f62a170 100644 --- a/features/logs_in_and_out.feature +++ b/features/logs_in_and_out.feature @@ -13,7 +13,8 @@ Feature: user authentication Given I am signed in And I click on my name in the header And I follow "log out" - Then I should be on the home page + Then I should be on the logged out page + And I should see "Now go mobile." Scenario: user uses token auth Given a user with username "ohai" and password "secret" diff --git a/public/images/mobile.jpg b/public/images/mobile.jpg new file mode 100644 index 000000000..ce56ac387 Binary files /dev/null and b/public/images/mobile.jpg differ diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 056caa20a..de8aa188c 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -3416,3 +3416,19 @@ ul#getting_started :display inline :margin :right 0.5em + +#grey_header + @include box-shadow(0,1px,1px,#eee) + :background + :color #fafafa + :width 100% + :position absolute + :left 0 + :top 0 + :padding + :top 80px + :bottom 20px + :text + :align center + :border + :bottom 1px solid #ddd