Sha256: c7af360a0fd4407da34c782d3d5187578bbea02b1b4de5ef20d3c0934314416c

Contents?: true

Size: 1.03 KB

Versions: 12

Compression:

Stored size: 1.03 KB

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 del_string.capitalize,
              commontator.polymorphic_path([del_string, comment]),
              :confirm => (!is_deleted ? \
                            "Are you sure you want to delete this " + \
                            "#{@thread.config.comment_name}?" : nil),
              :method => :put,
              :id => "comment_#{comment.id.to_s}_#{del_string}_link",
              :class => "comment_#{del_string}_link",
              :remote => true %>
<% end %>

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
commontator-1.1.1 app/views/commontator/comments/_actions.html.erb~
commontator-1.1.0 app/views/commontator/comments/_actions.html.erb~
commontator-1.0.6 app/views/commontator/comments/_actions.html.erb~
commontator-1.0.5 app/views/commontator/comments/_actions.html.erb~
commontator-1.0.4 app/views/commontator/comments/_actions.html.erb~
commontator-1.0.3 app/views/commontator/comments/_actions.html.erb~
commontator-1.0.2 app/views/commontator/comments/_actions.html.erb~
commontator-1.0.1 app/views/commontator/comments/_actions.html.erb~
commontator-1.0.0 app/views/commontator/comments/_actions.html.erb~
commontator-0.5.14 app/views/commontator/comments/_actions.html.erb~
commontator-0.5.13 app/views/commontator/comments/_actions.html.erb~
commontator-0.5.12 app/views/commontator/comments/_actions.html.erb~