aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/general
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/general')
-rw-r--r--app/views/general/_before_body_end.rhtml16
-rw-r--r--app/views/general/_credits.rhtml5
-rw-r--r--app/views/general/_locale_switcher.rhtml12
-rw-r--r--app/views/general/_orglink.rhtml2
-rw-r--r--app/views/general/custom_css.rhtml1
-rw-r--r--app/views/general/frontpage.rhtml25
-rw-r--r--app/views/general/search.rhtml72
7 files changed, 86 insertions, 47 deletions
diff --git a/app/views/general/_before_body_end.rhtml b/app/views/general/_before_body_end.rhtml
new file mode 100644
index 000000000..8d7ebeeb5
--- /dev/null
+++ b/app/views/general/_before_body_end.rhtml
@@ -0,0 +1,16 @@
+<% if MySociety::Config.get("DOMAIN", '127.0.0.1:3000') == 'www.whatdotheyknow.com' %>
+<!-- Piwik -->
+<script type="text/javascript">
+var pkBaseURL = (("https:" == document.location.protocol) ? "https://piwik.mysociety.org/" : "http://piwik.mysociety.org/");
+document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
+</script><script type="text/javascript">
+try {
+var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 4);
+piwikTracker.trackPageView();
+piwikTracker.enableLinkTracking();
+} catch( err ) {}
+</script><noscript><p><img src="http://piwik.mysociety.org/piwik.php?idsite=4" style="border:0" alt=""/></p></noscript>
+<!-- End Piwik Tag -->
+<% end %>
+
+
diff --git a/app/views/general/_credits.rhtml b/app/views/general/_credits.rhtml
new file mode 100644
index 000000000..a2f7a9cb2
--- /dev/null
+++ b/app/views/general/_credits.rhtml
@@ -0,0 +1,5 @@
+|
+ Built by <a href="http://www.mysociety.org/">mySociety</a> ...
+ <a href="/help/credits#helpus">and you</a>
+ |
+ Dedicated to <a href="http://mk.ucant.org/archives/000129.html">Chris Lightfoot</a>
diff --git a/app/views/general/_locale_switcher.rhtml b/app/views/general/_locale_switcher.rhtml
new file mode 100644
index 000000000..4f01a4d13
--- /dev/null
+++ b/app/views/general/_locale_switcher.rhtml
@@ -0,0 +1,12 @@
+ <% if FastGettext.default_available_locales.length > 1 %>
+ <div id="user_locale_switcher">
+ Language:
+ <% for possible_locale in FastGettext.default_available_locales %>
+ <% if possible_locale == I18n.locale.to_s %>
+ <%= possible_locale %>
+ <% else %>
+ <a href="<%= locale_switcher(possible_locale, params) %>"><%= possible_locale %></a>
+ <% end %>
+ <% end %>
+ </div>
+ <% end %>
diff --git a/app/views/general/_orglink.rhtml b/app/views/general/_orglink.rhtml
new file mode 100644
index 000000000..551b18646
--- /dev/null
+++ b/app/views/general/_orglink.rhtml
@@ -0,0 +1,2 @@
+<%-# Put the link to your organisation here, or leave blank -%>
+<a href="http://www.mysociety.org">a site by mysociety.org</a>
diff --git a/app/views/general/custom_css.rhtml b/app/views/general/custom_css.rhtml
new file mode 100644
index 000000000..0def82ed0
--- /dev/null
+++ b/app/views/general/custom_css.rhtml
@@ -0,0 +1 @@
+// this should be overridden in a local "theme" plugin
diff --git a/app/views/general/frontpage.rhtml b/app/views/general/frontpage.rhtml
index 51bf55e34..276ac70a7 100644
--- a/app/views/general/frontpage.rhtml
+++ b/app/views/general/frontpage.rhtml
@@ -1,25 +1,28 @@
<% view_cache :ttl => 5.minutes do %>
<div id="frontpage_search">
- <h1>Make or explore Freedom of Information requests</h1>
+ <h1><%= _('Make or explore Freedom of Information requests') %></h1>
<% form_tag({:action => "search_redirect"}, {:id => "search_form"}) do %>
<p>
- First, type in the <strong>name of the UK public authority</strong> you'd
+ <%= _('First, type in the <strong>name of the UK public authority</strong> you\'d
<br>like information from. <strong>By law, they have to respond</strong>
- (<a href="/help/about">why?</a>).
+ (<a href="%s">why?</a>).') % help_about_url %>
<br>
<br>
<%= text_field_tag 'query', params[:query], { :size => 30 } %>
<%= hidden_field_tag 'bodies', 1 %>
- <%= submit_tag "Search" %>
+ <%= submit_tag _('Search') %>
<br>
- e.g. <%=link_to 'Liverpool', search_url('liverpool', 'bodies')%>, <%=link_to 'MRSA', search_url('mrsa', 'bodies')%>, <%=link_to 'Treasury', search_url('treasury', 'bodies')%>
+ <%= _('e.g.') %>
+ <% @popular_bodies.each_with_index do |body, i| %>
+ <%=link_to body.name, search_url(body.name, 'bodies')%><% if i < 2 %>, <% else %>. <% break %><% end %>
+ <% end %>
<br>
<br>
- OR, <strong>search</strong> for information others have requested using WhatDoTheyKnow.com
+ <%= _('OR, <strong>search</strong> for information others have requested using {{site_name}}', :site_name => site_name) %>
</p>
<% end %>
</div>
@@ -27,15 +30,15 @@
<div id="frontpage_examples">
<% if @popular_bodies.size > 0 %>
<div id="examples_0">
- <ul>
+ <ul>
<% for popular_body in @popular_bodies %>
<li><%=public_body_link(popular_body)%>
- <%=h popular_body.info_requests.count%> requests
+ <%= n_('%d request', '%d requests', popular_body.info_requests.count) % popular_body.info_requests.count %>
</li>
<% end%>
</ul>
<p><strong>
- <%= link_to "More authorities...", list_public_bodies_default %>
+ <%= link_to _('More authorities...'), list_public_bodies_default %>
</strong></p>
</div>
<% end %>
@@ -45,11 +48,11 @@
<ul>
<% for event in @successful_request_events %>
<li><%=link_to h(excerpt(event.info_request.title, "", 30)), request_url(event.info_request)%>
- <%=h time_ago_in_words(event.described_at).gsub("about ", "") %> ago
+ <%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(event.described_at)) %>
</li>
<% end %>
</ul>
- <p><strong><a href="/list/successful">More successful requests...</a></strong></p>
+ <p><strong><%=link_to _('More successful requests...'), request_list_successful_url %></strong></p>
</div>
<% end %>
</div>
diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml
index 29ce73d5c..876d54270 100644
--- a/app/views/general/search.rhtml
+++ b/app/views/general/search.rhtml
@@ -1,21 +1,20 @@
<% @show_tips = @xapian_requests.nil? || (@total_hits == 0) %>
<% if @query.nil? %>
- <% @title = "Search Freedom of Information requests, public authorities and users" %>
+ <% @title = _("Search Freedom of Information requests, public authorities and users") %>
<h1><%=@title%></h1>
<% elsif @total_hits == 0 %>
- <% @title = "Nothing found for '" + h(@query) + "'" %>
+ <%= _("Nothing found for '{{search_terms}}'", :search_terms => h(@query)) %>
<% else %>
- <% @title = "Results page " + @page.to_s %>
+ <% @title = _("Results page {{page_number}}", :page_number => @page.to_s) %>
<% end%>
<% @include_request_link_in_authority_listing = true %>
<% if @bodies && (@page == 1 || @xapian_bodies.results.size > 0) %>
<div id="stepwise_instructions">
- <p><strong>Next, select the public authority you'd like to make the request from.</strong></p>
- <p>Can't find it? <%= link_to "Browse all", list_public_bodies_default %> or
- <a href="/help/requesting#missing_body">ask us to add it</a>.</p>
+ <p><strong><%=_("Next, select the public authority you'd like to make the request from.") %></strong></p>
+ <p><% _('Can\'t find it? <a href="%s">Browse all</a> or <a href="%s">ask us to add it</a>.') % [list_public_bodies_default, "#{help_requesting_path}#missing_body"] %></p>
<p>
</div>
<% end %>
@@ -27,30 +26,31 @@
<% if @bodies %>
<%= hidden_field_tag 'bodies', 1 %>
<% end %>
- <%= submit_tag "Search" %>
+ <%= submit_tag _("Search") %>
<% if not @show_tips %>
- &nbsp;&nbsp;<a href="/search">Advanced search tips</a>
+ &nbsp;&nbsp;<%= link_to _('Advanced search tips'), search_redirect_path %>
<% end %>
</p>
<% end %>
<% if !@query.nil? %>
<p>
- <%=link_to_unless @sortby == 'relevant', "Show most relevant results first", search_url(@query, 'relevant') %>
+ <%=link_to_unless @sortby == 'relevant', _("Show most relevant results first"), search_url(@query, 'relevant') %>
|
- <%=link_to_unless @sortby == 'newest', "Newest results first", search_url(@query, 'newest') %>
+ <%=link_to_unless @sortby == 'newest', _("Newest results first"), search_url(@query, 'newest') %>
<% if @sortby == 'described' %>
- | Recently described results first
+ | <%= _('Recently described results first') %>
<% end %>
</p>
<% end %>
<% if @bodies && !@query.nil? && @xapian_bodies.results.size == 0 && @page == 1 %>
- <h1>No public authorities found</h1>
+ <h1><%= _('No public authorities found') %></h1>
<% if @spelling_correction %>
- <p id="did_you_mean">Did you mean: <%= search_link(@spelling_correction, @postfix) %></p>
+ <p id="did_you_mean"><%= _('Did you mean: {{correction}}',
+ :correction => search_link(@spelling_correction, @postfix)) %></p>
<% end %>
- <p><%=link_to "Browse all", list_public_bodies_default %> or <a href="/help/requesting#missing_body">ask us to add one</a>.</p>
+ <p><%= _('<a href="%s">Browse all</a> or <a href="%s">ask us to add one</a>.') % [list_public_bodies_default, help_requesting_path + '#missing_body'] %></p>
<% end %>
<% if @total_hits == 0 %>
@@ -59,7 +59,7 @@
<% if not @query.nil? %>
<% if @spelling_correction %>
- <p id="did_you_mean">Did you mean: <%= search_link(@spelling_correction, @postfix) %></p>
+ <p id="did_you_mean"><%= _('Did you mean: {{correction}}', :correction => search_link(@spelling_correction, @postfix)) %></p>
<% end %>
<% if (!@bodies || @xapian_requests.results.size == 0) && @track_thing && (@xapian_bodies.results.size > 0 || @xapian_users.results.size > 0 || @total_hits == 0)%>
@@ -67,7 +67,7 @@
<% end %>
<% if @xapian_bodies.results.size > 0 %>
- <h1><%= "Public authorities " + ((@page-1)*@bodies_per_page+1).to_s + "-" + [@page*@bodies_per_page, @xapian_bodies.matches_estimated].min.to_s + " of " + @xapian_bodies.matches_estimated.to_s + " for '" + h(@query) + "'" %></h1>
+ <h1><%= _('Public authorities {{start_count}} to {{end_count}} of {{total_count}} for {{user_search_query}}', :start_count => ((@page-1)*@bodies_per_page+1).to_s, :end_count => [@page*@bodies_per_page, @xapian_bodies.matches_estimated].min.to_s, :total_count => @xapian_bodies.matches_estimated.to_s, :user_search_query => h(@query)) %></h1>
<% for result in @xapian_bodies.results %>
<%= render :partial => 'public_body/body_listing_single', :locals => { :public_body => result[:model] } %>
@@ -77,7 +77,7 @@
<% end %>
<% if @xapian_users.results.size > 0 %>
- <h1><%= "People " + ((@page-1)*@users_per_page+1).to_s + "-" + [@page*@users_per_page, @xapian_users.matches_estimated].min.to_s + " of " + @xapian_users.matches_estimated.to_s + " for '" + h(@query) + "'" %></h1>
+ <h1><%= _("People {{start_count}} to {{end_count}} of {{total_count}} for {{user_search_query}}", :start_count => ((@page-1)*@users_per_page+1).to_s, :end_count => [@page*@users_per_page, @xapian_users.matches_estimated].min.to_s, :total_count => @xapian_users.matches_estimated.to_s, :user_search_query => h(@query)) %></h1>
<% for result in @xapian_users.results %>
<%= render :partial => 'user/user_listing_single', :locals => { :display_user => result[:model] } %>
@@ -87,7 +87,7 @@
<% end %>
<% if @xapian_requests.results.size > 0 %>
- <h1><%= "FOI requests " + ((@page-1)*@requests_per_page+1).to_s + "-" + [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s + " of " + @xapian_requests.matches_estimated.to_s + " for '" + h(@query) + "'" %></h1>
+ <h1><%= _("FOI requests {{start_count}} to {{end_count}} of {{total_count}} for {{user_search_query}}", :start_count => ((@page-1)*@requests_per_page+1).to_s, :end_count => [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s, :total_count => @xapian_requests.matches_estimated.to_s, :user_search_query => h(@query)) %></h1>
<% if @track_thing %>
<%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>
@@ -106,27 +106,27 @@
<% end %>
<% if @show_tips %>
- <h2>Advanced search tips</h2>
+ <h2><%= _("Advanced search tips")%></h2>
<ul>
- <li>Enter words that you want to find separated by spaces, e.g. <strong><%=search_link('climbing lane')%></strong></li>
- <li>Use OR (in capital letters) where you don't mind which word, e.g. <strong><%=search_link('commons OR lords')%></strong>
- <li>Use quotes when you want to find an exact phrase, e.g. <strong><%=search_link('"Liverpool City Council"')%></strong>
- <li><strong>status:</strong> to select based on the status or historical status of the request, see the <a href="#statuses">table of statuses</a> below.
- <li><strong>variety:</strong> to select type of thing to search for, see the <a href="#varieties">table of varieties</a> below.
- <li><strong><%=search_link('requested_from:home_office')%></strong> to search requests from the <%= link_to "Home Office", show_public_body_url(:url_name => 'home_office') %>, typing the name as in the URL.
- <li><strong><%=search_link('requested_by:julian_todd')%></strong> to search requests made by <%= link_to "Julian Todd", show_user_url(:url_name => 'julian_todd') %>, typing the name as in the URL.
- <li><strong><%=search_link('commented_by:tony_bowden')%></strong> to search annotations made by <%= link_to "Tony Bowden", show_user_url(:url_name => 'tony_bowden') %>, typing the name as in the URL.
- <li><strong>request:</strong> to restrict to a specific request, typing the title as in the URL.
- <li><strong><%=search_link('filetype:pdf')%></strong> to find all responses with PDF attachments. Or try these: <%= IncomingMessage.get_all_file_extentions%>.
- <li>Type <strong><%=search_link('01/01/2008..14/01/2008')%></strong> to only show things that happened in the first two weeks of January.
- <li><strong><%=search_link('tag:charity')%></strong> to find all public bodies or requests with a given tag. You can include multiple tags,
- and tag values, e.g. <%=search_link('tag:openlylocal AND tag:financial_transaction:335633')%>. Note that by default any of the tags
- can be present, you have to put AND explicitly if you only want results them all present.
- <li>Read about <a href="http://www.xapian.org/docs/queryparser.html">advanced search operators</a>, such as proximity and wildcards.
+ <li><%= _("Enter words that you want to find separated by spaces, e.g. <strong>climbing lane</strong>") %></li>
+ <li><%= _('Use OR (in capital letters) where you don\'t mind which word, e.g. <strong><code>commons OR lords</code></strong>') %>
+ <li><%= _('Use quotes when you want to find an exact phrase, e.g. <strong><code>"Liverpool City Council"</code></strong>') %></li>
+ <li><%= _('<strong><code>status:</code></strong> to select based on the status or historical status of the request, see the <a href="%s">table of statuses</a> below.') % "#statuses" %></li>
+ <li><%= _('<strong><code>variety:</code></strong> to select type of thing to search for, see the <a href="%s">table of varieties</a> below.') % "#varieties" %></li>
+ <li><%= _('<strong><code>requested_from:home_office</code></strong> to search requests from the Home Office, typing the name as in the URL.')%></li>
+ <li><%= _('<strong><code>requested_by:julian_todd</code></strong> to search requests made by Julian Todd, typing the name as in the URL.') %></li>
+ <li><%= _('<strong><code>commented_by:tony_bowden</code></strong> to search annotations made by Tony Bowden, typing the name as in the URL.')%></li>
+ <li><%= _('<strong><code>request:</code></strong> to restrict to a specific request, typing the title as in the URL.')%>
+ <li><%= _('<strong><code>filetype:pdf</code></strong> to find all responses with PDF attachments. Or try these: <code>{{list_of_file_extensions}}</code>', :list_of_file_extensions => IncomingMessage.get_all_file_extentions)%></li>
+ <li><%= _('Type <strong><code>01/01/2008..14/01/2008</code></strong> to only show things that happened in the first two weeks of January.')%></li>
+ <li><%= _('<strong><code>tag:charity</code></strong> to find all public bodies or requests with a given tag. You can include multiple tags,
+ and tag values, e.g. <code>tag:openlylocal AND tag:financial_transaction:335633</code>. Note that by default any of the tags
+ can be present, you have to put <code>AND</code> explicitly if you only want results them all present.')%></li>
+ <li><%= _('Read about <a href="%s">advanced search operators</a>, such as proximity and wildcards.') % "http://www.xapian.org/docs/queryparser.html" %></li>
</ul>
- <h2 id="statuses">Table of statuses</h2>
-
+ <h2 id="statuses"><%= _('Table of statuses') %></h2>
+ <h3>XXX this should be automatically generated</h3>
<table class="status_table">
<tr><td><strong><%=search_link('status:waiting_response')%></strong></td><td> Waiting for the public authority to reply </td></tr>
<tr><td><strong><%=search_link('status:not_held')%></strong></td><td> The public authority does not have the information requested </td></tr>