pagination update
This commit is contained in:
@@ -1,17 +1,19 @@
|
||||
<div id="<%= comment.divid %>">
|
||||
<a class="pull-left media-object" href="#"><%= image_tag comment.thumb_url %></a>
|
||||
<div class="media-body">
|
||||
<b><%= comment.user.try(:email) %></b> (<%= I18n.l(comment.created_at) %>):
|
||||
|
||||
<b><%= (!comment.anonym) ? comment.user.try(:email) : "Anonym" %></b> (<%= I18n.l(comment.created_at) %>) <%= link_to ffi1_icon("remove9"), comment, method: :delete, data: { confirm: 'Are you sure?' } %>:
|
||||
<p><%= comment.text %>
|
||||
<% if can?(:comment, comment.commentable) %>
|
||||
<br><%= link_to "comment" , new_comment_path( commentable_type: "Comment", commentable_id: comment.id), remote:true %>
|
||||
<% end %>
|
||||
</p>
|
||||
<div id="<%= Comment.formid_for(comment) %>">
|
||||
</div>
|
||||
|
||||
<%= render partial:"comments/comments", object: comment.children.order(:created_at).reverse_order if comment.children.size >0 %>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="<%= Comment.formid_for(comment) %>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,4 +6,7 @@
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% if comments.first.root? %>
|
||||
<%= paginate comments, :remote=>true , :theme=>'twitter-bootstrap'%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
3
app/views/comments/hide.js.erb
Normal file
3
app/views/comments/hide.js.erb
Normal file
@@ -0,0 +1,3 @@
|
||||
$("#<%= Comment.wrapid_for(@commentable) %>").html("<%= escape_javascript "" %>")
|
||||
|
||||
$("#<%= Comment.switchshowid_for(@commentable) %>").attr("href","<%= escape_javascript comments_path(commentable_type: @commentable.class.to_s, commentable_id: @commentable.id) %>")
|
||||
@@ -1,4 +1,5 @@
|
||||
<h1>Listing comments</h1>
|
||||
<%= render partial:"comments/comments", object: @comments %>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
2
app/views/comments/index.js.erb
Normal file
2
app/views/comments/index.js.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
$("#<%= Comment.wrapid_for(@commentable) %>").html("<%= escape_javascript render partial:"comments/comments", object: @comments %>")
|
||||
$("#<%= Comment.switchshowid_for(@commentable) %>").attr("href","<%= escape_javascript hide_comments_path(commentable_type: @commentable.class.to_s, commentable_id: @commentable.id) %>")
|
||||
Reference in New Issue
Block a user