reworked logged in homepage

This commit is contained in:
Connor Turland 2014-03-03 00:25:47 -08:00
parent 7f5269bb84
commit 19df96cb77
2 changed files with 46 additions and 23 deletions

View file

@ -10,10 +10,16 @@ class MainController < ApplicationController
# home page # home page
def home def home
@current = current_user
if !authenticated?
@maps = Map.find_all_by_featured(true).shuffle! @maps = Map.find_all_by_featured(true).shuffle!
@maps = @maps.slice(0,3) @maps = @maps.slice(0,3)
elsif authenticated?
@maps = Map.order("updated_at DESC").limit(3)
end
respond_with(@maps) respond_with(@maps, @current)
end end
# /request # /request

View file

@ -15,8 +15,16 @@
<div class="home_content"> <div class="home_content">
<div class="home_desc"> <div class="home_desc">
<div class="welcomeTo">Welcome to Metamaps</div> <div class="welcomeTo">
<% if !authenticated? %>
Welcome to Metamaps
<% elsif authenticated? %>
Welcome back, <%= @current.name.split[0...1][0] %>!
<% end %>
</div>
<img id="homeMapImage" src="/assets/metamap128x128.png" width="128" height="128" /> <img id="homeMapImage" src="/assets/metamap128x128.png" width="128" height="128" />
<% if !authenticated? %>
<div class="metamapsIs"> <div class="metamapsIs">
a home on the web for <span class="swapWord"> a home on the web for <span class="swapWord">
<ul class="texts"> <ul class="texts">
@ -33,13 +41,22 @@
</ul> </ul>
</span> </span>
</div> </div>
<% end %>
</div> </div>
<div class="clearfloat"></div> <div class="clearfloat"></div>
<p class="contact"> <p class="contact">
<% if !authenticated? %>
<a href="/request" class="request button">Request Invite</a> <a href="/request" class="request button">Request Invite</a>
<a href="#" class="learnmore button openLightbox" data-open="about">Learn More</a> <a href="#" class="learnmore button openLightbox" data-open="about">Learn More</a>
<div class="featuredMaps">explore featured maps from our community</div> <% end %>
<div class="featuredMaps">
<% if !authenticated? %>
explore featured maps from our community
<% elsif authenticated? %>
explore recently active maps
<% end %>
</div>
</p> </p>
<div class="centeredProfile"> <div class="centeredProfile">