* 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:
0
app/views/comments/create.js.rjs
Normal file
0
app/views/comments/create.js.rjs
Normal file
19
app/views/comments/partials/index/_list.html.erb
Normal file
19
app/views/comments/partials/index/_list.html.erb
Normal 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>
|
||||
|
||||
22
app/views/comments/partials/show/_comment.html.erb
Normal file
22
app/views/comments/partials/show/_comment.html.erb
Normal 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>
|
||||
Reference in New Issue
Block a user