diff options
Diffstat (limited to 'app/views/request')
-rw-r--r-- | app/views/request/_request_filter_form.rhtml | 52 | ||||
-rw-r--r-- | app/views/request/_request_listing_via_event.rhtml | 29 | ||||
-rw-r--r-- | app/views/request/_sidebar.rhtml | 2 | ||||
-rw-r--r-- | app/views/request/list.rhtml | 63 | ||||
-rw-r--r-- | app/views/request/new.rhtml | 19 | ||||
-rw-r--r-- | app/views/request/show.rhtml | 2 |
6 files changed, 109 insertions, 58 deletions
diff --git a/app/views/request/_request_filter_form.rhtml b/app/views/request/_request_filter_form.rhtml new file mode 100644 index 000000000..b13637c25 --- /dev/null +++ b/app/views/request/_request_filter_form.rhtml @@ -0,0 +1,52 @@ +<%= render :partial => 'general/localised_datepicker' %> + +<div id="list-filter"> + <div class="list-filter-item"> + <h3 class="title">Showing</h3> + <% statuses = [["all", _("all requests")], + ["successful", _("successful requests")], + ["unsuccessful", _("unsuccessful requests")], + ["awaiting", _("unresolved requests")]] %> + <% for status, label in statuses %> + <% if params[:view] != status %> + <% if params[:controller] == "public_body" %> + <%= link_to label, url_for(:controller => "public_body", :action => "show", :view => status, :url_name => @public_body.url_name) + "?" + request.query_string %> + <% else %> + <%= link_to label, url_for(:controller => "request", :action => "list", :view => status) + "?" + request.query_string %> + <% end %> + <% else %> + <%= label %> + <% end %> + <%= "|" unless statuses.last[0] == status %> + <% end %> + </div> + <% form_tag(request.path, :method => "get", :id=>"filter_requests_form") do %> + <div class="list-filter-item"> + <%= label_tag(:query, _("Keywords"), :class=>"form_label title") %> + <%= text_field_tag(:query, params[:query]) %> + </div> +<% if false # don't think we want this, but leaving as an example %> + <div class="list-filter-item"> + <%= _("Search for words in:") %> <br/> + <% [["sent", _("messages from users")], + ["response", _("messages from authorities")], + ["comment", _("comments")]].each_with_index do |item, index| + variety, title = item %> + + <%= check_box_tag "request_variety[]", variety, params[:request_variety].nil? ? true : params[:request_variety].include?(variety), :id => "request_variety_#{index}" %> + <%= label_tag("request_variety_#{index}", title) %> <br/> + <% end %> + </div> +<% end %> + <div class="list-filter-item"> + <%= label_tag(:query, _("Made between"), :class=>"form_label title") %> + <%= text_field_tag(:request_date_after, params[:request_date_after], {:class => "use-datepicker", :size => 10}) %> + <%= label_tag(:query, _("and"), :class=>"form_label") %> + <%= text_field_tag(:request_date_before, params[:request_date_before], {:class => "use-datepicker", :size => 10}) %> + </div> + + <div class="list-filter-item"> + <%= submit_tag("Search") %> + </div> +<% end %> +</div> diff --git a/app/views/request/_request_listing_via_event.rhtml b/app/views/request/_request_listing_via_event.rhtml index afacabea5..e7c378cec 100644 --- a/app/views/request/_request_listing_via_event.rhtml +++ b/app/views/request/_request_listing_via_event.rhtml @@ -3,7 +3,8 @@ end %> <div class="request_listing"> - <span class="head"> + <div class="request_left"> + <span class="head"> <% if event.is_incoming_message? %> <%= link_to highlight_words(info_request.title, @highlight_words), incoming_message_url(event.incoming_message) %> <% elsif event.is_outgoing_message? and event.event_type == 'followup_sent' %> @@ -13,18 +14,9 @@ end %> <% else %> <%= link_to highlight_words(info_request.title, @highlight_words), request_url(info_request) %> <% end %> - </span> - <span class="desc"> - <%= highlight_and_excerpt(event.search_text_main(true), @highlight_words, 150) %> - </span> - - <span class="bottomline icon_<%= info_request.calculate_status %>"> - - <strong> - <%= info_request.display_status %> - </strong><br> - - <% if event.event_type == 'sent' %> + </span> + <div class="requester"> + <% if event.event_type == 'sent' %> <%= _('Request sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>user_link_absolute(info_request.user),:date=>simple_date(event.created_at )) %> <% elsif event.event_type == 'followup_sent' %> <%=event.display_status %> @@ -37,6 +29,17 @@ end %> <% else %> <% raise _("unknown event type indexed ") + event.event_type %> <% end %> + </div> + <span class="bottomline icon_<%= info_request.calculate_status %>"> + <strong> + <%= info_request.display_status %> + </strong><br> </span> + </div> + <div class="request_right"> + <span class="desc"> + <%= highlight_and_excerpt(event.search_text_main(true), @highlight_words, 150) %> + </span> + </div> </div> diff --git a/app/views/request/_sidebar.rhtml b/app/views/request/_sidebar.rhtml index 2b9652d9c..4dce18e76 100644 --- a/app/views/request/_sidebar.rhtml +++ b/app/views/request/_sidebar.rhtml @@ -1,4 +1,4 @@ -<div id="request_sidebar"> +<div id="right_column"> <h2><%= _('Track this request') %></h2> <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => @info_request.user == @user, :location => 'sidebar' } %> diff --git a/app/views/request/list.rhtml b/app/views/request/list.rhtml index 04dc0d010..28dc55cdf 100644 --- a/app/views/request/list.rhtml +++ b/app/views/request/list.rhtml @@ -1,40 +1,35 @@ -<div id="list_sidebar"> -<h1><%= _('Show only...')%></h1> -<ul> -<% for view, description, target in [ - ['successful', _('Successful responses'), request_list_successful_url(:view => 'successful')], - ['recent', _('Recently sent requests'), request_list_recent_url(:view => 'recent')] -] %> -<li> - <%= link_to_unless (@view == view), description, target %> -</li> -<% end %> -</ul> + +<div id="header_left"> + <h1><%=@title%></h1> + <%= render :partial => 'request/request_filter_form' %> </div> -<h1><%=@title%></h1> +<div id="header_right"> + <h2>Track these requests</h2> + <% if @track_thing %> + <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %> + <% end %> +</div> -<% if @track_thing %> - <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %> -<% end %> +<div style="clear:both"></div> -<% view_cache :ttl => 5.minutes, :tag => [@view, @page, I18n.locale] do %> - <% if @list_results.empty? %> - <p> <%= _('No requests of this sort yet.')%></p> - <% else %> - <% for result in @list_results%> - <% if result.class.to_s == 'InfoRequestEvent' %> - <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result, :info_request => result.info_request } %> - <% else %> - <p><strong><%= _('Unexpected search result type') %> <%=result.class.to_s%></strong></p> +<div class="results_section"> + <% view_cache :ttl => 5.minutes, :tag => [@view, @page, I18n.locale] do %> + <% if @list_results.empty? %> + <p> <%= _('No requests of this sort yet.')%></p> + <% else %> + <h2 class="foi_results"><%= _('{{count}} FOI requests found', :count => @list_results.size) %></h2> + <div class="results_block"> + <% for result in @list_results%> + <% if result.class.to_s == 'InfoRequestEvent' %> + <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result, :info_request => result.info_request } %> + <% else %> + <p><strong><%= _('Unexpected search result type') %> <%=result.class.to_s%></strong></p> + <% end %> <% end %> - <% end %> - <% end %> + </div> + <% end %> - <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @matches_estimated) %> -<% end %> - -<% if @track_thing %> - <p></p> - <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %> -<% end %> + <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @matches_estimated) %> + <% end %> +</div> diff --git a/app/views/request/new.rhtml b/app/views/request/new.rhtml index b8625a8e6..9538065ed 100644 --- a/app/views/request/new.rhtml +++ b/app/views/request/new.rhtml @@ -10,11 +10,13 @@ </ul></div> <% end %> +<h1>Make a new request</h1> + <%= foi_error_messages_for :info_request, :outgoing_message %> <div id="request_advice"> - <h1><%= _('Read this before writing your {{info_request_law_used_full}} request', :info_request_law_used_full=>h(@info_request.law_used_full)) %></h1> - <ul> + <h2><%= _('Read this before writing your {{info_request_law_used_full}} request', :info_request_law_used_full=>h(@info_request.law_used_full)) %></h2> + <ol> <li> <% form_tag("http://www.google.co.uk/search", {:id => "search_body_website_form", :method => "get"} ) do %> <p> @@ -26,11 +28,12 @@ <% end %> <% if !@info_request.public_body.calculated_home_page.nil? %> <br> - <%= text_field_tag 'q', params[:q], { :size => 20 } %> - <%= hidden_field_tag 'as_sitesearch', @info_request.public_body.calculated_home_page %> - <%= submit_tag _("Search") %> + <p> + <%= text_field_tag 'q', params[:q], { :size => 20 } %> + <%= hidden_field_tag 'as_sitesearch', @info_request.public_body.calculated_home_page %> + <%= submit_tag _("Search") %> + </p> <% end %> - <br> ... <%= _('to check that the info isn\'t already published.') %> </p> <% end %> @@ -47,7 +50,7 @@ <li><%= _('Ask for <strong>specific</strong> documents or information, this site is not suitable for general enquiries.') %></li> <li><%= _('Keep it <strong>focused</strong>, you\'ll be more likely to get what you want (<a href="%s">why?</a>).') % [help_requesting_path + '#focused'] %></li> <li><%= _('This site is <strong>public</strong>. Everything you type and any response will be published.') %></li> - </ul> + </ol> <% if @info_request.public_body.has_notes? %> <h1><%= _('Special note for this authority!') %></h1> @@ -84,10 +87,8 @@ <% form_for(:info_request, @info_request, :html => { :id => 'write_form' } ) do |f| %> <div id="request_form"> - <h1> <label class="form_label" for="info_request_public_body_id"><%= _('To:') %></label> <span id="to_public_body"><%=h(@info_request.public_body.name)%></span> - </h1> <p> <label class="form_label" for="info_request_title"><%= _('Summary:') %></label> diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml index 2897a3564..c5d040fb7 100644 --- a/app/views/request/show.rhtml +++ b/app/views/request/show.rhtml @@ -22,7 +22,7 @@ <%= render :partial => 'sidebar' %> -<div id="request_main"> +<div id="left_column"> <h1><%=h(@info_request.title)%></h1> <% if @info_request.user.profile_photo %> |