- <div class="richtext"><%= diary_comment.body.to_html %></div>
- <% if current_user && current_user.administrator? %>
- <span>
- <%= link_to t('.hide_link'), hide_diary_comment_path(:display_name => diary_comment.diary_entry.user.display_name, :id => diary_comment.diary_entry.id, :comment => diary_comment.id), :method => :post, :data=> { :confirm => t('.confirm') } %>
- </span>
- <% end %>
+ <div class="richtext text-break"><%= diary_comment.body.to_html %></div>
+ <% if can? :hide, DiaryComment %>
+ <span>
+ <% if diary_comment.visible? %>
+ <%= link_to t(".hide_link"), hide_diary_comment_path(diary_comment.diary_entry.user, diary_comment.diary_entry, diary_comment), :method => :post, :data => { :confirm => t(".confirm") } %>
+ <% else %>
+ <%= link_to t(".unhide_link"), unhide_diary_comment_path(diary_comment.diary_entry.user, diary_comment.diary_entry, diary_comment), :method => :post, :data => { :confirm => t(".confirm") } %>
+ <% end %>
+ </span>
+ <% end %>
+ </div>