diff options
Diffstat (limited to 'app/views/general')
-rw-r--r-- | app/views/general/_frontpage_intro_sentence.rhtml | 6 | ||||
-rw-r--r-- | app/views/general/frontpage.rhtml | 51 | ||||
-rw-r--r-- | app/views/general/search.rhtml | 201 |
3 files changed, 131 insertions, 127 deletions
diff --git a/app/views/general/_frontpage_intro_sentence.rhtml b/app/views/general/_frontpage_intro_sentence.rhtml index 2c3bcaf83..4e6dbecb3 100644 --- a/app/views/general/_frontpage_intro_sentence.rhtml +++ b/app/views/general/_frontpage_intro_sentence.rhtml @@ -1,3 +1,3 @@ -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_url %>">why?</a>). +<h3>Use your Right to Know</h3> + +Every citizen has the right to access information held by public authorities. <strong>By law, they have to respond</strong>. <a href="<%= help_about_url %>">Find out more about freedom of information.</a> diff --git a/app/views/general/frontpage.rhtml b/app/views/general/frontpage.rhtml index abed0294e..6294e4353 100644 --- a/app/views/general/frontpage.rhtml +++ b/app/views/general/frontpage.rhtml @@ -1,33 +1,40 @@ <% view_cache :ttl => 5.minutes, :tag => I18n.locale do %> -<div id="frontpage_search"> - <h1><%= _('Make or explore Freedom of Information requests') %></h1> + <div class="frontpage-box" id="frontpage-box-1"> + <%= render :partial => 'frontpage_intro_sentence' %> + </div> + + <div class="frontpage-box" id="frontpage-box-2"> + <div id="bighand"> + Make a new <strong>Freedom of Information</strong> request + <br /> + <a href="http://127.0.0.1:3000/en/new/tgq"><img alt="Start-button" src="http://127.0.0.1:3000/images/start-button.png?1314013338"></a> + </div> + </div> + + <div class="frontpage-box" id="frontpage-box-3"> + <div id="littlehand"> + Search over <strong><%= InfoRequest.count %> requests</strong> and <strong><%= PublicBody.count %> authorities</strong>: <% form_tag({:action => "search_redirect"}, {:id => "search_form"}) do %> - <p> - <%= render :partial => 'frontpage_intro_sentence' %> - <br> - - <br> <%= text_field_tag 'query', params[:query], { :size => 30 } %> <%= hidden_field_tag 'bodies', 1 %> - <%= submit_tag _('Search') %> + <%= image_submit_tag 'button-search.png', :title => '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> + </div> + <div id="frontpage_examples"> <% if @popular_bodies.size > 0 %> <div id="examples_0"> + <h3>Who has the information?</h3> + <%= site_name %> covers requests to <%= PublicBody.count %> authorities, including: <ul> <% for popular_body in @popular_bodies %> <li><%=public_body_link(popular_body)%> @@ -36,23 +43,27 @@ <% end%> </ul> <p><strong> - <%= link_to _('More authorities...'), list_public_bodies_default %> + <%= link_to _('Browse all authorities...'), list_public_bodies_default %> </strong></p> </div> <% end %> - <% if @successful_request_events.size > 0 %> <div id="examples_1"> + <h3>What are people asking?</h3> + <%= site_name %> users have asked <%= InfoRequest.count %> questions. <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)) %> + + <% for event in @successful_request_events %> + <li> + <%= public_body_link(event.info_request.public_body) %> answered a question about + <%=link_to h(event.info_request.title), request_url(event.info_request)%> + <%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(event.described_at)) %> + <p class="excerpt" onclick="document.location.href='<%=request_url(event.info_request)%>'"><%= excerpt(event.info_request.title, "", 200) %></p> </li> <% end %> </ul> <p><strong><%=link_to _('More successful requests...'), request_list_successful_url %></strong></p> </div> - <% end %> </div> diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml index ec12b2bf3..cc522b367 100644 --- a/app/views/general/search.rhtml +++ b/app/views/general/search.rhtml @@ -1,120 +1,113 @@ <% @show_tips = @xapian_requests.nil? || (@total_hits == 0) %> -<% if @query.nil? %> - <% @title = _("Search Freedom of Information requests, public authorities and users") %> - <h1><%=@title%></h1> -<% elsif @total_hits == 0 %> - <%= _("Nothing found for ‘{{search_terms}}’", :search_terms => h(@query)) %> -<% else %> - <% @title = _("Results page {{page_number}}", :page_number => @page.to_s) %> -<% end%> - <% @include_request_link_in_authority_listing = true %> -<% if @bodies && (@page == 1 || @xapian_bodies.results.size > 0) %> - <div id="stepwise_instructions"> - <p><strong><%=_("Next, select the public authority you'd like to make the request from.") %></strong></p> - <p><% _('Can\'t find it? <a href="%s">Browse all</a> or <a href="%s">ask us to add it</a>.') % [list_public_bodies_default, "#{help_requesting_path}#missing_body"] %></p> - <p> - </div> -<% end %> - -<% form_tag({:action => "search_redirect"}, {:id => "search_form"}) do %> - <p> - <%= text_field_tag 'query', @query, { :size => 40 } %> - <%= hidden_field_tag 'sortby', @inputted_sortby %> - <% if @bodies %> - <%= hidden_field_tag 'bodies', 1 %> - <% end %> - <%= submit_tag _("Search") %> - <% if not @show_tips %> - <%= link_to _('Advanced search tips'), search_redirect_path %> - <% end %> - </p> -<% end %> - -<% if !@query.nil? %> - <p> - <%=link_to_unless @sortby == 'relevant', _("Show most relevant results first"), search_url(@query, 'relevant') %> - | - <%=link_to_unless @sortby == 'newest', _("Newest results first"), search_url(@query, 'newest') %> - <% if @sortby == 'described' %> - | <%= _('Recently described results first') %> - <% end %> - </p> +<div id="header_left"> + <% if @query.nil? %> + <h1>Search</h1> + <% else %> + <h1>Search results</h1> + <% end%> + + <% form_tag({:action => "search_redirect"}, {:id => "search_form"}) do %> + <p> + <%= text_field_tag 'query', @query, { :size => 40 } %> + <%= hidden_field_tag 'sortby', @inputted_sortby %> + <% if @bodies %> + <%= hidden_field_tag 'bodies', 1 %> + <% end %> + <%= image_submit_tag 'button-search.png', :title=>"Search" %> + <% if not @show_tips %> + <%= link_to _('Advanced search tips'), search_redirect_path %> + <% end %> + </p> + <% end %> + + <% if !@query.nil? %> + <p id="search_controls"> + <%=link_to_unless @sortby == 'relevant', _("Show most relevant results first"), search_url(@query, 'relevant') %> + | + <%=link_to_unless @sortby == 'newest', _("Newest results first"), search_url(@query, 'newest') %> + <% if @sortby == 'described' %> + | <%= _('Recently described results first') %> + <% end %> + </p> + <% end %> +</div> + +<% if @track_thing %> + <div id="header_right"> + <h2>Track this search</h2> + <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %> + </div> <% end %> -<% if @bodies && !@query.nil? && @xapian_bodies.results.size == 0 && @page == 1 %> - <h1><%= _('No public authorities found') %></h1> - <% if @spelling_correction %> - <p id="did_you_mean"><%= _('Did you mean: {{correction}}', - :correction => search_link(@spelling_correction, @postfix)) %></p> - <% end %> - <p><%= _('<a href="%s">Browse all</a> or <a href="%s">ask us to add one</a>.') % [list_public_bodies_default, help_requesting_path + '#missing_body'] %></p> -<% end %> +<div style="clear:both;"></div> <% if @total_hits == 0 %> - <h1><%=@title %></h1> + <h2><%=@title %></h2> <% end %> <% if not @query.nil? %> - <% if @spelling_correction %> - <p id="did_you_mean"><%= _('Did you mean: {{correction}}', :correction => search_link(@spelling_correction, @postfix)) %></p> - <% end %> - - <% if (!@bodies || @xapian_requests.results.size == 0) && @track_thing && (@xapian_bodies.results.size > 0 || @xapian_users.results.size > 0 || @total_hits == 0)%> - <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %> - <% end %> - - <% if @xapian_bodies.results.size > 0 %> - <% if @xapian_bodies.results.size == 1 && @page == 1 %> - <h1><%= _('One public authority matching ‘{{user_search_query}}’', :user_search_query => h(@query)) %></h1> - <% else %> - <h1><%= _('Public authorities {{start_count}} to {{end_count}} of {{total_count}} for {{user_search_query}}', :start_count => ((@page-1)*@bodies_per_page+1).to_s, :end_count => [@page*@bodies_per_page, @xapian_bodies.matches_estimated].min.to_s, :total_count => @xapian_bodies.matches_estimated.to_s, :user_search_query => h(@query)) %></h1> - <% end %> - - <% for result in @xapian_bodies.results %> - <%= render :partial => 'public_body/body_listing_single', :locals => { :public_body => result[:model] } %> - <% end %> - - <%= will_paginate WillPaginate::Collection.new(@page, @bodies_per_page, @xapian_bodies.matches_estimated) %> - <% end %> - - <% if @xapian_users.results.size > 0 %> - <% if @xapian_users.results.size == 1 && @page == 1 %> - <h1><%= _("One person matching ‘{{user_search_query}}’", :user_search_query => h(@query)) %></h1> - <% else %> - <h1><%= _("People {{start_count}} to {{end_count}} of {{total_count}} for ‘{{user_search_query}}’", :start_count => ((@page-1)*@users_per_page+1).to_s, :end_count => [@page*@users_per_page, @xapian_users.matches_estimated].min.to_s, :total_count => @xapian_users.matches_estimated.to_s, :user_search_query => h(@query)) %></h1> - <% end %> - - <% for result in @xapian_users.results %> - <%= render :partial => 'user/user_listing_single', :locals => { :display_user => result[:model] } %> - <% end %> - - <%= will_paginate WillPaginate::Collection.new(@page, @users_per_page, @xapian_users.matches_estimated) %> - <% end %> - - <% if @xapian_requests.results.size > 0 %> - <% if @xapian_requests.results.size == 1 && @page == 1 %> - <h1><%= _("One FOI request matching ‘{{user_search_query}}’", :user_search_query => h(@query)) %></h1> - <% else %> - <h1><%= _("FOI requests {{start_count}} to {{end_count}} of {{total_count}} for ‘{{user_search_query}}’", :start_count => ((@page-1)*@requests_per_page+1).to_s, :end_count => [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s, :total_count => @xapian_requests.matches_estimated.to_s, :user_search_query => h(@query)) %></h1> - <% end %> - - <% if @track_thing %> - <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %> + <div class="results_section"> + <% if @xapian_bodies.results.size > 0 %> + <% if @xapian_bodies.results.size == 1 && @page == 1 %> + <h2 class="publicbody_results"><%= _('One public authority found') %></h2> + <% else %> + <h2 class="publicbody_results"><%= _('Public authorities {{start_count}} to {{end_count}} of {{total_count}} for {{user_search_query}}', :start_count => ((@page-1)*@bodies_per_page+1).to_s, :end_count => [@page*@bodies_per_page, @xapian_bodies.matches_estimated].min.to_s, :total_count => @xapian_bodies.matches_estimated.to_s, :user_search_query => h(@query)) %></h2> + <% end %> + + <div class="results_block"> + <% for result in @xapian_bodies.results %> + <%= render :partial => 'public_body/body_listing_single', :locals => { :public_body => result[:model] } %> + <% end %> + </div> + + <%= will_paginate WillPaginate::Collection.new(@page, @bodies_per_page, @xapian_bodies.matches_estimated) %> + <% elsif @bodies && !@query.nil? && @xapian_bodies.results.size == 0 && @page == 1 %> + <h2 class="publicbody_results"><%= _('No public authorities found') %></h2> + <% if @spelling_correction %> + <p id="did_you_mean"><%= _('Did you mean: {{correction}}', :correction => search_link(@spelling_correction, @postfix)) %></p> <% end %> + <p><%= _('<a href="%s">Browse all</a> or <a href="%s">ask us to add one</a>.') % [list_public_bodies_default, help_requesting_path + '#missing_body'] %></p> + <% end %> + </div> - <% for result in @xapian_requests.results %> - <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %> - <% end %> + <div class="results_section"> + <% if @xapian_users.results.size > 0 %> + <% if @xapian_users.results.size == 1 && @page == 1 %> + <h2 class="person_results"><%= _("One person found") %></h2> + <% else %> + <h2 class="person_results"><%= _("People {{start_count}} to {{end_count}} of {{total_count}} for ‘{{user_search_query}}’", :start_count => ((@page-1)*@users_per_page+1).to_s, :end_count => [@page*@users_per_page, @xapian_users.matches_estimated].min.to_s, :total_count => @xapian_users.matches_estimated.to_s, :user_search_query => h(@query)) %></h2> + <% end %> + + <div class="results_block"> + <% for result in @xapian_users.results %> + <%= render :partial => 'user/user_listing_single', :locals => { :display_user => result[:model] } %> + <% end %> + </div> + + <%= will_paginate WillPaginate::Collection.new(@page, @users_per_page, @xapian_users.matches_estimated) %> + <% end %> + </div> - <%= will_paginate WillPaginate::Collection.new(@page, @requests_per_page, @xapian_requests.matches_estimated) %> - <% if @track_thing %> - <p></p> - <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %> - <% end %> - <% end %> + <div class="results_section"> + <% if @xapian_requests.results.size > 0 %> + <% if @xapian_requests.results.size == 1 && @page == 1 %> + <h2 class="foi_results"><%= _("One FOI request found") %></h2> + <% else %> + <h2 class="foi_results"><%= _("FOI requests {{start_count}} to {{end_count}} of {{total_count}} for ‘{{user_search_query}}’", :start_count => ((@page-1)*@requests_per_page+1).to_s, :end_count => [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s, :total_count => @xapian_requests.matches_estimated.to_s, :user_search_query => h(@query)) %></h2> + <% end %> + + <div class="results_block"> + <% for result in @xapian_requests.results %> + <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %> + <% end %> + </div> + + <%= will_paginate WillPaginate::Collection.new(@page, @requests_per_page, @xapian_requests.matches_estimated) %> + <% end %> + </div> <% end %> <% if @show_tips %> @@ -152,7 +145,7 @@ <tr><td><strong><%=search_link('status:user_withdrawn')%></strong></td><td><%= _('The requester has abandoned this request for some reason') %></td></tr> </table> - <h2 id="varieties">Table of varieties</h2> + <h2 id="varieties"><%= _('Table of varieties') %></h2> <table class="status_table"> <tr><td><strong><%=search_link('variety:sent')%></strong></td><td><%= _('Original request sent') %></td></tr> |