app/views/admin_request/_some_annotations.html.erb
<% if comments.any? %>
<%= form_tag modify_comment_visibility_admin_users_path do %>
<div class="accordion" id="comments">
<% comments.each do |comment| %>
<div class="accordion-group">
<div class="accordion-heading accordion-toggle row">
<span class="item-title span6">
<%= check_box_tag 'comment_ids[]', comment.id %>
<a href="#comment_<%= comment.id %>" data-toggle="collapse" data-parent="comments">
<%= chevron_right %>
</a>
<%= both_links(comment) %>
</span>
<span class="item-metadata span6">
<%= both_links(comment.user) %>
<%= arrow_right %>
<%= both_links(comment.info_request) %>
<span class="muted">
--
(<%= admin_date(comment.updated_at, ago_only: true) %>)
</span>
</span>
</div>
<div id="comment_<%= comment.id %>" class="item-detail accordion-body collapse row">
<table class="span12 table table-striped table-condensed">
<tbody>
<tr>
<td colspan="2">
By <%= both_links(comment.user) %>
</td>
</tr>
<tr>
<td colspan="2">
On <%= both_links(comment.info_request) %>
</td>
</tr>
<% comment.for_admin_column(
:body, :visible, :created_at, :updated_at
) do |name, value| %>
<tr>
<td>
<b><%= name.humanize %></b>
</td>
<td>
<% if name == 'body' && !comment.visible %>
<s><%= h comment.send(name) %></s>
<% else %>
<%= h comment.send(name) %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
<% end %>
</div>
<div class="btn-group">
<%= submit_tag 'Hide selected', name: 'hide_selected', class: 'btn' %>
<%= submit_tag 'Unhide selected', name: 'unhide_selected', class: 'btn' %>
</div>
<a href="#" class="select_all btn btn-link" data-state="unchecked" data-target="comment_ids[]">
Select all
</a>
<% end %>
<% else %>
<p>None yet.</p>
<% end %>