aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/general/frontpage.rhtml
blob: 51bf55e3497691f71c96aaa1e9eb2521e11205db (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
<% 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="/help/about">why?</a>).
           <br>
            
           <br>
           <%= text_field_tag 'query', params[:query], { :size => 30 } %>
           <%= hidden_field_tag 'bodies', 1 %>
           <%= submit_tag "Search" %>
           <br>
           e.g. <%=link_to 'Liverpool', search_url('liverpool', 'bodies')%>, <%=link_to 'MRSA', search_url('mrsa', 'bodies')%>, <%=link_to 'Treasury', search_url('treasury', 'bodies')%>

           <br>
           <br>
           OR, <strong>search</strong> for information others have requested using WhatDoTheyKnow.com
       </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)%> 
                <%=h popular_body.info_requests.count%> requests
                </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)%> 
                <%=h time_ago_in_words(event.described_at).gsub("about ", "") %> ago
                </li>
            <% end %>
            </ul>
            <p><strong><a href="/list/successful">More successful requests...</a></strong></p>
        </div>
    <% end %>
</div>

<% end %>