Skip to content

Instantly share code, notes, and snippets.

@batasrki
Created August 21, 2008 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save batasrki/6608 to your computer and use it in GitHub Desktop.
Save batasrki/6608 to your computer and use it in GitHub Desktop.
<div id="posts" class="module">
<div class="module_head">
<h3 class="module_name"><%= link_to post.title, user_post_path(user,post) %></h3>
<% if @me == @user -%>
<ul class="module_options cx">
<li><%= link_to 'Edit', edit_user_post_path(user, post) %></li>
<li><%= link_to 'Delete', user_post_path(user, post), :method => 'delete', :confirm => 'Are you sure?' %></li>
</ul>
<% end -%>
</div>
<div class="module_content cx">
<%- if full_post %>
<p id="text"><%= post.body %></p>
<% else -%>
<div><%=h white_list post.preview -%></div>
<% end -%>
<small>
<em>Posted </em><%= distance_of_time_in_words_to_now post.created_at %> ago |
<em>Comments: </em><%= post.comments.size %>
</small>
<%= render :partial => 'comments/comment', :collection => post.comments, :locals => { :full_post => full_post, :post => post, :user => user, :logged_in => logged_in, :owner => owner} %>
<%- if logged_in %>
<div>
<%= error_messages_for :comment %>
</div>
<div class="item">
<h4>Post your comment</h4>
<%= render :partial => "comments/new" %>
</div>
<% end -%>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment