Sha256: 4a0b670b62ee730168584c8ecf9f87d498568bedf6c395b3325f9e36d2374a89

Contents?: true

Size: 992 Bytes

Versions: 2

Compression:

Stored size: 992 Bytes

Contents

<% # Clients of this partial must supply the following variables:
   # comment
   # user
%>

<% can_edit = comment.can_be_edited_by?(user)
   can_delete = comment.can_be_deleted_by?(user) %>

<% if can_edit %>
  <%= link_to t('commontator.comment.actions.edit'),
              commontator.edit_comment_path(comment),
              id: "comment_#{comment.id.to_s}_edit_link",
              class: "comment_edit_link",
              remote: true %>
<% end %>

&nbsp;

<% if can_delete %>
  <% is_deleted = comment.is_deleted? %>
  <% del_string = is_deleted ? 'undelete' : 'delete' %>
  <%= link_to t("commontator.comment.actions.#{del_string}"),
              commontator.polymorphic_path([del_string, comment]),
              confirm: (!is_deleted ? t('commontator.comment.actions.confirm_delete') : nil),
              method: :put,
              id: "comment_#{comment.id.to_s}_#{del_string}_link",
              class: "comment_#{del_string}_link",
              remote: true %>
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
commontator-5.1.0 app/views/commontator/comments/_actions.html.erb
commontator-5.0.0 app/views/commontator/comments/_actions.html.erb