aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortony <tony>2009-03-25 13:28:05 +0000
committertony <tony>2009-03-25 13:28:05 +0000
commita3fd013b5e43b2dda8e72aaea0a8bb0c803ddff9 (patch)
tree2aeeca1df9730fc9e85fca5382e8c5547e7022be
parentcb92ddd35d598c08498a440f859dfb004cfd9b6a (diff)
Use simple_format() to make text more readable, and wrap YAML in pre
tags.
-rw-r--r--app/views/admin_request/show.rhtml27
1 files changed, 17 insertions, 10 deletions
diff --git a/app/views/admin_request/show.rhtml b/app/views/admin_request/show.rhtml
index eec9092b3..398fe9984 100644
--- a/app/views/admin_request/show.rhtml
+++ b/app/views/admin_request/show.rhtml
@@ -31,8 +31,16 @@
<% for info_request_event in @info_request.info_request_events.find(:all, :order => "created_at, id") %>
<tr class="<%= cycle('odd', 'even') %>">
<td><%=h info_request_event.id %></td>
- <% for column in InfoRequestEvent.content_columns.map { |c| c.name } %>
- <td><%=h info_request_event.send(column) %></td>
+ <% for column in InfoRequestEvent.content_columns %>
+ <td>
+ <% if column.name == 'params_yaml' %>
+ <pre><%= info_request_event.params_yaml %></pre>
+ <% elsif column.text? %>
+ <%=h (info_request_event.send(column.name) || '').gsub(/_/,' ') %>
+ <% else %>
+ <%=h info_request_event.send(column.name) %>
+ <% end %>
+ </td>
<% end %>
</tr>
<% end %>
@@ -42,18 +50,18 @@
<table>
<tr>
- <th>Id</th>
- <% for column in OutgoingMessage.content_columns %>
- <th><%= column.human_name %></th>
- <% end %>
- <th>Actions</th>
+ <th>Id</th>
+ <% for column in OutgoingMessage.content_columns %>
+ <th><%= column.human_name %></th>
+ <% end %>
+ <th>Actions</th>
</tr>
<% for outgoing_message in @info_request.outgoing_messages.find(:all, :order => 'created_at') %>
<tr class="<%= cycle('odd', 'even') %>">
<td><%=h outgoing_message.id %></td>
<% for column in OutgoingMessage.content_columns.map { |c| c.name } %>
- <td><%=h outgoing_message.send(column) %></td>
+ <td><%= simple_format( outgoing_message.send(column) ) %></td>
<% end %>
<td>
<% form_tag '../resend' do %>
@@ -83,12 +91,11 @@
<tr class="<%= cycle('odd', 'even') %>" id="incoming-<%=incoming_message.id.to_s%>">
<td><%=h incoming_message.id %></td>
<% for column in IncomingMessage.content_columns.map { |c| c.name } %>
- <td><%=h incoming_message.send(column) %></td>
+ <td><%= simple_format( incoming_message.send(column) ) %></td>
<% end %>
<td>
<% if !incoming_message.raw_email_id.nil? %>
<p>
-
<%= link_to "View raw email", "../show_raw_email/" + incoming_message.raw_email_id.to_s %>
</p>
<% end %>