Sha256: 53d457a69724a5636ab49138a9743ddd345afab14e5001788d72860b6c9f7854

Contents?: true

Size: 1.04 KB

Versions: 7

Compression:

Stored size: 1.04 KB

Contents

<div id = "comment_<%= comment.id %>" class = "comment">
	<div class = "comment_body">
		<%= comment.body %>
	</div>
	<p class = "comment_author">By <%= comment.author %></p>

	<%
		deleteMessage = "Are you sure you want to delete this comment?"
		unless comment.children.empty?
			deleteMessage += " Note that this will remove all replies to this "\
			                 "comment as well."
		end

		replyComment = comment.children.build
	%>

	<%= link_to "Reply", "#", class: "reply",
	            data: {
	            	form: "#{render(partial: "proclaim/comments/form", locals: {comment: replyComment, target: target})}",
	            	target: target
	            } %>

	<% if policy(comment).destroy? %>
		<%= link_to "Edit", "#", class: "edit",
	            data: {
	            	form: "#{render(partial: "proclaim/comments/form", locals: {comment: comment})}"
	            } %>
	<% end %>

	<% if policy(comment).destroy? %>
		<%= link_to "Delete", comment, method: :delete, remote: true, class: "delete", data: { confirm: deleteMessage } %>
	<% end %>
</div>

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
proclaim-0.2.2 app/views/proclaim/comments/_comment.html.erb
proclaim-0.2.1 app/views/proclaim/comments/_comment.html.erb
proclaim-0.2.0 app/views/proclaim/comments/_comment.html.erb
proclaim-0.1.3 app/views/proclaim/comments/_comment.html.erb
proclaim-0.1.2 app/views/proclaim/comments/_comment.html.erb
proclaim-0.1.1 app/views/proclaim/comments/_comment.html.erb
proclaim-0.1.0 app/views/proclaim/comments/_comment.html.erb