removecomments

This commit is contained in:
Andreas Stephanides
2014-10-04 12:09:56 +02:00
parent 6a4d2ff536
commit 6ee1468ce3
19 changed files with 5 additions and 296 deletions

View File

@@ -33,18 +33,5 @@
</div>
</div>
<%= link_to "comment" , new_comment_path( commentable_type: "Beispiel", commentable_id: beispiel.id), remote:true if can? :comment, beispiel %>
<%= link_to "comments:.."+beispiel.comments.count().to_s, comments_path(commentable_type: "Beispiel", commentable_id: beispiel.id), remote:true, id: Comment.switchshowid_for(beispiel) %>
<div id="<%= Comment.formid_for(beispiel) %>">
</div>
<% unless beispiel.comments.roots.empty? %>
<div class="row-fluid">
<div class="span12">
<div id="<%= Comment.wrapid_for(beispiel)%>">
<%= render partial:"comments/comments", object: beispiel.comments.order(:created_at).roots.reverse_order if params[:show_comments] %>
</div>
</div>
</div>
<% end %>
</div>

View File

@@ -1,19 +0,0 @@
<div id="<%= comment.divid %>">
<a class="pull-left media-object" href="#"><%= image_tag comment.thumb_url %></a>
<div class="media-body">
<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>

View File

@@ -1,12 +0,0 @@
<% unless comments.empty? %>
<div class="contentbox" style="border-right:none;border-bottom:none; border-top:none">
<ul class="unstyled media-list">
<% comments.each do |c| %>
<li class="media"><%= render c %></li>
<% end %>
</ul>
</div>
<% if comments.first.root? %>
<%= paginate comments, :remote=>true , :theme=>'twitter-bootstrap'%>
<% end %>
<% end %>

View File

@@ -1,14 +0,0 @@
<div id="<%= form.formid %>">
<%= semantic_form_for form , remote:true, html: {class: "form-inline"} do |f| %>
<%= f.inputs do %>
<%= f.input :commentable_id, as: :hidden %>
<%= f.input :commentable_type, as: :hidden %>
<%= f.input :text, as: :string %>
<%= f.input :anonym %>
<% end %>
<%= f.actions do %>
<%= f.action :submit, :as => :input %>
<% end %>
<% end %>
</div>

View File

@@ -1,6 +0,0 @@
<h1>Editing comment</h1>
<%= render 'form', object: @comment %>
<%= link_to 'Show', @comment %> |
<%= link_to 'Back', comments_path %>

View File

@@ -1,3 +0,0 @@
$("#<%= 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) %>")

View File

@@ -1,22 +0,0 @@
<h1>Listing comments</h1>
<%= render partial:"comments/comments", object: @comments %>
<table>
<tr>
<th></th>
<th></th>
<th></th>
</tr>
<% @comments.each do |comment| %>
<tr>
<td><%= link_to 'Show', comment %></td>
<td><%= link_to 'Edit', edit_comment_path(comment) %></td>
<td><%= link_to 'Destroy', comment, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New Comment', new_comment_path %>

View File

@@ -1,2 +0,0 @@
$("#<%= 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) %>")

View File

@@ -1,5 +0,0 @@
<h1>New comment</h1>
<%= render partial: 'form', object: @comment %>
<%= link_to 'Back', comments_path %>

View File

@@ -1 +0,0 @@
$("#<%= @comment.formid %>").replaceWith("<%= escape_javascript render partial: "form", object: @comment %>")

View File

@@ -1,6 +0,0 @@
<p id="notice"><%= notice %></p>
<%= render @comment %>
<%= link_to 'Edit', edit_comment_path(@comment) %> |
<%= link_to 'Back', comments_path %>