diff options
author | tony <tony> | 2009-03-25 13:34:40 +0000 |
---|---|---|
committer | tony <tony> | 2009-03-25 13:34:40 +0000 |
commit | e14f85eaceb4d5e356889aa1df2827b2675b96de (patch) | |
tree | ed56883b64c46788ae7c96ecba6f806703045351 | |
parent | f12a7788b569fa26d3ab710741ea86ae8616b6e7 (diff) |
Only show censor rules table if there are some.
-rw-r--r-- | app/views/admin_censor_rule/_show.rhtml | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/app/views/admin_censor_rule/_show.rhtml b/app/views/admin_censor_rule/_show.rhtml index 4d6432a9e..112715301 100644 --- a/app/views/admin_censor_rule/_show.rhtml +++ b/app/views/admin_censor_rule/_show.rhtml @@ -1,25 +1,29 @@ -<table> - <tr> - <th>Id</th> - <% for column in CensorRule.content_columns %> - <th><%= column.human_name %></th> - <% end %> - <th>Actions</th> - </tr> +<% if censor_rules.size > 0 %> + <table> + <tr> + <th>Id</th> + <% for column in CensorRule.content_columns %> + <th><%= column.human_name %></th> + <% end %> + <th>Actions</th> + </tr> -<% for censor_rule in censor_rules %> - <tr class="<%= cycle('odd', 'even') %>"> - <td><%=h censor_rule.id %></td> - <% for column in CensorRule.content_columns.map { |c| c.name } %> - <td><%=h censor_rule.send(column) %></td> + <% for censor_rule in censor_rules %> + <tr class="<%= cycle('odd', 'even') %>"> + <td><%=h censor_rule.id %></td> + <% for column in CensorRule.content_columns.map { |c| c.name } %> + <td><%=h censor_rule.send(column) %></td> + <% end %> + <td> + <%= link_to "Edit", '../../censor/edit/' + censor_rule.id.to_s %> + </td> + </tr> <% end %> - <td> - <%= link_to "Edit", '../../censor/edit/' + censor_rule.id.to_s %> - </td> - </tr> + </table> +<% else %> + <p>None yet.</p> <% end %> -</table> <p> <%= link_to "New censor rule", '../../censor/new?info_request_id=' + info_request.id.to_s %> |