-
-
Notifications
You must be signed in to change notification settings - Fork 196
/
select_authority.html.erb
60 lines (51 loc) · 2.23 KB
/
select_authority.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<script type="text/javascript">
$(document).ready(function() {
// Avoid triggering too often (on each keystroke) by using the debounce
// jQuery plugin:
// http://benalman.com/projects/jquery-throttle-debounce-plugin/
$("#query").keypress($.debounce( 300, function() {
// Do a type ahead search and display results
$("#typeahead_response").load("<%= search_ahead_bodies_url %>?query="+encodeURI(this.value));
}));
});
</script>
<% @title = _("Select the authority to write to") %>
<h1 style="clear: left"><%= _('1. Select an authority') %></h1>
<div id="authority_selection">
<%= form_tag select_authority_path, { :id => 'search_form', :method => 'get' } do %>
<div>
<p>
<%= _(%Q(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>
(<a href="{{url}}">why?</a>).), :url => (help_about_path(:anchor => 'whybother_them')).html_safe) %>
</p>
<%= text_field_tag :query,
params[:query],
{ :size => 30,
:title => _('type your search term here'),
:placeholder => _('e.g. Ministry of Defence') } %>
<%= hidden_field_tag :bodies, 1 %>
<%= submit_tag _('Search') %>
</div>
<% if AlaveteliConfiguration.allow_batch_requests && @user && @user.can_make_batch_requests? %>
<div id="batch_request_link">
<p>
<%= _('Or make a <a href="{{url}}">batch request</a> to <strong>multiple authorities</strong> at once.',
:url => select_authorities_path) %>
</p>
</div>
<% end %>
<% end %>
<div id="typeahead_response">
<%= render :partial => 'public_body/search_ahead' %>
</div>
</div>
<div id="select_authority_help">
<p class="info"><%= _("Can't find the one you want?") %></p>
<p class="actions">
<%= raw _('<a href="{{browse_url}}">Browse all</a> or <a href="{{add_url}}">ask us to add one</a>.',
:browse_url => list_public_bodies_default_path.html_safe,
:add_url => help_requesting_path(:anchor => 'missing_body')
).html_safe %>
</p>
</div>