aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/general/frontpage.rhtml
blob: f412a696468d1b0816eb947d15a356b04bef3ab4 (plain)
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
<% view_cache :ttl => 5.minutes do %>

<div id="frontpage_search">
    <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 
           <br>like information from. <strong>By law, they have to respond</strong>
           (<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') %>
           <br>
           <%= _('e.g.') %>
	   <% @search_examples.each_with_index do |name, i| %>
             <%=link_to name, search_url(name, 'bodies')%><% if i < 2 %>, <% else %>. <% break %><% end %>
	   <% end %>

           <br>
           <br>
           <%= _('OR, <strong>search</strong> for information others have requested using {{site_name}}', :site_name => site_name) %>
       </p>
    <% end %>
</div>

<div id="frontpage_examples">
    <% if @popular_bodies.size > 0 %>
        <div id="examples_0">
          <ul>
            <% for popular_body in @popular_bodies %>
                <li><%=public_body_link(popular_body)%> 
                 <%= 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 %>
            </strong></p>
        </div>
    <% end %>

    <% if @successful_request_events.size > 0 %>
        <div id="examples_1">
            <ul>
            <% for event in @successful_request_events %>
                <li><%=link_to h(excerpt(event.info_request.title, "", 30)), request_url(event.info_request)%> 
                <%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(event.described_at)) %> 
                </li>
            <% end %>
            </ul>
            <p><strong><%=link_to _('More successful requests...'), request_list_successful_url %></strong></p>
        </div>
    <% end %>
</div>

<% end %>