diff options
author | tony <tony> | 2009-03-25 13:56:37 +0000 |
---|---|---|
committer | tony <tony> | 2009-03-25 13:56:37 +0000 |
commit | b3b99fc645fceb28b426dd3794d98c59dc6ab391 (patch) | |
tree | e75f209d0c005911821089fa8e4dce555d926f1f | |
parent | e14f85eaceb4d5e356889aa1df2827b2675b96de (diff) |
Only show start of messages by default, with JS toggle to see the
remainder.
-rw-r--r-- | app/views/admin_request/show.rhtml | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/app/views/admin_request/show.rhtml b/app/views/admin_request/show.rhtml index 452cbe599..ddab744e9 100644 --- a/app/views/admin_request/show.rhtml +++ b/app/views/admin_request/show.rhtml @@ -1,4 +1,5 @@ <% @title = "FOI request - " + h(@info_request.title) %> +<%= javascript_include_tag :defaults %> <h1><%=@title%></h1> @@ -61,7 +62,18 @@ <tr class="<%= cycle('odd', 'even') %>"> <td><%=h outgoing_message.id %></td> <% for column in OutgoingMessage.content_columns.map { |c| c.name } %> - <td><%= simple_format( outgoing_message.send(column) ) %></td> + + <% if column == 'body' %> + <td> + <div><%= simple_format( truncate(outgoing_message.body, 400, + link_to_function("...", "$(this).up('td').childElements().invoke('toggle')") + )) %></div> + <div style="display:none;"><%= simple_format( outgoing_message.body ) %></div> + </td> + <% else %> + <td><%= simple_format( outgoing_message.send(column) ) %></td> + <% end %> + <% end %> <td> <% form_tag '../resend' do %> @@ -91,7 +103,16 @@ <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><%= simple_format( incoming_message.send(column) ) %></td> + <% if column =~ /^cached_.*?_text$/ %> + <td> + <div><%= simple_format( truncate(incoming_message.send(column), 400, + link_to_function("...", "$(this).up('td').childElements().invoke('toggle')") + )) %></div> + <div style="display:none;"><%= simple_format( incoming_message.send(column) ) %></div> + </td> + <% else %> + <td><%= simple_format( incoming_message.send(column) ) %></td> + <% end %> <% end %> <td> <% if !incoming_message.raw_email_id.nil? %> |