]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/diary_entries/_diary_comment.html.erb
Allow admins to unhide diary comments, if they wish
[rails.git] / app / views / diary_entries / _diary_comment.html.erb
index 9ee67534304e2c709582f28c40fc0b1ee5d17f1b..25bdcd96835d54718ae2697e9ec70c79bf90005e 100644 (file)
@@ -9,7 +9,11 @@
   <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") } %>
+      <% if diary_comment.visible? %>
+        <%= 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") } %>
+      <% else %>
+        <%= link_to t(".unhide_link"), unhide_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") } %>
+      <% end %>
     </span>
   <% end %>
 </div>