aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/general/search.rhtml20
-rw-r--r--app/views/layouts/default.rhtml8
-rw-r--r--app/views/request/_request_listing_single.rhtml13
-rw-r--r--app/views/request/_request_listing_via_event.rhtml41
-rw-r--r--app/views/request/_request_listing_via_incoming.rhtml18
-rw-r--r--app/views/request/_request_listing_via_outgoing.rhtml24
6 files changed, 55 insertions, 69 deletions
diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml
index 3b5661ee3..9f021e540 100644
--- a/app/views/general/search.rhtml
+++ b/app/views/general/search.rhtml
@@ -1,5 +1,5 @@
<% if @query.nil? %>
- <% @title = "Search Freedom of Information requests, public bodies and users" %>
+ <% @title = "Search Freedom of Information requests, public authorities and users" %>
<h1><%=@title%></h1>
<% elsif @search_hits == 0 %>
<% @title = "Nothing found for '" + h(@query) + "'" %>
@@ -28,16 +28,12 @@
<% if @search_results.empty? %>
<% else %>
<% for search_result in @search_results %>
- <% if search_result.class.to_s == 'InfoRequest' %>
- <%= render :partial => 'request/request_listing_single', :locals => { :info_request => search_result } %>
- <% elsif search_result.class.to_s == 'OutgoingMessage' %>
- <%= render :partial => 'request/request_listing_via_outgoing', :locals => { :info_request => search_result.info_request, :outgoing_message => search_result } %>
- <% elsif search_result.class.to_s == 'IncomingMessage' %>
- <%= render :partial => 'request/request_listing_via_incoming', :locals => { :info_request => search_result.info_request, :incoming_message => search_result } %>
- <% elsif search_result.class.to_s == 'PublicBody' %>
+ <% if search_result.class.to_s == 'PublicBody' %>
<%= render :partial => 'body/body_listing_single', :locals => { :public_body => search_result } %>
<% elsif search_result.class.to_s == 'User' %>
<%= render :partial => 'user/user_listing_single', :locals => { :display_user => search_result } %>
+ <% elsif search_result.class.to_s == 'InfoRequestEvent' %>
+ <%= render :partial => 'request/request_listing_via_event', :locals => { :event => search_result, :info_request => search_result.info_request } %>
<% else %>
<p><strong>Unknown search result type <%=search_result.class.to_s%></strong></p>
<% end %>
@@ -53,10 +49,10 @@
<li>Enter words that you want to find separated by spaces, e.g. <strong>climbing lane</strong></li>
<li>Use OR (in capital letters) where you don't mind which word, e.g. <strong>commons OR lords</strong>
<li>Use quotes when you want to find an exact phrase, e.g. <strong>"Liverpool City Council"</strong>
- <li>Type <strong>status:</strong> to select based on the status of the request, see table below.
- <li><strong>requested_from:home_office</strong>, typing the name as in the URL, to restrict to requests from the Home Office.
- <li><strong>requested_by:francis_irving</strong>, typing the name as in the URL, to restrict to requests made by Francis Irving.
- <li><strong>type:</strong> with value InfoRequest, OutgoingMessage, IncomingMessage, PubicBody or User to select type of thing being searched for
+ <li><strong>variety:</strong> with value sent, followup_sent, response, authority or user to select type of thing to search for.
+ <li>Type <strong>status:</strong> to select based on the status of the request or the status that the response caused, see table below.
+ <li><strong>requested_from:home_office</strong> to restrict to requests from the <%= link_to "Home Office", show_public_body_url(:url_name => 'home_office') %>, typing the name as in the URL.
+ <li><strong>requested_by:julian_todd</strong> to restrict to requests made by <%= link_to "Julian Todd", show_user_url(:url_name => 'julian_todd') %>, typing the name as in the URL.
<li>Read about <a href="http://lucene.apache.org/java/docs/queryparsersyntax.html">advanced search operators</a>, such as fuzziness and proximity.
</ul>
diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml
index f09684b81..9d9044339 100644
--- a/app/views/layouts/default.rhtml
+++ b/app/views/layouts/default.rhtml
@@ -23,11 +23,11 @@
</div>
</div>
<ul id="navigation">
- <li><a href="/">Make Request</a></li>
- <li><%= link_to "View Requests", request_list_url %></li>
- <li><%= link_to "View Authorities", list_public_bodies_url(:tag => 'department') %></li>
+ <li><a href="/">Make request</a></li>
+ <li><%= link_to "View requests", request_list_url %></li>
+ <li><%= link_to "View authorities", list_public_bodies_url(:tag => 'department') %></li>
<% if @user %>
- <li><%=link_to "My Requests", user_url(@user) %></li>
+ <li><%=link_to "My requests", user_url(@user) %></li>
<% end %>
<li><%= link_to "About", about_url %></li>
</ul>
diff --git a/app/views/request/_request_listing_single.rhtml b/app/views/request/_request_listing_single.rhtml
index be419b8f7..f50627a5f 100644
--- a/app/views/request/_request_listing_single.rhtml
+++ b/app/views/request/_request_listing_single.rhtml
@@ -1,17 +1,8 @@
<p class="request_listing">
- <% if not @highlighting.nil? and @highlighting['InfoRequest'][info_request.id].include?('title') %>
- <%= link_to @highlighting['InfoRequest'][info_request.id]["title"], request_url(info_request) %>
- <% @highlighting['InfoRequest'][info_request.id].delete("title") %>
- <% else %>
- <%= link_to h(info_request.title), request_url(info_request) %>
- <% end %>
+ <%= link_to h(info_request.title), request_url(info_request) %>
<br>
- <% if not @highlighting.nil? and @highlighting['InfoRequest'][info_request.id].size > 0 %>
- <%= @highlighting['InfoRequest'][info_request.id].values.join(" ") %>
- <% else %>
- <%= excerpt(info_request.initial_request_text, "", 150) %>
- <% end %>
+ <%= excerpt(info_request.initial_request_text, "", 150) %>
<br>
<span class="request_listing_bottomline">
diff --git a/app/views/request/_request_listing_via_event.rhtml b/app/views/request/_request_listing_via_event.rhtml
new file mode 100644
index 000000000..91af64ccf
--- /dev/null
+++ b/app/views/request/_request_listing_via_event.rhtml
@@ -0,0 +1,41 @@
+<p class="request_listing">
+
+ <% if not @highlighting.nil? and @highlighting['InfoRequestEvent'][event.id].include?('title') %>
+ <%= link_to @highlighting['InfoRequestEvent'][event.id]["title"], request_url(info_request) %>
+ <% @highlighting['InfoRequestEvent'][event.id].delete("title") %>
+ <% elsif not event.incoming_message.nil? %>
+ <%= link_to "Response to '" + h(info_request.title) + "'", request_url(info_request)+"#incoming-"+event.incoming_message.id.to_s %>
+ <% elsif not event.outgoing_message.nil? and event.event_type == 'followup_sent' %>
+ <%= link_to "Follow up message for '" + h(info_request.title) + "'", request_url(info_request)+"#outgoing-"+event.outgoing_message.id.to_s %>
+ <% else %>
+ <%= link_to h(info_request.title), request_url(info_request) %>
+ <% end %>
+
+ <br>
+ <% if not @highlighting.nil? and @highlighting['InfoRequestEvent'][event.id].size > 0 %>
+ <%= @highlighting['InfoRequestEvent'][event.id].values.join(" ") %>
+ <% else %>
+ <%= excerpt(info_request.initial_request_text, "", 150) %>
+ <% end %>
+ <br>
+
+ <span class="request_listing_bottomline">
+
+ <% if event.event_type == 'sent' %>
+ <strong>Request</strong> sent to <%= public_body_link(info_request.public_body) %>
+ by <%= user_link(info_request.user) %>
+ <% elsif event.event_type == 'followup_sent' %>
+ <strong>Follow up</strong> sent to <%= public_body_link(info_request.public_body) %>
+ by <%= user_link(info_request.user) %>
+ <% elsif event.event_type == 'response' %>
+ <% # <strong> XXX <%=event.display_status %> <%= info_request.display_status %> </strong> %>
+ <strong>Response</strong> by <%= public_body_link(info_request.public_body) %>
+ to <%= user_link(info_request.user) %>
+ <% else %>
+ <% raise "unknown event type indexed " + event.event_type %>
+ <% end %>
+
+ on <%= simple_date(event.created_at) %>.
+ </span>
+</p>
+
diff --git a/app/views/request/_request_listing_via_incoming.rhtml b/app/views/request/_request_listing_via_incoming.rhtml
deleted file mode 100644
index 3f7026cc4..000000000
--- a/app/views/request/_request_listing_via_incoming.rhtml
+++ /dev/null
@@ -1,18 +0,0 @@
-<p class="request_listing">
- <%= link_to "Response to '" + h(info_request.title) + "'", request_url(info_request)+"#incoming-"+incoming_message.id.to_s %>
-
- <br>
- <%= @highlighting['IncomingMessage'][incoming_message.id].values.join(" ") %>
- <br>
-
- <span class="request_listing_bottomline">
- <strong>
- <%= info_request.display_status %>
- </strong>
-
- Response by <%= public_body_link(info_request.public_body) %>
- to <%= user_link(info_request.user) %>
- on <%= simple_date(incoming_message.sent_at) %>.
- </span>
-</p>
-
diff --git a/app/views/request/_request_listing_via_outgoing.rhtml b/app/views/request/_request_listing_via_outgoing.rhtml
deleted file mode 100644
index 55af9fa6c..000000000
--- a/app/views/request/_request_listing_via_outgoing.rhtml
+++ /dev/null
@@ -1,24 +0,0 @@
-<p class="request_listing">
- <% if outgoing_message.message_type == 'initial_request' %>
- <% raise "initial_request shouldn't be indexed for search, text is indexed in InfoRequest model" %>
- <% elsif outgoing_message.message_type == 'followup' %>
- <%= link_to "Follow up message for '" + h(info_request.title) + "'", request_url(info_request)+"#outgoing-"+outgoing_message.id.to_s %>
- <% else %>
- <% raise "unknown outgoing message type" %>
- <% end %>
-
- <br>
- <%= @highlighting['OutgoingMessage'][outgoing_message.id].values.join(" ") %>
- <br>
-
- <span class="request_listing_bottomline">
- <strong>
- <%= info_request.display_status %>
- </strong>
-
- Follow up sent to <%= public_body_link(info_request.public_body) %>
- by <%= user_link(info_request.user) %>
- on <%= simple_date(outgoing_message.created_at) %>.
- </span>
-</p>
-