Refactor post preview attributes into one method

This commit is contained in:
Toks
2013-07-11 16:52:42 -04:00
parent 161c7cb4f5
commit ebcc465216
3 changed files with 20 additions and 3 deletions

View File

@@ -5,7 +5,7 @@
<div class="comments-for-post">
<div class="list-of-comments">
<% @comments.each do |comment| %>
<div class="post <%= PostPresenter.preview_class(comment.post) %>" data-tags="<%= comment.post.tag_string %>" data-uploader="<%= comment.post.uploader_name %>" data-rating="<%= comment.post.rating %>" data-flags="<%= comment.post.status %>" data-score="<%= comment.post.score %>" data-fav-count="<%= comment.post.fav_count %>" data-parent-id="<%= comment.post.parent_id %>" data-has-children="<%= comment.post.has_children? %>">
<div class="post <%= PostPresenter.preview_class(comment.post) %>" <%= PostPresenter.preview_attributes(comment.post) %>>
<div class="preview">
<%= link_to(image_tag(comment.post.preview_file_url), post_path(comment.post)) %>
</div>