Sha256: cd8d61e4691034a6e4613b7dbb0b6467705c8b1c47d9c4388cc912ee9ad92dc5

Contents?: true

Size: 995 Bytes

Versions: 6

Compression:

Stored size: 995 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 '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

6 entries across 6 versions & 1 rubygems

Version Path
commontator-4.5.3 app/views/commontator/comments/_actions.html.erb
commontator-4.5.2 app/views/commontator/comments/_actions.html.erb
commontator-4.5.1 app/views/commontator/comments/_actions.html.erb
commontator-4.5.0 app/views/commontator/comments/_actions.html.erb
commontator-4.4.1 app/views/commontator/comments/_actions.html.erb
commontator-4.3.0 app/views/commontator/comments/_actions.html.erb