aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/request_controller.rb4
-rw-r--r--app/views/request/frontpage.rhtml19
2 files changed, 19 insertions, 4 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index c669f0aaf..60d12e68d 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: request_controller.rb,v 1.57 2008-02-22 01:58:36 francis Exp $
+# $Id: request_controller.rb,v 1.58 2008-02-22 13:26:36 francis Exp $
class RequestController < ApplicationController
@@ -34,6 +34,7 @@ class RequestController < ApplicationController
def frontpage
# Public body search on the left
@public_bodies = []
+ @query_made = false
if params[:public_body] and params[:public_body][:query]
# Try and do exact match - redirect if it is made
@public_body = PublicBody.find_by_name(params[:public_body][:query])
@@ -42,6 +43,7 @@ class RequestController < ApplicationController
end
# Otherwise use search engine to find public body
@public_bodies = public_body_query(params[:public_body][:query])
+ @query_made = true
end
# Get all successful requests for display on the right
diff --git a/app/views/request/frontpage.rhtml b/app/views/request/frontpage.rhtml
index f4e9c0fca..e7fe32c61 100644
--- a/app/views/request/frontpage.rhtml
+++ b/app/views/request/frontpage.rhtml
@@ -3,6 +3,13 @@
<div id="make_requests">
<h1>Make requests for information from the UK Government</h1>
+ <% if @public_bodies.size == 0 and @query_made %>
+ <div id="error">
+ Sorry! We couldn't find any public bodies with that in their names.
+ Please <a href="/help/contact">ask us to add the one you want</a>.
+ </div>
+ <% end %>
+
<% form_tag({:action => :frontpage}, :method => 'get', :id => 'public_body_form', :class => 'plaque' ) do %>
<p>
<label for="public_body_query">Find the public body you would like information from:</label>
@@ -17,12 +24,15 @@
} %>
</div>
<div class="public_body_search_note">
- Type to search e.g. Health, Business, Scotland
+ Type to search e.g. Health, Business, Scotland
</div>
- <p>
- <%= submit_tag "Submit" %>
+ <p id="public_body_query_button">
+ <%= submit_tag "Search" %>
</p>
+ <script>
+ Element.toggle('public_body_query_button')
+ </script>
<% if @public_bodies.size > 0 %>
<div id="public_body_search">
@@ -37,6 +47,9 @@
</div>
<% end %>
+ <p>
+ Can't find the one you want? <a href="/help/contact">Ask us to add it</a>
+ </p>
<% end %>
</div>