reworked logged in homepage
This commit is contained in:
parent
7f5269bb84
commit
19df96cb77
2 changed files with 46 additions and 23 deletions
|
@ -10,10 +10,16 @@ class MainController < ApplicationController
|
|||
|
||||
# home page
|
||||
def home
|
||||
@current = current_user
|
||||
|
||||
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)
|
||||
respond_with(@maps, @current)
|
||||
end
|
||||
|
||||
# /request
|
||||
|
|
|
@ -15,8 +15,16 @@
|
|||
|
||||
<div class="home_content">
|
||||
<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" />
|
||||
|
||||
<% if !authenticated? %>
|
||||
<div class="metamapsIs">
|
||||
a home on the web for <span class="swapWord">
|
||||
<ul class="texts">
|
||||
|
@ -33,13 +41,22 @@
|
|||
</ul>
|
||||
</span>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="clearfloat"></div>
|
||||
|
||||
<p class="contact">
|
||||
<% if !authenticated? %>
|
||||
<a href="/request" class="request button">Request Invite</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>
|
||||
|
||||
<div class="centeredProfile">
|
||||
|
|
Loading…
Reference in a new issue