forked from bofh/fetsite
AutoCommit Sam Aug 1 12:03:01 CEST 2015
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
<div id="<%= comment.divid %>">
|
||||
<div id="<%= divid_for(comment) %>">
|
||||
<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) %>)
|
||||
<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?' }, remote: true %>:
|
||||
<p>
|
||||
<%= comment.text %>
|
||||
@@ -9,9 +11,9 @@
|
||||
<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 id="<%= divid_for(comment,"newform") %>">
|
||||
</div>
|
||||
<%= render partial:"comments/comments", object: comment.children.order(:created_at).reverse_order if comment.children.size >0 %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<% 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 %>
|
||||
<% unless comments.nil? || 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 %>
|
||||
|
||||
13
app/views/comments/_comments_block.html.erb
Normal file
13
app/views/comments/_comments_block.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<%= link_to "Comment" , new_comment_path( commentable_type: comments_block.class.to_s.gsub("::","_"), commentable_id: comments_block.id), remote:true if can? :comment, comments_block %> <%# This is the button to add a new comment %>
|
||||
<%= link_to "comments:.."+ comments_block.comments.count().to_s, comments_path(commentable_type: "Survey_Question", commentable_id: comments_block.id), remote:true, id: Comment.switchshowid_for( comments_block) %> <%# load the comments in the comments block %>
|
||||
<div id="<%= divid_for(comments_block,"newform") %>">
|
||||
</div>
|
||||
<% unless comments_block.comments.roots.empty? %>
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="<%= Comment.wrapid_for( comments_block)%>">
|
||||
<%= render partial:"comments/comments", object: comments_block.comments.order(:created_at).roots.reverse_order if params[:show_comments] %><%# can? fehlt!%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -1,14 +1,14 @@
|
||||
<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 %>
|
||||
|
||||
|
||||
<%= 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>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
$("#<%= Comment.formid_for(@comment.parent) %>").html("")
|
||||
$("#<%= Comment.wrapid_for(@comment.commentable) %>").html("<%= escape_javascript render partial:"comments/comments", object: @comments %>")
|
||||
$("#<%= divid_for(@comment.parent_object,"newform") %>").html("")
|
||||
$("#<%= Comment.wrapid_for(@comment.parent_object) %>").html("<%= escape_javascript render partial:"comments/comments", object: @comments %>")
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
$('#<%= @divid %>').remove()
|
||||
|
||||
$("#<%= Comment.wrapid_for(@commentable) %>").html("<%= escape_javascript render partial:"comments/comments", object: @comments %>")
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
$("#<%= @comment.formid %>").replaceWith("<%= escape_javascript render partial: "form", object: @comment %>")
|
||||
$("#<%= divid_for(@comment.commentable,"newform") %>").html("<%= escape_javascript render partial: "form", object: @comment %>")
|
||||
|
||||
|
||||
@@ -6,20 +6,7 @@
|
||||
|
||||
<%= render @survey_question %>
|
||||
|
||||
<%= link_to "comment" , new_comment_path( commentable_type: "Survey::Question", commentable_id: @survey_question.id), remote:true if can? :comment, @survey_question %>
|
||||
<%= link_to "comments:.."+ @survey_question.comments.count().to_s, comments_path(commentable_type: "Survey_Question", commentable_id: @survey_question.id), remote:true, id: Comment.switchshowid_for( @survey_question) %>
|
||||
<div id="<%= Comment.formid_for( @survey_question) %>">
|
||||
</div>
|
||||
<% unless @survey_question.comments.roots.empty? %>
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="<%= Comment.wrapid_for( @survey_question)%>">
|
||||
<%= render partial:"comments/comments", object: @survey_question.comments.order(:created_at).roots.reverse_order if params[:show_comments] %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= render_comments_for(@survey_question) %>
|
||||
|
||||
<%= link_to 'Edit', edit_survey_question_path(@survey_question) %> |
|
||||
<%= link_to 'Back', survey_questions_path %>
|
||||
|
||||
Reference in New Issue
Block a user