aboutsummaryrefslogtreecommitdiffstats
path: root/app
Commit message (Collapse)AuthorAgeLines
* Use mb_chars to prevent slicing multibyte chars under ruby 1.8Louise Crow2015-05-15-1/+1
| | | | | | | | | | mb_chars provides a multibyte-aware wrapper for strings. It should have no effect on ruby 1.9.3 and above. Although ruby 1.8.7 wouldn't raise errors on a badly sliced multibyte string, on upgrading to ruby 1.9.3 and above, string operations such as gsub, match and join may produce ArgumentErrors with the message "invalid byte sequence in UTF-8". Additionally, a database with 'UTF-8' encoding may produce the error "PG::CharacterNotInRepertoire: ERROR: invalid byte sequence for encoding "UTF8""
* Merge branch 'master' of ssh://git.mysociety.org/data/git/public/alaveteli ↵Louise Crow2015-05-15-3/+11
|\ | | | | | | into hotfix/0.21.0.30
| * Discard rejected responses with malformed From:Gareth Rees2015-05-13-1/+6
| | | | | | | | | | | | | | | | | | Stops the RequestMailer trying to send a stopped_responses mail if the To: address can’t be parsed from the incoming message. ArgumentError: An SMTP To address is required to send a message. Set the message smtp_envelope_to, to, cc, or bcc address.
| * Add explaining commentsGareth Rees2015-05-13-0/+2
| |
| * Sensible error messageGareth Rees2015-05-13-1/+1
| |
| * Put emails with malformed To: field in holding penGareth Rees2015-05-13-1/+1
| | | | | | | | | | Prevents mailin exiting with an error code of 75 and sending error reports to the team@ email address.
| * Use each instead of forGareth Rees2015-05-13-1/+2
| | | | | | | | Extract email collection to explaining variable
* | Add UTF-8 encoding line.hotfix/0.29.0.30Louise Crow2015-05-15-0/+1
|/ | | | | | | Without this line, strings created in the file will use the default external encoding set by the ENV variable LANG. When processes are forked or run in cron, this may not be preserved, so better to set explicitly.
* Rescue from Holidays::UnknownRegionErrorhotfix/0.21.0.24Gareth Rees2015-04-29-4/+8
| | | | | If you run an Alaveteli in a region where we can’t show holiday suggestions the holiday import page breaks. This commit rescues from an unavailable region so that we display a friendly error message.
* Tidy InfoRequest#initial_request_textGareth Rees2015-04-27-5/+2
|
* Only load the outgoing messages that will be usedGareth Rees2015-04-27-1/+1
| | | | | | | | | | | | | | | | Prevents loading of all outgoing messages related to the info request. Before OutgoingMessage Load (1.5ms) SELECT "outgoing_messages".* FROM "outgoing_messages" WHERE "outgoing_messages"."info_request_id" = 137 ORDER BY created_at After OutgoingMessage Load (0.8ms) SELECT "outgoing_messages".* FROM "outgoing_messages" WHERE "outgoing_messages"."info_request_id" = 137 ORDER BY created_at LIMIT 1
* Improve performance initializing OutgoingMessageGareth Rees2015-04-27-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduces the amount of queries to associated objects by directly checking the database before setting the default body content. Before > info_request.outgoing_messages OutgoingMessage Load (0.4ms) SELECT "outgoing_messages".* FROM "outgoing_messages" WHERE "outgoing_messages"."info_request_id" = 137 ORDER BY created_at InfoRequest Load (0.5ms) SELECT "info_requests".* FROM "info_requests" WHERE "info_requests"."id" = 137 LIMIT 1 PublicBody Load (0.5ms) SELECT "public_bodies".* FROM "public_bodies" WHERE "public_bodies"."id" = 16 LIMIT 1 HasTagString::HasTagStringTag Load (0.4ms) SELECT "has_tag_string_tags".* FROM "has_tag_string_tags" WHERE "has_tag_string_tags"."model_id" = 16 AND (model = 'PublicBody') CensorRule Load (0.4ms) SELECT "censor_rules".* FROM "censor_rules" WHERE "censor_rules"."info_request_id" IS NULL AND "censor_rules"."public_body_id" IS NULL AND "censor_rules"."user_id" IS NULL User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 13 LIMIT 1 (0.5ms) SELECT COUNT(*) FROM "censor_rules" WHERE "censor_rules"."user_id" = 13 CensorRule Load (0.5ms) SELECT "censor_rules".* FROM "censor_rules" WHERE "censor_rules"."info_request_id" = 137 ORDER BY created_at desc CensorRule Load (0.5ms) SELECT "censor_rules".* FROM "censor_rules" WHERE "censor_rules"."public_body_id" = 16 ORDER BY created_at desc InfoRequest Load (0.5ms) SELECT "info_requests".* FROM "info_requests" WHERE "info_requests"."id" = 137 LIMIT 1 PublicBody Load (0.5ms) SELECT "public_bodies".* FROM "public_bodies" WHERE "public_bodies"."id" = 16 LIMIT 1 HasTagString::HasTagStringTag Load (0.6ms) SELECT "has_tag_string_tags".* FROM "has_tag_string_tags" WHERE "has_tag_string_tags"."model_id" = 16 AND (model = 'PublicBody') CensorRule Load (0.5ms) SELECT "censor_rules".* FROM "censor_rules" WHERE "censor_rules"."info_request_id" IS NULL AND "censor_rules"."public_body_id" IS NULL AND "censor_rules"."user_id" IS NULL User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."id" = 13 LIMIT 1 (0.5ms) SELECT COUNT(*) FROM "censor_rules" WHERE "censor_rules"."user_id" = 13 CensorRule Load (0.4ms) SELECT "censor_rules".* FROM "censor_rules" WHERE "censor_rules"."info_request_id" = 137 ORDER BY created_at desc CensorRule Load (0.5ms) SELECT "censor_rules".* FROM "censor_rules" WHERE "censor_rules"."public_body_id" = 16 ORDER BY created_at desc => [#<OutgoingMessage id: 36, info_request_id: 137, body: "Some information please", status: "sent", message_type: "initial_request", created_at: "2015-04-17 10:50:21", updated_at: "2015-04-17 10:50:21", last_sent_at: "2015-04-17 10:50:21", incoming_message_followup_id: nil, what_doing: "normal_sort", prominence: "normal", prominence_reason: nil>, #<OutgoingMessage id: 37, info_request_id: 137, body: "Dear Example Public Body 6,\r\n\r\nc'mooooooonnnnnn\r\n\r\n...", status: "sent", message_type: "followup", created_at: "2015-04-20 12:18:30", updated_at: "2015-04-20 12:18:30", last_sent_at: "2015-04-20 12:18:30", incoming_message_followup_id: 30, what_doing: "normal_sort", prominence: "normal", prominence_reason: nil>] After > info_request.outgoing_messages OutgoingMessage Load (0.8ms) SELECT "outgoing_messages".* FROM "outgoing_messages" WHERE "outgoing_messages"."info_request_id" = 137 ORDER BY created_at => [#<OutgoingMessage id: 36, info_request_id: 137, body: "Some information please", status: "sent", message_type: "initial_request", created_at: "2015-04-17 10:50:21", updated_at: "2015-04-17 10:50:21", last_sent_at: "2015-04-17 10:50:21", incoming_message_followup_id: nil, what_doing: "normal_sort", prominence: "normal", prominence_reason: nil>, #<OutgoingMessage id: 37, info_request_id: 137, body: "Dear Example Public Body 6,\r\n\r\nc'mooooooonnnnnn\r\n\r\n...", status: "sent", message_type: "followup", created_at: "2015-04-20 12:18:30", updated_at: "2015-04-20 12:18:30", last_sent_at: "2015-04-20 12:18:30", incoming_message_followup_id: 30, what_doing: "normal_sort", prominence: "normal", prominence_reason: nil>]
* Reduce N+1 queries in RequestGameController#playGareth Rees2015-04-27-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Eliminates the following Bullet warnings: 2015-04-21 11:42:26[WARN] /categorise/play N+1 Query detected user: vagrant InfoRequest => [:public_body] Add to your finder: :includes => [:public_body] N+1 Query method call stack /home/vagrant/alaveteli/app/views/request/_request_listing_single.html.erb:16:in `_app_views_request__request_listing_single_html_erb__949797960_70091194573720' /home/vagrant/alaveteli/app/views/request_game/play.html.erb:46:in `_app_views_request_game_play_html_erb___279307748_70091194720080' /home/vagrant/alaveteli/app/views/request_game/play.html.erb:45:in `each' /home/vagrant/alaveteli/app/views/request_game/play.html.erb:45:in `_app_views_request_game_play_html_erb___279307748_70091194720080' /home/vagrant/alaveteli/app/controllers/application_controller.rb:111:in `record_memory' /home/vagrant/alaveteli/lib/whatdotheyknow/strip_empty_sessions.rb:14:in `call' 2015-04-21 11:42:26[WARN] /categorise/play N+1 Query detected user: vagrant InfoRequest => [:user] Add to your finder: :includes => [:user] N+1 Query method call stack /home/vagrant/alaveteli/app/views/request/_request_listing_single.html.erb:17:in `_app_views_request__request_listing_single_html_erb__949797960_70091194573720' /home/vagrant/alaveteli/app/views/request_game/play.html.erb:46:in `_app_views_request_game_play_html_erb___279307748_70091194720080' /home/vagrant/alaveteli/app/views/request_game/play.html.erb:45:in `each' /home/vagrant/alaveteli/app/views/request_game/play.html.erb:45:in `_app_views_request_game_play_html_erb___279307748_70091194720080' /home/vagrant/alaveteli/app/controllers/application_controller.rb:111:in `record_memory' /home/vagrant/alaveteli/lib/whatdotheyknow/strip_empty_sessions.rb:14:in `call'
* Minor tidy upGareth Rees2015-04-27-16/+26
|
* Don't redirect to signin on expiration of a non remember-me sessionLouise Crow2015-04-23-1/+0
| | | | In practice, it's just confusing if you've been away from the site.
* Only use CSRF protection for logged-in users.Louise Crow2015-04-10-1/+12
|
* Use GET for search forms, not POST.Louise Crow2015-04-10-3/+3
| | | | | | | | | | Now that we use global CSRF authenticity checks, searches were logging logged-in users out as the form is an HTML form, not a Rails-generated form with a CSRF token. So form submission raised an InvalidAuthenticityToken error and reset their session. We could generate the form in Rails, but we also want to minimise the number of non-logged in people who have a session cookie, so that varnish can cache pages extensively. So we don't want to put the CSRF token for the search form in everyone's session.
* Merge branch 'hotfix/0.21.0.6'0.21.0.6Louise Crow2015-04-07-3/+4
|\ | | | | | | | | Conflicts: config/initializers/alaveteli.rb
| * Fix failure to capitalise when non category tag precedes categories.Louise Crow2015-04-07-3/+4
| | | | | | | | Thanks to @RichardTaylor for reporting.
* | Limit the number of pages of requests shown for public bodies.Louise Crow2015-04-07-1/+9
|/ | | | Needs to be restored as part of https://github.com/mysociety/alaveteli/issues/2137.
* made filtering style a bit clearerissues/2218-filtering-linksMartin Wright2015-03-27-1/+3
|
* new indent styles working better on small screensMartin Wright2015-03-27-8/+15
|
* added styles for selected filterMartin Wright2015-03-27-7/+14
|
* Wrap current filter in span for styling hookGareth Rees2015-03-27-1/+1
|
* add better styles to filter-request-typesMartin Wright2015-03-27-12/+46
|
* move list-filter styles to better filesMartin Wright2015-03-27-40/+42
| | | | They shouldn't be in public_body, as the styles are used in more places
* Merge branch 'add-frontpage-autodetect-feed' into rails-3-developLouise Crow2015-03-26-0/+5
|\
| * Add an autodetect feed for the frontpage list of requestsLouise Crow2015-03-19-0/+5
| | | | | | | | Closes Â#434.
* | Don't translate validation messages yet.Louise Crow2015-03-24-3/+3
| | | | | | | | | | | | They're only visible in the admin interface. See https://github.com/mysociety/alaveteli/issues/1353 for details.
* | Make sure fields with errors are highlighted in the default locale.Louise Crow2015-03-18-0/+12
| |
* | Highlight fields with errors in the admin interface.Louise Crow2015-03-18-0/+8
| |
* | Fix translating Public Body HeadingsGareth Rees2015-03-18-78/+106
| | | | | | | | | | Fixes submission of form containing both existing and new translations
* | Fix translating Public Body CategoriesGareth Rees2015-03-18-71/+123
| |
* | Fix translating Public BodiesGareth Rees2015-03-18-40/+44
|/
* Merge branch '59-localised-authority-links' into rails-3-developLouise Crow2015-03-05-30/+27
|\ | | | | | | | | Conflicts: app/views/public_body/show.html.erb
| * Use routing helper to generate localised urls.Louise Crow2015-03-05-26/+27
| |
| * Remove 'html' param.Louise Crow2015-03-05-8/+4
| | | | | | | | | | There's only one call to this function in the rest of the code. That has 'html' set to true.
* | Merge branch '2178-improve-batch-sent-notice' into rails-3-developLouise Crow2015-03-05-17/+56
|\ \
| * | Use new styling for batch request sent panel.Louise Crow2015-03-03-15/+54
| | |
| * | Make notice about override work with batch requests.Louise Crow2015-03-03-2/+2
| | | | | | | | | | | | They don't have a public body, so use the config param directly.
* | | Merge branch 'remove-public-body-categories' into rails-3-developLouise Crow2015-03-05-5/+0
|\ \ \ | |/ / |/| |
| * | Remove deprecated code. Fixes #2015.Louise Crow2015-02-26-5/+0
| |/
* | Restore text from 0870c537bdd910091b604e0e0c1f90b7ea57ac06.Louise Crow2015-03-02-1/+2
| |
* | Remove duplicate notes field.Louise Crow2015-03-02-3/+1
| |
* | Make unsubscribe a button as it is elsewhere on this page.Louise Crow2015-03-02-6/+6
| |
* | Align buttons and follower count.Louise Crow2015-03-02-1/+0
| |
* | Make request extract full width when on authority page.Louise Crow2015-03-02-0/+4
| |
* | Don't display stepwise_make_request unless there's some content for it.Louise Crow2015-03-02-1/+3
| |
* | Add some side margin to the notes contentLouise Crow2015-03-02-0/+5
| | | | | | | | Don't want it right by the border of stepwise_make_request.
* | Add bottom margin to stepwise_make_requestLouise Crow2015-03-02-0/+1
| | | | | | | | Next element shouldn't be right along its border.