aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/general
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/general')
-rw-r--r--app/views/general/frontpage.rhtml4
-rw-r--r--app/views/general/search.rhtml23
2 files changed, 19 insertions, 8 deletions
diff --git a/app/views/general/frontpage.rhtml b/app/views/general/frontpage.rhtml
index 032a8b222..f1bee3ba1 100644
--- a/app/views/general/frontpage.rhtml
+++ b/app/views/general/frontpage.rhtml
@@ -16,8 +16,8 @@
<%= submit_tag _('Search') %>
<br>
<%= _('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 %>
+ <% @search_examples.each_with_index do |name, i| %>
+ <%=link_to name, search_url(name, 'bodies')%><% if i < 2 %>, <% else %>. <% break %><% end %>
<% end %>
<br>
diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml
index 876d54270..a4680c0f6 100644
--- a/app/views/general/search.rhtml
+++ b/app/views/general/search.rhtml
@@ -4,7 +4,7 @@
<% @title = _("Search Freedom of Information requests, public authorities and users") %>
<h1><%=@title%></h1>
<% elsif @total_hits == 0 %>
- <%= _("Nothing found for '{{search_terms}}'", :search_terms => h(@query)) %>
+ <%= _("Nothing found for &#x2018;{{search_terms}}&#x2019;", :search_terms => h(@query)) %>
<% else %>
<% @title = _("Results page {{page_number}}", :page_number => @page.to_s) %>
<% end%>
@@ -67,7 +67,11 @@
<% end %>
<% if @xapian_bodies.results.size > 0 %>
- <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>
+ <% if @xapian_bodies.results.size == 1 && @page == 1 %>
+ <h1><%= _('One public authority matching &#x2018;{{user_search_query}}&#x2019;', :user_search_query => h(@query)) %></h1>
+ <% else %>
+ <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>
+ <% end %>
<% for result in @xapian_bodies.results %>
<%= render :partial => 'public_body/body_listing_single', :locals => { :public_body => result[:model] } %>
@@ -77,7 +81,11 @@
<% end %>
<% if @xapian_users.results.size > 0 %>
- <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>
+ <% if @xapian_users.results.size == 1 && @page == 1 %>
+ <h1><%= _("One person matching &#x2018;{{user_search_query}}&#x2019;", :user_search_query => h(@query)) %></h1>
+ <% else %>
+ <h1><%= _("People {{start_count}} to {{end_count}} of {{total_count}} for &#x2018;{{user_search_query}}&#x2019;", :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>
+ <% end %>
<% for result in @xapian_users.results %>
<%= render :partial => 'user/user_listing_single', :locals => { :display_user => result[:model] } %>
@@ -87,7 +95,11 @@
<% end %>
<% if @xapian_requests.results.size > 0 %>
- <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 @xapian_requests.results.size == 1 && @page == 1 %>
+ <h1><%= _("One FOI request matching &#x2018;{{user_search_query}}&#x2019;", :user_search_query => h(@query)) %></h1>
+ <% else %>
+ <h1><%= _("FOI requests {{start_count}} to {{end_count}} of {{total_count}} for &#x2018;{{user_search_query}}&#x2019;", :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>
+ <% end %>
<% if @track_thing %>
<%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>
@@ -117,7 +129,7 @@
<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><%= _('<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_extensions)%></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
@@ -126,7 +138,6 @@
</ul>
<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>