* Continued work on improving post view templates

* Added statistics-based estimator for related tag calculator
* Fleshed out IpBan class based on changes to Danbooru 1.xx
This commit is contained in:
albert
2010-04-29 17:32:15 -04:00
parent 3666364469
commit 23656e3fa9
39 changed files with 816 additions and 86 deletions

View File

View File

@@ -0,0 +1,19 @@
<div class="comment-section" data-post-id="<%= post.id %>">
<div class="comment-list">
<%= render :partial => "comments/partials/show/comment", :collection => comments %>
</div>
<div class="comment-response">
<p><%= submit_tag "Post comment", :class => "expand-comment-response" %></p>
<div class="comment-preview"></div>
<% form_tag(comments_path) do %>
<%= hidden_field "comment", "post_id", :value => post.id%>
<%= text_area "comment", "body", :size => "60x7" %><br>
<%= submit_tag "Post" %>
<%= submit_tag "Preview" %>
<% end %>
</div>
</div>

View File

@@ -0,0 +1,22 @@
<article data-comment-id="<%= comment.id %>">
<header>
<h1><%= link_to comment.creator_name, user_path(comment.creator_id) %></h1>
<time datetime="<%= comment.created_at %>"><%= time_ago_in_words(comment.created_at) %> ago</time>
</header>
<div>
<section>
<%= format_text(comment.body) %>
</section>
<footer>
<menu>
<li><span class="link">Quote</span></li>
<% if @current_user.is_janitor? || @current_user.id == comment.creator_id %>
<li><%= link_to "Delete", comment_path(comment.id), :confirm => "Do you really want to delete this comment?", :method => :delete %></li>
<% end %>
<li><%= link_to "Vote up", comment_vote_path(comment.id, :is_positive => true), :method => :post %></li>
<li><%= link_to "Vote down", comment_vote_path(comment.id, :is_positive => false), :method => :post %></li>
</menu>
</footer>
</div>
</article>
<div class="clearfix"></div>