updating user profile pages

This commit is contained in:
Connor Turland 2013-01-07 19:57:04 -05:00
parent a3b74168ce
commit 3ee2921ae4
5 changed files with 37 additions and 6 deletions

View file

@ -56,7 +56,7 @@ var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null,
sliding1 = true;
if (userid != null) {
$('.footer .menu').animate({
height: '252px'
height: '272px'
}, 300, function() {
sliding1 = false;
});

View file

@ -24,8 +24,11 @@ class UsersController < ApplicationController
# GET /user
def show
@user = User.find(params[:id])
@topics = @user.topics.order("created_at").limit(3)
@synapses = @user.synapses.order("created_at").limit(3)
@maps = @user.maps.order("created_at").limit(3)
respond_with(@user)
respond_with(@user, @topics, @synapses, @maps)
end
# POST /user

View file

@ -46,6 +46,7 @@
<li><%= link_to "My Topics", user_topics_url(user) %></li>
<li><%= link_to "My Synapses", user_synapses_url(user) %></li>
<li><%= link_to "My Maps", user_maps_url(user) %></li>
<li><%= link_to "My Profile", user_url(user) %></li>
<li><%= link_to "Invite", invite_path %></li>
<li><%= link_to "Settings", edit_user_url(user) %></li>
<% unless Map.first(:conditions => [ "id = ?", 7]).nil? %>

View file

@ -1,8 +1,24 @@
<%= div_for map do %>
<% if map.user == user %><%= link_to 'Delete', map_path(map), :class => 'delete', :confirm => 'Delete this map (nodes and synapses will remain)?', :method => :delete, :remote => true %><% end %>
<div class="scroll">
<%= link_to map.name, map_path(map), :class => 'title' %>
<div class="desc"><p><%= map.desc %></p><p># of Topics: <%= map.topics.count %></p><p># of Synapses: <%= map.synapses.count %></p></div>
<p class="type">Map</p>
<%= image_tag 'map.png', :class => 'icon', :size => '50x50' %>
<span class="title">
<span><%=map.name %></span>
<a href="/maps/<%=map.id %>" class="topic-go-arrow">
<img class="topic-go-arrow"
title="Go to map"
src="/assets/go-arrow.png" />
</a>
<div class="clearfloat"></div>
</span>
<div class="contributor">
Added by: <a href="/users/<%=map.user.id %>" target="_blank"><%=map.user.name %>
</a>
</div>
<div class="scroll">
<div class="desc">
<p class="mapdata"><%= map.topics.count %> topics and <%= map.synapses.count %> synapses</p>
<p><%= map.desc %></p>
</div>
</div>
<div class="link"><p>Permissions:<%= map.permission %></p></div>
<% end %>

View file

@ -17,6 +17,17 @@
</div>
<div class="clearfloat nodemargin"></div>-->
<h2>Recently Created Topics</h2>
<% @topics.each do |topic| %>
<%= render topic %>
<% end %>
<div class="clearfloat"></div>
<h2>Recently Created Maps</h2>
<% @maps.each do |map| %>
<%= render map %>
<% end %>
<div class="clearfloat"></div>
<h1 class="index">
Viewing Mapper: <%= @user.name %>