aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/track_controller.rb9
-rw-r--r--app/views/request/_request_listing_via_event.rhtml23
-rw-r--r--app/views/request/select_authority.rhtml2
3 files changed, 22 insertions, 12 deletions
diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb
index e06701a5f..e39a0489d 100644
--- a/app/controllers/track_controller.rb
+++ b/app/controllers/track_controller.rb
@@ -46,7 +46,14 @@ class TrackController < ApplicationController
# Track all updates to a particular public body
def track_public_body
- @public_body = PublicBody.find_by_url_name(params[:url_name])
+ @public_body = PublicBody.find_by_url_name_with_historic(params[:url_name])
+ raise ActiveRecord::RecordNotFound.new("None found") if @public_body.nil?
+ # If found by historic name, or alternate locale name, redirect to new name
+ if @public_body.url_name != params[:url_name]
+ redirect_to track_public_body_url(:url_name => @public_body.url_name, :feed => params[:feed])
+ return
+ end
+
@track_thing = TrackThing.create_track_for_public_body(@public_body)
return atom_feed_internal if params[:feed] == 'feed'
diff --git a/app/views/request/_request_listing_via_event.rhtml b/app/views/request/_request_listing_via_event.rhtml
index e7c378cec..e247163a3 100644
--- a/app/views/request/_request_listing_via_event.rhtml
+++ b/app/views/request/_request_listing_via_event.rhtml
@@ -4,7 +4,7 @@ end %>
<div class="request_listing">
<div class="request_left">
- <span class="head">
+ <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' %>
@@ -14,9 +14,9 @@ end %>
<% else %>
<%= link_to highlight_words(info_request.title, @highlight_words), request_url(info_request) %>
<% end %>
- </span>
- <div class="requester">
- <% 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 %>
@@ -27,19 +27,22 @@ end %>
<% elsif event.event_type == 'comment' %>
<%= _('Request to {{public_body_name}} by {{info_request_user}}. Annotated by {{event_comment_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>user_link_absolute(info_request.user),:event_comment_user=>user_link_absolute(event.comment.user),:date=>simple_date(event.created_at)) %>
<% else %>
- <% raise _("unknown event type indexed ") + event.event_type %>
+ <%# Events of other types will not be indexed: see InfoRequestEvent#indexed_by_search?
+ However, it can happen that we see other types of event transiently here in the period
+ between a change being made and the update-xapian-index job being run. %>
+ <!-- Event of type '<%= event.event_type %>', id=<%= event.id %> -->
<% end %>
- </div>
- <span class="bottomline icon_<%= info_request.calculate_status %>">
+ </div>
+ <span class="bottomline icon_<%= info_request.calculate_status %>">
<strong>
<%= info_request.display_status %>
</strong><br>
- </span>
+ </span>
</div>
<div class="request_right">
<span class="desc">
<%= highlight_and_excerpt(event.search_text_main(true), @highlight_words, 150) %>
- </span>
- </div>
+ </span>
+ </div>
</div>
diff --git a/app/views/request/select_authority.rhtml b/app/views/request/select_authority.rhtml
index 0b1c65d13..0e8df872d 100644
--- a/app/views/request/select_authority.rhtml
+++ b/app/views/request/select_authority.rhtml
@@ -35,7 +35,7 @@
<p>
<%= _('First, type in the <strong>name of the UK public authority</strong> you\'d
like information from. <strong>By law, they have to respond</strong>
- (<a href="%s">why?</a>).') % help_about_url %>
+ (<a href="%s#%s">why?</a>).') % [help_about_url, "whybother_them"] %>
</p>
<%= text_field_tag 'query', params[:query], { :size => 30 } %>
<%= hidden_field_tag 'bodies', 1 %>