aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/helpers/application_helper.rb19
-rw-r--r--app/models/raw_email.rb4
-rw-r--r--app/views/help/api.rhtml2
-rw-r--r--app/views/layouts/default.rhtml4
-rw-r--r--app/views/request/select_authority.rhtml4
5 files changed, 7 insertions, 26 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index ab953cb25..5c856383b 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -77,25 +77,6 @@ module ApplicationHelper
return LanguageNames::get_language_name(locale)
end
- # Use our own algorithm for finding path of cache
- def foi_cache(name = {}, options = nil, &block)
- if @controller.perform_caching
- key = name.merge(:only_path => true)
- key_path = @controller.foi_fragment_cache_path(key)
-
- if @controller.foi_fragment_cache_exists?(key_path)
- cached = @controller.foi_fragment_cache_read(key_path)
- output_buffer.concat(cached)
- return
- end
-
- pos = output_buffer.length
- content = block.call
- @controller.foi_fragment_cache_write(key_path, output_buffer[pos..-1])
- else
- block.call
- end
- end
# (unfortunately) ugly way of getting id of generated form element
# ids
# see http://chrisblunt.com/2009/10/12/rails-getting-the-id-of-form-fields-inside-a-fields_for-block/
diff --git a/app/models/raw_email.rb b/app/models/raw_email.rb
index bae144931..de7978b82 100644
--- a/app/models/raw_email.rb
+++ b/app/models/raw_email.rb
@@ -22,7 +22,7 @@ class RawEmail < ActiveRecord::Base
if request_id.empty?
raise "Failed to find the id number of the associated request: has it been saved?"
end
-
+
if ENV["RAILS_ENV"] == "test"
return File.join(Rails.root, 'files/raw_email_test')
else
@@ -49,7 +49,7 @@ class RawEmail < ActiveRecord::Base
end
def data
- File.open(self.filepath, "rb").read
+ File.open(self.filepath, "r").read
end
def destroy_file_representation!
diff --git a/app/views/help/api.rhtml b/app/views/help/api.rhtml
index 76d2992fb..facddce41 100644
--- a/app/views/help/api.rhtml
+++ b/app/views/help/api.rhtml
@@ -51,11 +51,11 @@
<dd>
<p>Quite a few pages have JSON versions, which let you download information about
objects in a structured form. Find them by:
+ </p>
<ul>
<li>Adding <tt>.json</tt> to the end of the URL. </li>
<li>Look for the <tt>&lt;link rel="alternate" type="application/json"&gt;</tt> tag in the head of the HTML. </li>
</ul>
- </p>
<p>Requests, users and authorities all have JSON versions containing basic
information about them. Every Atom feed has a JSON equivalent, containing
diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml
index 76bdbd2dd..29ff209b9 100644
--- a/app/views/layouts/default.rhtml
+++ b/app/views/layouts/default.rhtml
@@ -140,11 +140,11 @@
</div>
<%
unless Configuration::ga_code.empty? || (@user && @user.super?) %>
- <script>
+ <script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
- <script>
+ <script type="text/javascript">
var pageTracker = _gat._getTracker("<%= Configuration::ga_code %>");
pageTracker._trackPageview();
</script>
diff --git a/app/views/request/select_authority.rhtml b/app/views/request/select_authority.rhtml
index 521136f8e..1166c3ff9 100644
--- a/app/views/request/select_authority.rhtml
+++ b/app/views/request/select_authority.rhtml
@@ -31,7 +31,7 @@
<div id="authority_selection">
<% form_tag({:controller => "request", :action => "select_authority"}, {:id => "search_form", :method => "get"}) do %>
- <p>
+ <div>
<p>
<%= _('First, type in the <strong>name of the UK public authority</strong> you\'d
like information from. <strong>By law, they have to respond</strong>
@@ -40,7 +40,7 @@
<%= text_field_tag 'query', params[:query], { :size => 30 } %>
<%= hidden_field_tag 'bodies', 1 %>
<%= submit_tag _('Search') %>
- </p>
+ </div>
<% end %>
<div id="typeahead_response">
<% if !@xapian_requests.nil? %>