diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/incoming_message.rb | 11 | ||||
-rw-r--r-- | app/views/request/_view_html_prefix.rhtml | 7 |
2 files changed, 16 insertions, 2 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 43fec24c1..061469448 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -19,7 +19,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: incoming_message.rb,v 1.216 2009-09-08 23:48:29 francis Exp $ +# $Id: incoming_message.rb,v 1.217 2009-09-09 14:40:31 francis Exp $ # TODO # Move some of the (e.g. quoting) functions here into rblib, as they feel @@ -333,6 +333,15 @@ class FOIAttachment end return false end + + # Name of type of attachment type - only valid for things that has_body_as_html? + def name_of_content_type + if self.content_type == 'application/vnd.ms-word' + return "Word document" + elsif self.content_type == 'application/pdf' + return "PDF file" + end + end end class IncomingMessage < ActiveRecord::Base diff --git a/app/views/request/_view_html_prefix.rhtml b/app/views/request/_view_html_prefix.rhtml index f62291725..486b62d5d 100644 --- a/app/views/request/_view_html_prefix.rhtml +++ b/app/views/request/_view_html_prefix.rhtml @@ -1,7 +1,12 @@ <div class="view_html_prefix"> + <div class="view_html_logo"> + <a href="/"><img src="/images/navimg/logo-trans-small.png" alt="WhatDotheyKnow?"></a> + </div> <div class="view_html_download_link"> <%=link_to "Download original attachment", @attachment_url %> + <br>(<%=h @attachment.name_of_content_type %>) </div> - Attachment to FOI request '<%=link_to h(@info_request.title), incoming_message_url(@incoming_message)%>' (HTML version) + This is an HTML version of an attachment to the Freedom of Information request + '<%=link_to h(@info_request.title), incoming_message_url(@incoming_message)%>'. </div> |