diff options
Diffstat (limited to 'app/views/public_body')
-rw-r--r-- | app/views/public_body/_body_listing.rhtml | 2 | ||||
-rw-r--r-- | app/views/public_body/_body_listing_single.rhtml | 4 | ||||
-rw-r--r-- | app/views/public_body/_search_ahead.rhtml | 18 | ||||
-rw-r--r-- | app/views/public_body/list.rhtml | 48 | ||||
-rw-r--r-- | app/views/public_body/show.rhtml | 169 |
5 files changed, 141 insertions, 100 deletions
diff --git a/app/views/public_body/_body_listing.rhtml b/app/views/public_body/_body_listing.rhtml index 48b6e8245..864ab8c9b 100644 --- a/app/views/public_body/_body_listing.rhtml +++ b/app/views/public_body/_body_listing.rhtml @@ -1,5 +1,7 @@ <% if public_bodies.empty? %> + <p> <%= _("None found.")%> + </p> <% else %> <% for public_body in public_bodies %> <%= render :partial => 'public_body/body_listing_single', :locals => { :public_body => public_body } %> diff --git a/app/views/public_body/_body_listing_single.rhtml b/app/views/public_body/_body_listing_single.rhtml index 7637a1077..b01d2ebb2 100644 --- a/app/views/public_body/_body_listing_single.rhtml +++ b/app/views/public_body/_body_listing_single.rhtml @@ -23,7 +23,9 @@ <%= link_to _("Make your own request"), public_body_url(public_body) %>. <% end %> <br> - <%= _("Added on {{date}}", :date => simple_date(public_body.created_at)) %>. + <span class="date_added"> + <%= _("Added on {{date}}", :date => simple_date(public_body.created_at)) %>. + </span> </span> </div> diff --git a/app/views/public_body/_search_ahead.rhtml b/app/views/public_body/_search_ahead.rhtml new file mode 100644 index 000000000..19c7eb4e8 --- /dev/null +++ b/app/views/public_body/_search_ahead.rhtml @@ -0,0 +1,18 @@ +<p> + <% if @xapian_requests.results.size > 0 %> + <h3><%= _('Top search results:') %></h3> + <p> + <%= _('Select one to see more information about the authority.')%> + </p> + <% else %> + <h3><%= _('No results found.') %></h3> + <% end %> + <div id="authority_search_ahead_results"> + <% for result in @xapian_requests.results %> + <%= render :partial => 'body_listing_single', :locals => { :public_body => result[:model] } %> + <% end %> + </div> +</p> + + + diff --git a/app/views/public_body/list.rhtml b/app/views/public_body/list.rhtml index 5d88b1501..af91d8ed2 100644 --- a/app/views/public_body/list.rhtml +++ b/app/views/public_body/list.rhtml @@ -1,14 +1,13 @@ -<div id="body_sidebar"> +<div id="right_column_flip"> + <h2><%=_('Show only...')%></h2> - <h1><%=_('Show only...')%></h1> - - <h2><%=_('Alphabet') %></h2> + <h3><%=_('Beginning with') %></h3> <ul><li> <%= render :partial => 'alphabet' %> - </li></ul> - + </li> + </ul> <% first_row = true %> - <% for row in PublicBodyCategories::CATEGORIES_WITH_HEADINGS %> + <% for row in PublicBodyCategories::get().with_headings() %> <% if row.instance_of?(Array) %> <li> <%= link_to_unless (@tag == row[0]), row[1], list_public_bodies_url(:tag => row[0]) %> @@ -19,36 +18,35 @@ <% else %> <% first_row = false %> <% end %> - <h2><%=h row%></h2> + <h3><%=h row%></h3> <ul> <% end %> <% end %> - </ul> - + <% if not first_row %> + </ul> + <% end %> <p> <%= _('<a href="%s">Are we missing a public authority?</a>.') % [help_requesting_path + '#missing_body'] %> </p> <p> <%= link_to _('List of all authorities (CSV)'), all_public_bodies_csv_url() %> </p> - </div> <% @title = _("Public authorities - {{description}}", :description => @description) %> - -<h1><%=@title%></h1> - -<p class="subtitle"> - <%= @public_bodies.size %> <%= _('in total') %> - (<%= _('<a href="%s">can\'t find the one you want?</a>') % [help_requesting_path + '#missing_body'] %>) -</p> - -<% if @tag.size == 1 %> - <p><%= render :partial => 'alphabet' %></p> +<div id="left_column_flip"> +<h1><%= _('Public authorities') %></h1> + +<% form_tag(list_public_bodies_default_url, :method => "get", :id=>"search_form") do %> + <div> + <%= text_field_tag(:public_body_query, params[:public_body_query]) %> + <%= submit_tag(_("Search")) %> + </div> <% end %> + +<h2 class="publicbody_results"><%= _('Found {{count}} public bodies {{description}}', :count=>@public_bodies.size, :description=>@description) %></h2> <%= render :partial => 'body_listing', :locals => { :public_bodies => @public_bodies } %> -<% if @tag.size == 1 && @public_bodies.size > 0 %> - <p><%= render :partial => 'alphabet' %></p> -<% end %> -<%= will_paginate(@public_bodies) %> + <%= will_paginate(@public_bodies) %><br/> + <%= _('<a href="%s">Can\'t find the one you want?</a>') % [help_requesting_path + '#missing_body'] %> +</div> diff --git a/app/views/public_body/show.rhtml b/app/views/public_body/show.rhtml index 36bba8851..7d37a35a7 100644 --- a/app/views/public_body/show.rhtml +++ b/app/views/public_body/show.rhtml @@ -1,70 +1,74 @@ -<% @title = h(@public_body.name) + " - view and make Freedom of Information requests" %> -<div id="request_sidebar"> - <h2><%= _('Track this authority')%></h2> - <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %> - <h2><%= _('More about this authority')%></h2> - <% if !@public_body.calculated_home_page.nil? %> - <%= link_to _('Home page of authority'), @public_body.calculated_home_page %><br> - <% end %> - <% if !@public_body.publication_scheme.empty? %> - <%= link_to _('Publication scheme'), @public_body.publication_scheme %><br> - <% end %> - <% if @public_body.has_tag?("charity") %> - <% for tag_value in @public_body.get_tag_values("charity") %> - <% if tag_value.match(/^SC/) %> - <%= link_to _('Charity registration'), "http://www.oscr.org.uk/CharityIndexDetails.aspx?id=" + tag_value %><br> - <% else %> - <%= link_to _('Charity registration'), "http://www.charity-commission.gov.uk/SHOWCHARITY/RegisterOfCharities/CharityFramework.aspx?RegisteredCharityNumber=" + tag_value %><br> - <% end %> - <% end %> - <% end %> - <%= link_to _('View FOI email address'), view_public_body_email_url(@public_body.url_name) %><br> -</div> +<% @title = h(@public_body.name) + _(" - view and make Freedom of Information requests") %> +<div id="main_content"> + <div id="header_right"> + <h2><%= _('Follow this authority')%></h2> -<h1><%=h(@public_body.name)%></h1> + <% follower_count = TrackThing.count(:all, :conditions => ["public_body_id = ?", @public_body.id]) %> + <p><%= n_("There is %d person following this authority", "There are %d people following this authority", follower_count) % follower_count %></p> -<p class="subtitle"> -<%=@public_body.type_of_authority(true)%> -<% if not @public_body.short_name.empty? %>, -<%= _('also called {{public_body_short_name}}', :public_body_short_name => h(@public_body.short_name))%><% end %> -<% if !@user.nil? && @user.admin_page_links? %> -(<%= link_to _("admin"), public_body_admin_url(@public_body) %>) -<% end %> -</p> + <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %> + <h2><%= _('More about this authority')%></h2> + <% if !@public_body.calculated_home_page.nil? %> + <%= link_to _('Home page of authority'), @public_body.calculated_home_page %><br> + <% end %> + <% if !@public_body.publication_scheme.empty? %> + <%= link_to _('Publication scheme'), @public_body.publication_scheme %><br> + <% end %> + <% if @public_body.has_tag?("charity") %> + <% for tag_value in @public_body.get_tag_values("charity") %> + <% if tag_value.match(/^SC/) %> + <%= link_to _('Charity registration'), "http://www.oscr.org.uk/CharityIndexDetails.aspx?id=" + tag_value %><br> + <% else %> + <%= link_to _('Charity registration'), "http://www.charity-commission.gov.uk/SHOWCHARITY/RegisterOfCharities/CharityFramework.aspx?RegisteredCharityNumber=" + tag_value %><br> + <% end %> + <% end %> + <% end %> + <%= link_to _('View FOI email address'), view_public_body_email_url(@public_body.url_name) %><br> + </div> -<% if @public_body.has_notes? && (@public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact') %> - <p><%= @public_body.notes_as_html %></p> -<% end %> + <div id="header_left"> + <p class="public-body-name-prefix"><%= _("Freedom of information requests to") %></p> + <h1><%=h(@public_body.name)%></h1> -<% if @public_body.eir_only? %> - <p><%= _('You can only request information about the environment from this authority.')%></p> -<% end %> + <p class="subtitle"> + <%=@public_body.type_of_authority(true)%><% if not @public_body.short_name.empty? %>, + <%= _('also called {{public_body_short_name}}', :public_body_short_name => h(@public_body.short_name))%><% end %> + <% if !@user.nil? && @user.admin_page_links? %> + (<%= link_to _("admin"), public_body_admin_url(@public_body) %>) + <% end %> + </p> -<div id="stepwise_make_request"> - <strong> - <% if @public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact' %> - <% if @public_body.eir_only? %> - <%= link_to _("Make a new Environmental Information request"), new_request_to_body_url(:url_name => @public_body.url_name)%> to <%= h(@public_body.name) %> + <% if @public_body.has_notes? && (@public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact') %> + <p><%= @public_body.notes_as_html %></p> + <% end %> + + <% if @public_body.eir_only? %> + <p><%= _('You can only request information about the environment from this authority.')%></p> + <% end %> + <div id="stepwise_make_request"> + <% if @public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact' %> + <% if @public_body.eir_only? %> + <%= _('Make a new <strong>Environmental Information</strong> request')%> + <% else %> + <%= _('Make a new <strong>Freedom of Information</strong> request to {{public_body}}', :public_body => h(@public_body.name))%> + <% end %> + <%= _('<a class="link_button_green" href="{{url}}">{{text}}</a>', :url=>new_request_to_body_url(:url_name => @public_body.url_name), :text=>_("Start"))%> + <% elsif @public_body.has_notes? %> + <%= @public_body.notes_as_html %> + <% elsif @public_body.not_requestable_reason == 'not_apply' %> + <%= _('Freedom of Information law does not apply to this authority, so you cannot make + a request to it.')%> + <% elsif @public_body.not_requestable_reason == 'defunct' %> + <%= _('This authority no longer exists, so you cannot make a request to it.')%> <% else %> - <%= _('<a href="{{url}}">Make a new Freedom of Information request</a> to {{public_body_name}}', - :public_body_name => h(@public_body.name), :url=>new_request_to_body_url(:url_name => @public_body.url_name))%> + <%= _('For an unknown reason, it is not possible to make a request to this authority.')%> <% end %> - <% elsif @public_body.has_notes? %> - <%= @public_body.notes_as_html %> - <% elsif @public_body.not_requestable_reason == 'not_apply' %> - <%= _('Freedom of Information law does not apply to this authority, so you cannot make - a request to it.')%> - <% elsif @public_body.not_requestable_reason == 'defunct' %> - <%= _('This authority no longer exists, so you cannot make a request to it.')%> - <% else %> - <%= _('For an unknown reason, it is not possible to make a request to this authority.')%> - <% end %> - </strong> -</div> + </div> + </div> -<% if !@xapian_requests.nil? %> - <% if @xapian_requests.results.empty? %> + <div id="foi_results_section"> + <% if @public_body.info_requests.size == 0 %> <% if @public_body.eir_only? %> <h2><%= _('Environmental Information Regulations requests made using this site') %></h2> <p>Nobody has made any Environmental Information Regulations requests to <%=h(@public_body.name)%> using this site yet.</p> @@ -73,30 +77,47 @@ <p><%= _('Nobody has made any Freedom of Information requests to {{public_body_name}} using this site yet.', :public_body_name => h(@public_body.name))%></p> <% end %> <% else %> - <h2> + <h2 class="foi_results"> <% if @public_body.eir_only? %> <%= pluralize(@public_body.info_requests.size, "Environmental Information Regulations request made using this site") %> <% else %> - <%= n_('%d Freedom of Information request made using this site', '%d Freedom of Information requests made using this site', @public_body.info_requests.size) % @public_body.info_requests.size %> + <% if @public_body.info_requests.size > 4 %> + <%= n_('Search within the %d Freedom of Information requests to %s', 'Search within the %d Freedom of Information requests made to %s', @public_body.info_requests.size) % [@public_body.info_requests.size, @public_body.name] %> + <% else %> + <%= n_('%d Freedom of Information request to %s', '%d Freedom of Information requests to %s', @public_body.info_requests.size) % [@public_body.info_requests.size, @public_body.name] %> + <% end %> <% end %> <%= @page_desc %> </h2> + <a name="results"></a> + + <% if @public_body.info_requests.size > 4 %> + <%= render :partial => 'request/request_filter_form' %> + <% end %> + <% end %> - <% 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 style="clear:both"> </div> + <% if !@xapian_requests.nil? %> - <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @public_body.info_requests.size) %> + <% for result in @xapian_requests.results %> + <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %> + <% end %> - <p> <%= _('Only requests made using {{site_name}} are shown.', :site_name => site_name) %></p> + <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @public_body.info_requests.size) %> - <% end %> -<% else %> - <% if @public_body.eir_only? %> - <h2><%= _('Environmental Information Regulations requests made') %></h2> - <% else %> - <h2> <%= _('Freedom of Information requests made')%></h2> - <% end %> - <p> <%= _('The search index is currently offline, so we can\'t show the Freedom of Information requests that have been made to this authority.')%></p> -<% end %> + <% if @xapian_requests.results.empty? %> + <p><% _('There were no requests matching your query.') %></p> + <% else %> + <p> <%= _('Only requests made using {{site_name}} are shown.', :site_name => site_name) %></p> + <% end %> + <% else %> + <% if @public_body.eir_only? %> + <h2><%= _('Environmental Information Regulations requests made') %></h2> + <% else %> + <h2> <%= _('Freedom of Information requests made')%></h2> + <% end %> + <p> <%= _('The search index is currently offline, so we can\'t show the Freedom of Information requests that have been made to this authority.')%></p> + <% end %> + </div> +</div> |