From 19df96cb77fa80be7c2a5497d0dea8a8b3e2cc68 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Mon, 3 Mar 2014 00:25:47 -0800 Subject: [PATCH] reworked logged in homepage --- app/controllers/main_controller.rb | 12 +++++-- app/views/main/home.html.erb | 57 +++++++++++++++++++----------- 2 files changed, 46 insertions(+), 23 deletions(-) diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index 3ea6cb77..f7e9708a 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -10,10 +10,16 @@ class MainController < ApplicationController # home page def home - @maps = Map.find_all_by_featured(true).shuffle! - @maps = @maps.slice(0,3) + @current = current_user - respond_with(@maps) + if !authenticated? + @maps = Map.find_all_by_featured(true).shuffle! + @maps = @maps.slice(0,3) + elsif authenticated? + @maps = Map.order("updated_at DESC").limit(3) + end + + respond_with(@maps, @current) end # /request diff --git a/app/views/main/home.html.erb b/app/views/main/home.html.erb index ef664bb9..53f3e1da 100644 --- a/app/views/main/home.html.erb +++ b/app/views/main/home.html.erb @@ -15,31 +15,48 @@
-
Welcome to Metamaps
- -
- a home on the web for -
    -
  • building shared knowledge
  • -
  • learning
  • -
  • visioning
  • -
  • conversing
  • -
  • collaborating
  • -
  • sensemaking
  • -
  • innovating
  • -
  • designing
  • -
  • playing
  • -
  • exploring
  • -
-
+
+ <% if !authenticated? %> + Welcome to Metamaps + <% elsif authenticated? %> + Welcome back, <%= @current.name.split[0...1][0] %>! + <% end %>
+ + + <% if !authenticated? %> +
+ a home on the web for +
    +
  • building shared knowledge
  • +
  • learning
  • +
  • visioning
  • +
  • conversing
  • +
  • collaborating
  • +
  • sensemaking
  • +
  • innovating
  • +
  • designing
  • +
  • playing
  • +
  • exploring
  • +
+
+
+ <% end %>

- Request Invite - Learn More -

explore featured maps from our community
+ <% if !authenticated? %> + Request Invite + Learn More + <% end %> +
+ <% if !authenticated? %> + explore featured maps from our community + <% elsif authenticated? %> + explore recently active maps + <% end %> +