<div class = "container">
<% @title=@user.name+"'s Portfolios" %>
<% @description=""%>
<div class= "whiteSpace span12"></div>
<div class="row">
  <div class="span6">
    <%= link_to "Send a message",new_message_path(:send_to => @user.id),:class=>"btn btn-primary" %>
    <br>
    <%= image_tag @user.picture.url(:medium), :class=>"bordz"%>
    <div class="whiteSpace"></div>
    Check me out in my leagues:
    <% portfolios = Portfolio.where("user_id = ?",@user.id) %>
    <% if portfolios %>
    <% league_ids = [] %>
    <% for portfolio in portfolios %>
    <%   league_ids.push(portfolio.league_id) %>
    <% end %>
    <% for league_id in league_ids %>
      <div><a href="<%=league_path(league_id)%>"><%= League.find(league_id).name %></a></div>
    <% end %>
    <% end %>
  </div>
  <div class="span6">
    <h2>Comments</h2>
    <div class="whiteSpace"></div>
    <div class="input-append">
      <%= form_for(Comment.new) do |f| %>
        <% if @focus %>
          <%= f.text_field :comment, :autofocus => true %>
        <% else %>
          <%= f.text_field :comment %>
        <% end %>
        <%= f.hidden_field :location_id, :value => @user.id %>
        <%= f.hidden_field :comment_type, :value => 2 %>
        <%= f.submit "Send", :class=>"btn" %>
      <% end %>
    </div>
    <% for comment in Comment.where("location_id = ? AND comment_type = ?", @user.id, 2).reverse[0,20] %>
    <% @curUser = User.find(comment.user_id)  %>
<div class="post-container">                
  <div class="post-thumb"><%= link_to image_tag(@curUser.picture.url(:tiny),:class=>"rounded"),user_path(@curUser.id) %></div>
  <div class="post-content">
    <h4 class="fleft"><%=@curUser.name%></h4><h5 class="fright"><%= comment.posted_at.strftime("%b %d %I:%M%p") %></h5><br>
    <p class="commentFix"><%=comment.comment%></p>
  </div>
</div>
<div class="fivePix fixwidth"></div>
    <% end %>
</div>  
</div>
</div>


