aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortony <tony>2009-03-25 13:32:16 +0000
committertony <tony>2009-03-25 13:32:16 +0000
commitf12a7788b569fa26d3ab710741ea86ae8616b6e7 (patch)
treeacf46ab1bda5a3cbed2ff4b35ec56c510abf8162
parenta3fd013b5e43b2dda8e72aaea0a8bb0c803ddff9 (diff)
Don't show annotations table if there aren't any
-rw-r--r--app/views/admin_request/show.rhtml56
1 files changed, 31 insertions, 25 deletions
diff --git a/app/views/admin_request/show.rhtml b/app/views/admin_request/show.rhtml
index 398fe9984..452cbe599 100644
--- a/app/views/admin_request/show.rhtml
+++ b/app/views/admin_request/show.rhtml
@@ -107,37 +107,43 @@
<h2>Annotations</h2>
-<table>
- <tr>
- <th>Id</th>
- <th>Posted by</th>
- <% for column in Comment.content_columns %>
- <th><%= column.human_name %></th>
- <% end %>
- <th>Actions</th>
- </tr>
-
-<% for comment in @info_request.comments %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%=h comment.id %></td>
- <td><%= user_both_links(comment.user) %></td>
- <% for column in Comment.content_columns.map { |c| c.name } %>
- <% if column == 'body' && !comment.visible %>
- <td><s><%=h comment.send(column) %></s></td>
- <% else %>
- <td><%=h comment.send(column) %></td>
+<% if @info_request.comments.size > 0 %>
+ <table>
+ <tr>
+ <th>Id</th>
+ <th>Posted by</th>
+ <% for column in Comment.content_columns %>
+ <th><%= column.human_name %></th>
<% end %>
+ <th>Actions</th>
+ </tr>
+
+ <% for comment in @info_request.comments %>
+ <tr class="<%= cycle('odd', 'even') %>">
+ <td><%=h comment.id %></td>
+ <td><%= user_both_links(comment.user) %></td>
+ <% for column in Comment.content_columns.map { |c| c.name } %>
+ <% if column == 'body' && !comment.visible %>
+ <td><s><%=h comment.send(column) %></s></td>
+ <% else %>
+ <td><%=h comment.send(column) %></td>
+ <% end %>
+ <% end %>
+ <td>
+ <%= link_to "Edit", '../edit_comment/' + comment.id.to_s %>
+ </td>
+ </tr>
<% end %>
- <td>
- <%= link_to "Edit", '../edit_comment/' + comment.id.to_s %>
- </td>
- </tr>
+ </table>
+<% else %>
+ <p>None yet.</p>
<% end %>
-</table>
+
+
<h2>Exim delivery logs</h2>
-<p>Lines containing the request incoming email address, updated hourly.</p>
+<p><i>(Lines containing the request incoming email address, updated hourly.)</i></p>
<% for exim_log_done_id, exim_logs in @info_request.exim_logs.group_by(&:exim_log_done_id) %>
<!-- <h3><%=h exim_logs[0].exim_log_done.filename %></h3> -->