aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/layouts/default.rhtml1
-rw-r--r--app/views/request/_public_body_query.rhtml5
-rw-r--r--app/views/request/frontpage.rhtml34
3 files changed, 34 insertions, 6 deletions
diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml
index fde60cfcf..fda9a553b 100644
--- a/app/views/layouts/default.rhtml
+++ b/app/views/layouts/default.rhtml
@@ -2,6 +2,7 @@
<html lang="en-gb">
<head>
<!-- <script type="text/javascript" src="/js.js"></script> -->
+ <%= javascript_include_tag :defaults %>
<title><%=@title%> <%= @title ? "-" : "" %> foi.mysociety.org</title>
<%= stylesheet_link_tag 'main' %>
</head>
diff --git a/app/views/request/_public_body_query.rhtml b/app/views/request/_public_body_query.rhtml
new file mode 100644
index 000000000..77efdfcc1
--- /dev/null
+++ b/app/views/request/_public_body_query.rhtml
@@ -0,0 +1,5 @@
+<ul>
+<% for public_body in @public_bodies %>
+<li><%=h public_body.name %></li>
+<% end %>
+</ul>
diff --git a/app/views/request/frontpage.rhtml b/app/views/request/frontpage.rhtml
index fd2c92ca3..42e4a6975 100644
--- a/app/views/request/frontpage.rhtml
+++ b/app/views/request/frontpage.rhtml
@@ -1,13 +1,35 @@
<div id="make_requests">
<h1>Make requests for information from the UK Government</h1>
- <% form_for(:info_request, @info_request, :url => new_request_url, :html => { :id => 'public_body_form', :class => 'plaque' } ) do |f| %>
- <p>Choose which public body you would like information from.</p>
- <p>
- <%= @public_bodies = PublicBody.find(:all, :order => "name")
- f.collection_select(:public_body_id, @public_bodies, :id, :name) %>
+ <% form_tag({:action => :frontpage}, :id => 'public_body_form', :class => 'plaque' ) do %>
+ <p>
+ <label for="public_body_query">Find the public body you would like information from:</label>
</p>
- <p><%= submit_tag "Submit >>" %></p>
+
+ <div>
+ <%= text_field_with_auto_complete 'public_body', 'query', {}, { :skip_style => true } %>
+ </div>
+ <div class="public_body_search_note">
+ Type to search e.g. Transport, Health, Defence
+ </div>
+
+ <p>
+ <%= submit_tag "Submit" %>
+ </p>
+
+ <% if @public_bodies.size > 0 %>
+ <div id="public_body_search">
+ <ul>
+ <strong>Public bodies found</strong>
+ <% for public_body in @public_bodies %>
+ <li>
+ <%= link_to h(public_body.name), new_request_to_body_url(:public_body_id => public_body.id.to_s) %>
+ </li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
+
<% end %>
</div>