diff options
-rw-r--r-- | app/controllers/track_controller.rb | 9 | ||||
-rw-r--r-- | app/views/request/_request_listing_via_event.rhtml | 23 | ||||
-rw-r--r-- | app/views/request/select_authority.rhtml | 2 | ||||
-rw-r--r-- | config/general.yml-example | 4 | ||||
-rw-r--r-- | public/stylesheets/main.css | 6 | ||||
-rw-r--r-- | vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb | 2 |
6 files changed, 30 insertions, 16 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 %> diff --git a/config/general.yml-example b/config/general.yml-example index a0d9dc705..86399f0bc 100644 --- a/config/general.yml-example +++ b/config/general.yml-example @@ -134,6 +134,6 @@ HTML_TO_PDF_COMMAND: /usr/local/bin/wkhtmltopdf-amd64 # Exception notifications EXCEPTION_NOTIFICATIONS_FROM: do-not-reply-to-this-address@example.com EXCEPTION_NOTIFICATIONS_TO: -- robin@example.org -- seb@example.org + - robin@example.org + - seb@example.org diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css index 471e1151b..2d3eaa38e 100644 --- a/public/stylesheets/main.css +++ b/public/stylesheets/main.css @@ -1624,9 +1624,13 @@ div.controller_help h1 a,#logged_in_bar a,#logged_in_bar a:visited,#stepwise_mak } .request_left,#header_left { -width:100%; +width:625px; float:left; } +#authority_preview .request_left, +#authority_preview #header_left { + width: 100%; +} #request_sidebar h2,.list-filter-item { margin-bottom:10px; diff --git a/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb b/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb index 592784ba1..39cfe929f 100644 --- a/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb +++ b/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb @@ -218,7 +218,7 @@ module ActsAsXapian full_path = @@db_path + suffix # for indexing - @@writable_db = Xapian::flint_open(full_path, Xapian::DB_CREATE_OR_OPEN) + @@writable_db = Xapian::WritableDatabase.new(full_path, Xapian::DB_CREATE_OR_OPEN) @@enquire = Xapian::Enquire.new(@@writable_db) @@term_generator = Xapian::TermGenerator.new() @@term_generator.set_flags(Xapian::TermGenerator::FLAG_SPELLING, 0) |