<div id="post_<%= post.id %>" class="post">
  <div class="avatar" rowspan="2">
    <h5>
      <%= link_to post.user, post.user, class: ("admin" if post.user.admin?) %>
    </h5>

    <div class="image">
      <%= image_tag post.user.profile.avatar.url %>  
    </div>

    <% if post.user.team %>
      <strong><%= namelink post.user.team %></strong>
    <% end %>

    <dl>
      <dt>Posts</dt>
      <dd><%= post.user.posts.count %></dd>
      <dt>Location</dt>
      <dd><%= post.user.from %></dd>
      <dt>Joined</dt>
      <dd><%= longdate post.user.created_at %></dd>
    </dl>
  </div>

  <div class="content">
    <div class="header">
      <div class="time">
        <span id="post_<%= post.id %>">
          <%= longertime post.created_at %>
        </span>
      </div>
      <div class="posts">
        <%= link_to "##{post.number(@posts, n)}", "#post_#{post.id}" %>
      </div>
    </div>

    <div class="text">
      <%= post.text_parsed.html_safe %>  
    </div>
  </div>

  <div class="base">
    <div class="user">
      <%= link_to "Send PM", { controller: "messages", action: "new", id: "User", id2: post.user }, class: 'button tiny' %>  
    </div>
    
    <div class="signature">
      <%= post.user.profile.signature_parsed.html_safe if post.user.profile.signature_parsed %>
      
      <div class="controls">
        <% if post.topic.posts.build.can_create? cuser %>
          <%= link_to_function 'Quote Reply', "QuoteText(#{post.id}); $('#reply').fadeIn('slow')", class: 'button tiny' %>
        <% end %>
        <% if post.can_update? cuser %>
          <%= link_to 'Edit', edit_post_path(post), class: 'button tiny' %>
        <% end %>
        <% if post.can_destroy? cuser %>
          <%= link_to 'Delete', post, confirm: 'Are you sure?', method: :delete, class: 'button tiny' %>
        <% end %>
      </div>
    </div>
  </div>
</div>