aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
Commit message (Collapse)AuthorAgeLines
* Add body_as_text, default_body.Louise Crow2015-06-22-4/+4
| | | | | | Main intent here is to be more explicit about what form you're getting the attachment body in - valid UTF-8 or binary, and has it been cleaned up in order to be UTF-8?
* Use ARel syntaxGareth Rees2015-06-04-1/+1
|
* Extract logic in view to controllerGareth Rees2015-06-04-0/+2
|
* Use string interpolationGareth Rees2015-06-04-1/+1
|
* Remove unused variableGareth Rees2015-05-29-2/+1
|
* Minor tidyGareth Rees2015-05-29-1/+15
|
* Merge remote-tracking branch 'jpmckinney/truefalse' into rails-3-developGareth Rees2015-05-28-13/+12
|\
| * Eliminate !! (bang bang)James McKinney2015-05-27-1/+1
| |
| * Avoid unnecessary ternary operationsJames McKinney2015-05-21-12/+12
| |
| * AdminUserController: remove unused instance variable and avoid unneeded ternaryJames McKinney2015-05-21-2/+1
| |
* | Merge remote-tracking branch ↵Louise Crow2015-05-26-0/+2
|\ \ | | | | | | | | | 'openaustralia_github/286-public-body-show-visible-requests' into rails-3-develop
| * | Only include visible requests in count on body pageHenare Degan2015-05-22-0/+2
| |/ | | | | | | Fixes #286
* / Remove all optional parentheses for method calls in RubyJames McKinney2015-05-21-31/+31
|/
* Merge branch 'set-file-encodings' into rails-3-developLouise Crow2015-05-15-3/+35
|\
| * Add source file encoding for all ruby files.Louise Crow2015-05-15-3/+35
| | | | | | | | | | | | This is important under ruby 1.9 in order to determine the encoding that will be used for new strings created in the code in the file.
* | Remove summary stats from admin summary pageGareth Rees2015-05-12-12/+0
| | | | | | | | | | | | They're duplicated on /admin/summary and a bit slow [1]. [1] https://wiki.postgresql.org/wiki/Slow_Counting
* | Remove N+1 QueryGareth Rees2015-05-07-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes the following bullet warning: N+1 Query detected PublicBody => [:translations] Add to your finder: :includes => [:translations] N+1 Query method call stack /home/vagrant/alaveteli/app/helpers/link_to_helper.rb:70:in `public_body_url' /home/vagrant/alaveteli/app/helpers/link_to_helper.rb:74:in `public_body_path' /home/vagrant/alaveteli/app/helpers/admin_helper.rb:28:in `public_body_both_links' /home/vagrant/alaveteli/app/views/admin_general/index.html.erb:148:in `_app_views_admin_general_index_html_erb__1495531968_70090875267640' /home/vagrant/alaveteli/app/views/admin_general/index.html.erb:145:in `each' /home/vagrant/alaveteli/app/views/admin_general/index.html.erb:145:in `_app_views_admin_general_index_html_erb__1495531968_70090875267640' /home/vagrant/alaveteli/app/controllers/application_controller.rb:111:in `record_memory' /home/vagrant/alaveteli/lib/whatdotheyknow/strip_empty_sessions.rb:14:in `call'
* | Reduce N+1 queries getting holding pen requestsGareth Rees2015-05-07-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes the following bullet warning: N+1 Query detected IncomingMessage => [:raw_email] Add to your finder: :includes => [:raw_email] N+1 Query method call stack /home/vagrant/alaveteli/app/models/incoming_message.rb:115:in `parse_raw_email!' /home/vagrant/alaveteli/app/models/incoming_message.rb:150:in `sent_at' /home/vagrant/alaveteli/app/views/admin_general/index.html.erb:54:in `_app_views_admin_general_index_html_erb___48164640_70115534664600' /home/vagrant/alaveteli/app/views/admin_general/index.html.erb:42:in `_app_views_admin_general_index_html_erb___48164640_70115534664600' /home/vagrant/alaveteli/app/controllers/application_controller.rb:111:in `record_memory' /home/vagrant/alaveteli/lib/whatdotheyknow/strip_empty_sessions.rb:14:in `call' Improved view rendering times: Before: Completed 200 OK in 2813.9ms (Views: 1697.3ms | ActiveRecord: 9.5ms) Completed 200 OK in 2548.6ms (Views: 1838.2ms | ActiveRecord: 8.2ms) After: Completed 200 OK in 2185.9ms (Views: 276.0ms | ActiveRecord: 7.5ms) Completed 200 OK in 2216.3ms (Views: 100.3ms | ActiveRecord: 7.6ms)
* | Reduce N+1 queries getting update body requestsGareth Rees2015-05-07-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes the following bullet warnings: N+1 Query detected PublicBodyChangeRequest => [:public_body] Add to your finder: :includes => [:public_body] N+1 Query method call stack /home/vagrant/alaveteli/app/models/public_body_change_request.rb:65:in `get_public_body_name' /home/vagrant/alaveteli/app/views/admin_general/_change_request_summary.html .erb:8:in `_app_views_admin_general__change_request_summary_html_erb__490351475_701155 42681500' /home/vagrant/alaveteli/app/views/admin_general/index.html.erb:225:in `_app_views_admin_general_index_html_erb___48164640_70115537288900' /home/vagrant/alaveteli/app/views/admin_general/index.html.erb:224:in `_app_views_admin_general_index_html_erb___48164640_70115537288900' /home/vagrant/alaveteli/app/controllers/application_controller.rb:111:in `record_memory' /home/vagrant/alaveteli/lib/whatdotheyknow/strip_empty_sessions.rb:14:in `call' N+1 Query detected PublicBodyChangeRequest => [:user] Add to your finder: :includes => [:user] N+1 Query method call stack /home/vagrant/alaveteli/app/models/public_body_change_request.rb:57:in `get_user_name' /home/vagrant/alaveteli/app/views/admin_general/_change_request_summary.html .erb:46:in `_app_views_admin_general__change_request_summary_html_erb__490351475_701155 42681500' /home/vagrant/alaveteli/app/views/admin_general/index.html.erb:225:in `_app_views_admin_general_index_html_erb___48164640_70115537288900' /home/vagrant/alaveteli/app/views/admin_general/index.html.erb:224:in `_app_views_admin_general_index_html_erb___48164640_70115537288900' /home/vagrant/alaveteli/app/controllers/application_controller.rb:111:in `record_memory' /home/vagrant/alaveteli/lib/whatdotheyknow/strip_empty_sessions.rb:14:in `call'
* | Reduce N+1 queries getting new body requestsGareth Rees2015-05-07-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes the following Bullet warnings: N+1 Query detected PublicBodyChangeRequest => [:public_body] Add to your finder: :includes => [:public_body] N+1 Query method call stack /home/vagrant/alaveteli/app/models/public_body_change_request.rb:65:in `get_public_body_name' /home/vagrant/alaveteli/app/views/admin_general/_change_request_summary.html .erb:8:in `_app_views_admin_general__change_request_summary_html_erb__490351475_701155 42681500' /home/vagrant/alaveteli/app/views/admin_general/index.html.erb:191:in `_app_views_admin_general_index_html_erb___48164640_70115537288900' /home/vagrant/alaveteli/app/views/admin_general/index.html.erb:190:in `_app_views_admin_general_index_html_erb___48164640_70115537288900' /home/vagrant/alaveteli/app/controllers/application_controller.rb:111:in `record_memory' /home/vagrant/alaveteli/lib/whatdotheyknow/strip_empty_sessions.rb:14:in `call' N+1 Query detected PublicBodyChangeRequest => [:user] Add to your finder: :includes => [:user] N+1 Query method call stack /home/vagrant/alaveteli/app/models/public_body_change_request.rb:57:in `get_user_name' /home/vagrant/alaveteli/app/views/admin_general/_change_request_summary.html .erb:46:in `_app_views_admin_general__change_request_summary_html_erb__490351475_701155 42681500' /home/vagrant/alaveteli/app/views/admin_general/index.html.erb:191:in `_app_views_admin_general_index_html_erb___48164640_70115537288900' /home/vagrant/alaveteli/app/views/admin_general/index.html.erb:190:in `_app_views_admin_general_index_html_erb___48164640_70115537288900' /home/vagrant/alaveteli/app/controllers/application_controller.rb:111:in `record_memory' /home/vagrant/alaveteli/lib/whatdotheyknow/strip_empty_sessions.rb:14:in `call'
* | Improve speed of collecting bodies with no emailGareth Rees2015-05-07-1/+5
|/ | | | | | user system total real old 0.050000 0.020000 0.070000 ( 0.088856) new 0.020000 0.000000 0.020000 ( 0.018556)
* Extract logic from controllerGareth Rees2015-05-07-13/+6
|
* Merge branch 'add-widget' into rails-3-developLouise Crow2015-04-28-2/+63
|\
| * Use a boolean operator - 'and' and 'or' are for control flow.Louise Crow2015-04-28-1/+1
| |
| * Use || - 'and' and 'or' are for control flow, not logical operatorsLouise Crow2015-04-28-1/+1
| |
| * Move existing track logic to controllerLouise Crow2015-04-28-0/+4
| |
| * Move vote calculation to controller.Louise Crow2015-04-28-0/+1
| |
| * Clean up first_or_create call.Louise Crow2015-04-28-1/+3
| |
| * Don't show the widget pages for requests without normal prominence.Louise Crow2015-04-28-1/+7
| |
| * Don't set 'same origin' policy for widget iframes.Louise Crow2015-04-27-0/+1
| | | | | | | | | | Whilst this is a good security precaution in general, we want people to display these widgets in iframes on other sites.
| * Allow widgets to be controlled with a feature flag.Louise Crow2015-04-27-1/+7
| |
| * Use resource-based RESTful routing and separate controllerLouise Crow2015-04-27-28/+43
| |
| * Add some specs for the vote tracking action.Louise Crow2015-04-27-3/+3
| |
| * Add controller for non-logged in "voting"Jody McIntyre2015-04-27-1/+9
| |
| * Send widget_vote cookie when user not logged inJody McIntyre2015-04-27-0/+4
| |
| * Add widget for info requestsJody McIntyre2015-04-23-0/+14
| |
* | Merge branch 'hotfix/0.21.0.23' into rails-3-developGareth Rees2015-04-27-1/+2
|\ \
| * | 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'
* | | Merge remote-tracking branch 'openaustralia_github/email-missing-defunct' ↵Louise Crow2015-04-24-2/+1
|\ \ \ | |/ / |/| | | | | into rails-3-develop
| * | Don't include defunct authorities in list of missing emailsHenare Degan2015-04-21-1/+1
| | | | | | | | | | | | Fixes #2358
| * | Simplify queryHenare Degan2015-04-21-2/+1
| |/
* / 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
|
* 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.
* 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.
* | Fix translating Public Body HeadingsGareth Rees2015-03-18-30/+33
| | | | | | | | | | Fixes submission of form containing both existing and new translations
* | Fix translating Public Body CategoriesGareth Rees2015-03-18-18/+26
| |
* | Fix translating Public BodiesGareth Rees2015-03-18-8/+4
|/
* WIP commit of public body page redesignMartin Wright2015-03-02-0/+3
|