From a48b457cc7de157be86125cf9dfd57c7f8250fcd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Dec 2022 04:06:35 +0000 Subject: [PATCH 001/289] Bump xapian-full-alaveteli from 1.4.18.1 to 1.4.21.1 Bumps [xapian-full-alaveteli](https://github.com/mysociety/xapian-full) from 1.4.18.1 to 1.4.21.1. - [Release notes](https://github.com/mysociety/xapian-full/releases) - [Commits](https://github.com/mysociety/xapian-full/commits) --- updated-dependencies: - dependency-name: xapian-full-alaveteli dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- Gemfile.rails_next.lock | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 036e2b6966..b6081523c8 100644 --- a/Gemfile +++ b/Gemfile @@ -133,7 +133,7 @@ gem 'syslog_protocol', '~> 0.9.0' gem 'thin', '~> 1.8.1' gem 'vpim', '~> 13.11.11' gem 'will_paginate', '~> 3.3.1' -gem 'xapian-full-alaveteli', '~> 1.4.18.1' +gem 'xapian-full-alaveteli', '~> 1.4.21.1' gem 'xml-simple', '~> 1.1.9', :require => 'xmlsimple' gem 'zip_tricks', '~> 5.6.0' diff --git a/Gemfile.lock b/Gemfile.lock index 8c242a82af..6d6e9abd19 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -502,7 +502,7 @@ GEM websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) will_paginate (3.3.1) - xapian-full-alaveteli (1.4.18.1) + xapian-full-alaveteli (1.4.21.1) xml-simple (1.1.9) rexml xpath (3.2.0) @@ -599,6 +599,6 @@ DEPENDENCIES web-console (>= 3.3.0) webmock (~> 3.18.1) will_paginate (~> 3.3.1) - xapian-full-alaveteli (~> 1.4.18.1) + xapian-full-alaveteli (~> 1.4.21.1) xml-simple (~> 1.1.9) zip_tricks (~> 5.6.0) diff --git a/Gemfile.rails_next.lock b/Gemfile.rails_next.lock index be63eedea4..08011bf3dd 100644 --- a/Gemfile.rails_next.lock +++ b/Gemfile.rails_next.lock @@ -529,7 +529,7 @@ GEM websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) will_paginate (3.3.1) - xapian-full-alaveteli (1.4.18.1) + xapian-full-alaveteli (1.4.21.1) xml-simple (1.1.9) rexml xpath (3.2.0) @@ -628,6 +628,6 @@ DEPENDENCIES web-console (>= 3.3.0) webmock (~> 3.18.1) will_paginate (~> 3.3.1) - xapian-full-alaveteli (~> 1.4.18.1) + xapian-full-alaveteli (~> 1.4.21.1) xml-simple (~> 1.1.9) zip_tricks (~> 5.6.0) From 5001d6fc287841ddc83926db7feebcc99be3c975 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 4 Jan 2023 09:46:55 +0000 Subject: [PATCH 002/289] Cleanup general/frontpage * Hash style * Quote style --- app/views/general/frontpage.html.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/general/frontpage.html.erb b/app/views/general/frontpage.html.erb index 825ecd4621..4e9b32d734 100644 --- a/app/views/general/frontpage.html.erb +++ b/app/views/general/frontpage.html.erb @@ -1,8 +1,8 @@ -<% cache_if_caching_fragments("frontpage-#{@locale}", :expires_in => 5.minutes) do %> - <%= render :partial => "frontpage_how_it_works" %> +<% cache_if_caching_fragments("frontpage-#{@locale}", expires_in: 5.minutes) do %> + <%= render partial: 'frontpage_how_it_works' %>
- <%= render :partial => "frontpage_bodies_list" %> - <%= render :partial => "frontpage_requests_list" %> + <%= render partial: 'frontpage_bodies_list' %> + <%= render partial: 'frontpage_requests_list' %>
<% end %> From 6193fd77cb451448702ecd0f616f360372f1d4a1 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 5 Jan 2023 09:04:33 +0000 Subject: [PATCH 003/289] Minor cleanup of admin_censor_rule/show rendering * Hash style * Line length --- app/views/admin_censor_rule/index.html.erb | 4 ++-- app/views/admin_public_body/show.html.erb | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/admin_censor_rule/index.html.erb b/app/views/admin_censor_rule/index.html.erb index 6977f4752a..bb9627c35d 100644 --- a/app/views/admin_censor_rule/index.html.erb +++ b/app/views/admin_censor_rule/index.html.erb @@ -22,8 +22,8 @@ -<%= render :partial => 'show', - :locals => { :censor_rules => @censor_rules } %> +<%= render partial: 'show', + locals: { censor_rules: @censor_rules } %>
diff --git a/app/views/admin_public_body/show.html.erb b/app/views/admin_public_body/show.html.erb index a577a679d9..718bc23b98 100644 --- a/app/views/admin_public_body/show.html.erb +++ b/app/views/admin_public_body/show.html.erb @@ -135,7 +135,9 @@

Censor rules

-<%= render :partial => 'admin_censor_rule/show', :locals => { :censor_rules => @public_body.censor_rules, :public_body => @public_body } %> +<%= render partial: 'admin_censor_rule/show', + locals: { censor_rules: @public_body.censor_rules, + public_body: @public_body } %>
From 53c6e20d96b40dc9cc72ad275d63b991f79a4078 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 5 Jan 2023 09:05:27 +0000 Subject: [PATCH 004/289] Rename admin_censor_rule/_show to _list This partial renders a list of Censor Rules rather than showing the full details of an individual record, so rename the partial to reflect that. --- app/views/admin_censor_rule/{_show.html.erb => _list.html.erb} | 0 app/views/admin_censor_rule/index.html.erb | 2 +- app/views/admin_public_body/show.html.erb | 2 +- app/views/admin_request/show.html.erb | 2 +- app/views/admin_user/show.html.erb | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename app/views/admin_censor_rule/{_show.html.erb => _list.html.erb} (100%) diff --git a/app/views/admin_censor_rule/_show.html.erb b/app/views/admin_censor_rule/_list.html.erb similarity index 100% rename from app/views/admin_censor_rule/_show.html.erb rename to app/views/admin_censor_rule/_list.html.erb diff --git a/app/views/admin_censor_rule/index.html.erb b/app/views/admin_censor_rule/index.html.erb index bb9627c35d..48d3b36066 100644 --- a/app/views/admin_censor_rule/index.html.erb +++ b/app/views/admin_censor_rule/index.html.erb @@ -22,7 +22,7 @@ -<%= render partial: 'show', +<%= render partial: 'admin_censor_rule/list', locals: { censor_rules: @censor_rules } %>
diff --git a/app/views/admin_public_body/show.html.erb b/app/views/admin_public_body/show.html.erb index 718bc23b98..e436dd9849 100644 --- a/app/views/admin_public_body/show.html.erb +++ b/app/views/admin_public_body/show.html.erb @@ -135,7 +135,7 @@

Censor rules

-<%= render partial: 'admin_censor_rule/show', +<%= render partial: 'admin_censor_rule/list', locals: { censor_rules: @public_body.censor_rules, public_body: @public_body } %> diff --git a/app/views/admin_request/show.html.erb b/app/views/admin_request/show.html.erb index 48308d1321..7cf7efdc7a 100644 --- a/app/views/admin_request/show.html.erb +++ b/app/views/admin_request/show.html.erb @@ -394,7 +394,7 @@

Censor rules

-<%= render partial: 'admin_censor_rule/show', +<%= render partial: 'admin_censor_rule/list', locals: { censor_rules: @info_request.applicable_censor_rules, info_request: @info_request } %> diff --git a/app/views/admin_user/show.html.erb b/app/views/admin_user/show.html.erb index a9b104242d..db1e340e99 100644 --- a/app/views/admin_user/show.html.erb +++ b/app/views/admin_user/show.html.erb @@ -173,6 +173,6 @@

Censor rules

-<%= render partial: 'admin_censor_rule/show', +<%= render partial: 'admin_censor_rule/list', locals: { censor_rules: @admin_user.censor_rules, user: @admin_user } %> From 1f3d9ba37609d8ec5147b4d27d0c64650f27aef6 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 5 Jan 2023 10:03:05 +0000 Subject: [PATCH 005/289] Add inline help around censor rule ordering It's not obvious that censor rules are applied in order, and each applies to the text after it's been modified by the previous rule, so some combinations of rules can do unexpected things. For example, we often want to redact "firstname lastname" and "firstname". If the rule for "firstname" is applied first, then the "firstname lastname" rule will not apply, because the text cannot be matched due to the "firstname" redaction. Fixes https://github.com/mysociety/alaveteli/issues/7495. --- app/views/admin_censor_rule/_list.html.erb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/views/admin_censor_rule/_list.html.erb b/app/views/admin_censor_rule/_list.html.erb index 98ae703cdf..cd3c31fe4a 100644 --- a/app/views/admin_censor_rule/_list.html.erb +++ b/app/views/admin_censor_rule/_list.html.erb @@ -1,3 +1,13 @@ +
+
+

+ Each rule applies sequentially to the text after having been modified by + the previous rule, so the order may matter depending on what you are + trying to redact. +

+
+
+
<% if censor_rules.size > 0 %> From 37fde3321a281bcd8519ffee87e9e89380ea8058 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 5 Jan 2023 11:46:00 +0000 Subject: [PATCH 006/289] Update Docker readme Point users to installation guide on alaveteli.org --- docker/README.md | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/docker/README.md b/docker/README.md index b7f9af2831..3d028e270b 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,33 +1,2 @@ -Tips and tricks for using the Alaveteli Docker setup. - -Run the development app server: - -``` -docker/server -``` - -Run the rails console: - -``` -dc run --rm app bin/rails c -``` - -Run other rails commands: - -``` -dc run --rm app bin/rails routes -dc run --rm app bin/rails runner "puts 1" -# etc… -``` - -Run a command with an environment variable set: - -``` -dc run -e RAILS_ENV=test --rm app bin/rails db:migrate -``` - -Use `-T` to pipe local files to scripts run in the app container. - -``` -cat spec/fixtures/files/incoming-request-plain.email | dc run --rm -T app script/mailin -``` +See https://alaveteli.org/docs/installing/docker/ for a guide to installing +Alaveteli via Docker. From bfff6a2ecbfd31e6c248841bae069046152e26f8 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 5 Jan 2023 11:46:46 +0000 Subject: [PATCH 007/289] Update Docker setup Show progress install Gems. This take a while and causes users to think nothing is happening. --- docker/setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/setup b/docker/setup index c1da52a129..d4836fd262 100755 --- a/docker/setup +++ b/docker/setup @@ -15,7 +15,7 @@ notice_msg() { printf "\033[33m%s\033[0m " "$*"; } success_msg() { printf "\033[32m%s\033[0m\n" "$*"; } notice_msg 'Installing Ruby gems...' -bundle install >/dev/null +bundle install success_msg 'done' if [ -L config/general.yml ]; then From afe787fbad29a06ff87e20dad4e527a8831b2905 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 5 Jan 2023 11:59:03 +0000 Subject: [PATCH 008/289] Update Docker reset script Call `docker/setup` after this script in order to complete the reset so the user ends up with a working Docker environment. --- docker/reset | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/reset b/docker/reset index 17bc124478..b78c27255c 100755 --- a/docker/reset +++ b/docker/reset @@ -18,4 +18,4 @@ docker compose down docker volume rm "$(basename $(pwd))_postgres" docker compose build --pull -./docker/bootstrap +./docker/setup From 914c043fb0558444e772d1a283154bb8600b31d1 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 5 Jan 2023 11:47:53 +0000 Subject: [PATCH 009/289] Update Docker reset script Allow user to choose if development database gets reset or not. Now if they choose "No" the Docker volume is kept, the script continues but skips the data steps (migration, loading sample, and rebuilding the Xapian index). --- docker/reset | 30 ++++++++++++++++++------------ docker/setup | 26 +++++++++++++++----------- 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/docker/reset b/docker/reset index b78c27255c..956184e68d 100755 --- a/docker/reset +++ b/docker/reset @@ -4,18 +4,24 @@ set -e cd "$(dirname "$0")/.." -while true -do - read -r -p 'This will remove your development database. Do you want to continue? ' choice - case "$choice" in - n|N) exit;; - y|Y) break;; - *) echo 'Response not valid';; - esac -done - docker compose down -docker volume rm "$(basename $(pwd))_postgres" + +db_volume="$(basename $(pwd))_postgres" +if docker volume ls | grep $db_volume >/dev/null; then + while true + do + read -r -p 'Do you also want to reset your development database? ' choice + case "$choice" in + n|N) break;; + y|Y) + docker volume rm $db_volume >/dev/null + data_reset=true + break;; + *) echo 'Response not valid';; + esac + done +fi + docker compose build --pull -./docker/setup +./docker/setup $data_reset diff --git a/docker/setup b/docker/setup index d4836fd262..ba25badd1d 100755 --- a/docker/setup +++ b/docker/setup @@ -6,7 +6,7 @@ cd "$(dirname "$0")/.." if [ -z "$DOCKER" ]; then ./docker/bootstrap - docker compose run --rm app ./docker/setup + docker compose run --rm app ./docker/setup "$@" exit fi @@ -14,6 +14,8 @@ error_msg() { printf "\033[31m%s\033[0m\n" "$*"; } notice_msg() { printf "\033[33m%s\033[0m " "$*"; } success_msg() { printf "\033[32m%s\033[0m\n" "$*"; } +data_reset="${1:-false}" + notice_msg 'Installing Ruby gems...' bundle install success_msg 'done' @@ -26,17 +28,19 @@ if [ -L config/general.yml ]; then success_msg 'done' fi -notice_msg 'Migrating development and test databases...' -bin/rails db:migrate db:seed >/dev/null -bin/rails db:migrate RAILS_ENV=test >/dev/null -success_msg 'done' +if $data_reset; then + notice_msg 'Migrating development and test databases...' + bin/rails db:migrate db:seed >/dev/null + bin/rails db:migrate RAILS_ENV=test >/dev/null + success_msg 'done' -notice_msg 'Loading sample data...' -bundle exec script/load-sample-data > /dev/null -success_msg 'done' + notice_msg 'Loading sample data...' + bundle exec script/load-sample-data > /dev/null + success_msg 'done' -notice_msg 'Rebuilding Xapian index...' -bundle exec script/destroy-and-rebuild-xapian-index > /dev/null -success_msg 'done' + notice_msg 'Rebuilding Xapian index...' + bundle exec script/destroy-and-rebuild-xapian-index > /dev/null + success_msg 'done' +fi success_msg 'Setup finished' From 434de39d8d3ec60f1f9100949a66901271dc3989 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 4 Jan 2023 09:59:10 +0000 Subject: [PATCH 010/289] Add general/frontpage_extra overrideable Adds a blank, overrideable template to add theme content below the body and request lists. --- app/views/general/_frontpage_extra.html.erb | 1 + app/views/general/frontpage.html.erb | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 app/views/general/_frontpage_extra.html.erb diff --git a/app/views/general/_frontpage_extra.html.erb b/app/views/general/_frontpage_extra.html.erb new file mode 100644 index 0000000000..0e9a333033 --- /dev/null +++ b/app/views/general/_frontpage_extra.html.erb @@ -0,0 +1 @@ +<%# Placeholder to be overridden by theme %> diff --git a/app/views/general/frontpage.html.erb b/app/views/general/frontpage.html.erb index 4e9b32d734..19c92e7cf5 100644 --- a/app/views/general/frontpage.html.erb +++ b/app/views/general/frontpage.html.erb @@ -5,4 +5,6 @@ <%= render partial: 'frontpage_bodies_list' %> <%= render partial: 'frontpage_requests_list' %> + + <%= render partial: 'frontpage_extra' %> <% end %> From 07ea8f98b9dc3617db95de1978bc41a1ed1091a0 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 21 Dec 2022 11:06:18 +0000 Subject: [PATCH 011/289] Update method calls for keyword args change In Ruby 3 positional and keyword arguments were separated meaning we have to add double splat when passing in a hash as an argument if we want to the value pairs to be treated as arguments. See: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/ --- .../alaveteli_pro/base_controller.rb | 2 +- app/controllers/application_controller.rb | 2 +- .../projects/classifications_controller.rb | 2 +- .../projects/extracts_controller.rb | 2 +- app/controllers/refusal_advice_controller.rb | 10 +++++++--- app/helpers/notes_helper.rb | 2 +- app/models/ability.rb | 4 ++-- lib/tasks/config_files.rake | 12 ++++++------ .../concerns/translatable_params_spec.rb | 19 +++++++++++-------- .../users/sessions_controller_spec.rb | 6 ++---- 10 files changed, 33 insertions(+), 28 deletions(-) diff --git a/app/controllers/alaveteli_pro/base_controller.rb b/app/controllers/alaveteli_pro/base_controller.rb index 65f47cb652..ae8ae22b7a 100644 --- a/app/controllers/alaveteli_pro/base_controller.rb +++ b/app/controllers/alaveteli_pro/base_controller.rb @@ -21,7 +21,7 @@ def pro_user_authenticated?(reason_params = nil) } end if !authenticated? - ask_to_login(reason_params) + ask_to_login(**reason_params) else unless current_user.is_pro? redirect_to( diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 2548c0dca1..ea80e6a4c2 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -231,7 +231,7 @@ def set_in_pro_area # Override the Rails method to only set the CSRF form token if there is a # logged in user - def form_authenticity_token(*args) + def form_authenticity_token(**args) super if authenticated? end diff --git a/app/controllers/projects/classifications_controller.rb b/app/controllers/projects/classifications_controller.rb index 3dc3112ea4..a70ded220d 100644 --- a/app/controllers/projects/classifications_controller.rb +++ b/app/controllers/projects/classifications_controller.rb @@ -7,7 +7,7 @@ class Projects::ClassificationsController < Projects::BaseController include Classifiable def create - @project.submissions.create(submission_params) + @project.submissions.create(**submission_params) flash[:notice] = _('Thank you for updating this request!') redirect_to project_classify_path(@project) diff --git a/app/controllers/projects/extracts_controller.rb b/app/controllers/projects/extracts_controller.rb index 3b3bd24d1e..9cc041ab24 100644 --- a/app/controllers/projects/extracts_controller.rb +++ b/app/controllers/projects/extracts_controller.rb @@ -37,7 +37,7 @@ def create authorize! :read, @project @value_set = Dataset::ValueSet.new(extract_params) - submission = @project.submissions.new(submission_params) + submission = @project.submissions.new(**submission_params) if submission.save redirect_to project_extract_path diff --git a/app/controllers/refusal_advice_controller.rb b/app/controllers/refusal_advice_controller.rb index fcd74bec8c..0d28b2333c 100644 --- a/app/controllers/refusal_advice_controller.rb +++ b/app/controllers/refusal_advice_controller.rb @@ -29,7 +29,7 @@ def log_event info_request.log_event( 'refusal_advice', - parsed_refusal_advice_params.merge(user_id: current_user.id).to_h + **parsed_refusal_advice_params.merge(user_id: current_user.id) ) end @@ -84,11 +84,15 @@ def refusal_advice_params end def parsed_refusal_advice_params - refusal_advice_params.merge( + parsed_params = refusal_advice_params.merge( actions: refusal_advice_params.fetch(:actions). each_pair do |_, suggestions| suggestions.transform_values! { |v| v == 'true' } end - ) + ).to_h + + return parsed_params.deep_symbolize_keys if RUBY_VERSION < '3.0' + + parsed_params end end diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb index 46bb6af3d0..0ae51ccd91 100644 --- a/app/helpers/notes_helper.rb +++ b/app/helpers/notes_helper.rb @@ -4,7 +4,7 @@ def render_notes(notes, batch: false, **options) allowed_tags = batch ? batch_notes_allowed_tags : notes_allowed_tags - tag.aside options.merge(id: 'notes') do + tag.aside(**options.merge(id: 'notes')) do notes.each do |note| note_classes = ['note'] note_classes << "tag-#{note.notable_tag}" if note.notable_tag diff --git a/app/models/ability.rb b/app/models/ability.rb index 8ffd05d8fc..0f3f18bd7e 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -4,8 +4,8 @@ class Ability attr_reader :user, :project, :public_token - def self.guest(*args) - new(nil, *args) + def self.guest(**args) + new(nil, **args) end def initialize(user, project: nil, public_token: false) diff --git a/lib/tasks/config_files.rake b/lib/tasks/config_files.rake index b7af371d3b..17daa13dec 100644 --- a/lib/tasks/config_files.rake +++ b/lib/tasks/config_files.rake @@ -20,8 +20,8 @@ namespace :config_files do end end - def convert_erb(file, replacements) - ExampleERBRenderer.new(file, replacements).lines + def convert_erb(file, **replacements) + ExampleERBRenderer.new(file, **replacements).lines end def daemons(only_active = false) @@ -67,7 +67,7 @@ namespace :config_files do } # Generate the template for potential further processing - convert_erb(ENV['SCRIPT_FILE'], replacements).each do |line| + convert_erb(ENV['SCRIPT_FILE'], **replacements).each do |line| puts line end end @@ -102,7 +102,7 @@ namespace :config_files do replacements.update(:daemon_name => "#{ replacements[:site] }-#{ daemon_name }") # Generate the template for potential further processing - converted = convert_erb(ENV['SCRIPT_FILE'], replacements) + converted = convert_erb(ENV['SCRIPT_FILE'], **replacements) # uncomment RAILS_ENV in to the generated template if its not set by the # hard coded config file @@ -143,7 +143,7 @@ namespace :config_files do } lines = [] - convert_erb(ENV['CRONTAB'], replacements).each do |line| + convert_erb(ENV['CRONTAB'], **replacements).each do |line| lines << line end @@ -167,7 +167,7 @@ namespace :config_files do } # Generate the template for potential further processing - converted = convert_erb(ENV['SCRIPT_FILE'], replacements) + converted = convert_erb(ENV['SCRIPT_FILE'], **replacements) # uncomment RAILS_ENV in to the generated template if its not set by the # hard coded config file diff --git a/spec/controllers/concerns/translatable_params_spec.rb b/spec/controllers/concerns/translatable_params_spec.rb index a6cdc47ef9..1646e37251 100644 --- a/spec/controllers/concerns/translatable_params_spec.rb +++ b/spec/controllers/concerns/translatable_params_spec.rb @@ -25,14 +25,14 @@ :name => 'Other name' } } } params = ActionController::Parameters.new(params) - expect(translatable_params(params, keys)). + expect(translatable_params(params, **keys)). to eq(ActionController::Parameters.new(expected).permit!) end context 'when there are no params' do it 'returns an empty hash' do - expect(translatable_params(nil, keys)).to eq({}) + expect(translatable_params(nil, **keys)).to eq({}) end end @@ -56,8 +56,9 @@ :status => 'good' } params = ActionController::Parameters.new(params) - expect(TranslatableParams::WhitelistedParams.new(keys).whitelist(params)). - to eq(ActionController::Parameters.new(expected).permit!) + expect( + TranslatableParams::WhitelistedParams.new(**keys).whitelist(params) + ).to eq(ActionController::Parameters.new(expected).permit!) end it 'allows id in the translation params' do @@ -69,8 +70,9 @@ expected = ActionController::Parameters.new(params).permit! params = params = ActionController::Parameters.new(params) - expect(TranslatableParams::WhitelistedParams.new(keys).whitelist(params.dup)). - to eq(expected) + expect( + TranslatableParams::WhitelistedParams.new(**keys).whitelist(params.dup) + ).to eq(expected) end it 'removes a non-whitelisted translation param' do @@ -85,8 +87,9 @@ :name => 'Other name' } } } params = ActionController::Parameters.new(params) - expect(TranslatableParams::WhitelistedParams.new(keys).whitelist(params)). - to eq(ActionController::Parameters.new(expected).permit!) + expect( + TranslatableParams::WhitelistedParams.new(**keys).whitelist(params) + ).to eq(ActionController::Parameters.new(expected).permit!) end end diff --git a/spec/controllers/users/sessions_controller_spec.rb b/spec/controllers/users/sessions_controller_spec.rb index 0a9169cf29..eefd565b0d 100644 --- a/spec/controllers/users/sessions_controller_spec.rb +++ b/spec/controllers/users/sessions_controller_spec.rb @@ -247,10 +247,8 @@ def do_signin(email, password) end def do_signin(email, password) - post :create, { - params: { - :user_signin => { :email => email, :password => password } - } + post :create, params: { + user_signin: { email: email, password: password } } end From 2543b1c6149cf25963a43b2d9035b4d80d3e9b6a Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 21 Dec 2022 11:06:30 +0000 Subject: [PATCH 012/289] Fix class variable override error in locale routes Instead of resetting `@@locals_pattern` to nil override the reader method to dynamically generate the regular expression. --- lib/routing_filters.rb | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/routing_filters.rb b/lib/routing_filters.rb index 75b30c5e36..a875166de9 100644 --- a/lib/routing_filters.rb +++ b/lib/routing_filters.rb @@ -1,11 +1,5 @@ module RoutingFilter class Conditionallyprependlocale < RoutingFilter::Locale - # We need to be able to override this class attribute so from Rails 4.0 - # onwards we're going to need write access. It looks as though we don't - # use the equivalent instance variables so we can opt out of creating - # accessors for them - cattr_accessor :locales, instance_accessor: false - # Override core Locale filter not to prepend locale path segment # when there's only one locale def prepend_locale?(locale) @@ -40,12 +34,7 @@ def default_locale?(locale) # Reset the locale pattern when the locales are set. class << self def locales_pattern - super - end - - def locales=(locales) - @@locales_pattern = nil - @@locales = locales.map(&:to_sym) + %r(^/(#{locales.map { |l| Regexp.escape(l.to_s) }.join('|')})(?=/|$)) end end end From c868add54a1a8b2bcbabd3e4678dd2485c8529a9 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 21 Dec 2022 10:46:55 +0000 Subject: [PATCH 013/289] Update stripe mock gem This is needed for Ruby 3 compatibility. Upstream also contained updated webhook fixtures which don't match our current Stripe API version so I have taken the fixtures from the current version of the gem which we current expect and test against. --- Gemfile | 4 +- Gemfile.lock | 6 +- Gemfile.rails_next.lock | 6 +- .../alaveteli_pro/subscription_collection.rb | 3 +- .../customer.subscription.deleted.json | 65 ++++++++++ .../invoice.payment_failed.json | 105 ++++++++++++++++ .../invoice.payment_succeeded.json | 112 ++++++++++++++++++ 7 files changed, 292 insertions(+), 9 deletions(-) create mode 100644 spec/fixtures/stripe_webhooks/customer.subscription.deleted.json create mode 100644 spec/fixtures/stripe_webhooks/invoice.payment_failed.json create mode 100644 spec/fixtures/stripe_webhooks/invoice.payment_succeeded.json diff --git a/Gemfile b/Gemfile index d05e770287..6bfdde4a6c 100644 --- a/Gemfile +++ b/Gemfile @@ -183,8 +183,8 @@ group :test do gem 'simplecov-lcov', '~> 0.7.0' gem 'capybara', '~> 3.38.0' gem 'stripe-ruby-mock', git: 'https://github.com/stripe-ruby-mock/stripe-ruby-mock', - ref: '2c925fd' - gem('rails-controller-testing') + ref: '6ceea96' + gem 'rails-controller-testing' end group :test, :development do diff --git a/Gemfile.lock b/Gemfile.lock index 7e3cde430e..88dc9ab842 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,10 +17,10 @@ GIT GIT remote: https://github.com/stripe-ruby-mock/stripe-ruby-mock - revision: 2c925fd8cb568e3d0cfebffbe1babb490793f150 - ref: 2c925fd + revision: 6ceea9679bb573cb8bc6830f1bdf670b220a9859 + ref: 6ceea96 specs: - stripe-ruby-mock (3.0.1) + stripe-ruby-mock (3.1.0.rc3) dante (>= 0.2.0) multi_json (~> 1.0) stripe (> 5, < 6) diff --git a/Gemfile.rails_next.lock b/Gemfile.rails_next.lock index b9733b85dd..9b63000d1f 100644 --- a/Gemfile.rails_next.lock +++ b/Gemfile.rails_next.lock @@ -17,10 +17,10 @@ GIT GIT remote: https://github.com/stripe-ruby-mock/stripe-ruby-mock - revision: 2c925fd8cb568e3d0cfebffbe1babb490793f150 - ref: 2c925fd + revision: 6ceea9679bb573cb8bc6830f1bdf670b220a9859 + ref: 6ceea96 specs: - stripe-ruby-mock (3.0.1) + stripe-ruby-mock (3.1.0.rc3) dante (>= 0.2.0) multi_json (~> 1.0) stripe (> 5, < 6) diff --git a/app/models/alaveteli_pro/subscription_collection.rb b/app/models/alaveteli_pro/subscription_collection.rb index e21ad89b0d..011037b58a 100644 --- a/app/models/alaveteli_pro/subscription_collection.rb +++ b/app/models/alaveteli_pro/subscription_collection.rb @@ -18,7 +18,8 @@ def initialize(customer) def build AlaveteliPro::Subscription.new( Stripe::Subscription.new.tap do |subscription| - subscription.update_attributes(customer: @customer) + params = { customer: @customer } + subscription.update_attributes(params) end ) end diff --git a/spec/fixtures/stripe_webhooks/customer.subscription.deleted.json b/spec/fixtures/stripe_webhooks/customer.subscription.deleted.json new file mode 100644 index 0000000000..c9c3ebee2c --- /dev/null +++ b/spec/fixtures/stripe_webhooks/customer.subscription.deleted.json @@ -0,0 +1,65 @@ +{ + "created": 1326853478, + "livemode": false, + "id": "evt_00000000000000", + "type": "customer.subscription.deleted", + "object": "event", + "data": { + "object": { + "id": "su_00000000000000", + "items": { + "object": "list", + "data": [{ + "id": "si_00000000000000", + "object": "subscription_item", + "created": 1497881783, + "plan": { + "interval": "month", + "product": "pr_00000000000000", + "amount": 100, + "currency": "usd", + "id": "fkx0AFo_00000000000000", + "object": "plan", + "livemode": false, + "interval_count": 1, + "trial_period_days": null, + "metadata": {} + }, + "quantity": 1 + }, + { + "id": "si_00000000000001", + "object": "subscription_item", + "created": 1497881788, + "plan": { + "interval": "month", + "product": "pr_00000000000001", + "amount": 200, + "currency": "eur", + "id": "fkx0AFo_00000000000001", + "object": "plan", + "livemode": false, + "interval_count": 1, + "trial_period_days": null, + "metadata": {} + }, + "quantity": 5 + } + ] + }, + "object": "subscription", + "start": 1381080564, + "status": "canceled", + "customer": "cus_00000000000000", + "cancel_at_period_end": false, + "current_period_start": 1381080564, + "current_period_end": 1383758964, + "ended_at": 1381021514, + "trial_start": null, + "trial_end": null, + "canceled_at": null, + "quantity": 1, + "application_fee_percent": null + } + } +} diff --git a/spec/fixtures/stripe_webhooks/invoice.payment_failed.json b/spec/fixtures/stripe_webhooks/invoice.payment_failed.json new file mode 100644 index 0000000000..294270e46d --- /dev/null +++ b/spec/fixtures/stripe_webhooks/invoice.payment_failed.json @@ -0,0 +1,105 @@ +{ + "created": 1326853478, + "livemode": false, + "id": "evt_00000000000000", + "type": "invoice.payment_failed", + "object": "event", + "data": { + "object": { + "date": 1380674206, + "id": "in_00000000000000", + "period_start": 1378082075, + "period_end": 1380674075, + "lines": { + "object": "list", + "count": 3, + "url": "/v1/invoices/in_00000000000000/lines", + "data": [ + { + "id": "ii_00000000000000", + "object": "line_item", + "type": "invoiceitem", + "livemode": false, + "amount": 19000, + "currency": "usd", + "proration": true, + "period": { + "start": 1393765661, + "end": 1393765661 + }, + "quantity": null, + "plan": null, + "description": "Remaining time on Platinum after 02 Mar 2014", + "metadata": {} + }, + { + "id": "ii_00000000000001", + "object": "line_item", + "type": "invoiceitem", + "livemode": false, + "amount": -9000, + "currency": "usd", + "proration": true, + "period": { + "start": 1393765661, + "end": 1393765661 + }, + "quantity": null, + "plan": null, + "description": "Unused time on Gold after 05 Mar 2014", + "metadata": {} + }, + { + "id": "su_00000000000000", + "object": "line_item", + "type": "subscription", + "livemode": false, + "amount": 20000, + "currency": "usd", + "proration": false, + "period": { + "start": 1383759053, + "end": 1386351053 + }, + "quantity": 1, + "plan": { + "interval": "month", + "product": "pr_00000000000000", + "created": 1300000000, + "amount": 20000, + "currency": "usd", + "id": "platinum", + "object": "plan", + "livemode": false, + "interval_count": 1, + "trial_period_days": null, + "metadata": {} + }, + "description": null, + "metadata": null + } + ] + }, + "subtotal": 30000, + "total": 30000, + "customer": "cus_00000000000000", + "object": "invoice", + "attempted": true, + "closed": false, + "paid": false, + "livemode": false, + "attempt_count": 1, + "amount_due": 30000, + "currency": "usd", + "starting_balance": 0, + "ending_balance": 0, + "next_payment_attempt": 1380760475, + "charge": "ch_00000000000000", + "discount": null, + "application_fee": null, + "subscription": "su_00000000000000", + "metadata": {}, + "description": null + } + } +} diff --git a/spec/fixtures/stripe_webhooks/invoice.payment_succeeded.json b/spec/fixtures/stripe_webhooks/invoice.payment_succeeded.json new file mode 100644 index 0000000000..9be30439cb --- /dev/null +++ b/spec/fixtures/stripe_webhooks/invoice.payment_succeeded.json @@ -0,0 +1,112 @@ +{ + "created": 1326853478, + "livemode": false, + "id": "evt_00000000000000", + "type": "invoice.payment_succeeded", + "object": "event", + "data": { + "object": { + "id": "in_00000000000000", + "object": "invoice", + "amount_due": 999, + "application_fee": null, + "attempt_count": 1, + "attempted": true, + "charge": "ch_18EcOcLrgDIZ7iq8TaNlErVv", + "closed": true, + "currency": "eur", + "customer": "cus_00000000000000", + "created": 1464084258, + "description": null, + "discount": null, + "ending_balance": 0, + "forgiven": false, + "lines": { + "data": [{ + "id": "sub_00000000000000", + "object": "line_item", + "amount": 50, + "currency": "eur", + "description": null, + "discountable": true, + "livemode": true, + "metadata": {}, + "period": { + "start": 1500637196, + "end": 1532173196 + }, + "plan": { + "id": "platinum", + "object": "plan", + "amount": 500, + "created": 1499943145, + "currency": "eur", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": {}, + "name": "New Plan Test", + "statement_descriptor": null, + "trial_period_days": null + }, + "proration": false, + "quantity": 1, + "subscription": null, + "subscription_item": "si_18ZfWyLrgDIZ7iq8fSlSNGIV", + "type": "subscription" + }, + { + "id": "sub_00000000000000", + "object": "line_item", + "amount": 50, + "currency": "eur", + "description": null, + "discountable": true, + "livemode": true, + "metadata": {}, + "period": { + "start": 1500637196, + "end": 1532173196 + }, + "plan": { + "id": "gold", + "object": "plan", + "amount": 300, + "created": 1499943155, + "currency": "eur", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": {}, + "name": "New gold Plan Test", + "statement_descriptor": null, + "trial_period_days": null + }, + "proration": false, + "quantity": 1, + "subscription": null, + "subscription_item": "si_18ZfWyLrgDIZ7iq8fSlSNGIV", + "type": "subscription" + }], + "total_count": 1, + "object": "list", + "url": "/v1/invoices/in_18EcOcLrgDIZ7iq8zsDkunZ0/lines" + }, + "livemode": false, + "metadata": {}, + "next_payment_attempt": null, + "paid": true, + "period_end": 1464084258, + "period_start": 1464084258, + "receipt_number": null, + "starting_balance": 0, + "statement_descriptor": null, + "subscription": "sub_00000000000000", + "subtotal": 999, + "tax": null, + "tax_percent": null, + "total": 999, + "webhooks_delivered_at": 1464084258 + } + } +} From 1428868d205e00967873a3cbb3038dc66e962ffe Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 20 Dec 2022 20:47:10 +0000 Subject: [PATCH 014/289] Add Ruby 3 support - Use forked version of `ActsAsVersioned` which has - Remove pry-byebug which isn't compiling on Ruby 3 (although Ruby 3.1 works). --- Gemfile | 4 ++-- Gemfile.lock | 29 ++++++++++++++++------------- Gemfile.rails_next.lock | 29 ++++++++++++++++------------- 3 files changed, 34 insertions(+), 28 deletions(-) diff --git a/Gemfile b/Gemfile index 6bfdde4a6c..1bb99a031a 100644 --- a/Gemfile +++ b/Gemfile @@ -93,7 +93,8 @@ end gem 'pg', '~> 1.4.4' # New gem releases aren't being done. master is newer and supports Rails > 3.0 -gem 'acts_as_versioned', :git => 'https://github.com/technoweenie/acts_as_versioned.git', :ref => '63b1fc8529d028' +gem 'acts_as_versioned', git: 'https://github.com/mysociety/acts_as_versioned.git', + ref: '13e928b' gem 'active_model_otp' gem 'bcrypt', '~> 3.1.18' gem 'cancancan', '~> 3.4.0' @@ -194,7 +195,6 @@ group :test, :development do gem 'rspec-activemodel-mocks', '~> 1.1.0' gem 'rspec-rails', '~> 6.0.0' gem 'pry', '~> 0.14.1' - gem 'pry-byebug', '~> 3.10.1' end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index 88dc9ab842..739c5c2561 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,11 @@ +GIT + remote: https://github.com/mysociety/acts_as_versioned.git + revision: 13e928b8227349461205c2fa22d0bc3dbe2f1135 + ref: 13e928b + specs: + acts_as_versioned (0.6.0) + activerecord (>= 3.0.9) + GIT remote: https://github.com/mysociety/ruby-msg.git revision: fae72e547299ab1f8b23239a79f5a1d353426b40 @@ -25,14 +33,6 @@ GIT multi_json (~> 1.0) stripe (> 5, < 6) -GIT - remote: https://github.com/technoweenie/acts_as_versioned.git - revision: 63b1fc8529d028fae632fe80ec0cb25df56cd76b - ref: 63b1fc8529d028 - specs: - acts_as_versioned (0.6.0) - activerecord (>= 3.0.9) - PATH remote: gems/alaveteli_features specs: @@ -146,7 +146,6 @@ GEM bullet (7.0.4) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) - byebug (11.1.3) cancancan (3.4.0) capistrano (2.15.9) highline @@ -276,6 +275,8 @@ GEM addressable (~> 2.3) libv8-node (16.10.0.0) libv8-node (16.10.0.0-aarch64-linux) + libv8-node (16.10.0.0-arm64-darwin) + libv8-node (16.10.0.0-x86_64-darwin) libv8-node (16.10.0.0-x86_64-linux) listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) @@ -316,6 +317,10 @@ GEM racc (~> 1.4) nokogiri (1.13.10-aarch64-linux) racc (~> 1.4) + nokogiri (1.13.10-arm64-darwin) + racc (~> 1.4) + nokogiri (1.13.10-x86_64-darwin) + racc (~> 1.4) nokogiri (1.13.10-x86_64-linux) racc (~> 1.4) oink (0.10.1) @@ -333,9 +338,6 @@ GEM pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) - pry-byebug (3.10.1) - byebug (~> 11.0) - pry (>= 0.13, < 0.15) public_suffix (5.0.0) racc (1.6.2) rack (2.2.4) @@ -513,7 +515,9 @@ GEM PLATFORMS aarch64-linux + arm64-darwin ruby + x86_64-darwin x86_64-linux DEPENDENCIES @@ -567,7 +571,6 @@ DEPENDENCIES open4 (~> 1.3.0) pg (~> 1.4.4) pry (~> 0.14.1) - pry-byebug (~> 3.10.1) rack (~> 2.2.4) rack-utf8_sanitizer (~> 1.7.0) rails (~> 6.1.7) diff --git a/Gemfile.rails_next.lock b/Gemfile.rails_next.lock index 9b63000d1f..ed20ef99ca 100644 --- a/Gemfile.rails_next.lock +++ b/Gemfile.rails_next.lock @@ -1,3 +1,11 @@ +GIT + remote: https://github.com/mysociety/acts_as_versioned.git + revision: 13e928b8227349461205c2fa22d0bc3dbe2f1135 + ref: 13e928b + specs: + acts_as_versioned (0.6.0) + activerecord (>= 3.0.9) + GIT remote: https://github.com/mysociety/ruby-msg.git revision: fae72e547299ab1f8b23239a79f5a1d353426b40 @@ -25,14 +33,6 @@ GIT multi_json (~> 1.0) stripe (> 5, < 6) -GIT - remote: https://github.com/technoweenie/acts_as_versioned.git - revision: 63b1fc8529d028fae632fe80ec0cb25df56cd76b - ref: 63b1fc8529d028 - specs: - acts_as_versioned (0.6.0) - activerecord (>= 3.0.9) - PATH remote: gems/alaveteli_features specs: @@ -152,7 +152,6 @@ GEM bullet (7.0.4) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) - byebug (11.1.3) cancancan (3.4.0) capistrano (2.15.9) highline @@ -283,6 +282,8 @@ GEM addressable (~> 2.3) libv8-node (16.10.0.0) libv8-node (16.10.0.0-aarch64-linux) + libv8-node (16.10.0.0-arm64-darwin) + libv8-node (16.10.0.0-x86_64-darwin) libv8-node (16.10.0.0-x86_64-linux) listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) @@ -340,6 +341,10 @@ GEM racc (~> 1.4) nokogiri (1.13.10-aarch64-linux) racc (~> 1.4) + nokogiri (1.13.10-arm64-darwin) + racc (~> 1.4) + nokogiri (1.13.10-x86_64-darwin) + racc (~> 1.4) nokogiri (1.13.10-x86_64-linux) racc (~> 1.4) oink (0.10.1) @@ -357,9 +362,6 @@ GEM pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) - pry-byebug (3.10.1) - byebug (~> 11.0) - pry (>= 0.13, < 0.15) public_suffix (5.0.0) racc (1.6.2) rack (2.2.4) @@ -540,7 +542,9 @@ GEM PLATFORMS aarch64-linux + arm64-darwin ruby + x86_64-darwin x86_64-linux DEPENDENCIES @@ -595,7 +599,6 @@ DEPENDENCIES open4 (~> 1.3.0) pg (~> 1.4.4) pry (~> 0.14.1) - pry-byebug (~> 3.10.1) rack (~> 2.2.4) rack-utf8_sanitizer (~> 1.7.0) rails (~> 7.0.4) From bae6ff7384acb21ed967d1ca0739203a43e31268 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Mon, 19 Dec 2022 14:57:26 +0000 Subject: [PATCH 015/289] Add Ruby 3 to CI build matrix Removes testing Rails 7 on Ruby 2.7 as we'll be upgrading Ruby first. Update the Gemfile to remove some default gems which come with Ruby which were added in #6703. These won't needed we're not support running Alaveteli on Rails 7 and Ruby 2.7. --- .github/workflows/ci.yml | 3 ++- Gemfile | 5 ----- Gemfile.rails_next.lock | 6 ------ README.md | 1 + 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51486cb02c..d412b6ac90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,8 @@ jobs: matrix: include: - { ruby: 2.7, postgres: 13.5 } - - { ruby: 2.7, postgres: 13.5, gemfile: 'Gemfile.rails_next' } + - { ruby: '3.0', postgres: 13.5 } + - { ruby: '3.0', postgres: 13.5, gemfile: 'Gemfile.rails_next' } services: postgres: diff --git a/Gemfile b/Gemfile index 1bb99a031a..fa2171ac62 100644 --- a/Gemfile +++ b/Gemfile @@ -172,11 +172,6 @@ gem 'aws-sdk-s3', require: false gem 'azure-storage', require: false gem 'google-cloud-storage', '~> 1.43', require: false -if rails_upgrade? && RUBY_VERSION < '3.1' - gem 'net-http', '0.1.1' - gem 'uri', '0.10.0' -end - group :test do gem 'fivemat', '~> 1.3.7' gem 'webmock', '~> 3.18.1' diff --git a/Gemfile.rails_next.lock b/Gemfile.rails_next.lock index ed20ef99ca..b105705b73 100644 --- a/Gemfile.rails_next.lock +++ b/Gemfile.rails_next.lock @@ -311,9 +311,6 @@ GEM i18n (>= 0.6.4, <= 2) multi_json (1.15.0) multipart-post (2.2.3) - net-http (0.1.1) - net-protocol - uri net-imap (0.2.3) digest net-protocol @@ -516,7 +513,6 @@ GEM unicode-display_width (2.3.0) unidecoder (1.1.2) uniform_notifier (1.16.0) - uri (0.10.0) vpim (13.11.11) web-console (4.2.0) actionview (>= 6.0.0) @@ -591,7 +587,6 @@ DEPENDENCIES mini_magick (~> 4.11.0) mini_racer (~> 0.6.3) money (~> 6.16.0) - net-http (= 0.1.1) net-ssh (~> 7.0.1) net-ssh-gateway (>= 1.1.0, < 3.0.0) nokogiri (~> 1.13.10) @@ -628,7 +623,6 @@ DEPENDENCIES uglifier (~> 4.2.0) unicode (~> 0.4.4) unidecoder (~> 1.1.0) - uri (= 0.10.0) vpim (~> 13.11.11) web-console (>= 3.3.0) webmock (~> 3.18.1) diff --git a/README.md b/README.md index b66a287c39..dd22d15634 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ see [the project website](http://alaveteli.org) for instructions on installing A Every Alaveteli commit is tested by GitHub Actions on the [following Ruby platforms](https://github.com/mysociety/alaveteli/blob/develop/.github/workflows/ci.yml#L15) * ruby-2.7 +* ruby-3.0 If you use a ruby version management tool (such as RVM or .rbenv) and want to use the default development version used by the Alaveteli team (currently 2.7.4), you can create a `.ruby-version` symlink with a target of `.ruby-version.example` to switch to that automatically in the project directory. From cb471ed02485b825e0864dc1aeab323f9498787e Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 5 Jan 2023 12:06:05 +0000 Subject: [PATCH 016/289] Switch to using Ruby 3 by default --- .github/workflows/rubocop.yml | 2 +- .ruby-style.yml | 2 +- .ruby-version.example | 2 +- README.md | 2 +- docker/Dockerfile | 2 +- lib/tasks/config_files.rake | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index 3a3757a775..4707f2017e 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -14,7 +14,7 @@ jobs: - name: Install Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7 + ruby-version: 3.0 - name: Run RuboCop linter uses: reviewdog/action-rubocop@v1 diff --git a/.ruby-style.yml b/.ruby-style.yml index 598c65f829..31f8ed39e2 100644 --- a/.ruby-style.yml +++ b/.ruby-style.yml @@ -4,7 +4,7 @@ require: - rubocop-rails AllCops: - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.0 RubyInterpreters: - ruby - rake diff --git a/.ruby-version.example b/.ruby-version.example index a4dd9dba4f..b0f2dcb32f 100644 --- a/.ruby-version.example +++ b/.ruby-version.example @@ -1 +1 @@ -2.7.4 +3.0.4 diff --git a/README.md b/README.md index dd22d15634..ea6db2d1da 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Every Alaveteli commit is tested by GitHub Actions on the [following Ruby platfo * ruby-2.7 * ruby-3.0 -If you use a ruby version management tool (such as RVM or .rbenv) and want to use the default development version used by the Alaveteli team (currently 2.7.4), you can create a `.ruby-version` symlink with a target of `.ruby-version.example` to switch to that automatically in the project directory. +If you use a ruby version management tool (such as RVM or .rbenv) and want to use the default development version used by the Alaveteli team (currently 3.0.4), you can create a `.ruby-version` symlink with a target of `.ruby-version.example` to switch to that automatically in the project directory. ## How to contribute diff --git a/docker/Dockerfile b/docker/Dockerfile index 875fbe51b8..e08d9c4d41 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.7-bullseye +FROM ruby:3.0-bullseye ENV DOCKER 1 ENV DEBIAN_FRONTEND noninteractive diff --git a/lib/tasks/config_files.rake b/lib/tasks/config_files.rake index 17daa13dec..e9b41368b1 100644 --- a/lib/tasks/config_files.rake +++ b/lib/tasks/config_files.rake @@ -80,7 +80,7 @@ namespace :config_files do 'VCSPATH=alaveteli ' \ 'SITE=alaveteli ' \ 'SCRIPT_FILE=config/alert-tracks-debian.example ' \ - 'RUBY_VERSION=2.7.4 ' \ + 'RUBY_VERSION=3.0.4 ' \ 'USE_RBENV=false ' check_for_env_vars(['DEPLOY_USER', 'VHOST_DIR', @@ -125,7 +125,7 @@ namespace :config_files do 'VHOST_DIR=/dir/above/alaveteli VCSPATH=alaveteli ' \ 'SITE=alaveteli CRONTAB=config/crontab-example ' \ 'MAILTO=cron-alaveteli@example.org ' \ - 'RUBY_VERSION=2.7.4 ' + 'RUBY_VERSION=3.0.4 ' 'USE_RBENV=false ' check_for_env_vars(['DEPLOY_USER', 'VHOST_DIR', From 418e2a5101c8bb36ed84be51d8afff6cd2cad515 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 5 Jan 2023 12:20:02 +0000 Subject: [PATCH 017/289] Drop support for Ruby 2.7 --- .github/workflows/ci.yml | 1 - README.md | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d412b6ac90..237db10108 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,6 @@ jobs: fail-fast: false matrix: include: - - { ruby: 2.7, postgres: 13.5 } - { ruby: '3.0', postgres: 13.5 } - { ruby: '3.0', postgres: 13.5, gemfile: 'Gemfile.rails_next' } diff --git a/README.md b/README.md index ea6db2d1da..44da287907 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,6 @@ see [the project website](http://alaveteli.org) for instructions on installing A Every Alaveteli commit is tested by GitHub Actions on the [following Ruby platforms](https://github.com/mysociety/alaveteli/blob/develop/.github/workflows/ci.yml#L15) -* ruby-2.7 * ruby-3.0 If you use a ruby version management tool (such as RVM or .rbenv) and want to use the default development version used by the Alaveteli team (currently 3.0.4), you can create a `.ruby-version` symlink with a target of `.ruby-version.example` to switch to that automatically in the project directory. From f2a3a0225968726f155fe545186674fed7f56ff3 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 5 Jan 2023 12:07:44 +0000 Subject: [PATCH 018/289] Update changelog --- doc/CHANGES.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 5de41d6074..0207f93eab 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -1,3 +1,16 @@ +# develop + +## Highlighted Features + +* Add support for Ruby 3 (Graeme Porteous) +* Drop support for Ruby 2.7 (Graeme Porteous) + +## Upgrade Notes + +* To upgrade the Ruby version in your development Docker container please run: + + docker/reset + # 0.42.0.0 ## Highlighted Features From 530ffa253e5f711eb0fd45b1e33ad293550a8e2d Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 5 Jan 2023 10:03:37 +0000 Subject: [PATCH 019/289] Upgrade to Rails 7 --- Gemfile | 2 +- Gemfile.lock | 161 ++++++++++-------- Gemfile.rails_next.lock | 2 +- config/application.rb | 2 +- .../alaveteli_features.gemspec | 4 +- 5 files changed, 94 insertions(+), 77 deletions(-) diff --git a/Gemfile b/Gemfile index fa2171ac62..9081e8727a 100644 --- a/Gemfile +++ b/Gemfile @@ -81,7 +81,7 @@ source 'https://rubygems.org' # See instructions in Gemfile.rails_next def rails_upgrade? - %w[1 true].include?(ENV['RAILS_UPGRADE']) + true end if rails_upgrade? diff --git a/Gemfile.lock b/Gemfile.lock index 739c5c2561..5e3625f3bc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,11 +17,11 @@ GIT GIT remote: https://github.com/mysociety/strip_attributes.git - revision: 62a5e1ee26501ad4c111b855cd73a5653091300b - branch: globalize3-rails5.2 + revision: 842a889258a897692296dff8445bb9dc12e676f8 + branch: globalize3-rails7 specs: - strip_attributes (1.11.0) - activemodel (>= 3.0, < 7.0) + strip_attributes (1.12.0) + activemodel (>= 3.0, < 8.0) GIT remote: https://github.com/stripe-ruby-mock/stripe-ruby-mock @@ -40,45 +40,52 @@ PATH flipper (~> 0.10) flipper-active_record (~> 0.10) mime-types (< 3.0.0) - rails (~> 6.1.4) + rails (~> 7.0.4) GEM remote: https://rubygems.org/ specs: - actioncable (6.1.7) - actionpack (= 6.1.7) - activesupport (= 6.1.7) + actioncable (7.0.4) + actionpack (= 7.0.4) + activesupport (= 7.0.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7) - actionpack (= 6.1.7) - activejob (= 6.1.7) - activerecord (= 6.1.7) - activestorage (= 6.1.7) - activesupport (= 6.1.7) + actionmailbox (7.0.4) + actionpack (= 7.0.4) + activejob (= 7.0.4) + activerecord (= 7.0.4) + activestorage (= 7.0.4) + activesupport (= 7.0.4) mail (>= 2.7.1) - actionmailer (6.1.7) - actionpack (= 6.1.7) - actionview (= 6.1.7) - activejob (= 6.1.7) - activesupport (= 6.1.7) + net-imap + net-pop + net-smtp + actionmailer (7.0.4) + actionpack (= 7.0.4) + actionview (= 7.0.4) + activejob (= 7.0.4) + activesupport (= 7.0.4) mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp rails-dom-testing (~> 2.0) - actionpack (6.1.7) - actionview (= 6.1.7) - activesupport (= 6.1.7) - rack (~> 2.0, >= 2.0.9) + actionpack (7.0.4) + actionview (= 7.0.4) + activesupport (= 7.0.4) + rack (~> 2.0, >= 2.2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7) - actionpack (= 6.1.7) - activerecord (= 6.1.7) - activestorage (= 6.1.7) - activesupport (= 6.1.7) + actiontext (7.0.4) + actionpack (= 7.0.4) + activerecord (= 7.0.4) + activestorage (= 7.0.4) + activesupport (= 7.0.4) + globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (6.1.7) - activesupport (= 6.1.7) + actionview (7.0.4) + activesupport (= 7.0.4) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -86,27 +93,26 @@ GEM active_model_otp (2.3.1) activemodel rotp (~> 6.2.0) - activejob (6.1.7) - activesupport (= 6.1.7) + activejob (7.0.4) + activesupport (= 7.0.4) globalid (>= 0.3.6) - activemodel (6.1.7) - activesupport (= 6.1.7) - activerecord (6.1.7) - activemodel (= 6.1.7) - activesupport (= 6.1.7) - activestorage (6.1.7) - actionpack (= 6.1.7) - activejob (= 6.1.7) - activerecord (= 6.1.7) - activesupport (= 6.1.7) + activemodel (7.0.4) + activesupport (= 7.0.4) + activerecord (7.0.4) + activemodel (= 7.0.4) + activesupport (= 7.0.4) + activestorage (7.0.4) + actionpack (= 7.0.4) + activejob (= 7.0.4) + activerecord (= 7.0.4) + activesupport (= 7.0.4) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7) + activesupport (7.0.4) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - zeitwerk (~> 2.3) addressable (2.8.1) public_suffix (>= 2.0.2, < 6.0) annotate (3.2.0) @@ -171,12 +177,13 @@ GEM daemons (1.4.0) dalli (3.2.3) dante (0.2.0) + date (3.3.3) declarative (0.0.20) diff-lcs (1.5.0) digest-crc (0.6.4) rake (>= 12.0.0, < 14.0.0) docile (1.3.5) - erubi (1.11.0) + erubi (1.12.0) eventmachine (1.2.7) exception_notification (4.5.0) actionmailer (>= 5.2, < 8) @@ -196,10 +203,10 @@ GEM fast_gettext (2.2.0) ffi (1.15.5) fivemat (1.3.7) - flipper (0.22.1) - flipper-active_record (0.22.1) - activerecord (>= 4.2, < 7) - flipper (~> 0.22.1) + flipper (0.24.1) + flipper-active_record (0.24.1) + activerecord (>= 4.2, < 8) + flipper (~> 0.24.1) forwardable (1.3.2) gender_detector (2.0.0) gettext (3.4.3) @@ -269,7 +276,7 @@ GEM thor (>= 0.14, < 2.0) jquery-ui-rails (6.0.1) railties (>= 3.2.16) - json (2.6.2) + json (2.6.3) jwt (2.5.0) launchy (2.4.3) addressable (~> 2.3) @@ -299,15 +306,24 @@ GEM mini_portile2 (2.8.1) mini_racer (0.6.3) libv8-node (~> 16.10.0.0) - minitest (5.16.3) + minitest (5.17.0) money (6.16.0) i18n (>= 0.6.4, <= 2) multi_json (1.15.0) multipart-post (2.2.3) + net-imap (0.3.4) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.1) + timeout net-scp (1.2.1) net-ssh (>= 2.6.5) net-sftp (2.1.2) net-ssh (>= 2.6.5) + net-smtp (0.3.3) + net-protocol net-ssh (7.0.1) net-ssh-gateway (2.0.0) net-ssh (>= 4.0.0) @@ -329,7 +345,7 @@ GEM open4 (1.3.4) os (1.1.4) parallel (1.22.1) - parser (3.1.2.1) + parser (3.1.3.0) ast (~> 2.4.1) pg (1.4.4) prime (0.1.2) @@ -340,26 +356,25 @@ GEM method_source (~> 1.0) public_suffix (5.0.0) racc (1.6.2) - rack (2.2.4) + rack (2.2.5) rack-test (2.0.2) rack (>= 1.3) rack-utf8_sanitizer (1.7.0) rack (>= 1.0, < 3.0) - rails (6.1.7) - actioncable (= 6.1.7) - actionmailbox (= 6.1.7) - actionmailer (= 6.1.7) - actionpack (= 6.1.7) - actiontext (= 6.1.7) - actionview (= 6.1.7) - activejob (= 6.1.7) - activemodel (= 6.1.7) - activerecord (= 6.1.7) - activestorage (= 6.1.7) - activesupport (= 6.1.7) + rails (7.0.4) + actioncable (= 7.0.4) + actionmailbox (= 7.0.4) + actionmailer (= 7.0.4) + actionpack (= 7.0.4) + actiontext (= 7.0.4) + actionview (= 7.0.4) + activejob (= 7.0.4) + activemodel (= 7.0.4) + activerecord (= 7.0.4) + activestorage (= 7.0.4) + activesupport (= 7.0.4) bundler (>= 1.15.0) - railties (= 6.1.7) - sprockets-rails (>= 2.0.0) + railties (= 7.0.4) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -372,12 +387,13 @@ GEM rails-i18n (7.0.5) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (6.1.7) - actionpack (= 6.1.7) - activesupport (= 6.1.7) + railties (7.0.4) + actionpack (= 7.0.4) + activesupport (= 7.0.4) method_source rake (>= 12.2) thor (~> 1.0) + zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.0.6) rb-fsevent (0.11.0) @@ -430,7 +446,7 @@ GEM rubocop-ast (>= 1.23.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.23.0) + rubocop-ast (1.24.0) parser (>= 3.1.1.0) rubocop-performance (1.15.1) rubocop (>= 1.7.0, < 2.0) @@ -480,6 +496,7 @@ GEM rack (>= 1, < 3) thor (1.2.1) tilt (2.0.10) + timeout (0.3.1) trailblazer-option (0.1.2) tzinfo (2.0.5) concurrent-ruby (~> 1.0) @@ -573,7 +590,7 @@ DEPENDENCIES pry (~> 0.14.1) rack (~> 2.2.4) rack-utf8_sanitizer (~> 1.7.0) - rails (~> 6.1.7) + rails (~> 7.0.4) rails-controller-testing rails-i18n (~> 7.0.5) recaptcha (~> 5.12.3) diff --git a/Gemfile.rails_next.lock b/Gemfile.rails_next.lock index b105705b73..9f5f4467aa 100644 --- a/Gemfile.rails_next.lock +++ b/Gemfile.rails_next.lock @@ -40,7 +40,7 @@ PATH flipper (~> 0.10) flipper-active_record (~> 0.10) mime-types (< 3.0.0) - rails (~> 7.0.2) + rails (~> 7.0.4) GEM remote: https://rubygems.org/ diff --git a/config/application.rb b/config/application.rb index 88995704d2..7fe9fd31b7 100644 --- a/config/application.rb +++ b/config/application.rb @@ -23,7 +23,7 @@ Bundler.require(*Rails.groups) def rails_upgrade? - %w[1 true].include?(ENV['RAILS_UPGRADE']) + true end module Alaveteli diff --git a/gems/alaveteli_features/alaveteli_features.gemspec b/gems/alaveteli_features/alaveteli_features.gemspec index f1e643ced0..9b7dd7ce32 100644 --- a/gems/alaveteli_features/alaveteli_features.gemspec +++ b/gems/alaveteli_features/alaveteli_features.gemspec @@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'alaveteli_features/version' def rails_upgrade? - %w[1 true].include?(ENV['RAILS_UPGRADE']) + true end Gem::Specification.new do |spec| @@ -21,7 +21,7 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_dependency "rails", rails_upgrade? ? "~> 7.0.2" : "~> 6.1.4" + spec.add_dependency "rails", rails_upgrade? ? "~> 7.0.4" : "~> 6.1.4" spec.add_dependency "flipper", "~> 0.10" spec.add_dependency "flipper-active_record", "~> 0.10" # Mime types 3 needs Ruby 2.0.0 or greater, but we need to support 1.9.3 so From 9bf0c864ba32e7c7c258d0d44fb4d992941def6e Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 5 Jan 2023 10:04:24 +0000 Subject: [PATCH 020/289] Remove rails_upgrade conditionals Rails 6.1 is no more so we can drop the old implementation. Leave conditionals methods in Gemfiles for when we prep for Rails edge. --- Gemfile | 12 +- app/views/admin_public_body/show.html.erb | 6 +- config/application.rb | 9 +- .../alaveteli_features.gemspec | 2 +- spec/factories/mail_server_log_dones.rb | 6 +- .../fixtures/files/yaml_compatibility_4_2.yml | 259 ------------------ spec/lib/yaml_compatability_spec.rb | 8 - 7 files changed, 8 insertions(+), 294 deletions(-) delete mode 100644 spec/fixtures/files/yaml_compatibility_4_2.yml diff --git a/Gemfile b/Gemfile index 9081e8727a..c78ea73569 100644 --- a/Gemfile +++ b/Gemfile @@ -84,11 +84,7 @@ def rails_upgrade? true end -if rails_upgrade? - gem 'rails', '~> 7.0.4' -else - gem 'rails', '~> 6.1.7' -end +gem 'rails', '~> 7.0.4' gem 'pg', '~> 1.4.4' @@ -124,11 +120,7 @@ gem 'ruby-msg', '~> 1.5.0', :git => 'https://github.com/mysociety/ruby-msg.git', gem 'rubyzip', '~> 2.3.2' gem 'secure_headers', '~> 6.4.0' gem 'statistics2', '~> 0.54' -if rails_upgrade? - gem 'strip_attributes', :git => 'https://github.com/mysociety/strip_attributes.git', :branch => 'globalize3-rails7' -else - gem 'strip_attributes', :git => 'https://github.com/mysociety/strip_attributes.git', :branch => 'globalize3-rails5.2' -end +gem 'strip_attributes', :git => 'https://github.com/mysociety/strip_attributes.git', :branch => 'globalize3-rails7' gem 'stripe', '~> 5.55.0' gem 'syck', '~> 1.4.1', require: false gem 'syslog_protocol', '~> 0.9.0' diff --git a/app/views/admin_public_body/show.html.erb b/app/views/admin_public_body/show.html.erb index a577a679d9..5f693afd3e 100644 --- a/app/views/admin_public_body/show.html.erb +++ b/app/views/admin_public_body/show.html.erb @@ -78,11 +78,7 @@
- <% if rails_upgrade? %> - <%= version.updated_at.to_fs(:db) %> - <% else %> - <%= version.updated_at.to_s(:db) %> - <% end %> + <%= version.updated_at.to_fs(:db) %> (<%= time_ago_in_words(version.updated_at) %> ago)
diff --git a/config/application.rb b/config/application.rb index 7fe9fd31b7..0495666279 100644 --- a/config/application.rb +++ b/config/application.rb @@ -35,12 +35,9 @@ class Application < Rails::Application # # config.time_zone = "Central Time (US & Canada)" # config.eager_load_paths << Rails.root.join("extras") - - if rails_upgrade? - config.autoloader = :zeitwerk - config.active_record.legacy_connection_handling = false - config.active_support.use_rfc4122_namespaced_uuids = true - end + config.autoloader = :zeitwerk + config.active_record.legacy_connection_handling = false + config.active_support.use_rfc4122_namespaced_uuids = true # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] diff --git a/gems/alaveteli_features/alaveteli_features.gemspec b/gems/alaveteli_features/alaveteli_features.gemspec index 9b7dd7ce32..9b3928b440 100644 --- a/gems/alaveteli_features/alaveteli_features.gemspec +++ b/gems/alaveteli_features/alaveteli_features.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_dependency "rails", rails_upgrade? ? "~> 7.0.4" : "~> 6.1.4" + spec.add_dependency "rails", "~> 7.0.4" spec.add_dependency "flipper", "~> 0.10" spec.add_dependency "flipper-active_record", "~> 0.10" # Mime types 3 needs Ruby 2.0.0 or greater, but we need to support 1.9.3 so diff --git a/spec/factories/mail_server_log_dones.rb b/spec/factories/mail_server_log_dones.rb index 9b3f480982..514aa6635c 100644 --- a/spec/factories/mail_server_log_dones.rb +++ b/spec/factories/mail_server_log_dones.rb @@ -14,11 +14,7 @@ factory :mail_server_log_done do filename { - if rails_upgrade? - "/var/log/mail/mail.log-#{ Date.current.to_fs(:number)} " - else - "/var/log/mail/mail.log-#{ Date.current.to_s(:number)} " - end + "/var/log/mail/mail.log-#{ Date.current.to_fs(:number)} " } last_stat { Time.current } end diff --git a/spec/fixtures/files/yaml_compatibility_4_2.yml b/spec/fixtures/files/yaml_compatibility_4_2.yml deleted file mode 100644 index e19ea582c3..0000000000 --- a/spec/fixtures/files/yaml_compatibility_4_2.yml +++ /dev/null @@ -1,259 +0,0 @@ ---- -:user: !ruby/object:User - raw_attributes: - locale: en - name: Annie All Roles - ban_text: '' - closed_at: - email: annie@localhost - id: '8' - hashed_password: 6b7cd45a5f35fd83febc0452a799530398bfb6e8 - salt: "-6116981980.392287733335677" - created_at: '2007-10-31 10:39:15.491593' - updated_at: '2007-10-31 10:39:15.491593' - email_confirmed: t - url_name: annie_admin - last_daily_track_email: '2000-01-01 00:00:00' - about_me: All the roles - email_bounced_at: - email_bounce_message: '' - no_limit: f - receive_email_alerts: t - can_make_batch_requests: f - otp_enabled: f - otp_secret_key: - otp_counter: '1' - confirmed_not_spam: f - comments_count: '0' - info_requests_count: '1' - track_things_count: '0' - request_classifications_count: '0' - public_body_change_requests_count: '0' - info_request_batches_count: '0' - daily_summary_hour: - daily_summary_minute: - attributes: !ruby/object:ActiveRecord::AttributeSet - attributes: !ruby/object:ActiveRecord::LazyAttributeHash - types: - id: &5 !ruby/object:ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Integer - precision: - scale: - limit: - range: !ruby/range - begin: -2147483648 - end: 2147483648 - excl: true - email: &1 !ruby/object:ActiveRecord::Type::String - precision: - scale: - limit: - name: *1 - hashed_password: *1 - salt: *1 - created_at: &7 !ruby/object:ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter - subtype: &2 !ruby/object:ActiveRecord::ConnectionAdapters::PostgreSQL::OID::DateTime - precision: - scale: - limit: - updated_at: &8 !ruby/object:ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter - subtype: *2 - email_confirmed: &4 !ruby/object:ActiveRecord::Type::Boolean - precision: - scale: - limit: - url_name: &3 !ruby/object:ActiveRecord::Type::Text - precision: - scale: - limit: - last_daily_track_email: &9 !ruby/object:ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter - subtype: *2 - ban_text: *3 - about_me: *3 - locale: *1 - email_bounced_at: &10 !ruby/object:ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter - subtype: *2 - email_bounce_message: *3 - no_limit: *4 - receive_email_alerts: *4 - can_make_batch_requests: *4 - otp_enabled: *4 - otp_secret_key: *1 - otp_counter: *5 - confirmed_not_spam: *4 - comments_count: *5 - info_requests_count: *5 - track_things_count: *5 - request_classifications_count: *5 - public_body_change_requests_count: *5 - info_request_batches_count: *5 - daily_summary_hour: *5 - daily_summary_minute: *5 - closed_at: &6 !ruby/object:ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter - subtype: *2 - values: - id: '8' - email: annie@localhost - name: Annie All Roles - hashed_password: 6b7cd45a5f35fd83febc0452a799530398bfb6e8 - salt: "-6116981980.392287733335677" - created_at: '2007-10-31 10:39:15.491593' - updated_at: '2007-10-31 10:39:15.491593' - email_confirmed: t - url_name: annie_admin - last_daily_track_email: '2000-01-01 00:00:00' - ban_text: '' - about_me: All the roles - locale: en - email_bounced_at: - email_bounce_message: '' - no_limit: f - receive_email_alerts: t - can_make_batch_requests: f - otp_enabled: f - otp_secret_key: - otp_counter: '1' - confirmed_not_spam: f - comments_count: '0' - info_requests_count: '1' - track_things_count: '0' - request_classifications_count: '0' - public_body_change_requests_count: '0' - info_request_batches_count: '0' - daily_summary_hour: - daily_summary_minute: - closed_at: - additional_types: {} - materialized: true - delegate_hash: - locale: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: locale - value_before_type_cast: en - type: *1 - value: en - name: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: name - value_before_type_cast: Annie All Roles - type: *1 - value: Annie All Roles - ban_text: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: ban_text - value_before_type_cast: '' - type: *3 - value: '' - closed_at: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: closed_at - value_before_type_cast: - type: *6 - value: - email: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: email - value_before_type_cast: annie@localhost - type: *1 - value: annie@localhost - id: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: id - value_before_type_cast: '8' - type: *5 - value: 8 - hashed_password: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: hashed_password - value_before_type_cast: 6b7cd45a5f35fd83febc0452a799530398bfb6e8 - type: *1 - salt: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: salt - value_before_type_cast: "-6116981980.392287733335677" - type: *1 - created_at: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: created_at - value_before_type_cast: '2007-10-31 10:39:15.491593' - type: *7 - updated_at: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: updated_at - value_before_type_cast: '2007-10-31 10:39:15.491593' - type: *8 - email_confirmed: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: email_confirmed - value_before_type_cast: t - type: *4 - url_name: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: url_name - value_before_type_cast: annie_admin - type: *3 - last_daily_track_email: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: last_daily_track_email - value_before_type_cast: '2000-01-01 00:00:00' - type: *9 - about_me: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: about_me - value_before_type_cast: All the roles - type: *3 - email_bounced_at: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: email_bounced_at - value_before_type_cast: - type: *10 - email_bounce_message: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: email_bounce_message - value_before_type_cast: '' - type: *3 - no_limit: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: no_limit - value_before_type_cast: f - type: *4 - receive_email_alerts: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: receive_email_alerts - value_before_type_cast: t - type: *4 - can_make_batch_requests: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: can_make_batch_requests - value_before_type_cast: f - type: *4 - otp_enabled: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: otp_enabled - value_before_type_cast: f - type: *4 - otp_secret_key: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: otp_secret_key - value_before_type_cast: - type: *1 - otp_counter: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: otp_counter - value_before_type_cast: '1' - type: *5 - confirmed_not_spam: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: confirmed_not_spam - value_before_type_cast: f - type: *4 - comments_count: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: comments_count - value_before_type_cast: '0' - type: *5 - info_requests_count: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: info_requests_count - value_before_type_cast: '1' - type: *5 - track_things_count: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: track_things_count - value_before_type_cast: '0' - type: *5 - request_classifications_count: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: request_classifications_count - value_before_type_cast: '0' - type: *5 - public_body_change_requests_count: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: public_body_change_requests_count - value_before_type_cast: '0' - type: *5 - info_request_batches_count: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: info_request_batches_count - value_before_type_cast: '0' - type: *5 - daily_summary_hour: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: daily_summary_hour - value_before_type_cast: - type: *5 - daily_summary_minute: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: daily_summary_minute - value_before_type_cast: - type: *5 - new_record: false - active_record_yaml_version: 0 diff --git a/spec/lib/yaml_compatability_spec.rb b/spec/lib/yaml_compatability_spec.rb index 96cd1ea1bc..7274936b99 100644 --- a/spec/lib/yaml_compatability_spec.rb +++ b/spec/lib/yaml_compatability_spec.rb @@ -6,14 +6,6 @@ subject(:output_hash) { described_class.load(content) } let(:hash) { YAML.load(yaml_compatibility_fixture('5_1')) } - context 'with Rails 4.2 YAML file' do - let(:content) { yaml_compatibility_fixture('4_2') } - - it 'correctly loads YAML file' do - is_expected.to eq hash unless rails_upgrade? - end - end - context 'with Rails 5.0 YAML file' do let(:content) { yaml_compatibility_fixture('5_0') } From 6bf3307526711c37207b1ad5aaa11a9305c3bf42 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 5 Jan 2023 10:05:19 +0000 Subject: [PATCH 021/289] Update changelog --- doc/CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 0207f93eab..f54d8fc63e 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -2,6 +2,7 @@ ## Highlighted Features +* Upgrade to Rails 7 (Graeme Porteous) * Add support for Ruby 3 (Graeme Porteous) * Drop support for Ruby 2.7 (Graeme Porteous) From fd7fc77d5f0cca3fba22ed18af343a4e8e13e653 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 12 Jan 2023 07:48:04 +0000 Subject: [PATCH 022/289] Update text masking for PDF attachments Large PDFs attachments, with lots of images are sometimes received. These will normally will be compressed and expand to much larger files size. This can cause memory issues due to how we are passing the data around the application to external commands such as `pdftk`. Passing this data via STDIN to `pdftk` to seems to be the main issue here where we are seeing uncompressed PDFs over 900Mb not able to be re-compressed despite leaving the process running for over 1 hour. This change switches to use tempfiles when uncompressing or compressing PDF attachments which, in testing on my development and WDTK production environment, allows the whole `apply_masks` process which includes uncompressing and re-compressing, to complete in under 2 minutes. --- doc/CHANGES.md | 1 + lib/alaveteli_text_masker.rb | 24 ++++++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 0207f93eab..bc0a7286c3 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -2,6 +2,7 @@ ## Highlighted Features +* Improve processing of large PDF attachments (Graeme Porteous) * Add support for Ruby 3 (Graeme Porteous) * Drop support for Ruby 2.7 (Graeme Porteous) diff --git a/lib/alaveteli_text_masker.rb b/lib/alaveteli_text_masker.rb index e2c827a3c4..add2680538 100644 --- a/lib/alaveteli_text_masker.rb +++ b/lib/alaveteli_text_masker.rb @@ -1,3 +1,5 @@ +require 'tempfile' + module AlaveteliTextMasker include ConfigHelper @@ -47,10 +49,22 @@ def apply_masks(text, content_type, options = {}) private def uncompress_pdf(text) - AlaveteliExternalCommand.run("pdftk", "-", "output", "-", "uncompress", :stdin_string => text) + temp = Tempfile.new('pdftk', './tmp', encoding: 'ascii-8bit') + temp.write(text) + temp.close + + AlaveteliExternalCommand.run( + "pdftk", temp.path, "output", "-", "uncompress" + ) + ensure + temp.unlink end def compress_pdf(text) + temp = Tempfile.new('pdftk', './tmp', encoding: 'ascii-8bit') + temp.write(text) + temp.close + if AlaveteliConfiguration::use_ghostscript_compression command = ["gs", "-sDEVICE=pdfwrite", @@ -60,11 +74,13 @@ def compress_pdf(text) "-dQUIET", "-dBATCH", "-sOutputFile=-", - "-"] + temp.path] else - command = ["pdftk", "-", "output", "-", "compress"] + command = ["pdftk", temp.path, "output", "-", "compress"] end - AlaveteliExternalCommand.run(*(command + [ :stdin_string => text ])) + AlaveteliExternalCommand.run(*command) + ensure + temp.unlink end def apply_pdf_masks(text, options = {}) From c51b0718c226e151e82887d28a17b3017cbe6695 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Fri, 13 Jan 2023 13:56:03 +0000 Subject: [PATCH 023/289] Add bootboot bundler plugin Use bootboot to manage our "next" Gemfile. This currently has been used for Rails upgrades but since we're now running the latest version we can use this for other dependencies too, such as Ruby versions or other large gems which might require large changes to the codebase. Co-authored-by: Graeme Porteous Co-authored-by: Alexander Griffen --- .github/workflows/ci.yml | 13 +- Gemfile | 9 +- Gemfile.rails_next | 2 +- Gemfile_next.lock | 626 ++++++++++++++++++ bin/bundle_next | 2 +- bin/rails_next | 2 +- bin/rspec_next | 2 +- config/application.rb | 4 +- .../alaveteli_features.gemspec | 4 +- 9 files changed, 649 insertions(+), 15 deletions(-) create mode 100644 Gemfile_next.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 237db10108..7b18fa5929 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ permissions: jobs: rspec: - name: Ruby ${{ matrix.ruby }} / PostgreSQL ${{ matrix.postgres }} / ${{ matrix.gemfile || 'Gemfile' }} + name: Ruby ${{ matrix.ruby }} / PostgreSQL ${{ matrix.postgres }} / ${{ matrix.dependencies }} runs-on: ubuntu-20.04 permissions: @@ -24,8 +24,8 @@ jobs: fail-fast: false matrix: include: - - { ruby: '3.0', postgres: 13.5 } - - { ruby: '3.0', postgres: 13.5, gemfile: 'Gemfile.rails_next' } + - { ruby: '3.0', postgres: 13.5, dependencies: 'Current'} + - { ruby: '3.0', postgres: 13.5, dependencies: 'Next' } services: postgres: @@ -41,11 +41,16 @@ jobs: --health-retries 5 env: - BUNDLE_GEMFILE: ${{ matrix.gemfile || 'Gemfile' }} DATABASE_URL: postgres://postgres:postgres@localhost:5432/alaveteli_test RAILS_ENV: test steps: + - name: Conditionally set environment variable + run: | + if [[ ${{ matrix.dependencies }} == 'Next' ]]; then + echo "DEPENDENCIES_NEXT=1" >> "$GITHUB_ENV" + fi + - name: Checkout repository uses: actions/checkout@v2 with: diff --git a/Gemfile b/Gemfile index c78ea73569..2803565e28 100644 --- a/Gemfile +++ b/Gemfile @@ -79,9 +79,8 @@ # the new version. It is always preferable to upgrade our code. source 'https://rubygems.org' -# See instructions in Gemfile.rails_next -def rails_upgrade? - true +def dependencies_next? + ENV['DEPENDENCIES_NEXT'] end gem 'rails', '~> 7.0.4' @@ -196,3 +195,7 @@ group :development do gem 'rubocop-performance', require: false gem 'rubocop-rails', require: false end + +plugin 'bootboot', '~> 0.2.1' +Plugin.send(:load_plugin, 'bootboot') if Plugin.installed?('bootboot') +enable_dual_booting if Plugin.installed?('bootboot') && dependencies_next? diff --git a/Gemfile.rails_next b/Gemfile.rails_next index 83fddc1692..5964ea563d 100644 --- a/Gemfile.rails_next +++ b/Gemfile.rails_next @@ -1,6 +1,6 @@ # BUNDLE_GEMFILE=Gemfile.rails_next bundle install # BUNDLE_GEMFILE=Gemfile.rails_next be rails s -b 0.0.0.0 -ENV["RAILS_UPGRADE"] = 'true' +ENV["DEPENDENCIES_NEXT"] = 'true' eval_gemfile File.expand_path('../Gemfile', __FILE__) diff --git a/Gemfile_next.lock b/Gemfile_next.lock new file mode 100644 index 0000000000..5e3625f3bc --- /dev/null +++ b/Gemfile_next.lock @@ -0,0 +1,626 @@ +GIT + remote: https://github.com/mysociety/acts_as_versioned.git + revision: 13e928b8227349461205c2fa22d0bc3dbe2f1135 + ref: 13e928b + specs: + acts_as_versioned (0.6.0) + activerecord (>= 3.0.9) + +GIT + remote: https://github.com/mysociety/ruby-msg.git + revision: fae72e547299ab1f8b23239a79f5a1d353426b40 + branch: ascii-encoding + specs: + ruby-msg (1.5.2) + ruby-ole (>= 1.2.8) + vpim (>= 0.360) + +GIT + remote: https://github.com/mysociety/strip_attributes.git + revision: 842a889258a897692296dff8445bb9dc12e676f8 + branch: globalize3-rails7 + specs: + strip_attributes (1.12.0) + activemodel (>= 3.0, < 8.0) + +GIT + remote: https://github.com/stripe-ruby-mock/stripe-ruby-mock + revision: 6ceea9679bb573cb8bc6830f1bdf670b220a9859 + ref: 6ceea96 + specs: + stripe-ruby-mock (3.1.0.rc3) + dante (>= 0.2.0) + multi_json (~> 1.0) + stripe (> 5, < 6) + +PATH + remote: gems/alaveteli_features + specs: + alaveteli_features (0.0.1) + flipper (~> 0.10) + flipper-active_record (~> 0.10) + mime-types (< 3.0.0) + rails (~> 7.0.4) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.0.4) + actionpack (= 7.0.4) + activesupport (= 7.0.4) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (7.0.4) + actionpack (= 7.0.4) + activejob (= 7.0.4) + activerecord (= 7.0.4) + activestorage (= 7.0.4) + activesupport (= 7.0.4) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.0.4) + actionpack (= 7.0.4) + actionview (= 7.0.4) + activejob (= 7.0.4) + activesupport (= 7.0.4) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.0) + actionpack (7.0.4) + actionview (= 7.0.4) + activesupport (= 7.0.4) + rack (~> 2.0, >= 2.2.0) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (7.0.4) + actionpack (= 7.0.4) + activerecord (= 7.0.4) + activestorage (= 7.0.4) + activesupport (= 7.0.4) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.0.4) + activesupport (= 7.0.4) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + active_model_otp (2.3.1) + activemodel + rotp (~> 6.2.0) + activejob (7.0.4) + activesupport (= 7.0.4) + globalid (>= 0.3.6) + activemodel (7.0.4) + activesupport (= 7.0.4) + activerecord (7.0.4) + activemodel (= 7.0.4) + activesupport (= 7.0.4) + activestorage (7.0.4) + actionpack (= 7.0.4) + activejob (= 7.0.4) + activerecord (= 7.0.4) + activesupport (= 7.0.4) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (7.0.4) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) + annotate (3.2.0) + activerecord (>= 3.2, < 8.0) + rake (>= 10.4, < 14.0) + ast (2.4.2) + aws-eventstream (1.2.0) + aws-partitions (1.649.0) + aws-sdk-core (3.164.0) + aws-eventstream (~> 1, >= 1.0.2) + aws-partitions (~> 1, >= 1.525.0) + aws-sigv4 (~> 1.1) + jmespath (~> 1, >= 1.6.1) + aws-sdk-kms (1.58.0) + aws-sdk-core (~> 3, >= 3.127.0) + aws-sigv4 (~> 1.1) + aws-sdk-s3 (1.116.0) + aws-sdk-core (~> 3, >= 3.127.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.4) + aws-sigv4 (1.5.2) + aws-eventstream (~> 1, >= 1.0.2) + azure-core (0.1.15) + faraday (~> 0.9) + faraday_middleware (~> 0.10) + nokogiri (~> 1.6) + azure-storage (0.15.0.preview) + azure-core (~> 0.1) + faraday (~> 0.9) + faraday_middleware (~> 0.10) + nokogiri (~> 1.6, >= 1.6.8) + bcrypt (3.1.18) + bindex (0.8.1) + bootstrap-sass (2.3.2.2) + sass (~> 3.2) + builder (3.2.4) + bullet (7.0.4) + activesupport (>= 3.0.0) + uniform_notifier (~> 1.11) + cancancan (3.4.0) + capistrano (2.15.9) + highline + net-scp (>= 1.0.0) + net-sftp (>= 2.0.0) + net-ssh (>= 2.0.14) + net-ssh-gateway (>= 1.1.0) + capybara (3.38.0) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + charlock_holmes (0.7.7) + coderay (1.1.3) + concurrent-ruby (1.1.10) + crack (0.4.5) + rexml + crass (1.0.6) + daemons (1.4.0) + dalli (3.2.3) + dante (0.2.0) + date (3.3.3) + declarative (0.0.20) + diff-lcs (1.5.0) + digest-crc (0.6.4) + rake (>= 12.0.0, < 14.0.0) + docile (1.3.5) + erubi (1.12.0) + eventmachine (1.2.7) + exception_notification (4.5.0) + actionmailer (>= 5.2, < 8) + activesupport (>= 5.2, < 8) + execjs (2.7.0) + factory_bot (6.2.0) + activesupport (>= 5.0.0) + factory_bot_rails (6.2.0) + factory_bot (~> 6.2.0) + railties (>= 5.0.0) + fancybox-rails (0.3.1) + railties (>= 3.1.0) + faraday (0.17.5) + multipart-post (>= 1.2, < 3) + faraday_middleware (0.14.0) + faraday (>= 0.7.4, < 1.0) + fast_gettext (2.2.0) + ffi (1.15.5) + fivemat (1.3.7) + flipper (0.24.1) + flipper-active_record (0.24.1) + activerecord (>= 4.2, < 8) + flipper (~> 0.24.1) + forwardable (1.3.2) + gender_detector (2.0.0) + gettext (3.4.3) + erubi + locale (>= 2.0.5) + prime + text (>= 1.3.0) + gettext_i18n_rails (1.9.0) + fast_gettext (>= 0.9.0) + globalid (1.0.0) + activesupport (>= 5.0) + globalize (6.2.1) + activemodel (>= 4.2, < 7.1) + activerecord (>= 4.2, < 7.1) + request_store (~> 1.0) + gnuplot (2.6.2) + google-apis-core (0.9.1) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.16.2, < 2.a) + httpclient (>= 2.8.1, < 3.a) + mini_mime (~> 1.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.a) + rexml + webrick + google-apis-iamcredentials_v1 (0.15.0) + google-apis-core (>= 0.9.0, < 2.a) + google-apis-storage_v1 (0.19.0) + google-apis-core (>= 0.9.0, < 2.a) + google-cloud-core (1.6.0) + google-cloud-env (~> 1.0) + google-cloud-errors (~> 1.0) + google-cloud-env (1.6.0) + faraday (>= 0.17.3, < 3.0) + google-cloud-errors (1.3.0) + google-cloud-storage (1.43.0) + addressable (~> 2.8) + digest-crc (~> 0.4) + google-apis-iamcredentials_v1 (~> 0.1) + google-apis-storage_v1 (~> 0.19.0) + google-cloud-core (~> 1.6) + googleauth (>= 0.16.2, < 2.a) + mini_mime (~> 1.0) + googleauth (1.3.0) + faraday (>= 0.17.3, < 3.a) + jwt (>= 1.4, < 3.0) + memoist (~> 0.16) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (>= 0.16, < 2.a) + hashdiff (1.0.1) + highline (2.0.0) + hodel_3000_compliant_logger (0.1.1) + holidays (8.6.0) + htmlentities (4.3.4) + httpclient (2.8.3) + i18n (1.12.0) + concurrent-ruby (~> 1.0) + icalendar (2.8.0) + ice_cube (~> 0.16) + ice_cube (0.16.4) + iso_country_codes (0.7.8) + jmespath (1.6.1) + jquery-rails (4.5.0) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + jquery-ui-rails (6.0.1) + railties (>= 3.2.16) + json (2.6.3) + jwt (2.5.0) + launchy (2.4.3) + addressable (~> 2.3) + libv8-node (16.10.0.0) + libv8-node (16.10.0.0-aarch64-linux) + libv8-node (16.10.0.0-arm64-darwin) + libv8-node (16.10.0.0-x86_64-darwin) + libv8-node (16.10.0.0-x86_64-linux) + listen (3.7.1) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + locale (2.1.3) + loofah (2.19.1) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mahoro (0.5) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (1.0.2) + matrix (0.4.2) + maxmind-db (1.0.0) + memoist (0.16.2) + method_source (1.0.0) + mime-types (2.99.3) + mini_magick (4.11.0) + mini_mime (1.1.2) + mini_portile2 (2.8.1) + mini_racer (0.6.3) + libv8-node (~> 16.10.0.0) + minitest (5.17.0) + money (6.16.0) + i18n (>= 0.6.4, <= 2) + multi_json (1.15.0) + multipart-post (2.2.3) + net-imap (0.3.4) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.1) + timeout + net-scp (1.2.1) + net-ssh (>= 2.6.5) + net-sftp (2.1.2) + net-ssh (>= 2.6.5) + net-smtp (0.3.3) + net-protocol + net-ssh (7.0.1) + net-ssh-gateway (2.0.0) + net-ssh (>= 4.0.0) + nio4r (2.5.8) + nokogiri (1.13.10) + mini_portile2 (~> 2.8.0) + racc (~> 1.4) + nokogiri (1.13.10-aarch64-linux) + racc (~> 1.4) + nokogiri (1.13.10-arm64-darwin) + racc (~> 1.4) + nokogiri (1.13.10-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.13.10-x86_64-linux) + racc (~> 1.4) + oink (0.10.1) + activerecord + hodel_3000_compliant_logger + open4 (1.3.4) + os (1.1.4) + parallel (1.22.1) + parser (3.1.3.0) + ast (~> 2.4.1) + pg (1.4.4) + prime (0.1.2) + forwardable + singleton + pry (0.14.1) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (5.0.0) + racc (1.6.2) + rack (2.2.5) + rack-test (2.0.2) + rack (>= 1.3) + rack-utf8_sanitizer (1.7.0) + rack (>= 1.0, < 3.0) + rails (7.0.4) + actioncable (= 7.0.4) + actionmailbox (= 7.0.4) + actionmailer (= 7.0.4) + actionpack (= 7.0.4) + actiontext (= 7.0.4) + actionview (= 7.0.4) + activejob (= 7.0.4) + activemodel (= 7.0.4) + activerecord (= 7.0.4) + activestorage (= 7.0.4) + activesupport (= 7.0.4) + bundler (>= 1.15.0) + railties (= 7.0.4) + rails-controller-testing (1.0.5) + actionpack (>= 5.0.1.rc1) + actionview (>= 5.0.1.rc1) + activesupport (>= 5.0.1.rc1) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.4.4) + loofah (~> 2.19, >= 2.19.1) + rails-i18n (7.0.5) + i18n (>= 0.7, < 2) + railties (>= 6.0.0, < 8) + railties (7.0.4) + actionpack (= 7.0.4) + activesupport (= 7.0.4) + method_source + rake (>= 12.2) + thor (~> 1.0) + zeitwerk (~> 2.5) + rainbow (3.1.1) + rake (13.0.6) + rb-fsevent (0.11.0) + rb-inotify (0.10.1) + ffi (~> 1.0) + recaptcha (5.12.3) + json + regexp_parser (2.6.1) + representable (3.2.0) + declarative (< 0.1.0) + trailblazer-option (>= 0.1.1, < 0.2.0) + uber (< 0.2.0) + request_store (1.5.1) + rack (>= 1.4) + retriable (3.1.2) + rexml (3.2.5) + rolify (5.3.0) + rotp (6.2.0) + routing-filter (0.7.0) + actionpack (>= 6.1) + activesupport (>= 6.1) + rspec-activemodel-mocks (1.1.0) + activemodel (>= 3.0) + activesupport (>= 3.0) + rspec-mocks (>= 2.99, < 4.0) + rspec-core (3.11.0) + rspec-support (~> 3.11.0) + rspec-expectations (3.11.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.11.0) + rspec-mocks (3.11.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.11.0) + rspec-rails (6.0.1) + actionpack (>= 6.1) + activesupport (>= 6.1) + railties (>= 6.1) + rspec-core (~> 3.11) + rspec-expectations (~> 3.11) + rspec-mocks (~> 3.11) + rspec-support (~> 3.11) + rspec-support (3.11.1) + rubocop (1.37.1) + json (~> 2.3) + parallel (~> 1.10) + parser (>= 3.1.2.1) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.23.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.24.0) + parser (>= 3.1.1.0) + rubocop-performance (1.15.1) + rubocop (>= 1.7.0, < 2.0) + rubocop-ast (>= 0.4.0) + rubocop-rails (2.17.3) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + ruby-ole (1.2.12.1) + ruby-progressbar (1.11.0) + rubyzip (2.3.2) + sass (3.4.25) + sass-rails (5.0.8) + railties (>= 5.2.0) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + secure_headers (6.4.0) + signet (0.17.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + simplecov (0.17.1) + docile (~> 1.1) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.2) + simplecov-lcov (0.7.0) + singleton (0.1.1) + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + sprockets (>= 3.0.0) + statistics2 (0.54) + stripe (5.55.0) + syck (1.4.1) + syslog_protocol (0.9.2) + text (1.3.1) + thin (1.8.1) + daemons (~> 1.0, >= 1.0.9) + eventmachine (~> 1.0, >= 1.0.4) + rack (>= 1, < 3) + thor (1.2.1) + tilt (2.0.10) + timeout (0.3.1) + trailblazer-option (0.1.2) + tzinfo (2.0.5) + concurrent-ruby (~> 1.0) + uber (0.1.0) + uglifier (4.2.0) + execjs (>= 0.3.0, < 3) + unicode (0.4.4.4) + unicode-display_width (2.3.0) + unidecoder (1.1.2) + uniform_notifier (1.16.0) + vpim (13.11.11) + web-console (4.2.0) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) + bindex (>= 0.4.0) + railties (>= 6.0.0) + webmock (3.18.1) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) + webrick (1.7.0) + websocket-driver (0.7.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + will_paginate (3.3.1) + xapian-full-alaveteli (1.4.21.1) + xml-simple (1.1.9) + rexml + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.6.6) + zip_tricks (5.6.0) + +PLATFORMS + aarch64-linux + arm64-darwin + ruby + x86_64-darwin + x86_64-linux + +DEPENDENCIES + active_model_otp + acts_as_versioned! + alaveteli_features! + annotate (< 3.2.1) + aws-sdk-s3 + azure-storage + bcrypt (~> 3.1.18) + bootstrap-sass (~> 2.3.2.2) + bullet (~> 7.0.4) + cancancan (~> 3.4.0) + capistrano (~> 2.15.0, < 3.0.0) + capybara (~> 3.38.0) + charlock_holmes (~> 0.7.7) + dalli (~> 3.2.3) + exception_notification (~> 4.5.0) + factory_bot_rails (~> 6.2.0) + fancybox-rails (~> 0.3.0) + fast_gettext (~> 2.2.0) + fivemat (~> 1.3.7) + gender_detector (~> 2.0.0) + gettext (~> 3.4.3) + gettext_i18n_rails (~> 1.9.0) + globalize (~> 6.2.1) + gnuplot (~> 2.6.0) + google-cloud-storage (~> 1.43) + holidays (~> 8.6.0) + htmlentities (~> 4.3.0) + i18n (~> 1.12.0) + icalendar (~> 2.8.0) + iso_country_codes (~> 0.7.8) + jquery-rails (~> 4.5.0) + jquery-ui-rails (~> 6.0.0) + json (~> 2.6.2) + launchy (< 2.5.0) + listen (>= 3.0.5, < 3.7.2) + locale (~> 2.1.3) + mahoro (~> 0.5) + mail (~> 2.7.1) + maxmind-db (~> 1.0.0) + mime-types (< 3.0.0) + mini_magick (~> 4.11.0) + mini_racer (~> 0.6.3) + money (~> 6.16.0) + net-ssh (~> 7.0.1) + net-ssh-gateway (>= 1.1.0, < 3.0.0) + nokogiri (~> 1.13.10) + oink (~> 0.10.1) + open4 (~> 1.3.0) + pg (~> 1.4.4) + pry (~> 0.14.1) + rack (~> 2.2.4) + rack-utf8_sanitizer (~> 1.7.0) + rails (~> 7.0.4) + rails-controller-testing + rails-i18n (~> 7.0.5) + recaptcha (~> 5.12.3) + rolify (~> 5.3.0) + routing-filter (~> 0.7.0) + rspec-activemodel-mocks (~> 1.1.0) + rspec-rails (~> 6.0.0) + rubocop (~> 1.37.0) + rubocop-performance + rubocop-rails + ruby-msg (~> 1.5.0)! + rubyzip (~> 2.3.2) + sass-rails (~> 5.0.8) + secure_headers (~> 6.4.0) + simplecov (~> 0.17.1) + simplecov-lcov (~> 0.7.0) + statistics2 (~> 0.54) + strip_attributes! + stripe (~> 5.55.0) + stripe-ruby-mock! + syck (~> 1.4.1) + syslog_protocol (~> 0.9.0) + thin (~> 1.8.1) + uglifier (~> 4.2.0) + unicode (~> 0.4.4) + unidecoder (~> 1.1.0) + vpim (~> 13.11.11) + web-console (>= 3.3.0) + webmock (~> 3.18.1) + will_paginate (~> 3.3.1) + xapian-full-alaveteli (~> 1.4.21.1) + xml-simple (~> 1.1.9) + zip_tricks (~> 5.6.0) diff --git a/bin/bundle_next b/bin/bundle_next index 8ecdb29ee7..ab77d8691f 100755 --- a/bin/bundle_next +++ b/bin/bundle_next @@ -1,2 +1,2 @@ #!/bin/sh -BUNDLE_GEMFILE=Gemfile.rails_next bundle "$@" +DEPENDENCIES_NEXT=1 bundle "$@" diff --git a/bin/rails_next b/bin/rails_next index c5bcd59661..9f606ef1df 100755 --- a/bin/rails_next +++ b/bin/rails_next @@ -1,2 +1,2 @@ #!/bin/sh -BUNDLE_GEMFILE=Gemfile.rails_next bundle exec rails "$@" +DEPENDENCIES_NEXT=1 bundle exec rails "$@" diff --git a/bin/rspec_next b/bin/rspec_next index 5e3d1f68b7..1580a0cc5c 100755 --- a/bin/rspec_next +++ b/bin/rspec_next @@ -1,2 +1,2 @@ #!/bin/sh -BUNDLE_GEMFILE=Gemfile.rails_next bundle exec rspec "$@" +DEPENDENCIES_NEXT=1 bundle exec rspec "$@" diff --git a/config/application.rb b/config/application.rb index 0495666279..c2e7126a27 100644 --- a/config/application.rb +++ b/config/application.rb @@ -22,8 +22,8 @@ # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) -def rails_upgrade? - true +def dependencies_next? + ENV['DEPENDENCIES_NEXT'] end module Alaveteli diff --git a/gems/alaveteli_features/alaveteli_features.gemspec b/gems/alaveteli_features/alaveteli_features.gemspec index 9b3928b440..1c20303495 100644 --- a/gems/alaveteli_features/alaveteli_features.gemspec +++ b/gems/alaveteli_features/alaveteli_features.gemspec @@ -2,8 +2,8 @@ lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'alaveteli_features/version' -def rails_upgrade? - true +def dependencies_next? + ENV['DEPENDENCIES_NEXT'] end Gem::Specification.new do |spec| From 75d3e698ed60e01e9a921afb1480d4fa85d70e50 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Fri, 13 Jan 2023 14:10:40 +0000 Subject: [PATCH 024/289] Remove old Rails next Gemfile --- Gemfile.rails_next | 6 - Gemfile.rails_next.lock | 632 ---------------------------------------- 2 files changed, 638 deletions(-) delete mode 100644 Gemfile.rails_next delete mode 100644 Gemfile.rails_next.lock diff --git a/Gemfile.rails_next b/Gemfile.rails_next deleted file mode 100644 index 5964ea563d..0000000000 --- a/Gemfile.rails_next +++ /dev/null @@ -1,6 +0,0 @@ -# BUNDLE_GEMFILE=Gemfile.rails_next bundle install -# BUNDLE_GEMFILE=Gemfile.rails_next be rails s -b 0.0.0.0 - -ENV["DEPENDENCIES_NEXT"] = 'true' - -eval_gemfile File.expand_path('../Gemfile', __FILE__) diff --git a/Gemfile.rails_next.lock b/Gemfile.rails_next.lock deleted file mode 100644 index 9f5f4467aa..0000000000 --- a/Gemfile.rails_next.lock +++ /dev/null @@ -1,632 +0,0 @@ -GIT - remote: https://github.com/mysociety/acts_as_versioned.git - revision: 13e928b8227349461205c2fa22d0bc3dbe2f1135 - ref: 13e928b - specs: - acts_as_versioned (0.6.0) - activerecord (>= 3.0.9) - -GIT - remote: https://github.com/mysociety/ruby-msg.git - revision: fae72e547299ab1f8b23239a79f5a1d353426b40 - branch: ascii-encoding - specs: - ruby-msg (1.5.2) - ruby-ole (>= 1.2.8) - vpim (>= 0.360) - -GIT - remote: https://github.com/mysociety/strip_attributes.git - revision: 842a889258a897692296dff8445bb9dc12e676f8 - branch: globalize3-rails7 - specs: - strip_attributes (1.12.0) - activemodel (>= 3.0, < 8.0) - -GIT - remote: https://github.com/stripe-ruby-mock/stripe-ruby-mock - revision: 6ceea9679bb573cb8bc6830f1bdf670b220a9859 - ref: 6ceea96 - specs: - stripe-ruby-mock (3.1.0.rc3) - dante (>= 0.2.0) - multi_json (~> 1.0) - stripe (> 5, < 6) - -PATH - remote: gems/alaveteli_features - specs: - alaveteli_features (0.0.1) - flipper (~> 0.10) - flipper-active_record (~> 0.10) - mime-types (< 3.0.0) - rails (~> 7.0.4) - -GEM - remote: https://rubygems.org/ - specs: - actioncable (7.0.4) - actionpack (= 7.0.4) - activesupport (= 7.0.4) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - actionmailbox (7.0.4) - actionpack (= 7.0.4) - activejob (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.0.4) - actionpack (= 7.0.4) - actionview (= 7.0.4) - activejob (= 7.0.4) - activesupport (= 7.0.4) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.4) - actionview (= 7.0.4) - activesupport (= 7.0.4) - rack (~> 2.0, >= 2.2.0) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4) - actionpack (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) - globalid (>= 0.6.0) - nokogiri (>= 1.8.5) - actionview (7.0.4) - activesupport (= 7.0.4) - builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - active_model_otp (2.3.1) - activemodel - rotp (~> 6.2.0) - activejob (7.0.4) - activesupport (= 7.0.4) - globalid (>= 0.3.6) - activemodel (7.0.4) - activesupport (= 7.0.4) - activerecord (7.0.4) - activemodel (= 7.0.4) - activesupport (= 7.0.4) - activestorage (7.0.4) - actionpack (= 7.0.4) - activejob (= 7.0.4) - activerecord (= 7.0.4) - activesupport (= 7.0.4) - marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.4) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 1.6, < 2) - minitest (>= 5.1) - tzinfo (~> 2.0) - addressable (2.8.1) - public_suffix (>= 2.0.2, < 6.0) - annotate (3.2.0) - activerecord (>= 3.2, < 8.0) - rake (>= 10.4, < 14.0) - ast (2.4.2) - aws-eventstream (1.2.0) - aws-partitions (1.649.0) - aws-sdk-core (3.164.0) - aws-eventstream (~> 1, >= 1.0.2) - aws-partitions (~> 1, >= 1.525.0) - aws-sigv4 (~> 1.1) - jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.58.0) - aws-sdk-core (~> 3, >= 3.127.0) - aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.116.0) - aws-sdk-core (~> 3, >= 3.127.0) - aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.4) - aws-sigv4 (1.5.2) - aws-eventstream (~> 1, >= 1.0.2) - azure-core (0.1.15) - faraday (~> 0.9) - faraday_middleware (~> 0.10) - nokogiri (~> 1.6) - azure-storage (0.15.0.preview) - azure-core (~> 0.1) - faraday (~> 0.9) - faraday_middleware (~> 0.10) - nokogiri (~> 1.6, >= 1.6.8) - bcrypt (3.1.18) - bindex (0.8.1) - bootstrap-sass (2.3.2.2) - sass (~> 3.2) - builder (3.2.4) - bullet (7.0.4) - activesupport (>= 3.0.0) - uniform_notifier (~> 1.11) - cancancan (3.4.0) - capistrano (2.15.9) - highline - net-scp (>= 1.0.0) - net-sftp (>= 2.0.0) - net-ssh (>= 2.0.14) - net-ssh-gateway (>= 1.1.0) - capybara (3.38.0) - addressable - matrix - mini_mime (>= 0.1.3) - nokogiri (~> 1.8) - rack (>= 1.6.0) - rack-test (>= 0.6.3) - regexp_parser (>= 1.5, < 3.0) - xpath (~> 3.2) - charlock_holmes (0.7.7) - coderay (1.1.3) - concurrent-ruby (1.1.10) - crack (0.4.5) - rexml - crass (1.0.6) - daemons (1.4.0) - dalli (3.2.3) - dante (0.2.0) - declarative (0.0.20) - diff-lcs (1.5.0) - digest (3.1.0) - digest-crc (0.6.4) - rake (>= 12.0.0, < 14.0.0) - docile (1.3.5) - erubi (1.11.0) - eventmachine (1.2.7) - exception_notification (4.5.0) - actionmailer (>= 5.2, < 8) - activesupport (>= 5.2, < 8) - execjs (2.7.0) - factory_bot (6.2.0) - activesupport (>= 5.0.0) - factory_bot_rails (6.2.0) - factory_bot (~> 6.2.0) - railties (>= 5.0.0) - fancybox-rails (0.3.1) - railties (>= 3.1.0) - faraday (0.17.5) - multipart-post (>= 1.2, < 3) - faraday_middleware (0.14.0) - faraday (>= 0.7.4, < 1.0) - fast_gettext (2.2.0) - ffi (1.15.5) - fivemat (1.3.7) - flipper (0.24.1) - flipper-active_record (0.24.1) - activerecord (>= 4.2, < 8) - flipper (~> 0.24.1) - forwardable (1.3.2) - gender_detector (2.0.0) - gettext (3.4.3) - erubi - locale (>= 2.0.5) - prime - text (>= 1.3.0) - gettext_i18n_rails (1.9.0) - fast_gettext (>= 0.9.0) - globalid (1.0.0) - activesupport (>= 5.0) - globalize (6.2.1) - activemodel (>= 4.2, < 7.1) - activerecord (>= 4.2, < 7.1) - request_store (~> 1.0) - gnuplot (2.6.2) - google-apis-core (0.9.1) - addressable (~> 2.5, >= 2.5.1) - googleauth (>= 0.16.2, < 2.a) - httpclient (>= 2.8.1, < 3.a) - mini_mime (~> 1.0) - representable (~> 3.0) - retriable (>= 2.0, < 4.a) - rexml - webrick - google-apis-iamcredentials_v1 (0.15.0) - google-apis-core (>= 0.9.0, < 2.a) - google-apis-storage_v1 (0.19.0) - google-apis-core (>= 0.9.0, < 2.a) - google-cloud-core (1.6.0) - google-cloud-env (~> 1.0) - google-cloud-errors (~> 1.0) - google-cloud-env (1.6.0) - faraday (>= 0.17.3, < 3.0) - google-cloud-errors (1.3.0) - google-cloud-storage (1.43.0) - addressable (~> 2.8) - digest-crc (~> 0.4) - google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.19.0) - google-cloud-core (~> 1.6) - googleauth (>= 0.16.2, < 2.a) - mini_mime (~> 1.0) - googleauth (1.3.0) - faraday (>= 0.17.3, < 3.a) - jwt (>= 1.4, < 3.0) - memoist (~> 0.16) - multi_json (~> 1.11) - os (>= 0.9, < 2.0) - signet (>= 0.16, < 2.a) - hashdiff (1.0.1) - highline (2.0.0) - hodel_3000_compliant_logger (0.1.1) - holidays (8.6.0) - htmlentities (4.3.4) - httpclient (2.8.3) - i18n (1.12.0) - concurrent-ruby (~> 1.0) - icalendar (2.8.0) - ice_cube (~> 0.16) - ice_cube (0.16.4) - iso_country_codes (0.7.8) - jmespath (1.6.1) - jquery-rails (4.5.0) - rails-dom-testing (>= 1, < 3) - railties (>= 4.2.0) - thor (>= 0.14, < 2.0) - jquery-ui-rails (6.0.1) - railties (>= 3.2.16) - json (2.6.3) - jwt (2.5.0) - launchy (2.4.3) - addressable (~> 2.3) - libv8-node (16.10.0.0) - libv8-node (16.10.0.0-aarch64-linux) - libv8-node (16.10.0.0-arm64-darwin) - libv8-node (16.10.0.0-x86_64-darwin) - libv8-node (16.10.0.0-x86_64-linux) - listen (3.7.1) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) - locale (2.1.3) - loofah (2.19.1) - crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mahoro (0.5) - mail (2.7.1) - mini_mime (>= 0.1.1) - marcel (1.0.2) - matrix (0.4.2) - maxmind-db (1.0.0) - memoist (0.16.2) - method_source (1.0.0) - mime-types (2.99.3) - mini_magick (4.11.0) - mini_mime (1.1.2) - mini_portile2 (2.8.1) - mini_racer (0.6.3) - libv8-node (~> 16.10.0.0) - minitest (5.16.3) - money (6.16.0) - i18n (>= 0.6.4, <= 2) - multi_json (1.15.0) - multipart-post (2.2.3) - net-imap (0.2.3) - digest - net-protocol - strscan - net-pop (0.1.1) - digest - net-protocol - timeout - net-protocol (0.1.3) - timeout - net-scp (1.2.1) - net-ssh (>= 2.6.5) - net-sftp (2.1.2) - net-ssh (>= 2.6.5) - net-smtp (0.3.1) - digest - net-protocol - timeout - net-ssh (7.0.1) - net-ssh-gateway (2.0.0) - net-ssh (>= 4.0.0) - nio4r (2.5.8) - nokogiri (1.13.10) - mini_portile2 (~> 2.8.0) - racc (~> 1.4) - nokogiri (1.13.10-aarch64-linux) - racc (~> 1.4) - nokogiri (1.13.10-arm64-darwin) - racc (~> 1.4) - nokogiri (1.13.10-x86_64-darwin) - racc (~> 1.4) - nokogiri (1.13.10-x86_64-linux) - racc (~> 1.4) - oink (0.10.1) - activerecord - hodel_3000_compliant_logger - open4 (1.3.4) - os (1.1.4) - parallel (1.22.1) - parser (3.1.3.0) - ast (~> 2.4.1) - pg (1.4.4) - prime (0.1.2) - forwardable - singleton - pry (0.14.1) - coderay (~> 1.1) - method_source (~> 1.0) - public_suffix (5.0.0) - racc (1.6.2) - rack (2.2.4) - rack-test (2.0.2) - rack (>= 1.3) - rack-utf8_sanitizer (1.7.0) - rack (>= 1.0, < 3.0) - rails (7.0.4) - actioncable (= 7.0.4) - actionmailbox (= 7.0.4) - actionmailer (= 7.0.4) - actionpack (= 7.0.4) - actiontext (= 7.0.4) - actionview (= 7.0.4) - activejob (= 7.0.4) - activemodel (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) - bundler (>= 1.15.0) - railties (= 7.0.4) - rails-controller-testing (1.0.5) - actionpack (>= 5.0.1.rc1) - actionview (>= 5.0.1.rc1) - activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) - nokogiri (>= 1.6) - rails-html-sanitizer (1.4.4) - loofah (~> 2.19, >= 2.19.1) - rails-i18n (7.0.5) - i18n (>= 0.7, < 2) - railties (>= 6.0.0, < 8) - railties (7.0.4) - actionpack (= 7.0.4) - activesupport (= 7.0.4) - method_source - rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) - rainbow (3.1.1) - rake (13.0.6) - rb-fsevent (0.11.0) - rb-inotify (0.10.1) - ffi (~> 1.0) - recaptcha (5.12.3) - json - regexp_parser (2.6.1) - representable (3.2.0) - declarative (< 0.1.0) - trailblazer-option (>= 0.1.1, < 0.2.0) - uber (< 0.2.0) - request_store (1.5.1) - rack (>= 1.4) - retriable (3.1.2) - rexml (3.2.5) - rolify (5.3.0) - rotp (6.2.0) - routing-filter (0.7.0) - actionpack (>= 6.1) - activesupport (>= 6.1) - rspec-activemodel-mocks (1.1.0) - activemodel (>= 3.0) - activesupport (>= 3.0) - rspec-mocks (>= 2.99, < 4.0) - rspec-core (3.11.0) - rspec-support (~> 3.11.0) - rspec-expectations (3.11.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-mocks (3.11.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-rails (6.0.1) - actionpack (>= 6.1) - activesupport (>= 6.1) - railties (>= 6.1) - rspec-core (~> 3.11) - rspec-expectations (~> 3.11) - rspec-mocks (~> 3.11) - rspec-support (~> 3.11) - rspec-support (3.11.1) - rubocop (1.37.1) - json (~> 2.3) - parallel (~> 1.10) - parser (>= 3.1.2.1) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.23.0, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.0) - parser (>= 3.1.1.0) - rubocop-performance (1.15.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - rubocop-rails (2.17.3) - activesupport (>= 4.2.0) - rack (>= 1.1) - rubocop (>= 1.33.0, < 2.0) - ruby-ole (1.2.12.1) - ruby-progressbar (1.11.0) - rubyzip (2.3.2) - sass (3.4.25) - sass-rails (5.0.8) - railties (>= 5.2.0) - sass (~> 3.1) - sprockets (>= 2.8, < 4.0) - sprockets-rails (>= 2.0, < 4.0) - tilt (>= 1.1, < 3) - secure_headers (6.4.0) - signet (0.17.0) - addressable (~> 2.8) - faraday (>= 0.17.5, < 3.a) - jwt (>= 1.5, < 3.0) - multi_json (~> 1.10) - simplecov (0.17.1) - docile (~> 1.1) - json (>= 1.8, < 3) - simplecov-html (~> 0.10.0) - simplecov-html (0.10.2) - simplecov-lcov (0.7.0) - singleton (0.1.1) - sprockets (3.7.2) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - sprockets (>= 3.0.0) - statistics2 (0.54) - stripe (5.55.0) - strscan (3.0.4) - syck (1.4.1) - syslog_protocol (0.9.2) - text (1.3.1) - thin (1.8.1) - daemons (~> 1.0, >= 1.0.9) - eventmachine (~> 1.0, >= 1.0.4) - rack (>= 1, < 3) - thor (1.2.1) - tilt (2.0.10) - timeout (0.3.0) - trailblazer-option (0.1.2) - tzinfo (2.0.5) - concurrent-ruby (~> 1.0) - uber (0.1.0) - uglifier (4.2.0) - execjs (>= 0.3.0, < 3) - unicode (0.4.4.4) - unicode-display_width (2.3.0) - unidecoder (1.1.2) - uniform_notifier (1.16.0) - vpim (13.11.11) - web-console (4.2.0) - actionview (>= 6.0.0) - activemodel (>= 6.0.0) - bindex (>= 0.4.0) - railties (>= 6.0.0) - webmock (3.18.1) - addressable (>= 2.8.0) - crack (>= 0.3.2) - hashdiff (>= 0.4.0, < 2.0.0) - webrick (1.7.0) - websocket-driver (0.7.5) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) - will_paginate (3.3.1) - xapian-full-alaveteli (1.4.21.1) - xml-simple (1.1.9) - rexml - xpath (3.2.0) - nokogiri (~> 1.8) - zeitwerk (2.6.1) - zip_tricks (5.6.0) - -PLATFORMS - aarch64-linux - arm64-darwin - ruby - x86_64-darwin - x86_64-linux - -DEPENDENCIES - active_model_otp - acts_as_versioned! - alaveteli_features! - annotate (< 3.2.1) - aws-sdk-s3 - azure-storage - bcrypt (~> 3.1.18) - bootstrap-sass (~> 2.3.2.2) - bullet (~> 7.0.4) - cancancan (~> 3.4.0) - capistrano (~> 2.15.0, < 3.0.0) - capybara (~> 3.38.0) - charlock_holmes (~> 0.7.7) - dalli (~> 3.2.3) - exception_notification (~> 4.5.0) - factory_bot_rails (~> 6.2.0) - fancybox-rails (~> 0.3.0) - fast_gettext (~> 2.2.0) - fivemat (~> 1.3.7) - gender_detector (~> 2.0.0) - gettext (~> 3.4.3) - gettext_i18n_rails (~> 1.9.0) - globalize (~> 6.2.1) - gnuplot (~> 2.6.0) - google-cloud-storage (~> 1.43) - holidays (~> 8.6.0) - htmlentities (~> 4.3.0) - i18n (~> 1.12.0) - icalendar (~> 2.8.0) - iso_country_codes (~> 0.7.8) - jquery-rails (~> 4.5.0) - jquery-ui-rails (~> 6.0.0) - json (~> 2.6.2) - launchy (< 2.5.0) - listen (>= 3.0.5, < 3.7.2) - locale (~> 2.1.3) - mahoro (~> 0.5) - mail (~> 2.7.1) - maxmind-db (~> 1.0.0) - mime-types (< 3.0.0) - mini_magick (~> 4.11.0) - mini_racer (~> 0.6.3) - money (~> 6.16.0) - net-ssh (~> 7.0.1) - net-ssh-gateway (>= 1.1.0, < 3.0.0) - nokogiri (~> 1.13.10) - oink (~> 0.10.1) - open4 (~> 1.3.0) - pg (~> 1.4.4) - pry (~> 0.14.1) - rack (~> 2.2.4) - rack-utf8_sanitizer (~> 1.7.0) - rails (~> 7.0.4) - rails-controller-testing - rails-i18n (~> 7.0.5) - recaptcha (~> 5.12.3) - rolify (~> 5.3.0) - routing-filter (~> 0.7.0) - rspec-activemodel-mocks (~> 1.1.0) - rspec-rails (~> 6.0.0) - rubocop (~> 1.37.0) - rubocop-performance - rubocop-rails - ruby-msg (~> 1.5.0)! - rubyzip (~> 2.3.2) - sass-rails (~> 5.0.8) - secure_headers (~> 6.4.0) - simplecov (~> 0.17.1) - simplecov-lcov (~> 0.7.0) - statistics2 (~> 0.54) - strip_attributes! - stripe (~> 5.55.0) - stripe-ruby-mock! - syck (~> 1.4.1) - syslog_protocol (~> 0.9.0) - thin (~> 1.8.1) - uglifier (~> 4.2.0) - unicode (~> 0.4.4) - unidecoder (~> 1.1.0) - vpim (~> 13.11.11) - web-console (>= 3.3.0) - webmock (~> 3.18.1) - will_paginate (~> 3.3.1) - xapian-full-alaveteli (~> 1.4.21.1) - xml-simple (~> 1.1.9) - zip_tricks (~> 5.6.0) From 8758872d30af2c0d3108d1103d47e7f34421be41 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 17 Jan 2023 09:29:48 +0000 Subject: [PATCH 025/289] Remove next Gemfile This was used to help upgrade Rails versions but since we're now on the latest version this isn't as useful. In fact it is causing headaches when dealing with dependency upgrades as we have to manually keep the two lockfiles in sync. We attempted to use `bootboot` and while it helped a bit the Dependabot PRs still didn't stage the next lockfile changes. I had though keeping the next Gemfile would be good for helping with Ruby and other larger dependency upgrades but we can handle these in isolation is separate PRs. --- .github/workflows/ci.yml | 11 +- Gemfile | 8 - Gemfile_next.lock | 626 ------------------ bin/bundle_next | 2 - bin/rails_next | 2 - bin/rspec_next | 2 - config/application.rb | 4 - .../alaveteli_features.gemspec | 4 - 8 files changed, 2 insertions(+), 657 deletions(-) delete mode 100644 Gemfile_next.lock delete mode 100755 bin/bundle_next delete mode 100755 bin/rails_next delete mode 100755 bin/rspec_next diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b18fa5929..6f25b7d058 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ permissions: jobs: rspec: - name: Ruby ${{ matrix.ruby }} / PostgreSQL ${{ matrix.postgres }} / ${{ matrix.dependencies }} + name: Ruby ${{ matrix.ruby }} / PostgreSQL ${{ matrix.postgres }} runs-on: ubuntu-20.04 permissions: @@ -24,8 +24,7 @@ jobs: fail-fast: false matrix: include: - - { ruby: '3.0', postgres: 13.5, dependencies: 'Current'} - - { ruby: '3.0', postgres: 13.5, dependencies: 'Next' } + - { ruby: '3.0', postgres: 13.5 } services: postgres: @@ -45,12 +44,6 @@ jobs: RAILS_ENV: test steps: - - name: Conditionally set environment variable - run: | - if [[ ${{ matrix.dependencies }} == 'Next' ]]; then - echo "DEPENDENCIES_NEXT=1" >> "$GITHUB_ENV" - fi - - name: Checkout repository uses: actions/checkout@v2 with: diff --git a/Gemfile b/Gemfile index 2803565e28..38c4641223 100644 --- a/Gemfile +++ b/Gemfile @@ -79,10 +79,6 @@ # the new version. It is always preferable to upgrade our code. source 'https://rubygems.org' -def dependencies_next? - ENV['DEPENDENCIES_NEXT'] -end - gem 'rails', '~> 7.0.4' gem 'pg', '~> 1.4.4' @@ -195,7 +191,3 @@ group :development do gem 'rubocop-performance', require: false gem 'rubocop-rails', require: false end - -plugin 'bootboot', '~> 0.2.1' -Plugin.send(:load_plugin, 'bootboot') if Plugin.installed?('bootboot') -enable_dual_booting if Plugin.installed?('bootboot') && dependencies_next? diff --git a/Gemfile_next.lock b/Gemfile_next.lock deleted file mode 100644 index 5e3625f3bc..0000000000 --- a/Gemfile_next.lock +++ /dev/null @@ -1,626 +0,0 @@ -GIT - remote: https://github.com/mysociety/acts_as_versioned.git - revision: 13e928b8227349461205c2fa22d0bc3dbe2f1135 - ref: 13e928b - specs: - acts_as_versioned (0.6.0) - activerecord (>= 3.0.9) - -GIT - remote: https://github.com/mysociety/ruby-msg.git - revision: fae72e547299ab1f8b23239a79f5a1d353426b40 - branch: ascii-encoding - specs: - ruby-msg (1.5.2) - ruby-ole (>= 1.2.8) - vpim (>= 0.360) - -GIT - remote: https://github.com/mysociety/strip_attributes.git - revision: 842a889258a897692296dff8445bb9dc12e676f8 - branch: globalize3-rails7 - specs: - strip_attributes (1.12.0) - activemodel (>= 3.0, < 8.0) - -GIT - remote: https://github.com/stripe-ruby-mock/stripe-ruby-mock - revision: 6ceea9679bb573cb8bc6830f1bdf670b220a9859 - ref: 6ceea96 - specs: - stripe-ruby-mock (3.1.0.rc3) - dante (>= 0.2.0) - multi_json (~> 1.0) - stripe (> 5, < 6) - -PATH - remote: gems/alaveteli_features - specs: - alaveteli_features (0.0.1) - flipper (~> 0.10) - flipper-active_record (~> 0.10) - mime-types (< 3.0.0) - rails (~> 7.0.4) - -GEM - remote: https://rubygems.org/ - specs: - actioncable (7.0.4) - actionpack (= 7.0.4) - activesupport (= 7.0.4) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - actionmailbox (7.0.4) - actionpack (= 7.0.4) - activejob (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.0.4) - actionpack (= 7.0.4) - actionview (= 7.0.4) - activejob (= 7.0.4) - activesupport (= 7.0.4) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.4) - actionview (= 7.0.4) - activesupport (= 7.0.4) - rack (~> 2.0, >= 2.2.0) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4) - actionpack (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) - globalid (>= 0.6.0) - nokogiri (>= 1.8.5) - actionview (7.0.4) - activesupport (= 7.0.4) - builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - active_model_otp (2.3.1) - activemodel - rotp (~> 6.2.0) - activejob (7.0.4) - activesupport (= 7.0.4) - globalid (>= 0.3.6) - activemodel (7.0.4) - activesupport (= 7.0.4) - activerecord (7.0.4) - activemodel (= 7.0.4) - activesupport (= 7.0.4) - activestorage (7.0.4) - actionpack (= 7.0.4) - activejob (= 7.0.4) - activerecord (= 7.0.4) - activesupport (= 7.0.4) - marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.4) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 1.6, < 2) - minitest (>= 5.1) - tzinfo (~> 2.0) - addressable (2.8.1) - public_suffix (>= 2.0.2, < 6.0) - annotate (3.2.0) - activerecord (>= 3.2, < 8.0) - rake (>= 10.4, < 14.0) - ast (2.4.2) - aws-eventstream (1.2.0) - aws-partitions (1.649.0) - aws-sdk-core (3.164.0) - aws-eventstream (~> 1, >= 1.0.2) - aws-partitions (~> 1, >= 1.525.0) - aws-sigv4 (~> 1.1) - jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.58.0) - aws-sdk-core (~> 3, >= 3.127.0) - aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.116.0) - aws-sdk-core (~> 3, >= 3.127.0) - aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.4) - aws-sigv4 (1.5.2) - aws-eventstream (~> 1, >= 1.0.2) - azure-core (0.1.15) - faraday (~> 0.9) - faraday_middleware (~> 0.10) - nokogiri (~> 1.6) - azure-storage (0.15.0.preview) - azure-core (~> 0.1) - faraday (~> 0.9) - faraday_middleware (~> 0.10) - nokogiri (~> 1.6, >= 1.6.8) - bcrypt (3.1.18) - bindex (0.8.1) - bootstrap-sass (2.3.2.2) - sass (~> 3.2) - builder (3.2.4) - bullet (7.0.4) - activesupport (>= 3.0.0) - uniform_notifier (~> 1.11) - cancancan (3.4.0) - capistrano (2.15.9) - highline - net-scp (>= 1.0.0) - net-sftp (>= 2.0.0) - net-ssh (>= 2.0.14) - net-ssh-gateway (>= 1.1.0) - capybara (3.38.0) - addressable - matrix - mini_mime (>= 0.1.3) - nokogiri (~> 1.8) - rack (>= 1.6.0) - rack-test (>= 0.6.3) - regexp_parser (>= 1.5, < 3.0) - xpath (~> 3.2) - charlock_holmes (0.7.7) - coderay (1.1.3) - concurrent-ruby (1.1.10) - crack (0.4.5) - rexml - crass (1.0.6) - daemons (1.4.0) - dalli (3.2.3) - dante (0.2.0) - date (3.3.3) - declarative (0.0.20) - diff-lcs (1.5.0) - digest-crc (0.6.4) - rake (>= 12.0.0, < 14.0.0) - docile (1.3.5) - erubi (1.12.0) - eventmachine (1.2.7) - exception_notification (4.5.0) - actionmailer (>= 5.2, < 8) - activesupport (>= 5.2, < 8) - execjs (2.7.0) - factory_bot (6.2.0) - activesupport (>= 5.0.0) - factory_bot_rails (6.2.0) - factory_bot (~> 6.2.0) - railties (>= 5.0.0) - fancybox-rails (0.3.1) - railties (>= 3.1.0) - faraday (0.17.5) - multipart-post (>= 1.2, < 3) - faraday_middleware (0.14.0) - faraday (>= 0.7.4, < 1.0) - fast_gettext (2.2.0) - ffi (1.15.5) - fivemat (1.3.7) - flipper (0.24.1) - flipper-active_record (0.24.1) - activerecord (>= 4.2, < 8) - flipper (~> 0.24.1) - forwardable (1.3.2) - gender_detector (2.0.0) - gettext (3.4.3) - erubi - locale (>= 2.0.5) - prime - text (>= 1.3.0) - gettext_i18n_rails (1.9.0) - fast_gettext (>= 0.9.0) - globalid (1.0.0) - activesupport (>= 5.0) - globalize (6.2.1) - activemodel (>= 4.2, < 7.1) - activerecord (>= 4.2, < 7.1) - request_store (~> 1.0) - gnuplot (2.6.2) - google-apis-core (0.9.1) - addressable (~> 2.5, >= 2.5.1) - googleauth (>= 0.16.2, < 2.a) - httpclient (>= 2.8.1, < 3.a) - mini_mime (~> 1.0) - representable (~> 3.0) - retriable (>= 2.0, < 4.a) - rexml - webrick - google-apis-iamcredentials_v1 (0.15.0) - google-apis-core (>= 0.9.0, < 2.a) - google-apis-storage_v1 (0.19.0) - google-apis-core (>= 0.9.0, < 2.a) - google-cloud-core (1.6.0) - google-cloud-env (~> 1.0) - google-cloud-errors (~> 1.0) - google-cloud-env (1.6.0) - faraday (>= 0.17.3, < 3.0) - google-cloud-errors (1.3.0) - google-cloud-storage (1.43.0) - addressable (~> 2.8) - digest-crc (~> 0.4) - google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.19.0) - google-cloud-core (~> 1.6) - googleauth (>= 0.16.2, < 2.a) - mini_mime (~> 1.0) - googleauth (1.3.0) - faraday (>= 0.17.3, < 3.a) - jwt (>= 1.4, < 3.0) - memoist (~> 0.16) - multi_json (~> 1.11) - os (>= 0.9, < 2.0) - signet (>= 0.16, < 2.a) - hashdiff (1.0.1) - highline (2.0.0) - hodel_3000_compliant_logger (0.1.1) - holidays (8.6.0) - htmlentities (4.3.4) - httpclient (2.8.3) - i18n (1.12.0) - concurrent-ruby (~> 1.0) - icalendar (2.8.0) - ice_cube (~> 0.16) - ice_cube (0.16.4) - iso_country_codes (0.7.8) - jmespath (1.6.1) - jquery-rails (4.5.0) - rails-dom-testing (>= 1, < 3) - railties (>= 4.2.0) - thor (>= 0.14, < 2.0) - jquery-ui-rails (6.0.1) - railties (>= 3.2.16) - json (2.6.3) - jwt (2.5.0) - launchy (2.4.3) - addressable (~> 2.3) - libv8-node (16.10.0.0) - libv8-node (16.10.0.0-aarch64-linux) - libv8-node (16.10.0.0-arm64-darwin) - libv8-node (16.10.0.0-x86_64-darwin) - libv8-node (16.10.0.0-x86_64-linux) - listen (3.7.1) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) - locale (2.1.3) - loofah (2.19.1) - crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mahoro (0.5) - mail (2.7.1) - mini_mime (>= 0.1.1) - marcel (1.0.2) - matrix (0.4.2) - maxmind-db (1.0.0) - memoist (0.16.2) - method_source (1.0.0) - mime-types (2.99.3) - mini_magick (4.11.0) - mini_mime (1.1.2) - mini_portile2 (2.8.1) - mini_racer (0.6.3) - libv8-node (~> 16.10.0.0) - minitest (5.17.0) - money (6.16.0) - i18n (>= 0.6.4, <= 2) - multi_json (1.15.0) - multipart-post (2.2.3) - net-imap (0.3.4) - date - net-protocol - net-pop (0.1.2) - net-protocol - net-protocol (0.2.1) - timeout - net-scp (1.2.1) - net-ssh (>= 2.6.5) - net-sftp (2.1.2) - net-ssh (>= 2.6.5) - net-smtp (0.3.3) - net-protocol - net-ssh (7.0.1) - net-ssh-gateway (2.0.0) - net-ssh (>= 4.0.0) - nio4r (2.5.8) - nokogiri (1.13.10) - mini_portile2 (~> 2.8.0) - racc (~> 1.4) - nokogiri (1.13.10-aarch64-linux) - racc (~> 1.4) - nokogiri (1.13.10-arm64-darwin) - racc (~> 1.4) - nokogiri (1.13.10-x86_64-darwin) - racc (~> 1.4) - nokogiri (1.13.10-x86_64-linux) - racc (~> 1.4) - oink (0.10.1) - activerecord - hodel_3000_compliant_logger - open4 (1.3.4) - os (1.1.4) - parallel (1.22.1) - parser (3.1.3.0) - ast (~> 2.4.1) - pg (1.4.4) - prime (0.1.2) - forwardable - singleton - pry (0.14.1) - coderay (~> 1.1) - method_source (~> 1.0) - public_suffix (5.0.0) - racc (1.6.2) - rack (2.2.5) - rack-test (2.0.2) - rack (>= 1.3) - rack-utf8_sanitizer (1.7.0) - rack (>= 1.0, < 3.0) - rails (7.0.4) - actioncable (= 7.0.4) - actionmailbox (= 7.0.4) - actionmailer (= 7.0.4) - actionpack (= 7.0.4) - actiontext (= 7.0.4) - actionview (= 7.0.4) - activejob (= 7.0.4) - activemodel (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) - bundler (>= 1.15.0) - railties (= 7.0.4) - rails-controller-testing (1.0.5) - actionpack (>= 5.0.1.rc1) - actionview (>= 5.0.1.rc1) - activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) - nokogiri (>= 1.6) - rails-html-sanitizer (1.4.4) - loofah (~> 2.19, >= 2.19.1) - rails-i18n (7.0.5) - i18n (>= 0.7, < 2) - railties (>= 6.0.0, < 8) - railties (7.0.4) - actionpack (= 7.0.4) - activesupport (= 7.0.4) - method_source - rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) - rainbow (3.1.1) - rake (13.0.6) - rb-fsevent (0.11.0) - rb-inotify (0.10.1) - ffi (~> 1.0) - recaptcha (5.12.3) - json - regexp_parser (2.6.1) - representable (3.2.0) - declarative (< 0.1.0) - trailblazer-option (>= 0.1.1, < 0.2.0) - uber (< 0.2.0) - request_store (1.5.1) - rack (>= 1.4) - retriable (3.1.2) - rexml (3.2.5) - rolify (5.3.0) - rotp (6.2.0) - routing-filter (0.7.0) - actionpack (>= 6.1) - activesupport (>= 6.1) - rspec-activemodel-mocks (1.1.0) - activemodel (>= 3.0) - activesupport (>= 3.0) - rspec-mocks (>= 2.99, < 4.0) - rspec-core (3.11.0) - rspec-support (~> 3.11.0) - rspec-expectations (3.11.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-mocks (3.11.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-rails (6.0.1) - actionpack (>= 6.1) - activesupport (>= 6.1) - railties (>= 6.1) - rspec-core (~> 3.11) - rspec-expectations (~> 3.11) - rspec-mocks (~> 3.11) - rspec-support (~> 3.11) - rspec-support (3.11.1) - rubocop (1.37.1) - json (~> 2.3) - parallel (~> 1.10) - parser (>= 3.1.2.1) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.23.0, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.0) - parser (>= 3.1.1.0) - rubocop-performance (1.15.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - rubocop-rails (2.17.3) - activesupport (>= 4.2.0) - rack (>= 1.1) - rubocop (>= 1.33.0, < 2.0) - ruby-ole (1.2.12.1) - ruby-progressbar (1.11.0) - rubyzip (2.3.2) - sass (3.4.25) - sass-rails (5.0.8) - railties (>= 5.2.0) - sass (~> 3.1) - sprockets (>= 2.8, < 4.0) - sprockets-rails (>= 2.0, < 4.0) - tilt (>= 1.1, < 3) - secure_headers (6.4.0) - signet (0.17.0) - addressable (~> 2.8) - faraday (>= 0.17.5, < 3.a) - jwt (>= 1.5, < 3.0) - multi_json (~> 1.10) - simplecov (0.17.1) - docile (~> 1.1) - json (>= 1.8, < 3) - simplecov-html (~> 0.10.0) - simplecov-html (0.10.2) - simplecov-lcov (0.7.0) - singleton (0.1.1) - sprockets (3.7.2) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - sprockets (>= 3.0.0) - statistics2 (0.54) - stripe (5.55.0) - syck (1.4.1) - syslog_protocol (0.9.2) - text (1.3.1) - thin (1.8.1) - daemons (~> 1.0, >= 1.0.9) - eventmachine (~> 1.0, >= 1.0.4) - rack (>= 1, < 3) - thor (1.2.1) - tilt (2.0.10) - timeout (0.3.1) - trailblazer-option (0.1.2) - tzinfo (2.0.5) - concurrent-ruby (~> 1.0) - uber (0.1.0) - uglifier (4.2.0) - execjs (>= 0.3.0, < 3) - unicode (0.4.4.4) - unicode-display_width (2.3.0) - unidecoder (1.1.2) - uniform_notifier (1.16.0) - vpim (13.11.11) - web-console (4.2.0) - actionview (>= 6.0.0) - activemodel (>= 6.0.0) - bindex (>= 0.4.0) - railties (>= 6.0.0) - webmock (3.18.1) - addressable (>= 2.8.0) - crack (>= 0.3.2) - hashdiff (>= 0.4.0, < 2.0.0) - webrick (1.7.0) - websocket-driver (0.7.5) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) - will_paginate (3.3.1) - xapian-full-alaveteli (1.4.21.1) - xml-simple (1.1.9) - rexml - xpath (3.2.0) - nokogiri (~> 1.8) - zeitwerk (2.6.6) - zip_tricks (5.6.0) - -PLATFORMS - aarch64-linux - arm64-darwin - ruby - x86_64-darwin - x86_64-linux - -DEPENDENCIES - active_model_otp - acts_as_versioned! - alaveteli_features! - annotate (< 3.2.1) - aws-sdk-s3 - azure-storage - bcrypt (~> 3.1.18) - bootstrap-sass (~> 2.3.2.2) - bullet (~> 7.0.4) - cancancan (~> 3.4.0) - capistrano (~> 2.15.0, < 3.0.0) - capybara (~> 3.38.0) - charlock_holmes (~> 0.7.7) - dalli (~> 3.2.3) - exception_notification (~> 4.5.0) - factory_bot_rails (~> 6.2.0) - fancybox-rails (~> 0.3.0) - fast_gettext (~> 2.2.0) - fivemat (~> 1.3.7) - gender_detector (~> 2.0.0) - gettext (~> 3.4.3) - gettext_i18n_rails (~> 1.9.0) - globalize (~> 6.2.1) - gnuplot (~> 2.6.0) - google-cloud-storage (~> 1.43) - holidays (~> 8.6.0) - htmlentities (~> 4.3.0) - i18n (~> 1.12.0) - icalendar (~> 2.8.0) - iso_country_codes (~> 0.7.8) - jquery-rails (~> 4.5.0) - jquery-ui-rails (~> 6.0.0) - json (~> 2.6.2) - launchy (< 2.5.0) - listen (>= 3.0.5, < 3.7.2) - locale (~> 2.1.3) - mahoro (~> 0.5) - mail (~> 2.7.1) - maxmind-db (~> 1.0.0) - mime-types (< 3.0.0) - mini_magick (~> 4.11.0) - mini_racer (~> 0.6.3) - money (~> 6.16.0) - net-ssh (~> 7.0.1) - net-ssh-gateway (>= 1.1.0, < 3.0.0) - nokogiri (~> 1.13.10) - oink (~> 0.10.1) - open4 (~> 1.3.0) - pg (~> 1.4.4) - pry (~> 0.14.1) - rack (~> 2.2.4) - rack-utf8_sanitizer (~> 1.7.0) - rails (~> 7.0.4) - rails-controller-testing - rails-i18n (~> 7.0.5) - recaptcha (~> 5.12.3) - rolify (~> 5.3.0) - routing-filter (~> 0.7.0) - rspec-activemodel-mocks (~> 1.1.0) - rspec-rails (~> 6.0.0) - rubocop (~> 1.37.0) - rubocop-performance - rubocop-rails - ruby-msg (~> 1.5.0)! - rubyzip (~> 2.3.2) - sass-rails (~> 5.0.8) - secure_headers (~> 6.4.0) - simplecov (~> 0.17.1) - simplecov-lcov (~> 0.7.0) - statistics2 (~> 0.54) - strip_attributes! - stripe (~> 5.55.0) - stripe-ruby-mock! - syck (~> 1.4.1) - syslog_protocol (~> 0.9.0) - thin (~> 1.8.1) - uglifier (~> 4.2.0) - unicode (~> 0.4.4) - unidecoder (~> 1.1.0) - vpim (~> 13.11.11) - web-console (>= 3.3.0) - webmock (~> 3.18.1) - will_paginate (~> 3.3.1) - xapian-full-alaveteli (~> 1.4.21.1) - xml-simple (~> 1.1.9) - zip_tricks (~> 5.6.0) diff --git a/bin/bundle_next b/bin/bundle_next deleted file mode 100755 index ab77d8691f..0000000000 --- a/bin/bundle_next +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -DEPENDENCIES_NEXT=1 bundle "$@" diff --git a/bin/rails_next b/bin/rails_next deleted file mode 100755 index 9f606ef1df..0000000000 --- a/bin/rails_next +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -DEPENDENCIES_NEXT=1 bundle exec rails "$@" diff --git a/bin/rspec_next b/bin/rspec_next deleted file mode 100755 index 1580a0cc5c..0000000000 --- a/bin/rspec_next +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -DEPENDENCIES_NEXT=1 bundle exec rspec "$@" diff --git a/config/application.rb b/config/application.rb index c2e7126a27..fa677e12be 100644 --- a/config/application.rb +++ b/config/application.rb @@ -22,10 +22,6 @@ # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) -def dependencies_next? - ENV['DEPENDENCIES_NEXT'] -end - module Alaveteli class Application < Rails::Application # Configuration for the application, engines, and railties goes here. diff --git a/gems/alaveteli_features/alaveteli_features.gemspec b/gems/alaveteli_features/alaveteli_features.gemspec index 1c20303495..da07c0c89d 100644 --- a/gems/alaveteli_features/alaveteli_features.gemspec +++ b/gems/alaveteli_features/alaveteli_features.gemspec @@ -2,10 +2,6 @@ lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'alaveteli_features/version' -def dependencies_next? - ENV['DEPENDENCIES_NEXT'] -end - Gem::Specification.new do |spec| spec.name = "alaveteli_features" spec.version = AlaveteliFeatures::VERSION From f0b703ce3fa223fbc4cc0c06e5b3353c9bbef417 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 5 Jan 2023 14:25:28 +0000 Subject: [PATCH 026/289] Add support for Ruby 3.1 Added matrix gem which has been extracted from standard lib and used by gnuplot. --- .github/workflows/ci.yml | 1 + Gemfile | 1 + Gemfile.lock | 1 + README.md | 1 + app/models/post_redirect.rb | 14 +++++++++++++- doc/CHANGES.md | 3 ++- spec/lib/yaml_compatability_spec.rb | 4 ++-- 7 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f25b7d058..746c45161b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,7 @@ jobs: matrix: include: - { ruby: '3.0', postgres: 13.5 } + - { ruby: '3.1', postgres: 13.5 } services: postgres: diff --git a/Gemfile b/Gemfile index 38c4641223..61faa56f23 100644 --- a/Gemfile +++ b/Gemfile @@ -109,6 +109,7 @@ gem 'open4', '~> 1.3.0' gem 'rack', '~> 2.2.4' gem 'rack-utf8_sanitizer', '~> 1.7.0' gem 'recaptcha', '~> 5.12.3', require: 'recaptcha/rails' +gem 'matrix', '~> 0.4.2' gem 'mini_magick', '~> 4.11.0' gem 'rolify', '~> 5.3.0' gem 'ruby-msg', '~> 1.5.0', :git => 'https://github.com/mysociety/ruby-msg.git', :branch => 'ascii-encoding' diff --git a/Gemfile.lock b/Gemfile.lock index 5e3625f3bc..497bb394d7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -576,6 +576,7 @@ DEPENDENCIES locale (~> 2.1.3) mahoro (~> 0.5) mail (~> 2.7.1) + matrix (~> 0.4.2) maxmind-db (~> 1.0.0) mime-types (< 3.0.0) mini_magick (~> 4.11.0) diff --git a/README.md b/README.md index 44da287907..f24b81e40e 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ see [the project website](http://alaveteli.org) for instructions on installing A Every Alaveteli commit is tested by GitHub Actions on the [following Ruby platforms](https://github.com/mysociety/alaveteli/blob/develop/.github/workflows/ci.yml#L15) * ruby-3.0 +* ruby-3.1 If you use a ruby version management tool (such as RVM or .rbenv) and want to use the default development version used by the Alaveteli team (currently 3.0.4), you can create a `.ruby-version` symlink with a target of `.ruby-version.example` to switch to that automatically in the project directory. diff --git a/app/models/post_redirect.rb b/app/models/post_redirect.rb index ac7e8fe863..3cd3c8dc59 100644 --- a/app/models/post_redirect.rb +++ b/app/models/post_redirect.rb @@ -70,7 +70,19 @@ def post_params=(params) def post_params return {} if post_params_yaml.nil? - YAML.load(post_params_yaml) + + if RUBY_VERSION < "3.1" + YAML.load(post_params_yaml) + else + YAML.load( + post_params_yaml, + permitted_classes: [ + ActionController::Parameters, + ActiveSupport::HashWithIndifferentAccess, + Symbol + ] + ) + end end # We store YAML version of textual "reason for redirect" parameters diff --git a/doc/CHANGES.md b/doc/CHANGES.md index cbef909601..239fdbdd76 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -2,9 +2,10 @@ ## Highlighted Features +* Add support for Ruby 3.1 (Graeme Porteous) * Upgrade to Rails 7 (Graeme Porteous) * Improve processing of large PDF attachments (Graeme Porteous) -* Add support for Ruby 3 (Graeme Porteous) +* Add support for Ruby 3.0 (Graeme Porteous) * Drop support for Ruby 2.7 (Graeme Porteous) ## Upgrade Notes diff --git a/spec/lib/yaml_compatability_spec.rb b/spec/lib/yaml_compatability_spec.rb index 7274936b99..482ea5aa01 100644 --- a/spec/lib/yaml_compatability_spec.rb +++ b/spec/lib/yaml_compatability_spec.rb @@ -10,7 +10,7 @@ let(:content) { yaml_compatibility_fixture('5_0') } it 'correctly loads YAML file' do - is_expected.to eq hash + is_expected.to eq hash if RUBY_VERSION < '3.1' end end @@ -18,7 +18,7 @@ let(:content) { yaml_compatibility_fixture('5_1') } it 'correctly loads YAML file' do - is_expected.to eq hash + is_expected.to eq hash if RUBY_VERSION < '3.1' end end From e4e96bc97cddecb7a490487ad3d3af8ec68dc80e Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 17 Jan 2023 11:23:31 +0000 Subject: [PATCH 027/289] Fix rendering of notes on request#new view Removed #request_header_text container as the inner note container contains all the layout/styling we need. Fixes https://github.com/mysociety/whatdotheyknow-theme/issues/1411 --- .../stylesheets/responsive/_new_request_style.scss | 9 --------- app/views/request/new.html.erb | 4 +--- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/app/assets/stylesheets/responsive/_new_request_style.scss b/app/assets/stylesheets/responsive/_new_request_style.scss index 607a6cd8d3..818a7272cf 100644 --- a/app/assets/stylesheets/responsive/_new_request_style.scss +++ b/app/assets/stylesheets/responsive/_new_request_style.scss @@ -50,15 +50,6 @@ margin-bottom: 2em; } -#request_header_text { - overflow: hidden; - font-size: 0.875em; - h3 { - font-size: 1em; - } - -} - #request_advice { margin-bottom: 1.5em; font-size: 0.875em; diff --git a/app/views/request/new.html.erb b/app/views/request/new.html.erb index 732ef69f6c..512c28e2de 100644 --- a/app/views/request/new.html.erb +++ b/app/views/request/new.html.erb @@ -137,9 +137,7 @@ <% unless @batch %> <% if @info_request.public_body.has_notes? %> -
- <%= render_notes(@info_request.public_body.notes) %> -
+ <%= render_notes(@info_request.public_body.notes) %> <% end %> <% end %> From 043a180f01280b5566e0e37979667f9a76270601 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 17 Jan 2023 11:52:54 +0000 Subject: [PATCH 028/289] Allow docker/compose to specify Ruby version Use the RUBY_VERSION environment variable or a .ruby-version file in the root directory to specify which version of Ruby should be used in the docker development environment. After changing the environment variable or the .ruby-version file you'll need to rebuild the docker image by running: `docker/reset` --- docker-compose.yml | 2 ++ docker/Dockerfile | 3 ++- docker/env | 9 +++++++++ docker/reset | 2 ++ docker/server | 1 + docker/setup | 1 + 6 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 docker/env diff --git a/docker-compose.yml b/docker-compose.yml index 414ad83f1a..a1a3f3a515 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,6 +5,8 @@ services: build: context: . dockerfile: docker/Dockerfile + args: + RUBY_VERSION: '${RUBY_VERSION:-3.0}' environment: - BUNDLE_PATH=/bundle/vendor - DATABASE_URL=postgres://postgres:password@db/ diff --git a/docker/Dockerfile b/docker/Dockerfile index e08d9c4d41..5e82880071 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,5 @@ -FROM ruby:3.0-bullseye +ARG RUBY_VERSION=3.0 +FROM ruby:${RUBY_VERSION}-bullseye ENV DOCKER 1 ENV DEBIAN_FRONTEND noninteractive diff --git a/docker/env b/docker/env new file mode 100755 index 0000000000..a8c9e848bb --- /dev/null +++ b/docker/env @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +cd "$(dirname "$0")/.." + +if [ -e .ruby-version ]; then + export RUBY_VERSION="$(cat .ruby-version)" +fi diff --git a/docker/reset b/docker/reset index 956184e68d..2549a1db70 100755 --- a/docker/reset +++ b/docker/reset @@ -4,6 +4,8 @@ set -e cd "$(dirname "$0")/.." +source docker/env + docker compose down db_volume="$(basename $(pwd))_postgres" diff --git a/docker/server b/docker/server index 6fa3706183..d4f8d0a05f 100755 --- a/docker/server +++ b/docker/server @@ -5,6 +5,7 @@ set -e cd "$(dirname "$0")/.." if [ -z "$DOCKER" ]; then + source docker/env docker compose up exit fi diff --git a/docker/setup b/docker/setup index ba25badd1d..45cdf93ffd 100755 --- a/docker/setup +++ b/docker/setup @@ -5,6 +5,7 @@ set -e cd "$(dirname "$0")/.." if [ -z "$DOCKER" ]; then + source docker/env ./docker/bootstrap docker compose run --rm app ./docker/setup "$@" exit From 91103b5ad604c8f1c708012a3129825406b7222a Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 17 Jan 2023 14:56:31 +0000 Subject: [PATCH 029/289] Update Git Submodules using Dependabot Get automated PRs for commonlib changes. --- .github/dependabot.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c06e767725..0594a6b0e2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,3 +11,8 @@ updates: - dependency-name: capistrano versions: - ">= 3.0.0" + + - package-ecosystem: gitsubmodule + directory: "/" + schedule: + interval: daily From 8afb211dfa7af406a78b95788153e79a03645f80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Jan 2023 15:41:11 +0000 Subject: [PATCH 030/289] Bump nokogiri from 1.13.10 to 1.14.0 Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.10 to 1.14.0. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.10...v1.14.0) --- updated-dependencies: - dependency-name: nokogiri dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 61faa56f23..eb5479dd90 100644 --- a/Gemfile +++ b/Gemfile @@ -104,7 +104,7 @@ gem 'iso_country_codes', '~> 0.7.8' gem 'mail', '~> 2.7.1' gem 'maxmind-db', '~> 1.0.0' gem 'mahoro', '~> 0.5' -gem 'nokogiri', '~> 1.13.10' +gem 'nokogiri', '~> 1.14.0' gem 'open4', '~> 1.3.0' gem 'rack', '~> 2.2.4' gem 'rack-utf8_sanitizer', '~> 1.7.0' diff --git a/Gemfile.lock b/Gemfile.lock index 497bb394d7..1593751ff5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -328,16 +328,16 @@ GEM net-ssh-gateway (2.0.0) net-ssh (>= 4.0.0) nio4r (2.5.8) - nokogiri (1.13.10) + nokogiri (1.14.0) mini_portile2 (~> 2.8.0) racc (~> 1.4) - nokogiri (1.13.10-aarch64-linux) + nokogiri (1.14.0-aarch64-linux) racc (~> 1.4) - nokogiri (1.13.10-arm64-darwin) + nokogiri (1.14.0-arm64-darwin) racc (~> 1.4) - nokogiri (1.13.10-x86_64-darwin) + nokogiri (1.14.0-x86_64-darwin) racc (~> 1.4) - nokogiri (1.13.10-x86_64-linux) + nokogiri (1.14.0-x86_64-linux) racc (~> 1.4) oink (0.10.1) activerecord @@ -584,7 +584,7 @@ DEPENDENCIES money (~> 6.16.0) net-ssh (~> 7.0.1) net-ssh-gateway (>= 1.1.0, < 3.0.0) - nokogiri (~> 1.13.10) + nokogiri (~> 1.14.0) oink (~> 0.10.1) open4 (~> 1.3.0) pg (~> 1.4.4) From 2828b6a2b5d782f1bbeb6514dac3ff704cdfdc58 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Jan 2023 17:48:07 +0000 Subject: [PATCH 031/289] Bump rack from 2.2.5 to 2.2.6.2 Bumps [rack](https://github.com/rack/rack) from 2.2.5 to 2.2.6.2. - [Release notes](https://github.com/rack/rack/releases) - [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md) - [Commits](https://github.com/rack/rack/compare/v2.2.5...v2.2.6.2) --- updated-dependencies: - dependency-name: rack dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 61faa56f23..5b16c02f33 100644 --- a/Gemfile +++ b/Gemfile @@ -106,7 +106,7 @@ gem 'maxmind-db', '~> 1.0.0' gem 'mahoro', '~> 0.5' gem 'nokogiri', '~> 1.13.10' gem 'open4', '~> 1.3.0' -gem 'rack', '~> 2.2.4' +gem 'rack', '~> 2.2.6' gem 'rack-utf8_sanitizer', '~> 1.7.0' gem 'recaptcha', '~> 5.12.3', require: 'recaptcha/rails' gem 'matrix', '~> 0.4.2' diff --git a/Gemfile.lock b/Gemfile.lock index 497bb394d7..8f11f4224c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -356,7 +356,7 @@ GEM method_source (~> 1.0) public_suffix (5.0.0) racc (1.6.2) - rack (2.2.5) + rack (2.2.6.2) rack-test (2.0.2) rack (>= 1.3) rack-utf8_sanitizer (1.7.0) @@ -589,7 +589,7 @@ DEPENDENCIES open4 (~> 1.3.0) pg (~> 1.4.4) pry (~> 0.14.1) - rack (~> 2.2.4) + rack (~> 2.2.6) rack-utf8_sanitizer (~> 1.7.0) rails (~> 7.0.4) rails-controller-testing From 789a99d9fcc63bd135bfbc6a64d4a32271ac25c2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Jan 2023 17:49:18 +0000 Subject: [PATCH 032/289] Bump rails from 7.0.4 to 7.0.4.1 Bumps [rails](https://github.com/rails/rails) from 7.0.4 to 7.0.4.1. - [Release notes](https://github.com/rails/rails/releases) - [Commits](https://github.com/rails/rails/compare/v7.0.4...v7.0.4.1) --- updated-dependencies: - dependency-name: rails dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 108 +++++++++++++++++++++++++-------------------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 497bb394d7..2eab7cd30a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -45,47 +45,47 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (7.0.4) - actionpack (= 7.0.4) - activesupport (= 7.0.4) + actioncable (7.0.4.1) + actionpack (= 7.0.4.1) + activesupport (= 7.0.4.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4) - actionpack (= 7.0.4) - activejob (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) + actionmailbox (7.0.4.1) + actionpack (= 7.0.4.1) + activejob (= 7.0.4.1) + activerecord (= 7.0.4.1) + activestorage (= 7.0.4.1) + activesupport (= 7.0.4.1) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.4) - actionpack (= 7.0.4) - actionview (= 7.0.4) - activejob (= 7.0.4) - activesupport (= 7.0.4) + actionmailer (7.0.4.1) + actionpack (= 7.0.4.1) + actionview (= 7.0.4.1) + activejob (= 7.0.4.1) + activesupport (= 7.0.4.1) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.4) - actionview (= 7.0.4) - activesupport (= 7.0.4) + actionpack (7.0.4.1) + actionview (= 7.0.4.1) + activesupport (= 7.0.4.1) rack (~> 2.0, >= 2.2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4) - actionpack (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) + actiontext (7.0.4.1) + actionpack (= 7.0.4.1) + activerecord (= 7.0.4.1) + activestorage (= 7.0.4.1) + activesupport (= 7.0.4.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4) - activesupport (= 7.0.4) + actionview (7.0.4.1) + activesupport (= 7.0.4.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -93,22 +93,22 @@ GEM active_model_otp (2.3.1) activemodel rotp (~> 6.2.0) - activejob (7.0.4) - activesupport (= 7.0.4) + activejob (7.0.4.1) + activesupport (= 7.0.4.1) globalid (>= 0.3.6) - activemodel (7.0.4) - activesupport (= 7.0.4) - activerecord (7.0.4) - activemodel (= 7.0.4) - activesupport (= 7.0.4) - activestorage (7.0.4) - actionpack (= 7.0.4) - activejob (= 7.0.4) - activerecord (= 7.0.4) - activesupport (= 7.0.4) + activemodel (7.0.4.1) + activesupport (= 7.0.4.1) + activerecord (7.0.4.1) + activemodel (= 7.0.4.1) + activesupport (= 7.0.4.1) + activestorage (7.0.4.1) + actionpack (= 7.0.4.1) + activejob (= 7.0.4.1) + activerecord (= 7.0.4.1) + activesupport (= 7.0.4.1) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.4) + activesupport (7.0.4.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -216,7 +216,7 @@ GEM text (>= 1.3.0) gettext_i18n_rails (1.9.0) fast_gettext (>= 0.9.0) - globalid (1.0.0) + globalid (1.0.1) activesupport (>= 5.0) globalize (6.2.1) activemodel (>= 4.2, < 7.1) @@ -361,20 +361,20 @@ GEM rack (>= 1.3) rack-utf8_sanitizer (1.7.0) rack (>= 1.0, < 3.0) - rails (7.0.4) - actioncable (= 7.0.4) - actionmailbox (= 7.0.4) - actionmailer (= 7.0.4) - actionpack (= 7.0.4) - actiontext (= 7.0.4) - actionview (= 7.0.4) - activejob (= 7.0.4) - activemodel (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) + rails (7.0.4.1) + actioncable (= 7.0.4.1) + actionmailbox (= 7.0.4.1) + actionmailer (= 7.0.4.1) + actionpack (= 7.0.4.1) + actiontext (= 7.0.4.1) + actionview (= 7.0.4.1) + activejob (= 7.0.4.1) + activemodel (= 7.0.4.1) + activerecord (= 7.0.4.1) + activestorage (= 7.0.4.1) + activesupport (= 7.0.4.1) bundler (>= 1.15.0) - railties (= 7.0.4) + railties (= 7.0.4.1) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -387,9 +387,9 @@ GEM rails-i18n (7.0.5) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.0.4) - actionpack (= 7.0.4) - activesupport (= 7.0.4) + railties (7.0.4.1) + actionpack (= 7.0.4.1) + activesupport (= 7.0.4.1) method_source rake (>= 12.2) thor (~> 1.0) From f9523542062368b96efb4cf186dd10ac41fd38c7 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 19 Jan 2023 11:05:30 +0000 Subject: [PATCH 033/289] Update commonlib --- commonlib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commonlib b/commonlib index 6438360fd5..8b638d674b 160000 --- a/commonlib +++ b/commonlib @@ -1 +1 @@ -Subproject commit 6438360fd5700044fd00533056a6bc1ba4da575e +Subproject commit 8b638d674badcb1dc6a4867d9f49571caecc923c From 3da3196de888b28a0f62d204a2530391ecc494f8 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 5 Jan 2023 17:15:34 +0000 Subject: [PATCH 034/289] Add support for Ruby 3.2 --- .github/workflows/ci.yml | 1 + README.md | 1 + doc/CHANGES.md | 1 + script/handle-mail-replies | 2 ++ script/load-mail-server-logs | 2 ++ script/mailin | 2 ++ 6 files changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 746c45161b..48546fd7c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,7 @@ jobs: include: - { ruby: '3.0', postgres: 13.5 } - { ruby: '3.1', postgres: 13.5 } + - { ruby: '3.2', postgres: 13.5 } services: postgres: diff --git a/README.md b/README.md index f24b81e40e..bb044984fc 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ Every Alaveteli commit is tested by GitHub Actions on the [following Ruby platfo * ruby-3.0 * ruby-3.1 +* ruby-3.2 If you use a ruby version management tool (such as RVM or .rbenv) and want to use the default development version used by the Alaveteli team (currently 3.0.4), you can create a `.ruby-version` symlink with a target of `.ruby-version.example` to switch to that automatically in the project directory. diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 239fdbdd76..a4c2d5fb02 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -2,6 +2,7 @@ ## Highlighted Features +* Add support for Ruby 3.2 (Graeme Porteous) * Add support for Ruby 3.1 (Graeme Porteous) * Upgrade to Rails 7 (Graeme Porteous) * Improve processing of large PDF attachments (Graeme Porteous) diff --git a/script/handle-mail-replies b/script/handle-mail-replies index 267ad56321..b2638c763b 100755 --- a/script/handle-mail-replies +++ b/script/handle-mail-replies @@ -1,4 +1,6 @@ #!/bin/bash +export RUBYOPT="-W0" + cd "`dirname "${BASH_SOURCE[0]}"`" exec bundle exec ./handle-mail-replies.rb "$@" diff --git a/script/load-mail-server-logs b/script/load-mail-server-logs index c517434387..0e575dfc6c 100755 --- a/script/load-mail-server-logs +++ b/script/load-mail-server-logs @@ -1,5 +1,7 @@ #!/bin/bash +export RUBYOPT="-W0" + LOC="`dirname "${BASH_SOURCE[0]}"`"/.. cd "$LOC" diff --git a/script/mailin b/script/mailin index 4d00fcaa80..41dfbf5a5e 100755 --- a/script/mailin +++ b/script/mailin @@ -1,5 +1,7 @@ #!/bin/bash +export RUBYOPT="-W0" + # Wire this script to receive incoming email for request responses. INPUT=$(mktemp -t foi-mailin-mail-XXXXXXXX) From d1179784e23b3d75142a8473cc298d64d5272672 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Jan 2023 11:44:17 +0000 Subject: [PATCH 035/289] Bump globalid from 1.0.0 to 1.0.1 Bumps [globalid](https://github.com/rails/globalid) from 1.0.0 to 1.0.1. - [Release notes](https://github.com/rails/globalid/releases) - [Commits](https://github.com/rails/globalid/compare/v1.0.0...v1.0.1) --- updated-dependencies: - dependency-name: globalid dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1593751ff5..4fb22f3f69 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -216,7 +216,7 @@ GEM text (>= 1.3.0) gettext_i18n_rails (1.9.0) fast_gettext (>= 0.9.0) - globalid (1.0.0) + globalid (1.0.1) activesupport (>= 5.0) globalize (6.2.1) activemodel (>= 4.2, < 7.1) From 1c29ac1370d7e9e118d3e2fb6a972a497ac9cdc4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 10:32:47 +0000 Subject: [PATCH 036/289] Bump secure_headers from 6.4.0 to 6.5.0 Bumps [secure_headers](https://github.com/twitter/secureheaders) from 6.4.0 to 6.5.0. - [Release notes](https://github.com/twitter/secureheaders/releases) - [Changelog](https://github.com/github/secure_headers/blob/main/CHANGELOG.md) - [Commits](https://github.com/twitter/secureheaders/compare/v6.4.0...v6.5.0) --- updated-dependencies: - dependency-name: secure_headers dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index eb5479dd90..a4fc9bfe27 100644 --- a/Gemfile +++ b/Gemfile @@ -114,7 +114,7 @@ gem 'mini_magick', '~> 4.11.0' gem 'rolify', '~> 5.3.0' gem 'ruby-msg', '~> 1.5.0', :git => 'https://github.com/mysociety/ruby-msg.git', :branch => 'ascii-encoding' gem 'rubyzip', '~> 2.3.2' -gem 'secure_headers', '~> 6.4.0' +gem 'secure_headers', '~> 6.5.0' gem 'statistics2', '~> 0.54' gem 'strip_attributes', :git => 'https://github.com/mysociety/strip_attributes.git', :branch => 'globalize3-rails7' gem 'stripe', '~> 5.55.0' diff --git a/Gemfile.lock b/Gemfile.lock index 1593751ff5..e9000138ef 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -465,7 +465,7 @@ GEM sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) - secure_headers (6.4.0) + secure_headers (6.5.0) signet (0.17.0) addressable (~> 2.8) faraday (>= 0.17.5, < 3.a) @@ -605,7 +605,7 @@ DEPENDENCIES ruby-msg (~> 1.5.0)! rubyzip (~> 2.3.2) sass-rails (~> 5.0.8) - secure_headers (~> 6.4.0) + secure_headers (~> 6.5.0) simplecov (~> 0.17.1) simplecov-lcov (~> 0.7.0) statistics2 (~> 0.54) From e4585240f96ad43aac0491741599bf0724a70a75 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 10:32:54 +0000 Subject: [PATCH 037/289] Bump rack-utf8_sanitizer from 1.7.0 to 1.8.0 Bumps [rack-utf8_sanitizer](https://github.com/whitequark/rack-utf8_sanitizer) from 1.7.0 to 1.8.0. - [Release notes](https://github.com/whitequark/rack-utf8_sanitizer/releases) - [Changelog](https://github.com/whitequark/rack-utf8_sanitizer/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/rack-utf8_sanitizer/compare/v1.7.0...v1.8.0) --- updated-dependencies: - dependency-name: rack-utf8_sanitizer dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index eb5479dd90..cab7782116 100644 --- a/Gemfile +++ b/Gemfile @@ -107,7 +107,7 @@ gem 'mahoro', '~> 0.5' gem 'nokogiri', '~> 1.14.0' gem 'open4', '~> 1.3.0' gem 'rack', '~> 2.2.4' -gem 'rack-utf8_sanitizer', '~> 1.7.0' +gem 'rack-utf8_sanitizer', '~> 1.8.0' gem 'recaptcha', '~> 5.12.3', require: 'recaptcha/rails' gem 'matrix', '~> 0.4.2' gem 'mini_magick', '~> 4.11.0' diff --git a/Gemfile.lock b/Gemfile.lock index 1593751ff5..9c5528aef8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -359,8 +359,8 @@ GEM rack (2.2.5) rack-test (2.0.2) rack (>= 1.3) - rack-utf8_sanitizer (1.7.0) - rack (>= 1.0, < 3.0) + rack-utf8_sanitizer (1.8.0) + rack (>= 1.0, < 4.0) rails (7.0.4) actioncable (= 7.0.4) actionmailbox (= 7.0.4) @@ -590,7 +590,7 @@ DEPENDENCIES pg (~> 1.4.4) pry (~> 0.14.1) rack (~> 2.2.4) - rack-utf8_sanitizer (~> 1.7.0) + rack-utf8_sanitizer (~> 1.8.0) rails (~> 7.0.4) rails-controller-testing rails-i18n (~> 7.0.5) From a015036fa3752aafdd11869101b910a1bbce692d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 10:33:06 +0000 Subject: [PATCH 038/289] Bump google-cloud-storage from 1.43.0 to 1.44.0 Bumps [google-cloud-storage](https://github.com/googleapis/google-cloud-ruby) from 1.43.0 to 1.44.0. - [Release notes](https://github.com/googleapis/google-cloud-ruby/releases) - [Changelog](https://github.com/googleapis/google-cloud-ruby/blob/main/google-cloud-document_ai-v1beta3/CHANGELOG.md) - [Commits](https://github.com/googleapis/google-cloud-ruby/compare/google-cloud-storage/v1.43.0...google-cloud-storage/v1.44.0) --- updated-dependencies: - dependency-name: google-cloud-storage dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Gemfile b/Gemfile index eb5479dd90..69e41e1374 100644 --- a/Gemfile +++ b/Gemfile @@ -158,7 +158,7 @@ gem 'alaveteli_features', :path => 'gems/alaveteli_features' # Storage backends gem 'aws-sdk-s3', require: false gem 'azure-storage', require: false -gem 'google-cloud-storage', '~> 1.43', require: false +gem 'google-cloud-storage', '~> 1.44', require: false group :test do gem 'fivemat', '~> 1.3.7' diff --git a/Gemfile.lock b/Gemfile.lock index 1593751ff5..527e22f0c7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -196,7 +196,7 @@ GEM railties (>= 5.0.0) fancybox-rails (0.3.1) railties (>= 3.1.0) - faraday (0.17.5) + faraday (0.17.6) multipart-post (>= 1.2, < 3) faraday_middleware (0.14.0) faraday (>= 0.7.4, < 1.0) @@ -223,7 +223,7 @@ GEM activerecord (>= 4.2, < 7.1) request_store (~> 1.0) gnuplot (2.6.2) - google-apis-core (0.9.1) + google-apis-core (0.9.5) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) @@ -232,8 +232,8 @@ GEM retriable (>= 2.0, < 4.a) rexml webrick - google-apis-iamcredentials_v1 (0.15.0) - google-apis-core (>= 0.9.0, < 2.a) + google-apis-iamcredentials_v1 (0.16.0) + google-apis-core (>= 0.9.1, < 2.a) google-apis-storage_v1 (0.19.0) google-apis-core (>= 0.9.0, < 2.a) google-cloud-core (1.6.0) @@ -242,7 +242,7 @@ GEM google-cloud-env (1.6.0) faraday (>= 0.17.3, < 3.0) google-cloud-errors (1.3.0) - google-cloud-storage (1.43.0) + google-cloud-storage (1.44.0) addressable (~> 2.8) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) @@ -277,7 +277,7 @@ GEM jquery-ui-rails (6.0.1) railties (>= 3.2.16) json (2.6.3) - jwt (2.5.0) + jwt (2.6.0) launchy (2.4.3) addressable (~> 2.3) libv8-node (16.10.0.0) @@ -354,7 +354,7 @@ GEM pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (5.0.0) + public_suffix (5.0.1) racc (1.6.2) rack (2.2.5) rack-test (2.0.2) @@ -562,7 +562,7 @@ DEPENDENCIES gettext_i18n_rails (~> 1.9.0) globalize (~> 6.2.1) gnuplot (~> 2.6.0) - google-cloud-storage (~> 1.43) + google-cloud-storage (~> 1.44) holidays (~> 8.6.0) htmlentities (~> 4.3.0) i18n (~> 1.12.0) From 20a4267d3e9fc2b01fa7e8b2ddf3aa5500593b6c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 10:33:19 +0000 Subject: [PATCH 039/289] Bump jquery-rails from 4.5.0 to 4.5.1 Bumps [jquery-rails](https://github.com/rails/jquery-rails) from 4.5.0 to 4.5.1. - [Release notes](https://github.com/rails/jquery-rails/releases) - [Changelog](https://github.com/rails/jquery-rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/rails/jquery-rails/compare/v4.5.0...v4.5.1) --- updated-dependencies: - dependency-name: jquery-rails dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index eb5479dd90..d67aa1ac50 100644 --- a/Gemfile +++ b/Gemfile @@ -96,7 +96,7 @@ gem 'fancybox-rails', '~> 0.3.0' gem 'gnuplot', '~> 2.6.0' gem 'htmlentities', '~> 4.3.0' gem 'icalendar', '~> 2.8.0' -gem 'jquery-rails', '~> 4.5.0' +gem 'jquery-rails', '~> 4.5.1' gem 'jquery-ui-rails', '~> 6.0.0' gem 'json', '~> 2.6.2' gem 'holidays', '~> 8.6.0' diff --git a/Gemfile.lock b/Gemfile.lock index 1593751ff5..1a987fdac8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -270,7 +270,7 @@ GEM ice_cube (0.16.4) iso_country_codes (0.7.8) jmespath (1.6.1) - jquery-rails (4.5.0) + jquery-rails (4.5.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) @@ -568,7 +568,7 @@ DEPENDENCIES i18n (~> 1.12.0) icalendar (~> 2.8.0) iso_country_codes (~> 0.7.8) - jquery-rails (~> 4.5.0) + jquery-rails (~> 4.5.1) jquery-ui-rails (~> 6.0.0) json (~> 2.6.2) launchy (< 2.5.0) From 20daf4ee30dc3a81cd8b14d86f07e2b65dec4e25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 10:33:35 +0000 Subject: [PATCH 040/289] Bump pg from 1.4.4 to 1.4.5 Bumps [pg](https://github.com/ged/ruby-pg) from 1.4.4 to 1.4.5. - [Release notes](https://github.com/ged/ruby-pg/releases) - [Changelog](https://github.com/ged/ruby-pg/blob/master/History.rdoc) - [Commits](https://github.com/ged/ruby-pg/compare/v1.4.4...v1.4.5) --- updated-dependencies: - dependency-name: pg dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index eb5479dd90..89887b0301 100644 --- a/Gemfile +++ b/Gemfile @@ -81,7 +81,7 @@ source 'https://rubygems.org' gem 'rails', '~> 7.0.4' -gem 'pg', '~> 1.4.4' +gem 'pg', '~> 1.4.5' # New gem releases aren't being done. master is newer and supports Rails > 3.0 gem 'acts_as_versioned', git: 'https://github.com/mysociety/acts_as_versioned.git', diff --git a/Gemfile.lock b/Gemfile.lock index 1593751ff5..1db87cd89e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -347,7 +347,7 @@ GEM parallel (1.22.1) parser (3.1.3.0) ast (~> 2.4.1) - pg (1.4.4) + pg (1.4.5) prime (0.1.2) forwardable singleton @@ -587,7 +587,7 @@ DEPENDENCIES nokogiri (~> 1.14.0) oink (~> 0.10.1) open4 (~> 1.3.0) - pg (~> 1.4.4) + pg (~> 1.4.5) pry (~> 0.14.1) rack (~> 2.2.4) rack-utf8_sanitizer (~> 1.7.0) From 19b19c2b6da1ec0c93dd90a34a3200954ed01a75 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 10:33:48 +0000 Subject: [PATCH 041/289] Bump aws-sdk-s3 from 1.116.0 to 1.118.0 Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.116.0 to 1.118.0. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-s3/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) --- updated-dependencies: - dependency-name: aws-sdk-s3 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1593751ff5..4af3e9a22e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -120,17 +120,17 @@ GEM rake (>= 10.4, < 14.0) ast (2.4.2) aws-eventstream (1.2.0) - aws-partitions (1.649.0) - aws-sdk-core (3.164.0) + aws-partitions (1.696.0) + aws-sdk-core (3.169.0) aws-eventstream (~> 1, >= 1.0.2) - aws-partitions (~> 1, >= 1.525.0) - aws-sigv4 (~> 1.1) + aws-partitions (~> 1, >= 1.651.0) + aws-sigv4 (~> 1.5) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.58.0) - aws-sdk-core (~> 3, >= 3.127.0) + aws-sdk-kms (1.62.0) + aws-sdk-core (~> 3, >= 3.165.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.116.0) - aws-sdk-core (~> 3, >= 3.127.0) + aws-sdk-s3 (1.118.0) + aws-sdk-core (~> 3, >= 3.165.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) aws-sigv4 (1.5.2) @@ -269,7 +269,7 @@ GEM ice_cube (~> 0.16) ice_cube (0.16.4) iso_country_codes (0.7.8) - jmespath (1.6.1) + jmespath (1.6.2) jquery-rails (4.5.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) From c1e0fa510e1bbe7838c146c4c1229b44c0354e2a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 10:33:51 +0000 Subject: [PATCH 042/289] Bump mini_magick from 4.11.0 to 4.12.0 Bumps [mini_magick](https://github.com/minimagick/minimagick) from 4.11.0 to 4.12.0. - [Release notes](https://github.com/minimagick/minimagick/releases) - [Commits](https://github.com/minimagick/minimagick/compare/v4.11.0...v4.12.0) --- updated-dependencies: - dependency-name: mini_magick dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index eb5479dd90..cd353ac5c3 100644 --- a/Gemfile +++ b/Gemfile @@ -110,7 +110,7 @@ gem 'rack', '~> 2.2.4' gem 'rack-utf8_sanitizer', '~> 1.7.0' gem 'recaptcha', '~> 5.12.3', require: 'recaptcha/rails' gem 'matrix', '~> 0.4.2' -gem 'mini_magick', '~> 4.11.0' +gem 'mini_magick', '~> 4.12.0' gem 'rolify', '~> 5.3.0' gem 'ruby-msg', '~> 1.5.0', :git => 'https://github.com/mysociety/ruby-msg.git', :branch => 'ascii-encoding' gem 'rubyzip', '~> 2.3.2' diff --git a/Gemfile.lock b/Gemfile.lock index 1593751ff5..ed1fde4e1c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -301,7 +301,7 @@ GEM memoist (0.16.2) method_source (1.0.0) mime-types (2.99.3) - mini_magick (4.11.0) + mini_magick (4.12.0) mini_mime (1.1.2) mini_portile2 (2.8.1) mini_racer (0.6.3) @@ -579,7 +579,7 @@ DEPENDENCIES matrix (~> 0.4.2) maxmind-db (~> 1.0.0) mime-types (< 3.0.0) - mini_magick (~> 4.11.0) + mini_magick (~> 4.12.0) mini_racer (~> 0.6.3) money (~> 6.16.0) net-ssh (~> 7.0.1) From 1fefffe22577c1533ad9240c241d717507d8df7c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 10:34:11 +0000 Subject: [PATCH 043/289] Bump rubocop from 1.37.1 to 1.43.0 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.37.1 to 1.43.0. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.37.1...v1.43.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index eb5479dd90..6773ea854e 100644 --- a/Gemfile +++ b/Gemfile @@ -188,7 +188,7 @@ group :development do gem 'launchy', '< 2.5.0' gem 'listen', '>= 3.0.5', '< 3.7.2' gem 'web-console', '>= 3.3.0' - gem 'rubocop', '~> 1.37.0', require: false + gem 'rubocop', '~> 1.43.0', require: false gem 'rubocop-performance', require: false gem 'rubocop-rails', require: false end diff --git a/Gemfile.lock b/Gemfile.lock index 1593751ff5..9df5004298 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -345,7 +345,7 @@ GEM open4 (1.3.4) os (1.1.4) parallel (1.22.1) - parser (3.1.3.0) + parser (3.2.0.0) ast (~> 2.4.1) pg (1.4.4) prime (0.1.2) @@ -401,7 +401,7 @@ GEM ffi (~> 1.0) recaptcha (5.12.3) json - regexp_parser (2.6.1) + regexp_parser (2.6.2) representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) @@ -436,17 +436,17 @@ GEM rspec-mocks (~> 3.11) rspec-support (~> 3.11) rspec-support (3.11.1) - rubocop (1.37.1) + rubocop (1.43.0) json (~> 2.3) parallel (~> 1.10) - parser (>= 3.1.2.1) + parser (>= 3.2.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.23.0, < 2.0) + rubocop-ast (>= 1.24.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.0) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.24.1) parser (>= 3.1.1.0) rubocop-performance (1.15.1) rubocop (>= 1.7.0, < 2.0) @@ -504,7 +504,7 @@ GEM uglifier (4.2.0) execjs (>= 0.3.0, < 3) unicode (0.4.4.4) - unicode-display_width (2.3.0) + unicode-display_width (2.4.2) unidecoder (1.1.2) uniform_notifier (1.16.0) vpim (13.11.11) @@ -599,7 +599,7 @@ DEPENDENCIES routing-filter (~> 0.7.0) rspec-activemodel-mocks (~> 1.1.0) rspec-rails (~> 6.0.0) - rubocop (~> 1.37.0) + rubocop (~> 1.43.0) rubocop-performance rubocop-rails ruby-msg (~> 1.5.0)! From 6ae25d8eac54b01c9b6127a0654aa00036e67c8a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 10:34:28 +0000 Subject: [PATCH 044/289] Bump simplecov from 0.17.1 to 0.22.0 Bumps [simplecov](https://github.com/simplecov-ruby/simplecov) from 0.17.1 to 0.22.0. - [Release notes](https://github.com/simplecov-ruby/simplecov/releases) - [Changelog](https://github.com/simplecov-ruby/simplecov/blob/main/CHANGELOG.md) - [Commits](https://github.com/simplecov-ruby/simplecov/compare/v0.17.1...v0.22.0) --- updated-dependencies: - dependency-name: simplecov dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index eb5479dd90..d2abdd3e5d 100644 --- a/Gemfile +++ b/Gemfile @@ -163,7 +163,7 @@ gem 'google-cloud-storage', '~> 1.43', require: false group :test do gem 'fivemat', '~> 1.3.7' gem 'webmock', '~> 3.18.1' - gem 'simplecov', '~> 0.17.1' + gem 'simplecov', '~> 0.22.0' gem 'simplecov-lcov', '~> 0.7.0' gem 'capybara', '~> 3.38.0' gem 'stripe-ruby-mock', git: 'https://github.com/stripe-ruby-mock/stripe-ruby-mock', diff --git a/Gemfile.lock b/Gemfile.lock index 1593751ff5..7cdd9340db 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -182,7 +182,7 @@ GEM diff-lcs (1.5.0) digest-crc (0.6.4) rake (>= 12.0.0, < 14.0.0) - docile (1.3.5) + docile (1.4.0) erubi (1.12.0) eventmachine (1.2.7) exception_notification (4.5.0) @@ -471,12 +471,13 @@ GEM faraday (>= 0.17.5, < 3.a) jwt (>= 1.5, < 3.0) multi_json (~> 1.10) - simplecov (0.17.1) + simplecov (0.22.0) docile (~> 1.1) - json (>= 1.8, < 3) - simplecov-html (~> 0.10.0) - simplecov-html (0.10.2) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-html (0.12.3) simplecov-lcov (0.7.0) + simplecov_json_formatter (0.1.4) singleton (0.1.1) sprockets (3.7.2) concurrent-ruby (~> 1.0) @@ -606,7 +607,7 @@ DEPENDENCIES rubyzip (~> 2.3.2) sass-rails (~> 5.0.8) secure_headers (~> 6.4.0) - simplecov (~> 0.17.1) + simplecov (~> 0.22.0) simplecov-lcov (~> 0.7.0) statistics2 (~> 0.54) strip_attributes! From b9e66428ccb7664ba17845c0a18b0eacf1c8ccc8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 10:34:33 +0000 Subject: [PATCH 045/289] Bump launchy from 2.4.3 to 2.5.2 Bumps [launchy](https://github.com/copiousfreetime/launchy) from 2.4.3 to 2.5.2. - [Release notes](https://github.com/copiousfreetime/launchy/releases) - [Changelog](https://github.com/copiousfreetime/launchy/blob/main/README.md) - [Commits](https://github.com/copiousfreetime/launchy/compare/v2.4.3...v2.5.2) --- updated-dependencies: - dependency-name: launchy dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index eb5479dd90..5df1d18fdb 100644 --- a/Gemfile +++ b/Gemfile @@ -185,7 +185,7 @@ group :development do gem 'capistrano', '~> 2.15.0', '< 3.0.0' gem 'net-ssh', '~> 7.0.1' gem 'net-ssh-gateway', '>= 1.1.0', '< 3.0.0' - gem 'launchy', '< 2.5.0' + gem 'launchy', '< 2.6.0' gem 'listen', '>= 3.0.5', '< 3.7.2' gem 'web-console', '>= 3.3.0' gem 'rubocop', '~> 1.37.0', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 1593751ff5..5b69ea9f3e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -278,8 +278,8 @@ GEM railties (>= 3.2.16) json (2.6.3) jwt (2.5.0) - launchy (2.4.3) - addressable (~> 2.3) + launchy (2.5.2) + addressable (~> 2.8) libv8-node (16.10.0.0) libv8-node (16.10.0.0-aarch64-linux) libv8-node (16.10.0.0-arm64-darwin) @@ -354,7 +354,7 @@ GEM pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (5.0.0) + public_suffix (5.0.1) racc (1.6.2) rack (2.2.5) rack-test (2.0.2) @@ -571,7 +571,7 @@ DEPENDENCIES jquery-rails (~> 4.5.0) jquery-ui-rails (~> 6.0.0) json (~> 2.6.2) - launchy (< 2.5.0) + launchy (< 2.6.0) listen (>= 3.0.5, < 3.7.2) locale (~> 2.1.3) mahoro (~> 0.5) From e5253388ab27705e9f58362ce4701d259fa317c6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 10:34:55 +0000 Subject: [PATCH 046/289] Bump bullet from 7.0.4 to 7.0.7 Bumps [bullet](https://github.com/flyerhzm/bullet) from 7.0.4 to 7.0.7. - [Release notes](https://github.com/flyerhzm/bullet/releases) - [Changelog](https://github.com/flyerhzm/bullet/blob/main/CHANGELOG.md) - [Commits](https://github.com/flyerhzm/bullet/compare/7.0.4...7.0.7) --- updated-dependencies: - dependency-name: bullet dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index eb5479dd90..8b463aee1c 100644 --- a/Gemfile +++ b/Gemfile @@ -172,7 +172,7 @@ group :test do end group :test, :development do - gem 'bullet', '~> 7.0.4' + gem 'bullet', '~> 7.0.7' gem 'factory_bot_rails', '~> 6.2.0' gem 'oink', '~> 0.10.1' gem 'rspec-activemodel-mocks', '~> 1.1.0' diff --git a/Gemfile.lock b/Gemfile.lock index 1593751ff5..c395573405 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -149,7 +149,7 @@ GEM bootstrap-sass (2.3.2.2) sass (~> 3.2) builder (3.2.4) - bullet (7.0.4) + bullet (7.0.7) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) cancancan (3.4.0) @@ -546,7 +546,7 @@ DEPENDENCIES azure-storage bcrypt (~> 3.1.18) bootstrap-sass (~> 2.3.2.2) - bullet (~> 7.0.4) + bullet (~> 7.0.7) cancancan (~> 3.4.0) capistrano (~> 2.15.0, < 3.0.0) capybara (~> 3.38.0) From 077a40c00b74d1bc6fd92548c342aef327763804 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 10:35:01 +0000 Subject: [PATCH 047/289] Bump listen from 3.7.1 to 3.8.0 Bumps [listen](https://github.com/guard/listen) from 3.7.1 to 3.8.0. - [Release notes](https://github.com/guard/listen/releases) - [Commits](https://github.com/guard/listen/compare/v3.7.1...v3.8.0) --- updated-dependencies: - dependency-name: listen dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index eb5479dd90..1bc34e0aa9 100644 --- a/Gemfile +++ b/Gemfile @@ -186,7 +186,7 @@ group :development do gem 'net-ssh', '~> 7.0.1' gem 'net-ssh-gateway', '>= 1.1.0', '< 3.0.0' gem 'launchy', '< 2.5.0' - gem 'listen', '>= 3.0.5', '< 3.7.2' + gem 'listen', '>= 3.0.5', '< 3.8.1' gem 'web-console', '>= 3.3.0' gem 'rubocop', '~> 1.37.0', require: false gem 'rubocop-performance', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 1593751ff5..f50cf1a404 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -285,7 +285,7 @@ GEM libv8-node (16.10.0.0-arm64-darwin) libv8-node (16.10.0.0-x86_64-darwin) libv8-node (16.10.0.0-x86_64-linux) - listen (3.7.1) + listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) locale (2.1.3) @@ -396,7 +396,7 @@ GEM zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.0.6) - rb-fsevent (0.11.0) + rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) recaptcha (5.12.3) @@ -572,7 +572,7 @@ DEPENDENCIES jquery-ui-rails (~> 6.0.0) json (~> 2.6.2) launchy (< 2.5.0) - listen (>= 3.0.5, < 3.7.2) + listen (>= 3.0.5, < 3.8.1) locale (~> 2.1.3) mahoro (~> 0.5) mail (~> 2.7.1) From 79192ca1d3f0e1b98a0acdbec66ab59b6fc8a3c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 10:35:02 +0000 Subject: [PATCH 048/289] Bump gettext_i18n_rails from 1.9.0 to 1.10.0 Bumps [gettext_i18n_rails](https://github.com/grosser/gettext_i18n_rails) from 1.9.0 to 1.10.0. - [Release notes](https://github.com/grosser/gettext_i18n_rails/releases) - [Commits](https://github.com/grosser/gettext_i18n_rails/compare/v1.9.0...v1.10.0) --- updated-dependencies: - dependency-name: gettext_i18n_rails dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index eb5479dd90..0896ebe2e7 100644 --- a/Gemfile +++ b/Gemfile @@ -133,7 +133,7 @@ gem 'gender_detector', '~> 2.0.0' # Gems related to internationalisation gem 'i18n', '~> 1.12.0' gem 'rails-i18n', '~> 7.0.5' -gem 'gettext_i18n_rails', '~> 1.9.0' +gem 'gettext_i18n_rails', '~> 1.10.0' gem 'fast_gettext', '~> 2.2.0' gem 'gettext', '~> 3.4.3' gem 'globalize', '~> 6.2.1' diff --git a/Gemfile.lock b/Gemfile.lock index 1593751ff5..8422aad408 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -214,7 +214,7 @@ GEM locale (>= 2.0.5) prime text (>= 1.3.0) - gettext_i18n_rails (1.9.0) + gettext_i18n_rails (1.10.0) fast_gettext (>= 0.9.0) globalid (1.0.0) activesupport (>= 5.0) @@ -559,7 +559,7 @@ DEPENDENCIES fivemat (~> 1.3.7) gender_detector (~> 2.0.0) gettext (~> 3.4.3) - gettext_i18n_rails (~> 1.9.0) + gettext_i18n_rails (~> 1.10.0) globalize (~> 6.2.1) gnuplot (~> 2.6.0) google-cloud-storage (~> 1.43) From db50eef7dc0da536da56c538aa7493c270d37101 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 10:35:11 +0000 Subject: [PATCH 049/289] Bump pry from 0.14.1 to 0.14.2 Bumps [pry](https://github.com/pry/pry) from 0.14.1 to 0.14.2. - [Release notes](https://github.com/pry/pry/releases) - [Changelog](https://github.com/pry/pry/blob/master/CHANGELOG.md) - [Commits](https://github.com/pry/pry/compare/v0.14.1...v0.14.2) --- updated-dependencies: - dependency-name: pry dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index eb5479dd90..8fcdf58b08 100644 --- a/Gemfile +++ b/Gemfile @@ -177,7 +177,7 @@ group :test, :development do gem 'oink', '~> 0.10.1' gem 'rspec-activemodel-mocks', '~> 1.1.0' gem 'rspec-rails', '~> 6.0.0' - gem 'pry', '~> 0.14.1' + gem 'pry', '~> 0.14.2' end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index 1593751ff5..babc9fdaff 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -351,7 +351,7 @@ GEM prime (0.1.2) forwardable singleton - pry (0.14.1) + pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) public_suffix (5.0.0) @@ -588,7 +588,7 @@ DEPENDENCIES oink (~> 0.10.1) open4 (~> 1.3.0) pg (~> 1.4.4) - pry (~> 0.14.1) + pry (~> 0.14.2) rack (~> 2.2.4) rack-utf8_sanitizer (~> 1.7.0) rails (~> 7.0.4) From b30eae453313f15c87bad9d4b4abdf5d4442a52b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 10:35:21 +0000 Subject: [PATCH 050/289] Bump mail from 2.7.1 to 2.8.0.1 Bumps [mail](https://github.com/mikel/mail) from 2.7.1 to 2.8.0.1. - [Release notes](https://github.com/mikel/mail/releases) - [Changelog](https://github.com/mikel/mail/blob/master/CHANGELOG.rdoc) - [Commits](https://github.com/mikel/mail/compare/2.7.1...2.8.0.1) --- updated-dependencies: - dependency-name: mail dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index eb5479dd90..92f466641f 100644 --- a/Gemfile +++ b/Gemfile @@ -101,7 +101,7 @@ gem 'jquery-ui-rails', '~> 6.0.0' gem 'json', '~> 2.6.2' gem 'holidays', '~> 8.6.0' gem 'iso_country_codes', '~> 0.7.8' -gem 'mail', '~> 2.7.1' +gem 'mail', '~> 2.8.0' gem 'maxmind-db', '~> 1.0.0' gem 'mahoro', '~> 0.5' gem 'nokogiri', '~> 1.14.0' diff --git a/Gemfile.lock b/Gemfile.lock index 1593751ff5..8a7a139a2e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -293,8 +293,11 @@ GEM crass (~> 1.0.2) nokogiri (>= 1.5.9) mahoro (0.5) - mail (2.7.1) + mail (2.8.0.1) mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp marcel (1.0.2) matrix (0.4.2) maxmind-db (1.0.0) @@ -575,7 +578,7 @@ DEPENDENCIES listen (>= 3.0.5, < 3.7.2) locale (~> 2.1.3) mahoro (~> 0.5) - mail (~> 2.7.1) + mail (~> 2.8.0) matrix (~> 0.4.2) maxmind-db (~> 1.0.0) mime-types (< 3.0.0) From b5d2ab78cb83973b23045ad7888dfb20c6fa3ceb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 10:34:21 +0000 Subject: [PATCH 051/289] Bump rubocop-performance from 1.15.1 to 1.15.2 Bumps [rubocop-performance](https://github.com/rubocop/rubocop-performance) from 1.15.1 to 1.15.2. - [Release notes](https://github.com/rubocop/rubocop-performance/releases) - [Changelog](https://github.com/rubocop/rubocop-performance/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-performance/compare/v1.15.1...v1.15.2) --- updated-dependencies: - dependency-name: rubocop-performance dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9df5004298..6af5d45a6c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -448,7 +448,7 @@ GEM unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.24.1) parser (>= 3.1.1.0) - rubocop-performance (1.15.1) + rubocop-performance (1.15.2) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) rubocop-rails (2.17.3) From b58fb296cd9d9527afebd1dc53ff274f0edf5717 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 10:34:17 +0000 Subject: [PATCH 052/289] Bump rubocop-rails from 2.17.3 to 2.17.4 Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.17.3 to 2.17.4. - [Release notes](https://github.com/rubocop/rubocop-rails/releases) - [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.17.3...v2.17.4) --- updated-dependencies: - dependency-name: rubocop-rails dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6af5d45a6c..e9b5253f19 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -451,7 +451,7 @@ GEM rubocop-performance (1.15.2) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - rubocop-rails (2.17.3) + rubocop-rails (2.17.4) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) From dd27b129f48d59c211b0366be63aa66bb359874f Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Fri, 20 Jan 2023 11:34:54 +0000 Subject: [PATCH 053/289] Update Rubocop config --- .ruby-style.yml | 30 ++++++++++++++++++++++++++++++ script/update-rubocop-config.rb | 8 +++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/.ruby-style.yml b/.ruby-style.yml index 31f8ed39e2..b40c31a3a1 100644 --- a/.ruby-style.yml +++ b/.ruby-style.yml @@ -773,6 +773,9 @@ Lint/UselessElseWithoutRescue: Lint/UselessMethodDefinition: Enabled: false +Lint/UselessRescue: + Enabled: false + Lint/UselessRuby2Keywords: Enabled: false @@ -1441,6 +1444,9 @@ Style/ArgumentsForwarding: Style/ArrayCoercion: Enabled: false +Style/ArrayIntersect: + Enabled: false + Style/ArrayJoin: Enabled: true @@ -1521,6 +1527,9 @@ Style/CommentAnnotation: Style/CommentedKeyword: Enabled: false +Style/ConcatArrayLiterals: + Enabled: false + Style/ConditionalAssignment: Enabled: false @@ -1733,6 +1742,9 @@ Style/MapCompactWithConditionalBlock: Style/MapToHash: Enabled: false +Style/MapToSet: + Enabled: false + Style/MethodCallWithArgsParentheses: Enabled: false @@ -1748,6 +1760,9 @@ Style/MethodDefParentheses: Style/MinMax: Enabled: false +Style/MinMaxComparison: + Enabled: false + Style/MissingElse: Enabled: false @@ -1919,6 +1934,15 @@ Style/RedundantCondition: Style/RedundantConditional: Enabled: false +Style/RedundantConstantBase: + Enabled: false + +Style/RedundantDoubleSplatHashBraces: + Enabled: false + +Style/RedundantEach: + Enabled: false + Style/RedundantException: Enabled: true @@ -1973,6 +1997,9 @@ Style/RedundantStringEscape: Style/RegexpLiteral: Enabled: false +Style/RequireOrder: + Enabled: false + Style/RescueModifier: Enabled: true @@ -2142,5 +2169,8 @@ Style/WordArray: Style/YodaCondition: Enabled: false +Style/YodaExpression: + Enabled: false + Style/ZeroLengthPredicate: Enabled: true diff --git a/script/update-rubocop-config.rb b/script/update-rubocop-config.rb index 863412be40..593d2d3fb0 100755 --- a/script/update-rubocop-config.rb +++ b/script/update-rubocop-config.rb @@ -34,7 +34,13 @@ def default_config File.write(tmp_path, Net::HTTP.get(uri)) unless File.exist?(tmp_path) - m.deep_merge!(YAML.load_file(tmp_path)) + if RUBY_VERSION < "3.1" + yaml = YAML.load_file(tmp_path) + else + yaml = YAML.load_file(tmp_path, permitted_classes: [Regexp, Symbol]) + end + + m.deep_merge!(yaml) end end From e4e88907cbd441c13d1a764a00a6f4e35c96b382 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Fri, 20 Jan 2023 15:46:32 +0000 Subject: [PATCH 054/289] Remove old RawEmail spec This was testing the old implementation when we stored raw emails outside of `ActiveStorage`. See: 1ab296a370cf19f337e32897b9af881943a408ee Fixes: #7530 --- spec/models/raw_email_spec.rb | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/spec/models/raw_email_spec.rb b/spec/models/raw_email_spec.rb index 1bfad2c6ac..33a7fb8da0 100644 --- a/spec/models/raw_email_spec.rb +++ b/spec/models/raw_email_spec.rb @@ -19,17 +19,6 @@ def roundtrip_data(raw_email, data) raw_email.data end - describe 'before destroy callbacks' do - let(:raw_email) { FactoryBot.create(:incoming_message).raw_email } - - it 'should only delete the directory if it exists' do - expect(File).to receive(:delete).once.and_call_original - raw_email.run_callbacks(:destroy) - expect { raw_email.run_callbacks(:destroy) }. - not_to raise_error - end - end - describe '#valid_to_reply_to?' do def test_email(result, email, empty_return_path, autosubmitted = nil) stubs = { :from_email => email, From a568875d5d6c2a97354b66af7afcc8e4c2a14789 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Fri, 20 Jan 2023 15:48:19 +0000 Subject: [PATCH 055/289] Remove RawEmail before destroy callback Manually calling `#purge` isn't needed as this is automatically done by `ActiveStorage`. --- app/models/raw_email.rb | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app/models/raw_email.rb b/app/models/raw_email.rb index b181804024..c4f1ff3e2f 100644 --- a/app/models/raw_email.rb +++ b/app/models/raw_email.rb @@ -22,8 +22,6 @@ class RawEmail < ApplicationRecord has_one_attached :file, service: :raw_emails - before_destroy :destroy_file_representation! - delegate :date, to: :mail delegate :message_id, to: :mail delegate :multipart?, to: :mail @@ -129,8 +127,4 @@ def request_id def incoming_message_id incoming_message.id.to_s end - - def destroy_file_representation! - file.purge if file.attached? - end end From 599f4980f35504f2d1d3485966a7e7598d5e7089 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 04:03:24 +0000 Subject: [PATCH 056/289] Bump listen from 3.7.1 to 3.8.0 Bumps [listen](https://github.com/guard/listen) from 3.7.1 to 3.8.0. - [Release notes](https://github.com/guard/listen/releases) - [Commits](https://github.com/guard/listen/compare/v3.7.1...v3.8.0) --- updated-dependencies: - dependency-name: listen dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index bbd97ece3c..026a8a147e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -285,7 +285,7 @@ GEM libv8-node (16.10.0.0-arm64-darwin) libv8-node (16.10.0.0-x86_64-darwin) libv8-node (16.10.0.0-x86_64-linux) - listen (3.7.1) + listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) locale (2.1.3) @@ -396,7 +396,7 @@ GEM zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.0.6) - rb-fsevent (0.11.0) + rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) recaptcha (5.12.3) From bbafb08995bc271d43cf97119ebd0fe5b6c4869e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 04:08:03 +0000 Subject: [PATCH 057/289] Bump launchy from 2.4.3 to 2.5.2 Bumps [launchy](https://github.com/copiousfreetime/launchy) from 2.4.3 to 2.5.2. - [Release notes](https://github.com/copiousfreetime/launchy/releases) - [Changelog](https://github.com/copiousfreetime/launchy/blob/main/README.md) - [Commits](https://github.com/copiousfreetime/launchy/compare/v2.4.3...v2.5.2) --- updated-dependencies: - dependency-name: launchy dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index bbd97ece3c..fb2c4457c5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -278,8 +278,8 @@ GEM railties (>= 3.2.16) json (2.6.3) jwt (2.6.0) - launchy (2.4.3) - addressable (~> 2.3) + launchy (2.5.2) + addressable (~> 2.8) libv8-node (16.10.0.0) libv8-node (16.10.0.0-aarch64-linux) libv8-node (16.10.0.0-arm64-darwin) From bd6cbc3c59f0965a5b21de3138841e8df95a49eb Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Mon, 23 Jan 2023 09:27:52 +0000 Subject: [PATCH 058/289] Update mail extension for changes upstream See: https://github.com/mikel/mail/pull/1120 --- lib/mail_handler/backends/mail_extensions.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mail_handler/backends/mail_extensions.rb b/lib/mail_handler/backends/mail_extensions.rb index 452eaa895e..1e0a028ff3 100644 --- a/lib/mail_handler/backends/mail_extensions.rb +++ b/lib/mail_handler/backends/mail_extensions.rb @@ -1,6 +1,6 @@ require 'mail/message' require 'mail/part' -require 'mail/fields/common/parameter_hash' +require 'mail/fields/parameter_hash' module Mail class Message attr_accessor :url_part_number @@ -22,7 +22,7 @@ def encoded value = Mail::Encodings.param_encode(value) key_name = "#{key_name}*" end - %Q{#{key_name}=#{quote_token(value)}} + %Q{#{key_name}=#{Mail::Utilities.quote_token(value)}} end.join(";\r\n\s") end end From 5bbdd57633ce8e8d969483613f5937ae2e04f5d2 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 24 Jan 2023 12:17:21 +0000 Subject: [PATCH 059/289] Add support for Mail v2.8.x Update sendmail settings to fix argument error. See: https://github.com/mikel/mail/issues/1538 See: https://github.com/rails/rails/pull/46650 --- config/environments/production.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 8962c5835b..80ca3e4c5b 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -118,7 +118,8 @@ config.action_mailer.delivery_method = AlaveteliConfiguration.production_mailer_delivery_method.to_sym - if AlaveteliConfiguration.production_mailer_delivery_method.to_sym == :smtp + case AlaveteliConfiguration.production_mailer_delivery_method.to_sym + when :smtp config.action_mailer.smtp_settings = { :address => AlaveteliConfiguration.smtp_mailer_address, :port => AlaveteliConfiguration.smtp_mailer_port, @@ -128,6 +129,11 @@ :authentication => AlaveteliConfiguration.smtp_mailer_authentication, :enable_starttls_auto => AlaveteliConfiguration.smtp_mailer_enable_starttls_auto } + when :sendmail + config.action_mailer.sendmail_settings = { + location: '/usr/sbin/sendmail', + arguments: %w[-i] + } end exception_notifier_prefix = '[ERROR] ' From 1739fddd79ca6279eb6f0e63e7d55a789e6ad038 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Fri, 27 Jan 2023 15:11:26 +0000 Subject: [PATCH 060/289] Fix deprecation warning when running spec suite Remove old `should` syntax and replace with the newer `expect` syntax. Added in #7301 --- spec/controllers/public_body_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/controllers/public_body_controller_spec.rb b/spec/controllers/public_body_controller_spec.rb index 8dfcf0a1ce..f8283f4d5d 100644 --- a/spec/controllers/public_body_controller_spec.rb +++ b/spec/controllers/public_body_controller_spec.rb @@ -416,7 +416,7 @@ def make_single_language_example(locale) it 'sends CSV file as response' do get :list_all_csv - response.body.should eq IO.binread(fixture) + expect(response.body).to eq IO.binread(fixture) end end From 6ecaefdef1fad27c17dd5fb39bf447fe2496063c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 04:05:19 +0000 Subject: [PATCH 061/289] Bump rails from 7.0.4.1 to 7.0.4.2 Bumps [rails](https://github.com/rails/rails) from 7.0.4.1 to 7.0.4.2. - [Release notes](https://github.com/rails/rails/releases) - [Commits](https://github.com/rails/rails/compare/v7.0.4.1...v7.0.4.2) --- updated-dependencies: - dependency-name: rails dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 114 +++++++++++++++++++++++++-------------------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 58d43bb601..7d59d1a306 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -45,47 +45,47 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (7.0.4.1) - actionpack (= 7.0.4.1) - activesupport (= 7.0.4.1) + actioncable (7.0.4.2) + actionpack (= 7.0.4.2) + activesupport (= 7.0.4.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4.1) - actionpack (= 7.0.4.1) - activejob (= 7.0.4.1) - activerecord (= 7.0.4.1) - activestorage (= 7.0.4.1) - activesupport (= 7.0.4.1) + actionmailbox (7.0.4.2) + actionpack (= 7.0.4.2) + activejob (= 7.0.4.2) + activerecord (= 7.0.4.2) + activestorage (= 7.0.4.2) + activesupport (= 7.0.4.2) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.4.1) - actionpack (= 7.0.4.1) - actionview (= 7.0.4.1) - activejob (= 7.0.4.1) - activesupport (= 7.0.4.1) + actionmailer (7.0.4.2) + actionpack (= 7.0.4.2) + actionview (= 7.0.4.2) + activejob (= 7.0.4.2) + activesupport (= 7.0.4.2) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.4.1) - actionview (= 7.0.4.1) - activesupport (= 7.0.4.1) + actionpack (7.0.4.2) + actionview (= 7.0.4.2) + activesupport (= 7.0.4.2) rack (~> 2.0, >= 2.2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4.1) - actionpack (= 7.0.4.1) - activerecord (= 7.0.4.1) - activestorage (= 7.0.4.1) - activesupport (= 7.0.4.1) + actiontext (7.0.4.2) + actionpack (= 7.0.4.2) + activerecord (= 7.0.4.2) + activestorage (= 7.0.4.2) + activesupport (= 7.0.4.2) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4.1) - activesupport (= 7.0.4.1) + actionview (7.0.4.2) + activesupport (= 7.0.4.2) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -93,22 +93,22 @@ GEM active_model_otp (2.3.1) activemodel rotp (~> 6.2.0) - activejob (7.0.4.1) - activesupport (= 7.0.4.1) + activejob (7.0.4.2) + activesupport (= 7.0.4.2) globalid (>= 0.3.6) - activemodel (7.0.4.1) - activesupport (= 7.0.4.1) - activerecord (7.0.4.1) - activemodel (= 7.0.4.1) - activesupport (= 7.0.4.1) - activestorage (7.0.4.1) - actionpack (= 7.0.4.1) - activejob (= 7.0.4.1) - activerecord (= 7.0.4.1) - activesupport (= 7.0.4.1) + activemodel (7.0.4.2) + activesupport (= 7.0.4.2) + activerecord (7.0.4.2) + activemodel (= 7.0.4.2) + activesupport (= 7.0.4.2) + activestorage (7.0.4.2) + actionpack (= 7.0.4.2) + activejob (= 7.0.4.2) + activerecord (= 7.0.4.2) + activesupport (= 7.0.4.2) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.4.1) + activesupport (7.0.4.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -170,7 +170,7 @@ GEM xpath (~> 3.2) charlock_holmes (0.7.7) coderay (1.1.3) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.0) crack (0.4.5) rexml crass (1.0.6) @@ -216,7 +216,7 @@ GEM text (>= 1.3.0) gettext_i18n_rails (1.10.0) fast_gettext (>= 0.9.0) - globalid (1.0.1) + globalid (1.1.0) activesupport (>= 5.0) globalize (6.2.1) activemodel (>= 4.2, < 7.1) @@ -364,20 +364,20 @@ GEM rack (>= 1.3) rack-utf8_sanitizer (1.8.0) rack (>= 1.0, < 4.0) - rails (7.0.4.1) - actioncable (= 7.0.4.1) - actionmailbox (= 7.0.4.1) - actionmailer (= 7.0.4.1) - actionpack (= 7.0.4.1) - actiontext (= 7.0.4.1) - actionview (= 7.0.4.1) - activejob (= 7.0.4.1) - activemodel (= 7.0.4.1) - activerecord (= 7.0.4.1) - activestorage (= 7.0.4.1) - activesupport (= 7.0.4.1) + rails (7.0.4.2) + actioncable (= 7.0.4.2) + actionmailbox (= 7.0.4.2) + actionmailer (= 7.0.4.2) + actionpack (= 7.0.4.2) + actiontext (= 7.0.4.2) + actionview (= 7.0.4.2) + activejob (= 7.0.4.2) + activemodel (= 7.0.4.2) + activerecord (= 7.0.4.2) + activestorage (= 7.0.4.2) + activesupport (= 7.0.4.2) bundler (>= 1.15.0) - railties (= 7.0.4.1) + railties (= 7.0.4.2) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -385,14 +385,14 @@ GEM rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.4.4) + rails-html-sanitizer (1.5.0) loofah (~> 2.19, >= 2.19.1) rails-i18n (7.0.5) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.0.4.1) - actionpack (= 7.0.4.1) - activesupport (= 7.0.4.1) + railties (7.0.4.2) + actionpack (= 7.0.4.2) + activesupport (= 7.0.4.2) method_source rake (>= 12.2) thor (~> 1.0) @@ -502,7 +502,7 @@ GEM tilt (2.0.10) timeout (0.3.1) trailblazer-option (0.1.2) - tzinfo (2.0.5) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) uber (0.1.0) uglifier (4.2.0) From a0e4c03d7e714628d45861436902e58337723008 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 04:08:56 +0000 Subject: [PATCH 062/289] Bump aws-sdk-s3 from 1.118.0 to 1.119.0 Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.118.0 to 1.119.0. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-s3/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) --- updated-dependencies: - dependency-name: aws-sdk-s3 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 58d43bb601..7b61249d8a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -120,8 +120,8 @@ GEM rake (>= 10.4, < 14.0) ast (2.4.2) aws-eventstream (1.2.0) - aws-partitions (1.696.0) - aws-sdk-core (3.169.0) + aws-partitions (1.701.0) + aws-sdk-core (3.170.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.5) @@ -129,7 +129,7 @@ GEM aws-sdk-kms (1.62.0) aws-sdk-core (~> 3, >= 3.165.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.118.0) + aws-sdk-s3 (1.119.0) aws-sdk-core (~> 3, >= 3.165.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) From 508e0e13b025ccf4bb9def2dc874d3b5cb9c552c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 04:02:45 +0000 Subject: [PATCH 063/289] Bump rubocop from 1.43.0 to 1.44.1 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.43.0 to 1.44.1. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.43.0...v1.44.1) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .ruby-style.yml | 9 +++++++++ Gemfile | 2 +- Gemfile.lock | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.ruby-style.yml b/.ruby-style.yml index b40c31a3a1..7b17e64b65 100644 --- a/.ruby-style.yml +++ b/.ruby-style.yml @@ -56,6 +56,9 @@ Gemspec/DependencyVersion: Gemspec/DeprecatedAttributeAssignment: Enabled: false +Gemspec/DevelopmentDependencies: + Enabled: false + Gemspec/DuplicatedAssignment: Enabled: false @@ -1527,6 +1530,9 @@ Style/CommentAnnotation: Style/CommentedKeyword: Enabled: false +Style/ComparableClamp: + Enabled: false + Style/ConcatArrayLiterals: Enabled: false @@ -1717,6 +1723,9 @@ Style/InlineComment: Style/InverseMethods: Enabled: false +Style/InvertibleUnlessCondition: + Enabled: false + Style/IpAddresses: Enabled: false diff --git a/Gemfile b/Gemfile index f72e9df05e..cc36002b61 100644 --- a/Gemfile +++ b/Gemfile @@ -188,7 +188,7 @@ group :development do gem 'launchy', '< 2.6.0' gem 'listen', '>= 3.0.5', '< 3.8.1' gem 'web-console', '>= 3.3.0' - gem 'rubocop', '~> 1.43.0', require: false + gem 'rubocop', '~> 1.44.1', require: false gem 'rubocop-performance', require: false gem 'rubocop-rails', require: false end diff --git a/Gemfile.lock b/Gemfile.lock index 58d43bb601..6aecebf500 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -439,7 +439,7 @@ GEM rspec-mocks (~> 3.11) rspec-support (~> 3.11) rspec-support (3.11.1) - rubocop (1.43.0) + rubocop (1.44.1) json (~> 2.3) parallel (~> 1.10) parser (>= 3.2.0.0) @@ -603,7 +603,7 @@ DEPENDENCIES routing-filter (~> 0.7.0) rspec-activemodel-mocks (~> 1.1.0) rspec-rails (~> 6.0.0) - rubocop (~> 1.43.0) + rubocop (~> 1.44.1) rubocop-performance rubocop-rails ruby-msg (~> 1.5.0)! From 913ef20f004ec58974c0b2d173b77f630b8fd5ce Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Fri, 2 Sep 2022 12:28:50 +0100 Subject: [PATCH 064/289] Remove PublicBody#notes This has been replace by a separate Note model. Searching of public bodies by their note content on `/body/list/all` is not possible due to the complex nature of the SQL query. A spec has been disabled due it now failing without the old notes column. This has been broken on WDTK for months without being noticed. Fixes #7254 --- app/models/public_body.rb | 24 ++----- db/migrate/096_create_translation_tables.rb | 6 ++ ...20220902112339_remove_public_body_notes.rb | 13 ++++ lib/tasks/temp.rake | 19 ------ spec/controllers/general_controller_spec.rb | 16 ++--- .../public_body_controller_spec.rb | 2 +- spec/factories/public_bodies.rb | 13 +++- spec/fixtures/note_translations.yml | 63 ++++++++++++++++++ spec/fixtures/notes.yml | 48 ++++++++++++++ spec/fixtures/public_bodies.yml | 3 +- spec/fixtures/public_body_translations.yml | 9 --- spec/lib/public_body_csv_spec.rb | 12 ++-- spec/models/public_body_spec.rb | 66 +++++-------------- spec/spec_helper.rb | 4 +- .../_search_result.html.erb_spec.rb | 33 ++++++---- 15 files changed, 202 insertions(+), 129 deletions(-) create mode 100644 db/migrate/20220902112339_remove_public_body_notes.rb create mode 100644 spec/fixtures/note_translations.yml create mode 100644 spec/fixtures/notes.yml diff --git a/app/models/public_body.rb b/app/models/public_body.rb index a8bd7c005d..2801fe6c1c 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 20220210114052 +# Schema version: 20220928093559 # # Table name: public_bodies # @@ -22,7 +22,6 @@ # short_name :text # request_email :text # url_name :text -# notes :text # first_letter :string # publication_scheme :text # disclosure_log :text @@ -136,7 +135,8 @@ def self.admin_title strip_attributes allow_empty: false, except: %i[request_email] strip_attributes allow_empty: true, only: %i[request_email] - translates :name, :short_name, :request_email, :url_name, :notes, :first_letter, :publication_scheme + translates :name, :short_name, :request_email, :url_name, :first_letter, + :publication_scheme # Cannot be grouped at top as it depends on the `translates` macro include Translatable @@ -439,7 +439,6 @@ def self.internal_admin_body :short_name => "", :request_email => AlaveteliConfiguration.contact_email, :home_page => nil, - :notes => nil, :publication_scheme => nil, :last_edit_editor => "internal_admin", :last_edit_comment => @@ -669,25 +668,13 @@ def self.extract_domain_from_email(email) end def notes - [legacy_note].compact + all_notes + all_notes end def notes_as_string notes.map(&:body).join(' ') end - def legacy_note - return unless read_attribute(:notes).present? - - Note.new(notable: self) do |note| - AlaveteliLocalization.available_locales.each do |locale| - AlaveteliLocalization.with_locale(locale) do - note.body = read_attribute(:notes) - end - end - end - end - def has_notes? notes.present? end @@ -966,8 +953,7 @@ def name_for_search def self.get_public_body_list_translated_condition(table, has_first_letter=false, locale=nil) result = "(upper(#{table}.name) LIKE upper(:query)" \ - " OR upper(#{table}.notes) LIKE upper(:query)" \ - " OR upper(#{table}.short_name) LIKE upper(:query))" + " OR upper(#{table}.short_name) LIKE upper(:query))" if has_first_letter result += " AND #{table}.first_letter = :first_letter" end diff --git a/db/migrate/096_create_translation_tables.rb b/db/migrate/096_create_translation_tables.rb index a9402c51c1..a07e1cbf1d 100644 --- a/db/migrate/096_create_translation_tables.rb +++ b/db/migrate/096_create_translation_tables.rb @@ -1,4 +1,10 @@ class CreateTranslationTables < ActiveRecord::Migration[4.2] # 2.3 + class ::PublicBody + # This has been removed from the model but is needed for this old migration + # to work + translates :notes + end + def self.up fields = { :name => :text, :short_name => :text, diff --git a/db/migrate/20220902112339_remove_public_body_notes.rb b/db/migrate/20220902112339_remove_public_body_notes.rb new file mode 100644 index 0000000000..90491f35c0 --- /dev/null +++ b/db/migrate/20220902112339_remove_public_body_notes.rb @@ -0,0 +1,13 @@ +class RemovePublicBodyNotes < ActiveRecord::Migration[6.1] + def change + reversible do |dir| + dir.up do + remove_column :public_body_translations, :notes + end + + dir.down do + PublicBody.add_translation_fields! notes: :text + end + end + end +end diff --git a/lib/tasks/temp.rake b/lib/tasks/temp.rake index c5989df626..b10f67891c 100644 --- a/lib/tasks/temp.rake +++ b/lib/tasks/temp.rake @@ -79,25 +79,6 @@ namespace :temp do puts "Populated InfoRequestEvent#params completed." end - desc 'Migrate PublicBody notes into Note model' - task migrate_public_body_notes: :environment do - scope = PublicBody.where.not(notes: nil) - count = scope.count - - scope.with_translations.find_each.with_index do |body, index| - PublicBody.transaction do - body.legacy_note&.save - body.translations.update(notes: nil) - end - - erase_line - print "Migrated PublicBody#notes #{index + 1}/#{count}" - end - - erase_line - puts "Migrated PublicBody#notes completed." - end - desc 'Populate incoming message from email' task populate_incoming_message_from_email: :environment do scope = IncomingMessage.where(from_email: nil) diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb index 5f6246ac4a..b057c6e1de 100644 --- a/spec/controllers/general_controller_spec.rb +++ b/spec/controllers/general_controller_spec.rb @@ -303,15 +303,13 @@ end it 'should prioritise direct matches of public body names' do - FactoryBot. - create(:public_body, - name: 'Cardiff Business Technology Centre Limited', - notes: 'Something something cardiff council something else.') - - FactoryBot. - create(:public_body, - name: 'Cardiff and Vale of Glamorgan Community Health Council', - notes: 'Another notes mentioning Cardiff Council.') + FactoryBot.create(:public_body, :with_note, + name: 'Cardiff Business Technology Centre Limited', + note_body: 'Something cardiff council something else.') + + FactoryBot.create(:public_body, :with_note, + name: 'Cardiff and Vale of Glamorgan Health Council', + note_body: 'Another notes mentioning Cardiff Council.') FactoryBot.create(:public_body, name: 'Cardiff Council') diff --git a/spec/controllers/public_body_controller_spec.rb b/spec/controllers/public_body_controller_spec.rb index 8dfcf0a1ce..32d62c45e9 100644 --- a/spec/controllers/public_body_controller_spec.rb +++ b/spec/controllers/public_body_controller_spec.rb @@ -276,7 +276,7 @@ def make_single_language_example(locale) expect(assigns[:public_bodies]).to eq([ public_bodies(:humpadink_public_body) ]) end - it "should support simple searching of bodies by notes" do + xit "should support simple searching of bodies by notes" do get :list, params: { :public_body_query => 'Albatross' } expect(assigns[:public_bodies]).to eq([ public_bodies(:humpadink_public_body) ]) end diff --git a/spec/factories/public_bodies.rb b/spec/factories/public_bodies.rb index 53940d4c94..0f7dd29acb 100644 --- a/spec/factories/public_bodies.rb +++ b/spec/factories/public_bodies.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 20220210114052 +# Schema version: 20220928093559 # # Table name: public_bodies # @@ -22,7 +22,6 @@ # short_name :text # request_email :text # url_name :text -# notes :text # first_letter :string # publication_scheme :text # disclosure_log :text @@ -49,6 +48,16 @@ tag_string { 'eir_only' } end + trait :with_note do + transient do + note_body { 'This is my note' } + end + + concrete_notes do + [association(:note, body: note_body)] + end + end + factory :blank_email_public_body do request_email { '' } end diff --git a/spec/fixtures/note_translations.yml b/spec/fixtures/note_translations.yml new file mode 100644 index 0000000000..c55e7ff598 --- /dev/null +++ b/spec/fixtures/note_translations.yml @@ -0,0 +1,63 @@ +geraldine_es_note_translation: + id: 1 + note_id: 2 + locale: es + body: + created_at: 2007-10-24 10:51:01.161639 + updated_at: 2007-10-24 10:51:01.161639 + +geraldine_en_note_translation: + id: 2 + note_id: 2 + locale: en + body: + created_at: 2007-10-24 10:51:01.161639 + updated_at: 2007-10-24 10:51:01.161639 + +humpadink_es_note_translation: + id: 3 + note_id: 3 + locale: es + body: Baguette + created_at: 2007-10-24 10:51:01.161639 + updated_at: 2007-10-24 10:51:01.161639 + +humpadink_en_note_translation: + id: 4 + note_id: 3 + locale: en + body: An albatross told me!!! + created_at: 2007-10-24 10:51:01.161639 + updated_at: 2007-10-24 10:51:01.161639 + +silly_walks_en_note_translation: + id: 6 + note_id: 5 + locale: en + body: You know the one. + created_at: 2007-10-24 10:51:01.161639 + updated_at: 2007-10-24 10:51:01.161639 + +sensible_walks_en_note_translation: + id: 7 + note_id: 6 + locale: en + body: I bet you’ve never heard of it. + created_at: 2008-10-25 10:51:01.161639 + updated_at: 2008-10-25 10:51:01.161639 + +other_note_translation: + id: 8 + note_id: 7 + locale: en + body: More notes + created_at: 2008-10-25 10:51:01.161639 + updated_at: 2008-10-25 10:51:01.161639 + +humpadink_he_IL_note_translation: + id: 9 + note_id: 3 + locale: he_IL + body: An albatross told me!!! + created_at: 2007-10-24 10:51:01.161639 + updated_at: 2007-10-24 10:51:01.161639 diff --git a/spec/fixtures/notes.yml b/spec/fixtures/notes.yml new file mode 100644 index 0000000000..2765719141 --- /dev/null +++ b/spec/fixtures/notes.yml @@ -0,0 +1,48 @@ +# == Schema Information +# Schema version: 20220928093559 +# +# Table name: notes +# +# id :bigint not null, primary key +# notable_type :string +# notable_id :bigint +# notable_tag :string +# created_at :datetime not null +# updated_at :datetime not null +# body :text +# + +geraldine_note: + id: 2 + notable_type: PublicBody + notable_id: 2 + created_at: 2007-10-24 10:51:01.161639 + updated_at: 2007-10-24 10:51:01.161639 + +humpadink_note: + id: 3 + notable_type: PublicBody + notable_id: 3 + created_at: 2007-10-24 10:51:01.161639 + updated_at: 2007-10-24 10:51:01.161639 + +silly_walks_note: + id: 5 + notable_type: PublicBody + notable_id: 5 + created_at: 2007-10-24 10:51:01.161639 + updated_at: 2007-10-24 10:51:01.161639 + +sensible_walks_note: + id: 6 + notable_type: PublicBody + notable_id: 6 + created_at: 2008-10-25 10:51:01.161639 + updated_at: 2008-10-25 10:51:01.161639 + +other_note: + id: 7 + notable_type: PublicBody + notable_id: 7 + created_at: 2008-10-25 10:51:01.161639 + updated_at: 2008-10-25 10:51:01.161639 diff --git a/spec/fixtures/public_bodies.yml b/spec/fixtures/public_bodies.yml index bd7644915e..25a2752d05 100644 --- a/spec/fixtures/public_bodies.yml +++ b/spec/fixtures/public_bodies.yml @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 20220210114052 +# Schema version: 20220928093559 # # Table name: public_bodies # @@ -22,7 +22,6 @@ # short_name :text # request_email :text # url_name :text -# notes :text # first_letter :string # publication_scheme :text # disclosure_log :text diff --git a/spec/fixtures/public_body_translations.yml b/spec/fixtures/public_body_translations.yml index 8d645912ad..3b13fcaf72 100644 --- a/spec/fixtures/public_body_translations.yml +++ b/spec/fixtures/public_body_translations.yml @@ -7,7 +7,6 @@ geraldine_es_public_body_translation: short_name: eTGQ url_name: etgq locale: es - notes: "" publication_scheme: "" disclosure_log: "" created_at: 2007-10-24 10:51:01.161639 @@ -22,7 +21,6 @@ geraldine_en_public_body_translation: short_name: TGQ url_name: tgq locale: en - notes: "" publication_scheme: "" disclosure_log: "" created_at: 2007-10-24 10:51:01.161639 @@ -37,7 +35,6 @@ humpadink_es_public_body_translation: short_name: eDfH url_name: edfh locale: es - notes: Baguette publication_scheme: "" disclosure_log: "" created_at: 2007-10-24 10:51:01.161639 @@ -52,7 +49,6 @@ humpadink_en_public_body_translation: short_name: DfH url_name: dfh locale: en - notes: An albatross told me!!! publication_scheme: "" disclosure_log: "" created_at: 2007-10-24 10:51:01.161639 @@ -67,7 +63,6 @@ forlorn_en_public_body_translation: short_name: DoL url_name: lonely locale: en - notes: A very lonely public body that no one has corresponded with publication_scheme: "" disclosure_log: "" created_at: 2007-10-24 10:51:01.161639 @@ -82,7 +77,6 @@ silly_walks_en_public_body_translation: request_email: silly-walks-requests@localhost short_name: MSW url_name: msw - notes: You know the one. publication_scheme: "" disclosure_log: "" created_at: 2007-10-24 10:51:01.161639 @@ -97,7 +91,6 @@ sensible_walks_en_public_body_translation: request_email: sensible-walks-requests@localhost short_name: SenseWalk url_name: sensible_walks - notes: I bet you’ve never heard of it. publication_scheme: "" disclosure_log: "" created_at: 2008-10-25 10:51:01.161639 @@ -112,7 +105,6 @@ other_public_body_translation: request_email: other@localhost short_name: Another Public Body url_name: another_public_body - notes: More notes publication_scheme: "" disclosure_log: "" created_at: 2008-10-25 10:51:01.161639 @@ -127,7 +119,6 @@ humpadink_he_IL_public_body_translation: short_name: DfH url_name: dfh locale: he_IL - notes: An albatross told me!!! publication_scheme: "" disclosure_log: "" created_at: 2007-10-24 10:51:01.161639 diff --git a/spec/lib/public_body_csv_spec.rb b/spec/lib/public_body_csv_spec.rb index d070762d4f..21ab0c57a9 100644 --- a/spec/lib/public_body_csv_spec.rb +++ b/spec/lib/public_body_csv_spec.rb @@ -117,10 +117,10 @@ :short_name => 'CSV', :request_email => 'csv@localhost', :tag_string => 'exported', - :notes => 'An exported authority', + :note_body => 'An exported authority', :created_at => '2007-10-25 10:51:01 UTC', :updated_at => '2007-10-25 10:51:01 UTC' } - body = FactoryBot.create(:public_body, attrs) + body = FactoryBot.create(:public_body, :with_note, attrs) csv = PublicBodyCSV.new csv << body @@ -138,19 +138,19 @@ :short_name => 'CSV1', :request_email => 'csv1@localhost', :tag_string => 'exported', - :notes => 'An exported authority', + :note_body => 'An exported authority', :created_at => '2007-10-25 10:51:01 UTC', :updated_at => '2007-10-25 10:51:01 UTC' } - body1 = FactoryBot.create(:public_body, attrs1) + body1 = FactoryBot.create(:public_body, :with_note, attrs1) attrs2 = { :name => 'Exported to CSV 2', :short_name => 'CSV2', :request_email => 'csv2@localhost', :tag_string => 'exported', - :notes => 'Exported authority', + :note_body => 'Exported authority', :created_at => '2011-01-26 14:11:02 UTC', :updated_at => '2011-01-26 14:11:02 UTC' } - body2 = FactoryBot.create(:public_body, attrs2) + body2 = FactoryBot.create(:public_body, :with_note, attrs2) expected = <<-CSV.strip_heredoc Name,Short name,URL name,Home page,Publication scheme,Disclosure log,Notes,Created at,Updated at,Version diff --git a/spec/models/public_body_spec.rb b/spec/models/public_body_spec.rb index e27207fc76..d6eb744368 100644 --- a/spec/models/public_body_spec.rb +++ b/spec/models/public_body_spec.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 20220210114052 +# Schema version: 20220928093559 # # Table name: public_bodies # @@ -22,7 +22,6 @@ # short_name :text # request_email :text # url_name :text -# notes :text # first_letter :string # publication_scheme :text # disclosure_log :text @@ -545,7 +544,7 @@ subject(:notes) { public_body.notes } let(:public_body) do - FactoryBot.build(:public_body, notes: 'foo', tag_string: 'important') + FactoryBot.build(:public_body, tag_string: 'important') end let!(:concrete_note) do @@ -558,13 +557,12 @@ it 'returns an array' do is_expected.to be_an Array - expect(notes.count).to eq 3 + expect(notes.count).to eq 2 end it 'combined notable notes with legacy note' do - expect(notes[0].body).to eq 'foo' - expect(notes[1]).to eq concrete_note - expect(notes[2]).to eq tagged_note + expect(notes[0]).to eq concrete_note + expect(notes[1]).to eq tagged_note end end @@ -572,7 +570,7 @@ subject(:notes) { public_body.notes_as_string } let(:public_body) do - FactoryBot.build(:public_body, notes: 'foo', tag_string: 'important') + FactoryBot.build(:public_body, tag_string: 'important') end let!(:concrete_note) do @@ -585,56 +583,28 @@ end it 'concaterates note bodies' do - is_expected.to eq('foo bar baz') - end - end - - describe '#legacy_note' do - subject(:legacy_note) { public_body.legacy_note } - - context 'without legacy translated attributes' do - let(:public_body) { FactoryBot.build(:public_body) } - it { is_expected.to be_nil } - end - - context 'with legacy translated attributes' do - let(:public_body) do - FactoryBot.build( - :public_body, - notes: 'foo', - translations_attributes: { es: { locale: 'es', notes: 'bar' } } - ) - end - - it 'builds new note instance' do - is_expected.to be_a Note - expect(legacy_note.body).to eq 'foo' - AlaveteliLocalization.with_locale('es') do - expect(legacy_note.body).to eq 'bar' - end - end - - it 'assigns body as notable' do - expect(legacy_note.notable).to eq public_body - end + is_expected.to eq('bar baz') end end describe '#has_notes?' do + subject { public_body.has_notes? } + let(:public_body) { PublicBody.new } + it 'returns false if notes is nil' do - subject = PublicBody.new(:notes => nil) - expect(subject.has_notes?).to eq(false) + allow(public_body).to receive(:notes).and_return(nil) + is_expected.to eq(false) end - it 'returns false if notes is blank' do - subject = PublicBody.new(:notes => '') - expect(subject.has_notes?).to eq(false) + it 'returns false if notes is empty' do + allow(public_body).to receive(:notes).and_return([]) + is_expected.to eq(false) end it 'returns true if notes are present' do - subject = PublicBody.new(:notes => 'x') - expect(subject.has_notes?).to eq(true) + allow(public_body).to receive(:notes).and_return([double(:note)]) + is_expected.to eq(true) end end @@ -1234,7 +1204,7 @@ def set_default_attributes(public_body) ActsAsXapian::ActsAsXapianJob.destroy_all - body.update!(notes: 'test') + body.update!(request_email: 'other@localhost') expected_events = ActsAsXapian::ActsAsXapianJob. diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 2e0a2d9bb4..0b426f0d8d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -63,7 +63,9 @@ :public_body_category_translations, :public_body_headings, :public_body_heading_translations, - :public_body_category_links + :public_body_category_links, + :notes, + :note_translations # If you're not using ActiveRecord, or you'd prefer not to run each of your # examples within a transaction, remove the following line or assign false diff --git a/spec/views/alaveteli_pro/public_bodies/_search_result.html.erb_spec.rb b/spec/views/alaveteli_pro/public_bodies/_search_result.html.erb_spec.rb index 8fa17817d0..b3f587455d 100644 --- a/spec/views/alaveteli_pro/public_bodies/_search_result.html.erb_spec.rb +++ b/spec/views/alaveteli_pro/public_bodies/_search_result.html.erb_spec.rb @@ -1,9 +1,12 @@ require 'spec_helper' RSpec.describe 'alaveteli_pro/public_bodies/_search_result' do + let(:note) { 'Some notes about the body' } + let(:public_body) do - FactoryBot.create(:public_body, notes: "Some notes about the body", - info_requests_visible_count: 1) + FactoryBot.create(:public_body, :with_note, + note_body: note, + info_requests_visible_count: 1) end let(:result) do @@ -28,17 +31,21 @@ def render_view expect(rendered).to have_text public_body.notes_as_string end - it "truncates the body notes to 150 chars" do - public_body.notes = "This are some extravagantly long notes about a " \ - "body which will need to be trimmed down somewhat " \ - "before they're suitable for inclusion in a small " \ - "amount of space." - render_view - expected_notes = "This are some extravagantly long notes about a body " \ - "which will need to be trimmed down somewhat before " \ - "they're suitable for inclusion in a small am..." - expect(rendered).not_to have_text public_body.notes_as_string - expect(rendered).to have_text expected_notes + context 'long note' do + let(:note) do + "This are some extravagantly long notes about a body which will need " \ + "to be trimmed down somewhat before they're suitable for inclusion in " \ + "a small amount of space." + end + + it "truncates the body notes to 150 chars" do + render_view + expected_notes = "This are some extravagantly long notes about a body " \ + "which will need to be trimmed down somewhat before " \ + "they're suitable for inclusion in a small am..." + expect(rendered).not_to have_text public_body.notes_as_string + expect(rendered).to have_text expected_notes + end end it "includes the number of requests made" do From afbc628505253ffce4bb72975ab0386102d10cf3 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Fri, 27 Jan 2023 13:37:23 +0000 Subject: [PATCH 065/289] Drop InfoRequestEvent#params_yaml This has been replaced by `InfoRequestEvent#params` so can now be removed. Fixes #7554 --- app/models/info_request_event.rb | 18 +- app/views/admin_comment/edit.html.erb | 2 +- ...9_remove_info_request_event_params_yaml.rb | 5 + lib/tasks/temp.rake | 80 ------- lib/yaml_compatibility.rb | 102 -------- script/load-sample-data | 2 +- spec/factories/info_request_events.rb | 3 +- .../fixtures/files/yaml_compatibility_5_0.yml | 223 ------------------ .../fixtures/files/yaml_compatibility_5_1.yml | 93 -------- .../yaml_compatibility_public_body_tag.yml | 8 - .../files/yaml_compatibility_tmail.yml | 62 ----- spec/fixtures/info_request_events.yml | 35 +-- spec/lib/yaml_compatability_spec.rb | 47 ---- spec/models/info_request_event_spec.rb | 25 +- 14 files changed, 12 insertions(+), 693 deletions(-) create mode 100644 db/migrate/20230127132719_remove_info_request_event_params_yaml.rb delete mode 100644 lib/yaml_compatibility.rb delete mode 100644 spec/fixtures/files/yaml_compatibility_5_0.yml delete mode 100644 spec/fixtures/files/yaml_compatibility_5_1.yml delete mode 100644 spec/fixtures/files/yaml_compatibility_public_body_tag.yml delete mode 100644 spec/fixtures/files/yaml_compatibility_tmail.yml delete mode 100644 spec/lib/yaml_compatability_spec.rb diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index 9f383c087d..bbfa169034 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -1,12 +1,11 @@ # == Schema Information -# Schema version: 20220408125559 +# Schema version: 20230127132719 # # Table name: info_request_events # # id :integer not null, primary key # info_request_id :integer not null # event_type :text not null -# params_yaml :text not null # created_at :datetime not null # described_state :string # calculated_state :string @@ -23,8 +22,6 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: hello@mysociety.org; WWW: http://www.mysociety.org/ -require 'yaml_compatibility' - class InfoRequestEvent < ApplicationRecord extend XapianQueries @@ -319,7 +316,6 @@ def visible def params=(new_params) super(params_for_jsonb(new_params)) - self.params_yaml = params_for_yaml(new_params) # TODO: should really set these explicitly, and stop storing them in # here, but keep it for compatibility with old way for now @@ -347,13 +343,7 @@ def [](key) def params params_jsonb = super - return Params[params_jsonb.deep_symbolize_keys] if params_jsonb - - param_hash = YAMLCompatibility.load(params_yaml) || {} - param_hash.each do |key, value| - param_hash[key] = value.force_encoding('UTF-8') if value.respond_to?(:force_encoding) - end - param_hash + Params[params_jsonb.deep_symbolize_keys] if params_jsonb end def params_diff @@ -605,8 +595,4 @@ def params_for_jsonb(params) memo end end - - def params_for_yaml(params) - params.to_yaml - end end diff --git a/app/views/admin_comment/edit.html.erb b/app/views/admin_comment/edit.html.erb index 34a7d51637..24d51d3db7 100644 --- a/app/views/admin_comment/edit.html.erb +++ b/app/views/admin_comment/edit.html.erb @@ -74,7 +74,7 @@ <% info_request_event.for_admin_column( - :event_type, :params_yaml, :created_at + :event_type, :params, :created_at ) do |name, value| %>
+ + <% end %> +
diff --git a/db/migrate/20230127132719_remove_info_request_event_params_yaml.rb b/db/migrate/20230127132719_remove_info_request_event_params_yaml.rb new file mode 100644 index 0000000000..8793b2115f --- /dev/null +++ b/db/migrate/20230127132719_remove_info_request_event_params_yaml.rb @@ -0,0 +1,5 @@ +class RemoveInfoRequestEventParamsYaml < ActiveRecord::Migration[7.0] + def change + remove_column :info_request_events, :params_yaml, :text + end +end diff --git a/lib/tasks/temp.rake b/lib/tasks/temp.rake index c5989df626..06790d7616 100644 --- a/lib/tasks/temp.rake +++ b/lib/tasks/temp.rake @@ -1,84 +1,4 @@ namespace :temp do - desc 'Convert old Syck YAML to Psych YAML' - task convert_syck_to_psych_yaml: :environment do - require 'syck' - - # requiring Syck redefines the YAML constant, we need to reset this back to - # Psych otherwise we can't load the InfoRequestEvent instances. - Object.send(:remove_const, :YAML) - YAML = Psych - - scope = InfoRequestEvent.where(params: nil) - count = scope.count - - scope.find_each.with_index do |event, index| - begin - Psych.parse(event.params_yaml) - rescue Psych::SyntaxError - yaml = Syck.load(event.params_yaml) - - event.no_xapian_reindex = true - event.update(params_yaml: Psych.dump(yaml)) - end - - erase_line - print "Converted InfoRequestEvent#param_yaml #{index + 1}/#{count}" - end - - erase_line - puts "Converted InfoRequestEvent#params_yaml completed." - end - - desc "Fix old objects stored in YAML which can't be decoded" - task fix_old_objects_in_yaml: :environment do - scope = InfoRequestEvent.where(params: nil) - count = scope.count - - scope.find_each.with_index do |event, index| - yaml = Psych.dump( - event.params.inject({}) do |params, (key, value)| - begin - # each param value needs to be able to converted into YAML but this - # can blow up for old Ruby objects previously stored as newer Rails - # can't correctly decode values generated older versions - value.to_yaml if value.is_a?(ApplicationRecord) - rescue NoMethodError - # reload object from DB store YAML value doesn't need to be decoded - value = value.reload - end - params[key] = value - params - end - ) - - event.no_xapian_reindex = true - event.update(params_yaml: yaml) - - erase_line - print "Fixed InfoRequestEvent#param_yaml #{index + 1}/#{count}" - end - - erase_line - puts "Fixed InfoRequestEvent#params_yaml completed." - end - - desc 'Sanitise and populate events params json column from yaml' - task sanitise_and_populate_events_params_json: :environment do - scope = InfoRequestEvent.where(params: nil) - count = scope.count - - scope.find_each.with_index do |event, index| - event.no_xapian_reindex = true - event.update(params: event.params) - - erase_line - print "Populated InfoRequestEvent#param #{index + 1}/#{count}" - end - - erase_line - puts "Populated InfoRequestEvent#params completed." - end - desc 'Migrate PublicBody notes into Note model' task migrate_public_body_notes: :environment do scope = PublicBody.where.not(notes: nil) diff --git a/lib/yaml_compatibility.rb b/lib/yaml_compatibility.rb deleted file mode 100644 index 07096a3424..0000000000 --- a/lib/yaml_compatibility.rb +++ /dev/null @@ -1,102 +0,0 @@ -## -# Class to load YAML which includes legacy marshalled Ruby objects. -# -class YAMLCompatibility - def self.load(yaml, aliases: false, filename: nil, fallback: nil, - symbolize_names: false) - result = if Gem::Version.new(YAML::VERSION) >= Gem::Version.new('3.1.0') - YAML.parse(yaml, filename: filename) - else - YAML.parse(yaml, filename) - end - return fallback unless result - - result = visitor.accept(result) - symbolize_names!(result) if symbolize_names - result - end - - def self.visitor - class_loader = LegacyMapClassLoader.new - scanner = YAML::ScalarScanner.new(class_loader) - YAML::Visitors::ToRuby.new(scanner, class_loader) - end - - # :nodoc: - class LazyAttributeHash < ActiveModel::LazyAttributeHash - def key?(key) - delegate_hash.key?(key) || - (values && values.key?(key)) || - (types && types.key?(key)) - end - end - - # :nodoc: - class TimeZoneConverter - def init_with(_coder); end - end - - # :nodoc: - LegacyObject = Class.new - - # :nodoc: - class LegacyMapClassLoader < YAML::ClassLoader - private - - MAPPINGS = { - 'ActiveModel::LazyAttributeHash' => - 'YAMLCompatibility::LazyAttributeHash', - 'ActiveRecord::LazyAttributeHash' => - 'YAMLCompatibility::LazyAttributeHash', - - # Rails <5 - 'ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter' => - 'YAMLCompatibility::TimeZoneConverter', - 'ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Integer' => - 'ActiveModel::Type::Integer', - - # Rails 5.0 - 'ActiveModel::Type::Text' => - 'ActiveRecord::Type::Text', - - # Legacy classes - 'PublicBodyTag' => - 'YAMLCompatibility::LegacyObject', - - 'TMail::AddressHeader' => - 'YAMLCompatibility::LegacyObject', - 'TMail::Config' => - 'YAMLCompatibility::LegacyObject', - 'TMail::ContentDispositionHeader' => - 'YAMLCompatibility::LegacyObject', - 'TMail::ContentTransferEncodingHeader' => - 'YAMLCompatibility::LegacyObject', - 'TMail::ContentTypeHeader' => - 'YAMLCompatibility::LegacyObject', - 'TMail::DateTimeHeader' => - 'YAMLCompatibility::LegacyObject', - 'TMail::Mail' => - 'YAMLCompatibility::LegacyObject', - 'TMail::MessageIdHeader' => - 'YAMLCompatibility::LegacyObject', - 'TMail::MimeVersionHeader' => - 'YAMLCompatibility::LegacyObject', - 'TMail::ReceivedHeader' => - 'YAMLCompatibility::LegacyObject', - 'TMail::ReferencesHeader' => - 'YAMLCompatibility::LegacyObject', - 'TMail::ReturnPathHeader' => - 'YAMLCompatibility::LegacyObject', - 'TMail::SingleAddressHeader' => - 'YAMLCompatibility::LegacyObject', - 'TMail::StringPort' => - 'YAMLCompatibility::LegacyObject', - 'TMail::UnstructuredHeader' => - 'YAMLCompatibility::LegacyObject' - } - - def resolve(klassname) - super(MAPPINGS[klassname] || klassname) - end - end -end diff --git a/script/load-sample-data b/script/load-sample-data index 0301522731..1fb8a51ee2 100755 --- a/script/load-sample-data +++ b/script/load-sample-data @@ -42,7 +42,7 @@ fixture_files = ["public_bodies", # append everything else that isn't order critical Dir["#{fixtures_dir}/**/*.yml"].map{ |f| f[(fixtures_dir.size + 1)..-5] }.each do |fixture| - next if fixture =~ /yaml_compatibility|refusal_advice/ + next if fixture =~ /refusal_advice/ fixture_files << fixture unless fixture_files.include?(fixture) end diff --git a/spec/factories/info_request_events.rb b/spec/factories/info_request_events.rb index e2b91825e7..0f194d7e5e 100644 --- a/spec/factories/info_request_events.rb +++ b/spec/factories/info_request_events.rb @@ -1,12 +1,11 @@ # == Schema Information -# Schema version: 20220408125559 +# Schema version: 20230127132719 # # Table name: info_request_events # # id :integer not null, primary key # info_request_id :integer not null # event_type :text not null -# params_yaml :text not null # created_at :datetime not null # described_state :string # calculated_state :string diff --git a/spec/fixtures/files/yaml_compatibility_5_0.yml b/spec/fixtures/files/yaml_compatibility_5_0.yml deleted file mode 100644 index 939190a94d..0000000000 --- a/spec/fixtures/files/yaml_compatibility_5_0.yml +++ /dev/null @@ -1,223 +0,0 @@ ---- -:user: !ruby/object:User - raw_attributes: - name: Annie All Roles - ban_text: '' - closed_at: - email: annie@localhost - id: 8 - hashed_password: 6b7cd45a5f35fd83febc0452a799530398bfb6e8 - salt: "-6116981980.392287733335677" - created_at: '2007-10-31 10:39:15.491593' - updated_at: '2007-10-31 10:39:15.491593' - email_confirmed: true - url_name: annie_admin - last_daily_track_email: '2000-01-01 00:00:00' - about_me: All the roles - locale: en - email_bounced_at: - email_bounce_message: '' - no_limit: false - receive_email_alerts: true - can_make_batch_requests: false - otp_enabled: false - otp_secret_key: - otp_counter: 1 - confirmed_not_spam: false - comments_count: 0 - info_requests_count: 1 - track_things_count: 0 - request_classifications_count: 0 - public_body_change_requests_count: 0 - info_request_batches_count: 0 - daily_summary_hour: - daily_summary_minute: - attributes: !ruby/object:ActiveRecord::AttributeSet - attributes: !ruby/object:ActiveRecord::LazyAttributeHash - delegate_hash: - name: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: name - value_before_type_cast: Annie All Roles - type: &1 !ruby/object:ActiveModel::Type::String - precision: - scale: - limit: - original_attribute: - value: Annie All Roles - ban_text: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: ban_text - value_before_type_cast: '' - type: &3 !ruby/object:ActiveModel::Type::Text - precision: - scale: - limit: - original_attribute: - value: '' - closed_at: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: closed_at - value_before_type_cast: - type: !ruby/object:ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter - delegate_dc_obj: &2 !ruby/object:ActiveRecord::ConnectionAdapters::PostgreSQL::OID::DateTime - precision: - scale: - limit: - original_attribute: - value: - email: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: email - value_before_type_cast: annie@localhost - type: *1 - original_attribute: - value: annie@localhost - id: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: id - value_before_type_cast: 8 - type: &5 !ruby/object:ActiveModel::Type::Integer - precision: - scale: - limit: - range: !ruby/range - begin: -2147483648 - end: 2147483648 - excl: true - original_attribute: - value: 8 - hashed_password: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: hashed_password - value_before_type_cast: 6b7cd45a5f35fd83febc0452a799530398bfb6e8 - type: *1 - original_attribute: - salt: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: salt - value_before_type_cast: "-6116981980.392287733335677" - type: *1 - original_attribute: - created_at: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: created_at - value_before_type_cast: '2007-10-31 10:39:15.491593' - type: !ruby/object:ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter - delegate_dc_obj: *2 - original_attribute: - updated_at: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: updated_at - value_before_type_cast: '2007-10-31 10:39:15.491593' - type: !ruby/object:ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter - delegate_dc_obj: *2 - original_attribute: - email_confirmed: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: email_confirmed - value_before_type_cast: true - type: &4 !ruby/object:ActiveModel::Type::Boolean - precision: - scale: - limit: - original_attribute: - url_name: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: url_name - value_before_type_cast: annie_admin - type: *3 - original_attribute: - last_daily_track_email: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: last_daily_track_email - value_before_type_cast: '2000-01-01 00:00:00' - type: !ruby/object:ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter - delegate_dc_obj: *2 - original_attribute: - about_me: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: about_me - value_before_type_cast: All the roles - type: *3 - original_attribute: - locale: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: locale - value_before_type_cast: en - type: *1 - original_attribute: - email_bounced_at: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: email_bounced_at - value_before_type_cast: - type: !ruby/object:ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter - delegate_dc_obj: *2 - original_attribute: - email_bounce_message: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: email_bounce_message - value_before_type_cast: '' - type: *3 - original_attribute: - no_limit: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: no_limit - value_before_type_cast: false - type: *4 - original_attribute: - receive_email_alerts: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: receive_email_alerts - value_before_type_cast: true - type: *4 - original_attribute: - can_make_batch_requests: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: can_make_batch_requests - value_before_type_cast: false - type: *4 - original_attribute: - otp_enabled: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: otp_enabled - value_before_type_cast: false - type: *4 - original_attribute: - otp_secret_key: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: otp_secret_key - value_before_type_cast: - type: *1 - original_attribute: - otp_counter: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: otp_counter - value_before_type_cast: 1 - type: *5 - original_attribute: - confirmed_not_spam: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: confirmed_not_spam - value_before_type_cast: false - type: *4 - original_attribute: - comments_count: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: comments_count - value_before_type_cast: 0 - type: *5 - original_attribute: - info_requests_count: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: info_requests_count - value_before_type_cast: 1 - type: *5 - original_attribute: - track_things_count: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: track_things_count - value_before_type_cast: 0 - type: *5 - original_attribute: - request_classifications_count: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: request_classifications_count - value_before_type_cast: 0 - type: *5 - original_attribute: - public_body_change_requests_count: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: public_body_change_requests_count - value_before_type_cast: 0 - type: *5 - original_attribute: - info_request_batches_count: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: info_request_batches_count - value_before_type_cast: 0 - type: *5 - original_attribute: - daily_summary_hour: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: daily_summary_hour - value_before_type_cast: - type: *5 - original_attribute: - daily_summary_minute: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: daily_summary_minute - value_before_type_cast: - type: *5 - original_attribute: - new_record: false - active_record_yaml_version: 1 diff --git a/spec/fixtures/files/yaml_compatibility_5_1.yml b/spec/fixtures/files/yaml_compatibility_5_1.yml deleted file mode 100644 index b54cb5d2e1..0000000000 --- a/spec/fixtures/files/yaml_compatibility_5_1.yml +++ /dev/null @@ -1,93 +0,0 @@ ---- -:user: !ruby/object:User - concise_attributes: - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: name - value_before_type_cast: Annie All Roles - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: ban_text - value_before_type_cast: '' - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: closed_at - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: email - value_before_type_cast: annie@localhost - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: id - value_before_type_cast: 8 - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: hashed_password - value_before_type_cast: 6b7cd45a5f35fd83febc0452a799530398bfb6e8 - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: salt - value_before_type_cast: "-6116981980.392287733335677" - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: created_at - value_before_type_cast: '2007-10-31 10:39:15.491593' - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: updated_at - value_before_type_cast: '2007-10-31 10:39:15.491593' - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: email_confirmed - value_before_type_cast: true - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: url_name - value_before_type_cast: annie_admin - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: last_daily_track_email - value_before_type_cast: '2000-01-01 00:00:00' - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: about_me - value_before_type_cast: All the roles - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: locale - value_before_type_cast: en - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: email_bounced_at - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: email_bounce_message - value_before_type_cast: '' - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: no_limit - value_before_type_cast: false - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: receive_email_alerts - value_before_type_cast: true - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: can_make_batch_requests - value_before_type_cast: false - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: otp_enabled - value_before_type_cast: false - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: otp_secret_key - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: otp_counter - value_before_type_cast: 1 - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: confirmed_not_spam - value_before_type_cast: false - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: comments_count - value_before_type_cast: 0 - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: info_requests_count - value_before_type_cast: 1 - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: track_things_count - value_before_type_cast: 0 - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: request_classifications_count - value_before_type_cast: 0 - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: public_body_change_requests_count - value_before_type_cast: 0 - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: info_request_batches_count - value_before_type_cast: 0 - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: daily_summary_hour - - !ruby/object:ActiveRecord::Attribute::FromDatabase - name: daily_summary_minute - new_record: false - active_record_yaml_version: 2 diff --git a/spec/fixtures/files/yaml_compatibility_public_body_tag.yml b/spec/fixtures/files/yaml_compatibility_public_body_tag.yml deleted file mode 100644 index 29112db217..0000000000 --- a/spec/fixtures/files/yaml_compatibility_public_body_tag.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -public_body_tags: -- !ruby/object:PublicBodyTag - attributes: - name: police - public_body_id: "1" - id: "2" - attributes_cache: {} diff --git a/spec/fixtures/files/yaml_compatibility_tmail.yml b/spec/fixtures/files/yaml_compatibility_tmail.yml deleted file mode 100644 index a0e7078a19..0000000000 --- a/spec/fixtures/files/yaml_compatibility_tmail.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -email: !ruby/object:TMail::Mail - port: !ruby/object:TMail::StringPort - buffer: ! "From: \"FOI Person\" \nTo: \"Bob Smith\" \nDate: - Tue, 13 Nov 2007 11:39:55 +0000\nBcc: \nSubject: Geraldine FOI Code AZXB421\nReply-To: - \nIn-Reply-To: <471f1eae5d1cb_7347..fdbe67386163@cat.tmail>\n\nNo way! I'm not - going to tell you that in a month of Thursdays.\n\nThe Geraldine Quango\n\nOn - Wed, Oct 24, 2007 at 11:30:06AM +0100, Bob Smith wrote:\n> Why do you have such - a fancy dog?\n\n" - config: &70134848947220 !ruby/object:TMail::Config - strict_parse: false - strict_base64decode: false - header: - from: !ruby/object:TMail::AddressHeader - body: ! '"FOI Person" - - ' - config: *70134848947220 - illegal: false - parsed: false - to: !ruby/object:TMail::AddressHeader - body: ! '"Bob Smith" - - ' - config: *70134848947220 - illegal: false - parsed: false - date: !ruby/object:TMail::DateTimeHeader - body: ! 'Tue, 13 Nov 2007 11:39:55 +0000 - - ' - config: *70134848947220 - illegal: false - parsed: false - bcc: !ruby/object:TMail::AddressHeader - body: '' - config: *70134848947220 - illegal: false - parsed: false - subject: !ruby/object:TMail::UnstructuredHeader - body: ! 'Geraldine FOI Code AZXB421 - - ' - config: *70134848947220 - illegal: false - parsed: false - reply-to: !ruby/object:TMail::AddressHeader - body: '' - config: *70134848947220 - illegal: false - parsed: false - in-reply-to: !ruby/object:TMail::ReferencesHeader - body: ! '<471f1eae5d1cb_7347..fdbe67386163@cat.tmail> - - ' - config: *70134848947220 - illegal: false - parsed: false - body_port: - body_parsed: false - epilogue: '' - parts: [] diff --git a/spec/fixtures/info_request_events.yml b/spec/fixtures/info_request_events.yml index 177d4a97f7..8eb1cece3a 100644 --- a/spec/fixtures/info_request_events.yml +++ b/spec/fixtures/info_request_events.yml @@ -1,12 +1,11 @@ # == Schema Information -# Schema version: 20220408125559 +# Schema version: 20230127132719 # # Table name: info_request_events # # id :integer not null, primary key # info_request_id :integer not null # event_type :text not null -# params_yaml :text not null # created_at :datetime not null # described_state :string # calculated_state :string @@ -20,8 +19,6 @@ useless_outgoing_message_event: id: 900 - params_yaml: "--- \n\ - :outgoing_message_id: 1\n" params: outgoing_message_id: 1 info_request_id: 101 @@ -31,8 +28,6 @@ useless_outgoing_message_event: outgoing_message_id: 1 silly_outgoing_message_event: id: 901 - params_yaml: "--- \n\ - :outgoing_message_id: 2\n" params: outgoing_message_id: 2 info_request_id: 103 @@ -44,8 +39,6 @@ silly_outgoing_message_event: last_described_at: 2007-10-14 10:41:12.686264 useless_incoming_message_event: id: 902 - params_yaml: "--- \n\ - :incoming_message_id: 1\n" params: incoming_message_id: 1 info_request_id: 101 @@ -55,8 +48,6 @@ useless_incoming_message_event: incoming_message_id: 1 silly_comment_event: id: 903 - params_yaml: "--- \n\ - :comment_id: 1\n" params: comment_id: 1 incoming_message_id: @@ -70,8 +61,6 @@ silly_comment_event: created_at: 2008-08-12 23:05:12.500942 badger_outgoing_message_event: id: 904 - params_yaml: "--- \n\ - :outgoing_message_id: 3\n" params: outgoing_message_id: 3 info_request_id: 104 @@ -84,8 +73,6 @@ badger_outgoing_message_event: # These in chronological order boring_outgoing_message_event: id: 905 - params_yaml: "--- \n\ - :outgoing_message_id: 4\n" params: outgoing_message_id: 4 outgoing_message_id: 4 @@ -96,8 +83,6 @@ boring_outgoing_message_event: calculated_state: waiting_response useful_incoming_message_event: id: 906 - params_yaml: "--- \n\ - :incoming_message_id: 2\n" params: incoming_message_id: 2 incoming_message_id: 2 @@ -109,8 +94,6 @@ useful_incoming_message_event: another_boring_outgoing_message_event: id: 907 - params_yaml: "--- \n\ - :outgoing_message_id: 5\n" params: outgoing_message_id: 5 outgoing_message_id: 5 @@ -121,8 +104,6 @@ another_boring_outgoing_message_event: calculated_state: waiting_response another_useful_incoming_message_event: id: 908 - params_yaml: "--- \n\ - :incoming_message_id: 3\n" params: incoming_message_id: 3 incoming_message_id: 3 @@ -135,8 +116,6 @@ another_useful_incoming_message_event: # The spam requests were both successful spam_1_outgoing_message_event: id: 910 - params_yaml: "--- \n\ - :outgoing_message_id: 6\n" params: outgoing_message_id: 6 outgoing_message_id: 6 @@ -147,8 +126,6 @@ spam_1_outgoing_message_event: calculated_state: waiting_response spam_1_incoming_message_event: id: 911 - params_yaml: "--- \n\ - :incoming_message_id: 4\n" params: incoming_message_id: 4 incoming_message_id: 4 @@ -160,8 +137,6 @@ spam_1_incoming_message_event: spam_2_outgoing_message_event: id: 912 - params_yaml: "--- \n\ - :outgoing_message_id: 7\n" params: outgoing_message_id: 7 outgoing_message_id: 7 @@ -172,8 +147,6 @@ spam_2_outgoing_message_event: calculated_state: waiting_response spam_2_incoming_message_event: id: 913 - params_yaml: "--- \n\ - :incoming_message_id: 5\n" params: incoming_message_id: 5 incoming_message_id: 5 @@ -185,8 +158,6 @@ spam_2_incoming_message_event: external_outgoing_message_event: id: 914 - params_yaml: "--- \n\ - :outgoing_message_id: 8\n" params: outgoing_message_id: 8 outgoing_message_id: 8 @@ -198,8 +169,6 @@ external_outgoing_message_event: anonymous_external_outgoing_message_event: id: 915 - params_yaml: "--- \n\ - :outgoing_message_id: 9\n" params: outgoing_message_id: 9 outgoing_message_id: 9 @@ -211,8 +180,6 @@ anonymous_external_outgoing_message_event: other_request_outgoing_message_event: id: 916 - params_yaml: "--- \n\ - :outgoing_message_id: 10\n" params: outgoing_message_id: 10 outgoing_message_id: 10 diff --git a/spec/lib/yaml_compatability_spec.rb b/spec/lib/yaml_compatability_spec.rb deleted file mode 100644 index 482ea5aa01..0000000000 --- a/spec/lib/yaml_compatability_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -require 'spec_helper' -require Rails.root.join('lib/yaml_compatibility') - -RSpec.describe YAMLCompatibility do - describe '.load' do - subject(:output_hash) { described_class.load(content) } - let(:hash) { YAML.load(yaml_compatibility_fixture('5_1')) } - - context 'with Rails 5.0 YAML file' do - let(:content) { yaml_compatibility_fixture('5_0') } - - it 'correctly loads YAML file' do - is_expected.to eq hash if RUBY_VERSION < '3.1' - end - end - - context 'with Rails 5.1 YAML file' do - let(:content) { yaml_compatibility_fixture('5_1') } - - it 'correctly loads YAML file' do - is_expected.to eq hash if RUBY_VERSION < '3.1' - end - end - - context 'YAML file with old PublicBodyTag class' do - let(:content) { yaml_compatibility_fixture('public_body_tag') } - - it 'does not raise an error' do - expect { output_hash }.to_not raise_error - end - end - - context 'YAML file with old TMail classes' do - let(:content) { yaml_compatibility_fixture('tmail') } - - it 'does not raise an error' do - expect { output_hash }.to_not raise_error - end - end - end - - private - - def yaml_compatibility_fixture(file) - load_file_fixture("yaml_compatibility_#{file}.yml") - end -end diff --git a/spec/models/info_request_event_spec.rb b/spec/models/info_request_event_spec.rb index 7bc84b7f58..4894db65bb 100644 --- a/spec/models/info_request_event_spec.rb +++ b/spec/models/info_request_event_spec.rb @@ -1,12 +1,11 @@ # == Schema Information -# Schema version: 20220408125559 +# Schema version: 20230127132719 # # Table name: info_request_events # # id :integer not null, primary key # info_request_id :integer not null # event_type :text not null -# params_yaml :text not null # created_at :datetime not null # described_state :string # calculated_state :string @@ -41,16 +40,9 @@ it "should convert event parameters into YAML and back successfully" do example_params = { :foo => 'this is stuff', :bar => 83, :humbug => "yikes!!!" } ire.params = example_params - expect(ire.params_yaml).to eq(example_params.to_yaml) expect(ire.params).to eq(example_params) end - it "should restore UTF8-heavy params stored under ruby 1.8 as UTF-8" do - utf8_params = "--- \n:foo: !binary |\n 0KLQvtCz0LDRiCDR\n" - ire.params_yaml = utf8_params - expect(ire.params[:foo].encoding.to_s).to eq('UTF-8') - end - it "should store the incoming_message, outgoing_messsage and comment ids" do comment = FactoryBot.create(:comment) example_params = {:incoming_message_id => 1, @@ -90,12 +82,6 @@ ire.params = { foo_id: 4 } expect(ire.params).to include(foo_id: 4) end - - it "should allow params_yaml to be blank" do - ire.params_yaml = '' - - expect(ire.params).to eql({}) - end end describe 'when deciding if it is indexed by search' do @@ -324,15 +310,6 @@ end end - describe '#params' do - it 'should not error with Rails 5.0 params' do - ire = InfoRequestEvent.new( - params_yaml: load_file_fixture('yaml_compatibility_5_0.yml') - ) - expect { ire.params }.to_not raise_error - end - end - describe '#params_diff' do let(:ire) { InfoRequestEvent.new } From 404921de256f27e68e61fdd0140d81be946c6d16 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 1 Feb 2023 17:55:43 +0000 Subject: [PATCH 066/289] Extract old request magic variables Want to use these values in help pages so that configuration changes do not go out of sync with explanatory text. --- app/models/info_request.rb | 15 ++++++++++----- spec/models/info_request_spec.rb | 24 ++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/app/models/info_request.rb b/app/models/info_request.rb index d54b029f82..70881e2ee1 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -531,18 +531,23 @@ def self.reject_incoming_at_mta(options) end end + def self.requests_old_after_months + AlaveteliConfiguration.restrict_new_responses_on_old_requests_after_months + end + + def self.requests_very_old_after_months + requests_old_after_months * 4 + end + # This is called from cron regularly. def self.stop_new_responses_on_old_requests - old = AlaveteliConfiguration.restrict_new_responses_on_old_requests_after_months - very_old = old * 4 - # 'old' months since last change to request, only allow new incoming # messages from authority domains InfoRequest .been_published .where(allow_new_responses_from: 'anybody') .where.not(url_title: 'holding_pen') - .updated_before(old.months.ago.to_date) + .updated_before(requests_old_after_months.months.ago.to_date) .find_in_batches do |batch| batch.each do |info_request| old_allow_new_responses_from = info_request.allow_new_responses_from @@ -565,7 +570,7 @@ def self.stop_new_responses_on_old_requests .been_published .where(allow_new_responses_from: %w[anybody authority_only]) .where.not(url_title: 'holding_pen') - .updated_before(very_old.months.ago.to_date) + .updated_before(requests_very_old_after_months.months.ago.to_date) .find_in_batches do |batch| batch.each do |info_request| old_allow_new_responses_from = info_request.allow_new_responses_from diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb index 2f3accff7c..dd11c58ef4 100644 --- a/spec/models/info_request_spec.rb +++ b/spec/models/info_request_spec.rb @@ -82,6 +82,30 @@ end end + describe '.requests_old_after_months' do + subject { described_class.requests_old_after_months } + + before do + allow(AlaveteliConfiguration). + to receive(:restrict_new_responses_on_old_requests_after_months). + and_return(1) + end + + it { is_expected.to eq(1) } + end + + describe '.requests_very_old_after_months' do + subject { described_class.requests_very_old_after_months } + + before do + allow(AlaveteliConfiguration). + to receive(:restrict_new_responses_on_old_requests_after_months). + and_return(1) + end + + it { is_expected.to eq(4) } + end + describe '#foi_attachments' do subject { info_request.foi_attachments } From 8ad7d666a5ade2bc26011bc9c8616ac3d30ac7bc Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Fri, 3 Feb 2023 10:44:16 +0000 Subject: [PATCH 067/289] Remove deprecated methods --- app/models/comment.rb | 6 ------ app/models/incoming_message.rb | 19 ------------------- 2 files changed, 25 deletions(-) diff --git a/app/models/comment.rb b/app/models/comment.rb index adc73e8d02..256c56c520 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -108,12 +108,6 @@ def reindex_request_events info_request_events.find_each(&:xapian_mark_needs_index) end - def event_xapian_update - warn 'DEPRECATION: Comment#event_xapian_update will be removed in 0.42. ' \ - 'It has been replaced with Comment#reindex_request_events' - reindex_request_events - end - # Return body for display as HTML def get_body_for_html_display text = body.strip diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 096213af00..9f0bd0f3a2 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -115,12 +115,6 @@ def parse_raw_email!(force = nil) alias_method :valid_to_reply_to?, :valid_to_reply_to - def mail_from - warn %q([DEPRECATION] IncomingMessage#mail_from will be removed in 0.42. It - has been replaced by IncomingMessage#from_name).squish - from_name - end - # Public: The display name of the email sender with the associated # InfoRequest's censor rules applied. # @@ -135,23 +129,10 @@ def mail_from # # => FOI [REDACTED] # # Returns a String - def safe_mail_from - warn %q([DEPRECATION] IncomingMessage#safe_mail_from will be removed in - 0.42. It has been replaced by IncomingMessage#safe_from_name).squish - safe_from_name - end - def safe_from_name info_request.apply_censor_rules_to_text(from_name) if from_name end - def mail_from_domain - warn %q([DEPRECATION] IncomingMessage#mail_from_domain will be removed in - 0.42. It has been replaced by - IncomingMessage#from_email_domain).squish - from_email_domain - end - def specific_from_name? !safe_from_name.nil? && safe_from_name.strip != info_request.public_body.name.strip end From 0f4e9fd8c073226c83f91df8a3ffc3cad4033ed4 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 3 Feb 2023 12:46:08 +0000 Subject: [PATCH 068/289] Refactor: Comment annotation linting --- app/controllers/application_controller.rb | 2 +- app/mailers/outgoing_mailer.rb | 2 +- lib/mail_handler.rb | 2 +- spec/lib/alaveteli_pro/metrics_report_spec.rb | 2 +- spec/models/user_spec.rb | 2 +- .../info_request_batches/_authority_list.html.erb_spec.rb | 2 +- .../info_request_batches/_authority_list.text.erb_spec.rb | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ea80e6a4c2..a789da1ded 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -32,7 +32,7 @@ class RouteNotFound < StandardError include FastGettext::Translation # make functions like _, n_, N_ etc available) include AlaveteliPro::PostRedirectHandler - # Note: a filter stops the chain if it redirects or renders something + # NOTE: a filter stops the chain if it redirects or renders something before_action :html_response before_action :authentication_check before_action :check_in_post_redirect diff --git a/app/mailers/outgoing_mailer.rb b/app/mailers/outgoing_mailer.rb index bf11b55dbf..ebee8e4762 100644 --- a/app/mailers/outgoing_mailer.rb +++ b/app/mailers/outgoing_mailer.rb @@ -4,7 +4,7 @@ # Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved. # Email: hello@mysociety.org; WWW: http://www.mysociety.org/ -# Note: The layout for this wraps messages by lines rather than (blank line +# NOTE: The layout for this wraps messages by lines rather than (blank line # separated) paragraphs, as is the convention for all the other mailers. This # turned out to fit better with user exepectations when formatting messages. # diff --git a/lib/mail_handler.rb b/lib/mail_handler.rb index 9a12ee2153..087e9b1cdd 100644 --- a/lib/mail_handler.rb +++ b/lib/mail_handler.rb @@ -67,7 +67,7 @@ def normalise_content_type(content_type) end def get_attachment_text_one_file(content_type, body, charset = 'utf-8') - # note re. charset: TMail always tries to convert email bodies + # NOTE: re. charset: TMail always tries to convert email bodies # to UTF8 by default, so normally it should already be that. text = '' # TODO: - tell all these command line tools to return utf-8 diff --git a/spec/lib/alaveteli_pro/metrics_report_spec.rb b/spec/lib/alaveteli_pro/metrics_report_spec.rb index aa39a0c0b3..9a97ff819a 100644 --- a/spec/lib/alaveteli_pro/metrics_report_spec.rb +++ b/spec/lib/alaveteli_pro/metrics_report_spec.rb @@ -149,7 +149,7 @@ subscription = Stripe::Subscription.create(customer: customer, plan: pro_plan.id) - # note - in later API versions, at_period_end is no longer + # NOTE: - in later API versions, at_period_end is no longer # available for delete so we'd have to call something like # this instead: # Stripe::Subscription.update(subscription.id, diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index c4f771ea9a..68a7557ac3 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1522,7 +1522,7 @@ def create_user(options = {}) end it "returns all of the user's events" do - # Note: there is a fourth "sent" event created automatically + # NOTE: there is a fourth "sent" event created automatically expect(user.info_request_events.count).to eq 4 end end diff --git a/spec/views/alaveteli_pro/info_request_batches/_authority_list.html.erb_spec.rb b/spec/views/alaveteli_pro/info_request_batches/_authority_list.html.erb_spec.rb index 7869f2568d..795efdf0e9 100644 --- a/spec/views/alaveteli_pro/info_request_batches/_authority_list.html.erb_spec.rb +++ b/spec/views/alaveteli_pro/info_request_batches/_authority_list.html.erb_spec.rb @@ -15,7 +15,7 @@ def render_html_partial(public_bodies) it "escapes HTMLEntities in public body names" do render_html_partial(public_bodies) - # Note: using include not have_text to test the html entity is there + # NOTE: using include not have_text to test the html entity is there expect(response).to include("One & Two") expect(response).not_to include("One & Two") end diff --git a/spec/views/alaveteli_pro/info_request_batches/_authority_list.text.erb_spec.rb b/spec/views/alaveteli_pro/info_request_batches/_authority_list.text.erb_spec.rb index 94d04d3f97..cdf6ef3d08 100644 --- a/spec/views/alaveteli_pro/info_request_batches/_authority_list.text.erb_spec.rb +++ b/spec/views/alaveteli_pro/info_request_batches/_authority_list.text.erb_spec.rb @@ -17,7 +17,7 @@ def render_text_partial(public_bodies) it "doesn't escape HTMLEntities in public body names" do render_text_partial(public_bodies) - # Note: using include not have_text to test the html entity is not there + # NOTE: using include not have_text to test the html entity is not there expect(response).to include("One & Two") expect(response).not_to include("One & Two") end From f0979da311b5722ff1a42c5a7d75553decff9af4 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 3 Feb 2023 12:46:54 +0000 Subject: [PATCH 069/289] Refactor: Numeric literals linting --- app/controllers/admin_public_body_controller.rb | 2 +- app/controllers/request_game_controller.rb | 2 +- app/models/incoming_message.rb | 4 ++-- app/models/request_classification.rb | 4 ++-- lib/database_collation.rb | 2 +- lib/mail_handler.rb | 2 +- spec/controllers/request_controller_spec.rb | 2 +- spec/helpers/analytics_helper_spec.rb | 2 +- spec/helpers/currency_helper_spec.rb | 8 ++++---- spec/lib/database_collation_spec.rb | 4 ++-- .../previews/alaveteli_pro/metrics_mailer_preview.rb | 2 +- spec/models/incoming_message_spec.rb | 6 +++--- spec/models/info_request_spec.rb | 10 +++++----- .../_cancel_subscription.html.erb_spec.rb | 4 ++-- 14 files changed, 27 insertions(+), 27 deletions(-) diff --git a/app/controllers/admin_public_body_controller.rb b/app/controllers/admin_public_body_controller.rb index e82a37c0bd..1dbaf53ac0 100644 --- a/app/controllers/admin_public_body_controller.rb +++ b/app/controllers/admin_public_body_controller.rb @@ -207,7 +207,7 @@ def import_csv # Save the contents to a temporary file - not using Tempfile as we need # the file to persist between requests. Return the name of the file. def store_csv_data(csv_contents) - tempfile_name = "csv_upload-#{Time.zone.now.strftime("%Y%m%d")}-#{SecureRandom.random_number(10000)}" + tempfile_name = "csv_upload-#{Time.zone.now.strftime("%Y%m%d")}-#{SecureRandom.random_number(10_000)}" tempfile = File.new(File.join(Dir::tmpdir, tempfile_name), 'w') tempfile.write(csv_contents) tempfile.close diff --git a/app/controllers/request_game_controller.rb b/app/controllers/request_game_controller.rb index c3c0acf704..f7bf70ba42 100644 --- a/app/controllers/request_game_controller.rb +++ b/app/controllers/request_game_controller.rb @@ -16,7 +16,7 @@ def play @total = InfoRequest.is_searchable.count @done = @total - @missing @percentage = if @total > 0 - (@done.to_f / @total.to_f * 10000).round / 100.0 + (@done.to_f / @total.to_f * 10_000).round / 100.0 else 100.0 end diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 096213af00..1287273ceb 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -41,7 +41,7 @@ class IncomingMessage < ApplicationRecord include CacheAttributesFromRawEmail include Taggable - MAX_ATTACHMENT_TEXT_CLIPPED = 1000000 # 1Mb ish + MAX_ATTACHMENT_TEXT_CLIPPED = 1_000_000 # 1Mb ish belongs_to :info_request, inverse_of: :incoming_messages, @@ -343,7 +343,7 @@ def _cache_main_body_text # - this also effectively does a .dup as well, so text mods don't alter original text = text.split(/^begin.+^`\n^end\n/m).join(" ") - if text.size > 1000000 # 1 MB ish + if text.size > 1_000_000 # 1 MB ish raise "main body text more than 1 MB, need to implement clipping like for attachment text, or there is some other MIME decoding problem or similar" end diff --git a/app/models/request_classification.rb b/app/models/request_classification.rb index bfce22be80..d0e4ff3889 100644 --- a/app/models/request_classification.rb +++ b/app/models/request_classification.rb @@ -12,8 +12,8 @@ class RequestClassification < ApplicationRecord MILESTONES = [ - 100, 250, 500, 1000, 2500, 5000, 10000, 25000, 50000, 75000, 100000, - 250000, 500000, 750000, 1000000 + 100, 250, 500, 1000, 2500, 5000, 10_000, 25_000, 50_000, 75_000, 100_000, + 250_000, 500_000, 750_000, 1_000_000 ].freeze belongs_to :user, diff --git a/lib/database_collation.rb b/lib/database_collation.rb index f0cc6a8ac9..c72535d085 100644 --- a/lib/database_collation.rb +++ b/lib/database_collation.rb @@ -3,7 +3,7 @@ # a given language. Prefer the class method .supports? rather than creating a # new instance. class DatabaseCollation - MINIMUM_POSTGRESQL_VERSION = 90112 + MINIMUM_POSTGRESQL_VERSION = 90112 # rubocop:disable Style/NumericLiterals attr_reader :connection diff --git a/lib/mail_handler.rb b/lib/mail_handler.rb index 087e9b1cdd..397e3fa05f 100644 --- a/lib/mail_handler.rb +++ b/lib/mail_handler.rb @@ -83,7 +83,7 @@ def get_attachment_text_one_file(content_type, body, charset = 'utf-8') :timeout => 1200 } if content_type == 'application/vnd.ms-word' AlaveteliExternalCommand.run("wvText", tempfile.path, tempfile.path + ".txt", - { :memory_limit => 536870912, :timeout => 120 } ) + { :memory_limit => 536_870_912, :timeout => 120 } ) # Try catdoc if we get into trouble (e.g. for InfoRequestEvent 2701) if not File.exist?(tempfile.path + ".txt") AlaveteliExternalCommand.run("catdoc", tempfile.path, default_params) diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index 658d59d0ca..4c3fe03944 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -19,7 +19,7 @@ it "should return 404 for pages we don't want to serve up" do xap_results = double(ActsAsXapian::Search, :results => (1..25).to_a.map { |m| { :model => m } }, - :matches_estimated => 1000000) + :matches_estimated => 1_000_000) expect { get :list, params: { :view => 'all', :page => 100 } }.to raise_error(ActiveRecord::RecordNotFound) diff --git a/spec/helpers/analytics_helper_spec.rb b/spec/helpers/analytics_helper_spec.rb index e1d61ad577..4d7f00abd4 100644 --- a/spec/helpers/analytics_helper_spec.rb +++ b/spec/helpers/analytics_helper_spec.rb @@ -66,7 +66,7 @@ expect(track_analytics_event( AnalyticsEvent::Category::OUTBOUND, AnalyticsEvent::Action::FACEBOOK_EXIT, - :value => 1234567 + :value => 1_234_567 )).not_to include("1234567") end diff --git a/spec/helpers/currency_helper_spec.rb b/spec/helpers/currency_helper_spec.rb index ebfea16715..a0e9dcd354 100644 --- a/spec/helpers/currency_helper_spec.rb +++ b/spec/helpers/currency_helper_spec.rb @@ -10,11 +10,11 @@ end it 'formats the amount in the configured currency' do - expect(format_currency(123456)).to eq('£1,234.56') + expect(format_currency(123_456)).to eq('£1,234.56') allow(AlaveteliConfiguration).to receive(:iso_currency_code). and_return('HRK') - expect(format_currency(123456)).to eq('1.234,56 kn') + expect(format_currency(123_456)).to eq('1.234,56 kn') end it 'shows currency sub-units by default' do @@ -23,13 +23,13 @@ context 'when asked to show the amount without trailing zeros' do it 'does not show the trailing sub-unit amount when it is 00' do - expect(format_currency(123400, no_cents_if_whole: true)).to eq('£1,234') + expect(format_currency(123_400, no_cents_if_whole: true)).to eq('£1,234') end it 'does not rely on the UK currency format' do allow(AlaveteliConfiguration).to receive(:iso_currency_code). and_return('EUR') - expect(format_currency(123400, no_cents_if_whole: true)).to eq('€1.234') + expect(format_currency(123_400, no_cents_if_whole: true)).to eq('€1.234') end it 'still shows the sub-unit value if it is a non-zero amount' do diff --git a/spec/lib/database_collation_spec.rb b/spec/lib/database_collation_spec.rb index deac08baf0..5c84a21ba8 100644 --- a/spec/lib/database_collation_spec.rb +++ b/spec/lib/database_collation_spec.rb @@ -35,7 +35,7 @@ it 'does not support collation if the postgresql version is too old' do database = DatabaseCollation. - new(mock_connection(:postgresql_version => 90111)) + new(mock_connection(:postgresql_version => 90111)) # rubocop:disable Style/NumericLiterals expect(database.supports?('en_GB')).to be false end @@ -66,7 +66,7 @@ def mock_connection(connection_double_opts = {}) # Connection must be PostgreSQL 90112 or greater default_double_opts = { :adapter_name => 'PostgreSQL', - :postgresql_version => 90112 } + :postgresql_version => 90112 } # rubocop:disable Style/NumericLiterals connection_double_opts = default_double_opts.merge(connection_double_opts) diff --git a/spec/mailers/previews/alaveteli_pro/metrics_mailer_preview.rb b/spec/mailers/previews/alaveteli_pro/metrics_mailer_preview.rb index e73933c7eb..4a2fca2c39 100644 --- a/spec/mailers/previews/alaveteli_pro/metrics_mailer_preview.rb +++ b/spec/mailers/previews/alaveteli_pro/metrics_mailer_preview.rb @@ -6,7 +6,7 @@ def weekly_report data = { new_pro_requests: 104, - estimated_total_pro_requests: 37535, + estimated_total_pro_requests: 37_535, new_batches: 3, new_signups: 5, total_accounts: 284, diff --git a/spec/models/incoming_message_spec.rb b/spec/models/incoming_message_spec.rb index 3e0e9983ef..d9104f94e1 100644 --- a/spec/models/incoming_message_spec.rb +++ b/spec/models/incoming_message_spec.rb @@ -1138,9 +1138,9 @@ def populate_raw_email(fixture) incoming_message = FactoryBot.build(:incoming_message) # This character is 2 bytes so the string should get sliced unless # we are handling multibyte chars correctly - multibyte_string = "å" * 500002 + multibyte_string = "å" * 500_002 allow(incoming_message).to receive(:_get_attachment_text_internal).and_return(multibyte_string) - expect(incoming_message.get_attachment_text_clipped.length).to eq(500002) + expect(incoming_message.get_attachment_text_clipped.length).to eq(500_002) end end @@ -1152,7 +1152,7 @@ def populate_raw_email(fixture) before do @incoming_message = FactoryBot.create(:incoming_message) allow(@incoming_message).to receive(:get_main_body_text_internal). - and_return("x" * 1000010) + and_return("x" * 1_000_010) end it 'raises an exception' do diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb index 2f3accff7c..f99559e7dc 100644 --- a/spec/models/info_request_spec.rb +++ b/spec/models/info_request_spec.rb @@ -1789,8 +1789,8 @@ end context 'email with an id mistyped using letters and missing punctuation' do - before { InfoRequest.where(id: 1231014).destroy_all } - let!(:info_request) { FactoryBot.create(:info_request, id: 1231014) } + before { InfoRequest.where(id: 1_231_014).destroy_all } + let!(:info_request) { FactoryBot.create(:info_request, id: 1_231_014) } let(:email) { 'request-123loL4abcdefgh@example.com' } let(:guess) { described_class::Guess.new(info_request, email, :id) } it { is_expected.to include(guess) } @@ -3669,7 +3669,7 @@ def apply_filters(filters) context "when the request is public" do let(:request) do - FactoryBot.create(:info_request_with_incoming, id: 123456, + FactoryBot.create(:info_request_with_incoming, id: 123_456, title: "Test") end @@ -3682,7 +3682,7 @@ def apply_filters(filters) context "when the request is hidden" do let(:request) do - FactoryBot.create(:info_request_with_incoming, id: 123456, + FactoryBot.create(:info_request_with_incoming, id: 123_456, title: "Test", prominence: "hidden") end @@ -3694,7 +3694,7 @@ def apply_filters(filters) let(:request) do FactoryBot.create( :info_request_with_incoming, - id: 123456, + id: 123_456, title: "Test", prominence: "requester_only" ) diff --git a/spec/views/alaveteli_pro/subscriptions/_cancel_subscription.html.erb_spec.rb b/spec/views/alaveteli_pro/subscriptions/_cancel_subscription.html.erb_spec.rb index 4334e5969d..6dfa8b0019 100644 --- a/spec/views/alaveteli_pro/subscriptions/_cancel_subscription.html.erb_spec.rb +++ b/spec/views/alaveteli_pro/subscriptions/_cancel_subscription.html.erb_spec.rb @@ -13,7 +13,7 @@ def render_view let(:subscription) do double(id: 'sub_BWb9jBSSO0nafs', cancel_at_period_end: false, - current_period_end: 1509882971) + current_period_end: 1_509_882_971) end it 'sets the section heading' do @@ -47,7 +47,7 @@ def render_view let(:subscription) do double(id: 'sub_BWb9jBSSO0nafs', cancel_at_period_end: true, - current_period_end: 1509882971) + current_period_end: 1_509_882_971) end it 'sets the section heading' do From 4321d61c29c480b91cb28ba55a51e594ffbc3f3b Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 3 Feb 2023 12:47:54 +0000 Subject: [PATCH 070/289] Refactor: Parallel assignment linting --- app/mailers/contact_mailer.rb | 13 ++++++++++--- app/mailers/info_request_batch_mailer.rb | 3 ++- app/mailers/request_mailer.rb | 9 ++++++--- app/mailers/track_mailer.rb | 3 ++- app/mailers/user_mailer.rb | 16 ++++++++++++---- lib/i18n_fixes.rb | 3 ++- spec/models/public_body_spec.rb | 3 ++- spec/models/user_spec.rb | 6 ++++-- spec/spec_helper.rb | 6 ++++-- 9 files changed, 44 insertions(+), 18 deletions(-) diff --git a/app/mailers/contact_mailer.rb b/app/mailers/contact_mailer.rb index 45936ad0d1..c84661a621 100644 --- a/app/mailers/contact_mailer.rb +++ b/app/mailers/contact_mailer.rb @@ -9,7 +9,10 @@ class ContactMailer < ApplicationMailer # Send message to administrator def to_admin_message(name, email, subject, message, logged_in_user, last_request, last_body) - @message, @logged_in_user, @last_request, @last_body = message, logged_in_user, last_request, last_body + @message = message + @logged_in_user = logged_in_user + @last_request = last_request + @last_body = last_body reply_to_address = MailHandler.address_from_name_and_email(name, email) set_reply_to_headers(nil, 'Reply-To' => reply_to_address) @@ -22,7 +25,10 @@ def to_admin_message(name, email, subject, message, logged_in_user, last_request # Send message to another user def user_message(from_user, recipient_user, from_user_url, subject, message) - @message, @from_user, @recipient_user, @from_user_url = message, from_user, recipient_user, from_user_url + @message = message + @from_user = from_user + @recipient_user = recipient_user + @from_user_url = from_user_url set_reply_to_headers(nil, 'Reply-To' => from_user.name_and_email) @@ -35,7 +41,8 @@ def user_message(from_user, recipient_user, from_user_url, subject, message) # Send message to a user from the administrator def from_admin_message(recipient_name, recipient_email, subject, message) @message = message - @recipient_name, @recipient_email = recipient_name, recipient_email + @recipient_name = recipient_name + @recipient_email = recipient_email recipient_user = User.find_by_email(recipient_email) diff --git a/app/mailers/info_request_batch_mailer.rb b/app/mailers/info_request_batch_mailer.rb index ffc55ad7ed..4d7ed3475c 100644 --- a/app/mailers/info_request_batch_mailer.rb +++ b/app/mailers/info_request_batch_mailer.rb @@ -7,7 +7,8 @@ class InfoRequestBatchMailer < ApplicationMailer def batch_sent(info_request_batch, unrequestable, user) - @info_request_batch, @unrequestable = info_request_batch, unrequestable + @info_request_batch = info_request_batch + @unrequestable = unrequestable @url = info_request_batch_url(@info_request_batch) set_reply_to_headers(user) diff --git a/app/mailers/request_mailer.rb b/app/mailers/request_mailer.rb index 3e88f50bb7..0bc77ab2ea 100644 --- a/app/mailers/request_mailer.rb +++ b/app/mailers/request_mailer.rb @@ -85,7 +85,8 @@ def requires_admin(info_request, set_by = nil, message = "") # Tell the requester that a new response has arrived def new_response(info_request, incoming_message) - @incoming_message, @info_request = incoming_message, info_request + @incoming_message = incoming_message + @info_request = info_request set_reply_to_headers(info_request.user) set_auto_generated_headers @@ -179,7 +180,8 @@ def not_clarified_alert(info_request, incoming_message) # Tell requester that somebody add an annotation to their request def comment_on_alert(info_request, comment) - @comment, @info_request = comment, info_request + @comment = comment + @info_request = info_request @url = comment_url(comment) set_reply_to_headers(info_request.user) @@ -194,7 +196,8 @@ def comment_on_alert(info_request, comment) # Tell requester that somebody added annotations to more than one of # their requests def comment_on_alert_plural(info_request, count, earliest_unalerted_comment) - @count, @info_request = count, info_request + @count = count + @info_request = info_request @url = comment_url(earliest_unalerted_comment) set_reply_to_headers(info_request.user) diff --git a/app/mailers/track_mailer.rb b/app/mailers/track_mailer.rb index af29c144b2..299feaa957 100644 --- a/app/mailers/track_mailer.rb +++ b/app/mailers/track_mailer.rb @@ -16,7 +16,8 @@ def contact_from_name_and_email end def event_digest(user, email_about_things) - @user, @email_about_things = user, email_about_things + @user = user + @email_about_things = email_about_things headers( # http://tools.ietf.org/html/rfc3834 diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index bc08e7171f..390a1d4ed2 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -6,21 +6,28 @@ class UserMailer < ApplicationMailer def confirm_login(user, reasons, url) - @reasons, @name, @url = reasons, user.name, url + @reasons = reasons + @name = user.name + @url = url set_reply_to_headers(user) mail_user(user, reasons[:email_subject]) end def already_registered(user, reasons, url) - @reasons, @name, @url = reasons, user.name, url + @reasons = reasons + @name = user.name + @url = url set_reply_to_headers(user) mail_user(user, reasons[:email_subject]) end def changeemail_confirm(user, new_email, url) - @name, @url, @old_email, @new_email = user.name, url, user.email, new_email + @name = user.name + @url = url + @old_email = user.email + @new_email = new_email set_reply_to_headers(user) mail(:from => contact_for_user(user), @@ -29,7 +36,8 @@ def changeemail_confirm(user, new_email, url) end def changeemail_already_used(old_email, new_email) - @old_email, @new_email = old_email, new_email + @old_email = old_email + @new_email = new_email user = User.find_by_email(@old_email) set_reply_to_headers(user) diff --git a/lib/i18n_fixes.rb b/lib/i18n_fixes.rb index be667a043f..838b52c0ec 100644 --- a/lib/i18n_fixes.rb +++ b/lib/i18n_fixes.rb @@ -28,7 +28,8 @@ def gettext_interpolate(string, values) # $1, $2 don't work with SafeBuffer so casting to string as workaround safe = string.html_safe? string = string.to_str.gsub(MATCH) do - pattern, key = $1, $1.to_sym + pattern = $1 + key = $1.to_sym if !values.include?(key) raise I18n::MissingInterpolationArgument.new(pattern, string, values) diff --git a/spec/models/public_body_spec.rb b/spec/models/public_body_spec.rb index d6eb744368..af1d3b3e5c 100644 --- a/spec/models/public_body_spec.rb +++ b/spec/models/public_body_spec.rb @@ -756,7 +756,8 @@ it 'calls expire on all associated requests' do public_body = FactoryBot.build(:public_body) - request_1, request_2 = double(:info_request), double(:info_request) + request_1 = double(:info_request) + request_2 = double(:info_request) allow(public_body).to receive_message_chain(:info_requests, :find_each). and_yield(request_1).and_yield(request_2) diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 68a7557ac3..bd31f5fdbc 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -792,7 +792,8 @@ def create_user(options = {}) it 'calls expire on all associated requests' do user = FactoryBot.build(:user) - request_1, request_2 = double(:info_request), double(:info_request) + request_1 = double(:info_request) + request_2 = double(:info_request) allow(user).to receive_message_chain(:info_requests, :find_each). and_yield(request_1).and_yield(request_2) @@ -808,7 +809,8 @@ def create_user(options = {}) it 'calls reindex_request_events on all associated requests' do user = FactoryBot.build(:user) - comment_1, comment_2 = double(:comment), double(:comment) + comment_1 = double(:comment) + comment_2 = double(:comment) allow(user).to receive_message_chain(:comments, :find_each). and_yield(comment_1).and_yield(comment_2) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0b426f0d8d..ac559e9903 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -181,14 +181,16 @@ def xapian_before_create_job_hook(action, model, model_id) end def with_env_tz(new_tz = 'US/Eastern') - old_tz, ENV['TZ'] = ENV['TZ'], new_tz + old_tz = ENV['TZ'] + ENV['TZ'] = new_tz yield ensure old_tz ? ENV['TZ'] = old_tz : ENV.delete('TZ') end def with_active_record_default_timezone(zone) - old_zone, ActiveRecord::Base.default_timezone = ActiveRecord::Base.default_timezone, zone + old_zone = ActiveRecord::Base.default_timezone + ActiveRecord::Base.default_timezone = zone yield ensure ActiveRecord::Base.default_timezone = old_zone From 31815813509df06ecc51396237e3631924aee566 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 3 Feb 2023 12:57:35 +0000 Subject: [PATCH 071/289] Add generated stubs to global exclude --- .ruby-style.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.ruby-style.yml b/.ruby-style.yml index 7b17e64b65..ee6ea7fde2 100644 --- a/.ruby-style.yml +++ b/.ruby-style.yml @@ -24,6 +24,8 @@ AllCops: - node_modules/**/* - vendor/**/* - ".git/**/*" + - "bin/bundle" + - "bin/rubocop" DisplayCopNames: false StyleGuideCopsOnly: false DisabledByDefault: true From 5b29d9c91ecd82d8914f0254070cfe5d8d8f3362 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 3 Feb 2023 12:59:28 +0000 Subject: [PATCH 072/289] Refactor: If modifier form --- Vagrantfile | 4 +- app/controllers/admin_comment_controller.rb | 12 +- .../admin_public_body_controller.rb | 12 +- app/controllers/admin_user_controller.rb | 4 +- .../embargo_extensions_controller.rb | 8 +- .../alaveteli_pro/embargoes_controller.rb | 4 +- app/controllers/api_controller.rb | 12 +- app/controllers/application_controller.rb | 8 +- app/controllers/followups_controller.rb | 8 +- app/controllers/general_controller.rb | 8 +- .../info_request_batch_controller.rb | 4 +- .../password_changes_controller.rb | 4 +- app/controllers/public_body_controller.rb | 4 +- app/controllers/request_controller.rb | 48 +++---- app/controllers/user_controller.rb | 12 +- app/controllers/widgets_controller.rb | 4 +- app/helpers/highlight_helper.rb | 8 +- app/helpers/link_to_helper.rb | 4 +- app/mailers/request_mailer.rb | 4 +- app/mailers/track_mailer.rb | 12 +- app/models/ability.rb | 8 +- .../alaveteli_pro/draft_info_request_batch.rb | 4 +- app/models/alaveteli_pro/embargo.rb | 8 +- .../concerns/public_body_derived_fields.rb | 4 +- app/models/foi_attachment.rb | 8 +- app/models/holiday_import.rb | 4 +- app/models/incoming_message.rb | 28 ++-- app/models/info_request.rb | 60 +++----- app/models/info_request_event.rb | 48 ++----- app/models/mail_server_log.rb | 4 +- app/models/outgoing_message.rb | 8 +- app/models/post_redirect.rb | 4 +- app/models/profile_photo.rb | 12 +- app/models/public_body.rb | 16 +-- .../category_collection.rb | 4 +- app/models/public_body_change_request.rb | 8 +- app/models/user.rb | 4 +- config/boot.rb | 4 +- config/initializers/theme_loader.rb | 4 +- db/migrate/096_create_translation_tables.rb | 4 +- ...1107_create_category_translation_tables.rb | 8 +- ...0718261524_add_expiring_notification_at.rb | 4 +- ...8_add_stripe_customer_id_to_pro_account.rb | 4 +- lib/acts_as_xapian/acts_as_xapian.rb | 136 +++++++++++------- lib/acts_as_xapian/tasks/xapian.rake | 8 +- lib/alaveteli_external_command.rb | 4 +- lib/alaveteli_file_types.rb | 20 +-- lib/alaveteli_mail_poller.rb | 8 +- lib/attachment_to_html.rb | 4 +- lib/attachment_to_html/adapters/rtf.rb | 4 +- lib/confidence_intervals.rb | 4 +- lib/mail_handler.rb | 8 +- lib/mail_handler/backends/mail_backend.rb | 20 +-- lib/mail_handler/reply_handler.rb | 28 +--- lib/memory_profiler.rb | 4 +- lib/routing_filters.rb | 17 ++- lib/tasks/cleanup.rake | 8 +- lib/tasks/config_files.rake | 4 +- lib/tasks/geoip.rake | 4 +- lib/tasks/gettext.rake | 4 +- lib/tasks/import.rake | 4 +- lib/tasks/themes.rake | 12 +- lib/tasks/usage.rb | 8 +- lib/tasks/users.rake | 4 +- lib/typeahead_search.rb | 4 +- lib/xapian_queries.rb | 8 +- script/handle-mail-replies.rb | 4 +- spec/models/info_request_spec.rb | 4 +- spec/spec_helper.rb | 16 +-- 69 files changed, 316 insertions(+), 477 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 401d8ec794..f08833608d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -159,9 +159,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box_url = os[:box_url] config.vm.hostname = "alaveteli-#{ SETTINGS['os'] }" - if SETTINGS['public_network'] - config.vm.network :public_network - end + config.vm.network :public_network if SETTINGS['public_network'] config.vm.network :private_network, ip: SETTINGS['ip'] diff --git a/app/controllers/admin_comment_controller.rb b/app/controllers/admin_comment_controller.rb index 50792aff40..333bfc99b3 100644 --- a/app/controllers/admin_comment_controller.rb +++ b/app/controllers/admin_comment_controller.rb @@ -19,23 +19,17 @@ def index Comment.order(created_at: :desc) end - if cannot? :admin, AlaveteliPro::Embargo - comments = comments.not_embargoed - end + comments = comments.not_embargoed if cannot? :admin, AlaveteliPro::Embargo @comments = comments.paginate :page => params[:page], :per_page => 100 end def edit - if cannot? :admin, @comment - raise ActiveRecord::RecordNotFound - end + raise ActiveRecord::RecordNotFound if cannot? :admin, @comment end def update - if cannot? :admin, @comment - raise ActiveRecord::RecordNotFound - end + raise ActiveRecord::RecordNotFound if cannot? :admin, @comment old_body = @comment.body.dup old_visible = @comment.visible old_attention = @comment.attention_requested diff --git a/app/controllers/admin_public_body_controller.rb b/app/controllers/admin_public_body_controller.rb index 1dbaf53ac0..b18da4ff23 100644 --- a/app/controllers/admin_public_body_controller.rb +++ b/app/controllers/admin_public_body_controller.rb @@ -190,9 +190,7 @@ def import_csv admin_current_user, AlaveteliLocalization. available_locales) - if errors.size != 0 - raise "dry run mismatched real run" - end + raise "dry run mismatched real run" if errors.size != 0 notes.push("Import was successful.") end end @@ -234,13 +232,9 @@ def lookup_query @locale = AlaveteliLocalization.locale AlaveteliLocalization.with_locale(@locale) do @query = params[:query] - if @query == "" - @query = nil - end + @query = nil if @query == "" @page = params[:page] - if @page == "" - @page = nil - end + @page = nil if @page == "" query = if @query query_str = <<-EOF.strip_heredoc diff --git a/app/controllers/admin_user_controller.rb b/app/controllers/admin_user_controller.rb index 5d6df278ab..ac7271496a 100644 --- a/app/controllers/admin_user_controller.rb +++ b/app/controllers/admin_user_controller.rb @@ -111,9 +111,7 @@ def clear_bounce end def clear_profile_photo - if @admin_user.profile_photo - @admin_user.profile_photo.destroy - end + @admin_user.profile_photo.destroy if @admin_user.profile_photo flash[:notice] = "Profile photo cleared" redirect_to admin_user_url(@admin_user) diff --git a/app/controllers/alaveteli_pro/embargo_extensions_controller.rb b/app/controllers/alaveteli_pro/embargo_extensions_controller.rb index 0771c3d265..d00ad8c16a 100644 --- a/app/controllers/alaveteli_pro/embargo_extensions_controller.rb +++ b/app/controllers/alaveteli_pro/embargo_extensions_controller.rb @@ -13,13 +13,9 @@ def create @info_request = @embargo.info_request # Embargoes cannot be updated individually on batch requests - if @info_request.info_request_batch_id - raise PermissionDenied - end + raise PermissionDenied if @info_request.info_request_batch_id - unless @embargo.expiring_soon? - raise PermissionDenied - end + raise PermissionDenied unless @embargo.expiring_soon? @embargo_extension = AlaveteliPro::EmbargoExtension.new(embargo_extension_params) diff --git a/app/controllers/alaveteli_pro/embargoes_controller.rb b/app/controllers/alaveteli_pro/embargoes_controller.rb index 1855b50fe2..b20e92bff6 100644 --- a/app/controllers/alaveteli_pro/embargoes_controller.rb +++ b/app/controllers/alaveteli_pro/embargoes_controller.rb @@ -36,9 +36,7 @@ def destroy authorize! :destroy, @embargo @info_request = @embargo.info_request # Embargoes cannot be updated individually on batch requests - if @info_request.info_request_batch_id - raise PermissionDenied - end + raise PermissionDenied if @info_request.info_request_batch_id if @embargo.destroy @info_request.log_event('expire_embargo', {}) flash[:notice] = _("Your request is now public!") diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index 2b1c7f8aca..1b85464b1c 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -196,7 +196,9 @@ def update_state def body_request_events feed_type = params[:feed_type] - raise PermissionDenied.new("#{@public_body.id} != #{params[:id]}") if @public_body.id != params[:id].to_i + if @public_body.id != params[:id].to_i + raise PermissionDenied.new("#{@public_body.id} != #{params[:id]}") + end since_date_str = params[:since_date] since_event_id = params[:since_event_id] @@ -256,9 +258,7 @@ def body_request_events :body => event.outgoing_message.body, :user_name => request.user_name, } - if request.user - this_event[:user_url] = user_url(request.user) - end + this_event[:user_url] = user_url(request.user) if request.user @event_data.push(this_event) end @@ -270,7 +270,9 @@ def body_request_events protected def check_api_key - raise PermissionDenied.new("Missing required parameter 'k'") if params[:k].nil? + if params[:k].nil? + raise PermissionDenied.new("Missing required parameter 'k'") + end @public_body = PublicBody.find_by_api_key(params[:k].gsub(' ', '+')) raise PermissionDenied if @public_body.nil? end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a789da1ded..1dd8e05821 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -172,9 +172,7 @@ def clear_session_credentials def render_exception(exception) # In development let Rails handle the exception with its stack trace # templates. - if Rails.application.config.consider_all_requests_local - raise exception - end + raise exception if Rails.application.config.consider_all_requests_local @exception_backtrace = exception.backtrace.join("\n") @exception_class = exception.class.to_s @@ -473,7 +471,9 @@ def user_ip # # Returns a Hash def sanitize_path(params) - params.merge!(:path => Rack::Utils.escape(params[:path])) if params.key?(:path) + if params.key?(:path) + params.merge!(:path => Rack::Utils.escape(params[:path])) + end end # Collect the current and available locales for the locale switcher diff --git a/app/controllers/followups_controller.rb b/app/controllers/followups_controller.rb index f558eb7fc0..463db9601d 100644 --- a/app/controllers/followups_controller.rb +++ b/app/controllers/followups_controller.rb @@ -33,9 +33,7 @@ def create def preview @outgoing_message.info_request = @info_request - if @outgoing_message.what_doing == 'internal_review' - @internal_review = true - end + @internal_review = true if @outgoing_message.what_doing == 'internal_review' unless @outgoing_message.valid? render :action => 'new' return @@ -54,9 +52,7 @@ def check_can_followup def set_internal_review @internal_review = false - if params[:internal_review] - @internal_review = true - end + @internal_review = true if params[:internal_review] end def check_reedit diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index dfa30f67ea..c06a8229c8 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -101,9 +101,7 @@ def search @sort_postfix = combined.pop @sortby = @sort_postfix end - if !params[:view].nil? - combined += [params[:view]] - end + combined += [params[:view]] if !params[:view].nil? if combined.size > 0 && (['bodies', 'requests', 'users', 'all'].include?(combined[-1])) @variety_postfix = combined.pop case @variety_postfix @@ -124,9 +122,7 @@ def search end end @query = combined.join("/") - if params[:query].nil? - params[:query] = @query - end + params[:query] = @query if params[:query].nil? if @variety_postfix != "all" && @requests @query = InfoRequestEvent.make_query_from_params(params) end diff --git a/app/controllers/info_request_batch_controller.rb b/app/controllers/info_request_batch_controller.rb index e68396fe55..c06aee89a9 100644 --- a/app/controllers/info_request_batch_controller.rb +++ b/app/controllers/info_request_batch_controller.rb @@ -20,9 +20,7 @@ def show def load_and_authorise_resource @info_request_batch = InfoRequestBatch.find(params[:id]) - if cannot?(:read, @info_request_batch) - raise ActiveRecord::RecordNotFound - end + raise ActiveRecord::RecordNotFound if cannot?(:read, @info_request_batch) end def redirect_embargoed_requests_for_pro_users diff --git a/app/controllers/password_changes_controller.rb b/app/controllers/password_changes_controller.rb index 1e3f1b3e6a..7bf4e8972a 100644 --- a/app/controllers/password_changes_controller.rb +++ b/app/controllers/password_changes_controller.rb @@ -69,9 +69,7 @@ def edit end def update - if @pretoken - @pretoken_redirect = PostRedirect.find_by(:token => @pretoken) - end + @pretoken_redirect = PostRedirect.find_by(:token => @pretoken) if @pretoken if @password_change_user @password_change_user.password = params[:password_change_user][:password] diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb index c51a55aa68..754a0561c7 100644 --- a/app/controllers/public_body_controller.rb +++ b/app/controllers/public_body_controller.rb @@ -77,9 +77,7 @@ def show @track_thing = TrackThing.create_track_for_public_body(@public_body) - if @user - @existing_track = TrackThing.find_existing(@user, @track_thing) - end + @existing_track = TrackThing.find_existing(@user, @track_thing) if @user @follower_count = TrackThing.where(:public_body_id => @public_body.id).count diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index a7808eec1f..82de89a3cc 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -49,9 +49,7 @@ def show medium_cache AlaveteliLocalization.with_locale(locale) do # Test for whole request being hidden - if cannot?(:read, @info_request) - return render_hidden - end + return render_hidden if cannot?(:read, @info_request) # Always show the pro livery if a request is embargoed. This makes it # clear to admins and ex-pro users that the `InfoRequest` is still @@ -107,9 +105,7 @@ def show def details long_cache @info_request = InfoRequest.find_by_url_title!(params[:url_title]) - if cannot?(:read, @info_request) - return render_hidden - end + return render_hidden if cannot?(:read, @info_request) @columns = ['id', 'event_type', 'created_at', @@ -130,9 +126,7 @@ def similar end @info_request = InfoRequest.find_by_url_title!(params[:url_title]) - if cannot?(:read, @info_request) - return render_hidden - end + return render_hidden if cannot?(:read, @info_request) @xapian_object = ActsAsXapian::Similar.new([InfoRequestEvent], @info_request.info_request_events, :offset => (@page - 1) * @per_page, @@ -145,7 +139,9 @@ def similar def list medium_cache @view = params[:view] - @page = get_search_page_from_params if !@page # used in cache case, as perform_search sets @page as side effect + if !@page # used in cache case, as perform_search sets @page as side effect + @page = get_search_page_from_params + end @per_page = PER_PAGE @max_results = MAX_RESULTS if @view == "recent" @@ -169,9 +165,7 @@ def list @feed_autodetect = [ { :url => do_track_url(@track_thing, 'feed'), :title => @track_thing.params[:title_in_rss], :has_json => true } ] # Don't let robots go more than 20 pages in - if @page > 20 - @no_crawl = true - end + @no_crawl = true if @page > 20 end # Page new form posts to @@ -258,9 +252,7 @@ def new end # Show preview page, if it is a preview - if params[:preview].to_i == 1 - return render_new_preview - end + return render_new_preview if params[:preview].to_i == 1 if user_exceeded_limit render :template => 'user/rate_limited' @@ -443,9 +435,7 @@ def download_entire_request @info_request = InfoRequest.find_by_url_title!(params[:url_title]) # Check for access and hide emargoed requests immediately, so that we # don't leak any info to people who can't access them - if @info_request.embargo && cannot?(:read, @info_request) - render_hidden - end + render_hidden if @info_request.embargo && cannot?(:read, @info_request) if !authenticated? ask_to_login( web: _('To download the zip file'), @@ -458,9 +448,7 @@ def download_entire_request ) else # Test for whole request being hidden or requester-only - if cannot?(:read, @info_request) - return render_hidden - end + return render_hidden if cannot?(:read, @info_request) cache_file_path = @info_request.make_zip_cache_path(@user) if !File.exist?(cache_file_path) FileUtils.mkdir_p(File.dirname(cache_file_path)) @@ -625,7 +613,9 @@ def render_new_compose PublicBody.find(params[:url_name]).id else public_body = PublicBody.find_by_url_name_with_historic(params[:url_name]) - raise ActiveRecord::RecordNotFound.new("None found") if public_body.nil? # TODO: proper 404 + if public_body.nil? # TODO: proper 404 + raise ActiveRecord::RecordNotFound.new("None found") + end public_body.id end elsif params[:public_body_id] @@ -657,7 +647,9 @@ def render_new_compose end message_params[:outgoing_message][:body] ||= params[:body] if params[:body] - message_params[:outgoing_message][:default_letter] ||= params[:default_letter] if params[:default_letter] + if params[:default_letter] + message_params[:outgoing_message][:default_letter] ||= params[:default_letter] + end message_params = ActionController::Parameters.new(message_params) permitted = message_params. @@ -717,9 +709,7 @@ def redirect_numeric_id_to_url_title @info_request = InfoRequest.find(params[:url_title].to_i) # We don't want to leak the title of embargoed or hidden requests, so # don't even redirect on if the user can't access the request - if cannot?(:read, @info_request) - return render_hidden - end + return render_hidden if cannot?(:read, @info_request) redirect_to request_url(@info_request, :format => params[:format]) end end @@ -742,9 +732,7 @@ def redirect_public_requests_from_pro_context # page, so that pro's seem them in that context after they publish them if feature_enabled?(:alaveteli_pro) && params[:pro] == "1" @info_request = InfoRequest.find_by_url_title!(params[:url_title]) - unless @info_request.embargo - redirect_to request_url(@info_request) - end + redirect_to request_url(@info_request) unless @info_request.embargo end end diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index a78de197f7..9b3101c4cd 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -94,8 +94,12 @@ def wall @xapian_comments = nil end - feed_results += @xapian_requests.results.map { |x| x[:model] } if @xapian_requests - feed_results += @xapian_comments.results.map { |x| x[:model] } if @xapian_comments + if @xapian_requests + feed_results += @xapian_requests.results.map { |x| x[:model] } + end + if @xapian_comments + feed_results += @xapian_comments.results.map { |x| x[:model] } + end # All tracks for the user if @is_you @@ -360,9 +364,7 @@ def clear_profile_photo return end - if @user.profile_photo - @user.profile_photo.destroy - end + @user.profile_photo.destroy if @user.profile_photo flash[:notice] = _("You've now cleared your profile photo") redirect_to user_url(@user) diff --git a/app/controllers/widgets_controller.rb b/app/controllers/widgets_controller.rb index 0ecf035e5d..a7c4cc700d 100644 --- a/app/controllers/widgets_controller.rb +++ b/app/controllers/widgets_controller.rb @@ -17,9 +17,7 @@ def show @user_owns_request = @info_request.user && @info_request.user == @user @existing_track = - if @user - TrackThing.find_existing(@user, @track_thing) - end + (TrackThing.find_existing(@user, @track_thing) if @user) @existing_vote = unless @existing_track diff --git a/app/helpers/highlight_helper.rb b/app/helpers/highlight_helper.rb index fbaabbbb2a..da0ed3539b 100644 --- a/app/helpers/highlight_helper.rb +++ b/app/helpers/highlight_helper.rb @@ -5,7 +5,9 @@ module HighlightHelper # the phrases parameter. # https://github.com/rails/rails/pull/11793 def highlight_matches(text, phrases, options = {}) - text = ActionController::Base.helpers.sanitize(text).try(:html_safe) if options.fetch(:sanitize, true) + if options.fetch(:sanitize, true) + text = ActionController::Base.helpers.sanitize(text).try(:html_safe) + end if text.blank? || phrases.blank? text @@ -34,9 +36,7 @@ def highlight_words(t, words, html = true) def highlight_and_excerpt(t, words, excount, html = true) newt = excerpt(t, words[0], :radius => excount) - if not newt - newt = excerpt(t, '', :radius => excount) - end + newt = excerpt(t, '', :radius => excount) if not newt t = newt t = highlight_words(t, words, html) return t diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb index 4c1c1cb08b..64ac95ad70 100755 --- a/app/helpers/link_to_helper.rb +++ b/app/helpers/link_to_helper.rb @@ -240,9 +240,7 @@ def search_url(query, options = nil) :action => 'search', :combined => query, :view => nil} - if !options.nil? - routing_info = options.merge(routing_info) - end + routing_info = options.merge(routing_info) if !options.nil? if routing_info.kind_of?(Hash) routing_info = ActionController::Parameters.new(routing_info) diff --git a/app/mailers/request_mailer.rb b/app/mailers/request_mailer.rb index 0bc77ab2ea..d995eb6b93 100644 --- a/app/mailers/request_mailer.rb +++ b/app/mailers/request_mailer.rb @@ -250,9 +250,7 @@ def receive(email, raw_email, source = :mailin) _("Could not identify the request from the email address") request = InfoRequest.holding_pen_request - unless SpamAddress.spam?(email.to) - request.receive(email, raw_email, opts) - end + request.receive(email, raw_email, opts) unless SpamAddress.spam?(email.to) return end diff --git a/app/mailers/track_mailer.rb b/app/mailers/track_mailer.rb index 299feaa957..37f682dedd 100644 --- a/app/mailers/track_mailer.rb +++ b/app/mailers/track_mailer.rb @@ -85,9 +85,15 @@ def self.alert_tracks raise "need to add other types to TrackMailer.alert_tracks (unalerted)" end - next if track_thing.created_at >= result[:model].described_at # made before the track was created - next if result[:model].described_at < one_week_ago # older than 1 week (see 14 days / 7 days in comment above) - next if done_info_request_events.include?(result[:model].id) # definitely already done + if track_thing.created_at >= result[:model].described_at # made before the track was created + next + end + if result[:model].described_at < one_week_ago # older than 1 week (see 14 days / 7 days in comment above) + next + end + if done_info_request_events.include?(result[:model].id) # definitely already done + next + end # OK alert this one alert_results.push(result) diff --git a/app/models/ability.rb b/app/models/ability.rb index 0f3f18bd7e..7ef1689933 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -208,13 +208,9 @@ def initialize(user, project: nil, public_token: false) end if feature_enabled? :alaveteli_pro - if user && user.is_pro_admin? - can :read, :api_key - end + can :read, :api_key if user && user.is_pro_admin? else - if user && user.is_admin? - can :read, :api_key - end + can :read, :api_key if user && user.is_admin? end if feature_enabled? :projects diff --git a/app/models/alaveteli_pro/draft_info_request_batch.rb b/app/models/alaveteli_pro/draft_info_request_batch.rb index 2943fc7819..9c14e28e25 100644 --- a/app/models/alaveteli_pro/draft_info_request_batch.rb +++ b/app/models/alaveteli_pro/draft_info_request_batch.rb @@ -37,9 +37,7 @@ def set_default_body template_options = {} template_options[:info_request_title] = title if title self.body = template.body(template_options) - if self.user - self.body += self.user.name - end + self.body += self.user.name if self.user end end diff --git a/app/models/alaveteli_pro/embargo.rb b/app/models/alaveteli_pro/embargo.rb index 2bad2bc23b..e40124e470 100644 --- a/app/models/alaveteli_pro/embargo.rb +++ b/app/models/alaveteli_pro/embargo.rb @@ -131,9 +131,7 @@ def self.log_expiring_events { event_created_at: Time.zone.now }, created_at: embargo.expiring_notification_at ) - if info_request.use_notifications? - info_request.user.notify(event) - end + info_request.user.notify(event) if info_request.use_notifications? end end @@ -144,9 +142,7 @@ def add_set_embargo_event yield if publish_at_changed params = { :embargo_id => self.id } - if extension - params[:embargo_extension_id] = extension.id - end + params[:embargo_extension_id] = extension.id if extension info_request.log_event('set_embargo', params) end end diff --git a/app/models/concerns/public_body_derived_fields.rb b/app/models/concerns/public_body_derived_fields.rb index 0566c0da62..a24bc147aa 100644 --- a/app/models/concerns/public_body_derived_fields.rb +++ b/app/models/concerns/public_body_derived_fields.rb @@ -32,9 +32,7 @@ def set_first_letter unless name.blank? # we use a regex to ensure it works with utf-8/multi-byte new_first_letter = name.scan(/^./mu)[0]&.upcase - if new_first_letter != first_letter - self.first_letter = new_first_letter - end + self.first_letter = new_first_letter if new_first_letter != first_letter end end diff --git a/app/models/foi_attachment.rb b/app/models/foi_attachment.rb index aa8edfaa7e..d9586628e7 100644 --- a/app/models/foi_attachment.rb +++ b/app/models/foi_attachment.rb @@ -158,9 +158,7 @@ def extra_note # For delivery status notification attachments, extract the status and # look up what it means in the DSN table. if @content_type == 'message/delivery-status' - if !@body.match(/Status:\s+([0-9]+\.([0-9]+\.[0-9]+))\s+/) - return "" - end + return "" if !@body.match(/Status:\s+([0-9]+\.([0-9]+\.[0-9]+))\s+/) dsn = $1 dsn_part = 'X.' + $2 @@ -214,9 +212,7 @@ def display_filename def ensure_filename! if self.filename.blank? calc_ext = AlaveteliFileTypes.mimetype_to_extension(self.content_type) - if !calc_ext - calc_ext = "bin" - end + calc_ext = "bin" if !calc_ext if !self.within_rfc822_subject.nil? computed = self.within_rfc822_subject + "." + calc_ext else diff --git a/app/models/holiday_import.rb b/app/models/holiday_import.rb index 3e2d739f66..d7e5a8d14e 100644 --- a/app/models/holiday_import.rb +++ b/app/models/holiday_import.rb @@ -60,7 +60,9 @@ def holidays private def all_holidays_valid - errors.add(:base, 'These holidays could not be imported') unless holidays.all?(&:valid?) + unless holidays.all?(&:valid?) + errors.add(:base, 'These holidays could not be imported') + end end def populate_from_ical_feed diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 1287273ceb..dd6b19fb81 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -95,9 +95,7 @@ def parse_raw_email!(force = nil) # The following fields may be absent; we treat them as cached # values in case we want to regenerate them (due to mail # parsing bugs, etc). - if self.raw_email.nil? - raise "Incoming message id=#{id} has no raw_email" - end + raise "Incoming message id=#{id} has no raw_email" if self.raw_email.nil? if (!force.nil? || self.last_parsed.nil?) ActiveRecord::Base.transaction do extract_attachments @@ -363,15 +361,11 @@ def _cache_main_body_text # (marked with FOLDED_QUOTED_SECTION) # TODO: returns a .dup of the text, so calling functions can in place modify it def get_main_body_text_folded - if self.cached_main_body_text_folded.nil? - self._cache_main_body_text - end + self._cache_main_body_text if self.cached_main_body_text_folded.nil? return self.cached_main_body_text_folded end def get_main_body_text_unfolded - if self.cached_main_body_text_unfolded.nil? - self._cache_main_body_text - end + self._cache_main_body_text if self.cached_main_body_text_unfolded.nil? return self.cached_main_body_text_unfolded end # Returns body text from main text part of email, converted to UTF-8 @@ -432,9 +426,7 @@ def get_main_body_text_part(leaves=[]) # Otherwise first part which is any sort of text leaves.each do |p| - if p.content_type.match(/^text/) - return p - end + return p if p.content_type.match(/^text/) end # ... or if none, consider first part @@ -540,9 +532,7 @@ def get_body_for_html_display(collapse_quoted_sections = true) # links, without escaping them. Rather than using some proper parser # making a tree structure (I don't know of one that is to hand, that # works well in this kind of situation, such as with regexps). - if collapse_quoted_sections - text = folded_quoted_text - end + text = folded_quoted_text if collapse_quoted_sections text = MySociety::Format.simplify_angle_bracketed_urls(text) text = CGI.escapeHTML(text) text = MySociety::Format.make_clickable(text, :contract => 1) @@ -651,7 +641,9 @@ def recently_arrived def self.find_all_unknown_mime_types IncomingMessage.find_each do |incoming_message| for attachment in incoming_message.get_attachments_for_display - raise "internal error incoming_message " + incoming_message.id.to_s if attachment.content_type.nil? + if attachment.content_type.nil? + raise "internal error incoming_message " + incoming_message.id.to_s + end if AlaveteliFileTypes.mimetype_to_extension(attachment.content_type).nil? $stderr.puts "Unknown type for /request/" + incoming_message.info_request.id.to_s + "#incoming-"+incoming_message.id.to_s $stderr.puts " " + attachment.filename.to_s + " " + attachment.content_type.to_s @@ -668,7 +660,9 @@ def get_present_file_extensions ret = {} for attachment in self.get_attachments_for_display ext = AlaveteliFileTypes.mimetype_to_extension(attachment.content_type) - ext = File.extname(attachment.filename).gsub(/^[.]/, "") if ext.nil? && !attachment.filename.nil? + if ext.nil? && !attachment.filename.nil? + ext = File.extname(attachment.filename).gsub(/^[.]/, "") + end ret[ext] = 1 if !ext.nil? end return ret.keys.join(" ") diff --git a/app/models/info_request.rb b/app/models/info_request.rb index d54b029f82..4f2f9b7e59 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -242,9 +242,7 @@ def self.custom_states_loaded def self.guess_by_incoming_email(*emails) guesses = emails.flatten.reduce([]) do |memo, email| id, idhash = _extract_id_hash_from_email(email) - if idhash.nil? || id.nil? - id, idhash = _guess_idhash_from_email(email) - end + id, idhash = _guess_idhash_from_email(email) if idhash.nil? || id.nil? memo << Guess.new(find_by_id(id), email, :id) memo << Guess.new(find_by_idhash(idhash), email, :idhash) end @@ -265,9 +263,7 @@ def self._guess_idhash_from_email(incoming_email) # try to grab the last 8 chars of the local part of the address instead local_part = incoming_email[0..incoming_email.index('@')-1] id_hash = - if local_part.length >= 8 - _clean_idhash(local_part[-8..-1]) - end + (_clean_idhash(local_part[-8..-1]) if local_part.length >= 8) end [id, id_hash] @@ -481,7 +477,9 @@ def self.hash_from_id(id) # Used to find when event last changed def self.last_event_time_clause(event_type=nil, join_table=nil, join_clause=nil) event_type_clause = '' - event_type_clause = " AND info_request_events.event_type = '#{event_type}'" if event_type + if event_type + event_type_clause = " AND info_request_events.event_type = '#{event_type}'" + end tables = ['info_request_events'] tables << join_table if join_table join_clause = "AND #{join_clause}" if join_clause @@ -681,9 +679,7 @@ def self.log_overdue_event_type(event_type) { event_created_at: Time.zone.now }, created_at: created_at ) - if info_request.use_notifications? - info_request.user.notify(event) - end + info_request.user.notify(event) if info_request.use_notifications? end end @@ -739,8 +735,12 @@ def must_be_internal_or_external # We must permit user_id and external_user_name both to be nil, because the system # allows a request to be created by a non-logged-in user. if user_id - errors.add(:external_user_name, "must be null for an internal request") unless external_user_name.nil? - errors.add(:external_url, "must be null for an internal request") unless external_url.nil? + unless external_user_name.nil? + errors.add(:external_user_name, "must be null for an internal request") + end + unless external_url.nil? + errors.add(:external_url, "must be null for an internal request") + end end end @@ -826,9 +826,7 @@ def update_last_public_response_at # Needed for legacy reasons, even though we call strip_attributes now def title _title = read_attribute(:title) - if _title - _title.strip! - end + _title.strip! if _title _title end @@ -877,14 +875,10 @@ def find_existing_outgoing_message(body) # Has this email already been received here? Based just on message id. def already_received?(email, raw_email_data) message_id = email.message_id - if message_id.nil? - raise "No message id for this message" - end + raise "No message id for this message" if message_id.nil? for im in incoming_messages - if message_id == im.message_id - return true - end + return true if message_id == im.message_id end false @@ -1051,9 +1045,7 @@ def calculate_event_states for event in info_request_events.reverse event.xapian_mark_needs_index # we need to reindex all events in order to update their latest_* terms if curr_state.nil? - if event.described_state - curr_state = event.described_state - end + curr_state = event.described_state if event.described_state end if curr_state && event.event_type == 'response' @@ -1264,7 +1256,9 @@ def get_last_public_response_event end def get_last_public_response - get_last_public_response_event.incoming_message if get_last_public_response_event + if get_last_public_response_event + get_last_public_response_event.incoming_message + end end def public_outgoing_events @@ -1316,9 +1310,7 @@ def get_previous_email_sent_to(info_request_event) last_email = nil for e in info_request_events if ((info_request_event.is_sent_sort? && e.is_sent_sort?) || (info_request_event.is_followup_sort? && e.is_followup_sort?)) && e.outgoing_message_id == info_request_event.outgoing_message_id - if e.id == info_request_event.id - break - end + break if e.id == info_request_event.id last_email = e.params[:email] end end @@ -1449,9 +1441,7 @@ def who_can_followup_to(skip_message = nil) end end for incoming_message in incoming_messages.reverse - if incoming_message == skip_message - next - end + next if incoming_message == skip_message incoming_message.safe_from_name next if ! incoming_message.is_public? @@ -1476,9 +1466,7 @@ def who_can_followup_to(skip_message = nil) # Get the list of censor rules that apply to this request def applicable_censor_rules applicable_rules = [censor_rules, CensorRule.global] - unless public_body.blank? - applicable_rules << public_body.censor_rules - end + applicable_rules << public_body.censor_rules unless public_body.blank? applicable_rules << user.censor_rules if user applicable_rules.flatten end @@ -1863,9 +1851,7 @@ def index_of_last_described_event def set_defaults begin - if described_state.nil? - self.described_state = 'waiting_response' - end + self.described_state = 'waiting_response' if described_state.nil? rescue ActiveModel::MissingAttributeError # this should only happen on Model.exists? call. It can be safely ignored. # See http://www.tatvartha.com/2011/03/activerecordmissingattributeerror-missing-attribute-a-bug-or-a-features/ diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index bbfa169034..73fcad12ef 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -160,17 +160,13 @@ def request def latest_variety sibling_events(:reverse => true).each do |event| - unless event.variety.blank? - return event.variety - end + return event.variety unless event.variety.blank? end end def latest_status sibling_events(:reverse => true).each do |event| - unless event.calculated_state.blank? - return event.calculated_state - end + return event.calculated_state unless event.calculated_state.blank? end end @@ -206,9 +202,7 @@ def incoming_message_selective_columns(fields) where('info_request_events.id = ?', id) message = message[0] - if message - message.info_request = InfoRequest.find(message.info_request_id) - end + message.info_request = InfoRequest.find(message.info_request_id) if message message end @@ -285,18 +279,14 @@ def request_public_body_tags def indexed_by_search? if ['sent', 'followup_sent', 'response', 'comment'].include?(event_type) - if !info_request.indexed_by_search? - return false - end + return false if !info_request.indexed_by_search? if event_type == 'response' && !incoming_message.indexed_by_search? return false end if ['sent', 'followup_sent'].include?(event_type) && !outgoing_message.indexed_by_search? return false end - if event_type == 'comment' && !comment.visible - return false - end + return false if event_type == 'comment' && !comment.visible return true end false @@ -325,9 +315,7 @@ def params=(new_params) if params[:outgoing_message] self.outgoing_message = params[:outgoing_message] end - if params[:comment] - self.comment = params[:comment] - end + self.comment = params[:comment] if params[:comment] end # A hash to lazy load Global ID reference models @@ -402,9 +390,7 @@ def is_clarification? waiting_clarification = true break end - if event.event_type == 'followup_sent' - break - end + break if event.event_type == 'followup_sent' end waiting_clarification && event_type == 'followup_sent' end @@ -413,9 +399,7 @@ def is_clarification? # on the request and resets them if so def recheck_due_dates subsequent_events.each do |event| - if event.resets_due_dates? - info_request.set_due_dates(event) - end + info_request.set_due_dates(event) if event.resets_due_dates? end end @@ -429,12 +413,8 @@ def display_status if is_outgoing_message? status = calculated_state if status - if status == 'internal_review' - return _("Internal review request") - end - if status == 'waiting_response' - return _("Clarification") - end + return _("Internal review request") if status == 'internal_review' + return _("Clarification") if status == 'waiting_response' raise _("unknown status {{status}}", :status => status) end # TRANSLATORS: "Follow up" in this context means a further @@ -479,12 +459,8 @@ def update_request def same_email_as_previous_send? prev_addr = info_request.get_previous_email_sent_to(self) curr_addr = params[:email] - if prev_addr.nil? && curr_addr.nil? - return true - end - if prev_addr.nil? || curr_addr.nil? - return false - end + return true if prev_addr.nil? && curr_addr.nil? + return false if prev_addr.nil? || curr_addr.nil? MailHandler.address_from_string(prev_addr) == MailHandler.address_from_string(curr_addr) end diff --git a/app/models/mail_server_log.rb b/app/models/mail_server_log.rb index 580b7b6915..74b2c0e83f 100644 --- a/app/models/mail_server_log.rb +++ b/app/models/mail_server_log.rb @@ -40,7 +40,9 @@ def self.load_file(file_name) file_name_db = is_gz ? file_name.gsub(".gz", "") : file_name modified = File.stat(file_name).mtime - raise "MailServerLog.load_file: file not found " + file_name if modified.nil? + if modified.nil? + raise "MailServerLog.load_file: file not found " + file_name + end ActiveRecord::Base.transaction do # see if we already have it diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb index 9bae5237e5..6f42118031 100644 --- a/app/models/outgoing_message.rb +++ b/app/models/outgoing_message.rb @@ -127,9 +127,7 @@ def get_default_message def set_signature_name(name) # We compare against raw_body as body strips linebreaks and applies # censor rules - if raw_body == get_default_message - self.body = get_default_message + name - end + self.body = get_default_message + name if raw_body == get_default_message end # Public: The value to be used in the From: header of an OutgoingMailer @@ -237,7 +235,9 @@ def record_email_delivery(to_addrs, message_id, log_event_type = 'sent') self.status = 'sent' save! - log_event_type = "followup_#{ log_event_type }" if message_type == 'followup' + if message_type == 'followup' + log_event_type = "followup_#{ log_event_type }" + end info_request.log_event( log_event_type, diff --git a/app/models/post_redirect.rb b/app/models/post_redirect.rb index 3cd3c8dc59..2de60a80d4 100644 --- a/app/models/post_redirect.rb +++ b/app/models/post_redirect.rb @@ -93,7 +93,9 @@ def reason_params=(reason_params) def reason_params param_hash = YAML.load(reason_params_yaml) param_hash.each do |key, value| - param_hash[key] = value.force_encoding('UTF-8') if value.respond_to?(:force_encoding) + if value.respond_to?(:force_encoding) + param_hash[key] = value.force_encoding('UTF-8') + end end param_hash end diff --git a/app/models/profile_photo.rb b/app/models/profile_photo.rb index 65559da8c7..ba4621f17c 100644 --- a/app/models/profile_photo.rb +++ b/app/models/profile_photo.rb @@ -49,9 +49,7 @@ def convert_image # draft images are before the user has cropped them if !draft && (image.width != WIDTH || image.height != HEIGHT) # do any exact cropping (taken from Jcrop interface) - if w && h - image.crop("#{ w }x#{ h }+#{ x }+#{ y }") - end + image.crop("#{ w }x#{ h }+#{ x }+#{ y }") if w && h # do any further cropping # resize_to_fill! image.combine_options do |c| @@ -69,9 +67,7 @@ def convert_image altered = true end - if altered - self.data = image.to_blob - end + self.data = image.to_blob if altered end private @@ -103,9 +99,7 @@ def data_and_draft_checks raise "Internal error, draft pictures must not have a user" end - if !draft && !user_id - raise "Internal error, real pictures must have a user" - end + raise "Internal error, real pictures must have a user" if !draft && !user_id end # Convert binary data blob into ImageMagick image when assigned diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 2801fe6c1c..6dfa05bad8 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -298,7 +298,9 @@ def self.find_by_url_name_with_historic(name) # Maybe return the first one, so we show something relevant, # rather than throwing an error? - raise "Two bodies with the same historical URL name: #{name}" if old.size > 1 + if old.size > 1 + raise "Two bodies with the same historical URL name: #{name}" + end return unless old.size == 1 # does acts_as_versioned provide a method that returns the current version? PublicBody.find(old.first) @@ -547,9 +549,7 @@ def self.import_csv_from_file(csv_filename, tag, tag_behaviour, dry_run, editor, end # Rollback if a dry run, or we had errors - if dry_run or errors.size > 0 - raise ImportCSVDryRun - end + raise ImportCSVDryRun if dry_run or errors.size > 0 end rescue ImportCSVDryRun # Ignore @@ -954,12 +954,8 @@ def name_for_search def self.get_public_body_list_translated_condition(table, has_first_letter=false, locale=nil) result = "(upper(#{table}.name) LIKE upper(:query)" \ " OR upper(#{table}.short_name) LIKE upper(:query))" - if has_first_letter - result += " AND #{table}.first_letter = :first_letter" - end - if locale - result += " AND #{table}.locale = :locale" - end + result += " AND #{table}.first_letter = :first_letter" if has_first_letter + result += " AND #{table}.locale = :locale" if locale result end diff --git a/app/models/public_body_category/category_collection.rb b/app/models/public_body_category/category_collection.rb index c8b36a96f7..31adbd82ca 100644 --- a/app/models/public_body_category/category_collection.rb +++ b/app/models/public_body_category/category_collection.rb @@ -47,9 +47,7 @@ def by_heading def headings output = [] @categories.each do |row| - unless row.is_a?(Array) - output << row - end + output << row unless row.is_a?(Array) end output end diff --git a/app/models/public_body_change_request.rb b/app/models/public_body_change_request.rb index ff652a104a..785491442f 100644 --- a/app/models/public_body_change_request.rb +++ b/app/models/public_body_change_request.rb @@ -118,12 +118,8 @@ def send_response(subject, response) def comment_for_public_body comments = ["Requested by: #{get_user_name} (#{get_user_email})"] - if !source_url.blank? - comments << "Source URL: #{source_url}" - end - if !notes.blank? - comments << "Notes: #{notes}" - end + comments << "Source URL: #{source_url}" if !source_url.blank? + comments << "Notes: #{notes}" if !notes.blank? comments.join("\n") end diff --git a/app/models/user.rb b/app/models/user.rb index b827dac824..9234366c52 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -479,7 +479,9 @@ def next_request_permitted_at order(created_at: :desc). limit(AlaveteliConfiguration.max_requests_per_user_per_day) - return nil if n_most_recent_requests.size < AlaveteliConfiguration::max_requests_per_user_per_day + if n_most_recent_requests.size < AlaveteliConfiguration::max_requests_per_user_per_day + return nil + end nth_most_recent_request = n_most_recent_requests[-1] nth_most_recent_request.created_at + 1.day diff --git a/config/boot.rb b/config/boot.rb index 2ef988ccf4..e6a5f1c48d 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -7,6 +7,4 @@ # it exists. Put just a line like this in there: # ENV['RAILS_ENV'] = 'production' rails_env_file = File.expand_path(File.join(File.dirname(__FILE__), 'rails_env.rb')) -if File.exist?(rails_env_file) - require rails_env_file -end +require rails_env_file if File.exist?(rails_env_file) diff --git a/config/initializers/theme_loader.rb b/config/initializers/theme_loader.rb index bd8dc69cdf..ec9b9c4e93 100644 --- a/config/initializers/theme_loader.rb +++ b/config/initializers/theme_loader.rb @@ -28,9 +28,7 @@ def require_theme(theme_name) # By setting this ALAVETELI_TEST_THEME to a theme name, theme tests can run in the Rails # context with the theme loaded. Otherwise the themes from the config aren't loaded in testing # so they don't interfere with core Alaveteli tests - if defined? ALAVETELI_TEST_THEME - require_theme(ALAVETELI_TEST_THEME) - end + require_theme(ALAVETELI_TEST_THEME) if defined? ALAVETELI_TEST_THEME else for url in AlaveteliConfiguration::theme_urls.reverse require_theme theme_url_to_theme_name(url) diff --git a/db/migrate/096_create_translation_tables.rb b/db/migrate/096_create_translation_tables.rb index a07e1cbf1d..c914a6fc6f 100644 --- a/db/migrate/096_create_translation_tables.rb +++ b/db/migrate/096_create_translation_tables.rb @@ -19,9 +19,7 @@ def self.up PublicBody.all.each do |publicbody| publicbody.translated_attributes.each do |a, default| value = publicbody.read_attribute(a) - unless value.nil? - publicbody.send(:"#{a}=", value) - end + publicbody.send(:"#{a}=", value) unless value.nil? end publicbody.save! end diff --git a/db/migrate/20140716131107_create_category_translation_tables.rb b/db/migrate/20140716131107_create_category_translation_tables.rb index f60ec1f3f6..798f40d404 100644 --- a/db/migrate/20140716131107_create_category_translation_tables.rb +++ b/db/migrate/20140716131107_create_category_translation_tables.rb @@ -16,9 +16,7 @@ def up PublicBodyCategory.where(:locale => default_locale).each do |category| category.translated_attributes.each do |a, default| value = category.read_attribute(a) - unless value.nil? - category.send(:"#{a}=", value) - end + category.send(:"#{a}=", value) unless value.nil? end category.save! end @@ -54,9 +52,7 @@ def up PublicBodyHeading.where(:locale => default_locale).each do |heading| heading.translated_attributes.each do |a, default| value = heading.read_attribute(a) - unless value.nil? - heading.send(:"#{a}=", value) - end + heading.send(:"#{a}=", value) unless value.nil? end heading.save! end diff --git a/db/migrate/20170718261524_add_expiring_notification_at.rb b/db/migrate/20170718261524_add_expiring_notification_at.rb index a1390b2b82..c8539aca73 100644 --- a/db/migrate/20170718261524_add_expiring_notification_at.rb +++ b/db/migrate/20170718261524_add_expiring_notification_at.rb @@ -14,9 +14,7 @@ def down private def column_exists?(table, column) - if data_source_exists?(table) - connection.column_exists?(table, column) - end + connection.column_exists?(table, column) if data_source_exists?(table) end def data_source_exists?(table) diff --git a/db/migrate/20170825150448_add_stripe_customer_id_to_pro_account.rb b/db/migrate/20170825150448_add_stripe_customer_id_to_pro_account.rb index 35957da64f..97196e469d 100644 --- a/db/migrate/20170825150448_add_stripe_customer_id_to_pro_account.rb +++ b/db/migrate/20170825150448_add_stripe_customer_id_to_pro_account.rb @@ -14,9 +14,7 @@ def down private def column_exists?(table, column) - if data_source_exists?(table) - connection.column_exists?(table, column) - end + connection.column_exists?(table, column) if data_source_exists?(table) end def data_source_exists?(table) diff --git a/lib/acts_as_xapian/acts_as_xapian.rb b/lib/acts_as_xapian/acts_as_xapian.rb index 610e9ebdc5..34caf8d98a 100644 --- a/lib/acts_as_xapian/acts_as_xapian.rb +++ b/lib/acts_as_xapian/acts_as_xapian.rb @@ -111,7 +111,9 @@ def self.prepare_environment # barf if we can't figure out the environment environment = (ENV['RAILS_ENV'] or Rails.env) - raise "Set RAILS_ENV, so acts_as_xapian can find the right Xapian database" if not environment + if not environment + raise "Set RAILS_ENV, so acts_as_xapian can find the right Xapian database" + end # check for a config file config_file = Rails.root.join("config","xapian.yml") @@ -141,8 +143,12 @@ def self.prepare_environment # TODO: we perhaps don't need to rebuild database and enquire and queryparser - # but db.reopen wasn't enough by itself, so just do everything it's easier. def self.readable_init - raise NoXapianRubyBindingsError.new("Xapian Ruby bindings not installed") unless ActsAsXapian.bindings_available - raise "acts_as_xapian hasn't been called in any models" if @@init_values.empty? + unless ActsAsXapian.bindings_available + raise NoXapianRubyBindingsError.new("Xapian Ruby bindings not installed") + end + if @@init_values.empty? + raise "acts_as_xapian hasn't been called in any models" + end prepare_environment @@ -151,9 +157,7 @@ def self.readable_init # only speculate about at the moment. (It is easy to reproduce this by # changing the code below to use reopen rather than open followed by # close, and running rake spec.) - if !@@db.nil? - @@db.close - end + @@db.close if !@@db.nil? # basic Xapian objects begin @@ -207,7 +211,9 @@ def self.init_query_parser def self.init_values(values) values.each do |method, index, prefix, value_type| - raise "Value index '#{index}' must be an Integer, is #{index.class}" unless index.is_a? Integer + unless index.is_a? Integer + raise "Value index '#{index}' must be an Integer, is #{index.class}" + end if @@values_by_number.include?(index) && @@values_by_number[index] != prefix raise "Already have value index '#{index}' in another model " \ "but with different prefix '#{@@values_by_number[index]}'" @@ -239,9 +245,15 @@ def self.init_values(values) def self.init_terms(terms) terms.each do |method, term_code, prefix| - raise "Use a single capital letter for term code" if not term_code.match(/^[A-Z]$/) - raise "M and I are reserved for use as the model/id term" if term_code == "M" || term_code == "I" - raise "model and modelid are reserved for use as the model/id prefixes" if prefix == "model" || prefix == "modelid" + if not term_code.match(/^[A-Z]$/) + raise "Use a single capital letter for term code" + end + if term_code == "M" || term_code == "I" + raise "M and I are reserved for use as the model/id term" + end + if prefix == "model" || prefix == "modelid" + raise "model and modelid are reserved for use as the model/id prefixes" + end raise "Z is reserved for stemming terms" if term_code == "Z" if @@terms_by_capital.include?(term_code) && @@terms_by_capital[term_code] != prefix raise "Already have code '#{term_code}' in another model but with different prefix " \ @@ -257,8 +269,12 @@ def self.init_terms(terms) end def self.writable_init(suffix = "") - raise NoXapianRubyBindingsError.new("Xapian Ruby bindings not installed") unless ActsAsXapian.bindings_available - raise "acts_as_xapian hasn't been called in any models" if @@init_values.empty? + unless ActsAsXapian.bindings_available + raise NoXapianRubyBindingsError.new("Xapian Ruby bindings not installed") + end + if @@init_values.empty? + raise "acts_as_xapian hasn't been called in any models" + end # if DB is not nil, then we're already initialised, so don't do it # again TODO: reopen it each time, xapian_spec.rb needs this so database @@ -295,9 +311,7 @@ def initialize_db self.runtime = 0.0 ActsAsXapian.readable_init - if ActsAsXapian.db.nil? - raise "ActsAsXapian not initialized" - end + raise "ActsAsXapian not initialized" if ActsAsXapian.db.nil? end MSET_MAX_TRIES = 5 @@ -309,7 +323,9 @@ def initialize_query(options) self.runtime += Benchmark::realtime { offset = options[:offset] || 0; offset = offset.to_i limit = options[:limit] - raise "please specifiy maximum number of results to return with parameter :limit" if not limit + if not limit + raise "please specifiy maximum number of results to return with parameter :limit" + end limit = limit.to_i sort_by_prefix = options[:sort_by_prefix] || nil sort_by_ascending = options[:sort_by_ascending].nil? ? true : options[:sort_by_ascending] @@ -321,14 +337,18 @@ def initialize_query(options) ActsAsXapian.enquire.sort_by_relevance! else value = ActsAsXapian.values_by_prefix[sort_by_prefix] - raise "couldn't find prefix '" + sort_by_prefix.to_s + "'" if value.nil? + if value.nil? + raise "couldn't find prefix '" + sort_by_prefix.to_s + "'" + end ActsAsXapian.enquire.sort_by_value_then_relevance!(value, sort_by_ascending) end if collapse_by_prefix.nil? ActsAsXapian.enquire.collapse_key = Xapian::BAD_VALUENO else value = ActsAsXapian.values_by_prefix[collapse_by_prefix] - raise "couldn't find prefix '" + collapse_by_prefix + "'" if value.nil? + if value.nil? + raise "couldn't find prefix '" + collapse_by_prefix + "'" + end ActsAsXapian.enquire.collapse_key = value end @@ -374,9 +394,7 @@ def has_normal_search_terms? #x = x + term.to_yaml + term.size.to_s + term[0..0] + "*" if term.size >= 2 && term[0..0] == 'Z' # normal terms begin Z (for stemmed), then have no capital letter prefix - if term[1..1] == term[1..1].downcase - ret = true - end + ret = true if term[1..1] == term[1..1].downcase end end return ret @@ -390,18 +408,14 @@ def matches_estimated # Return query string with spelling correction def spelling_correction correction = ActsAsXapian.query_parser.get_corrected_query_string - if correction.empty? - return nil - end + return nil if correction.empty? correction.force_encoding('UTF-8') end # Return array of models found def results # If they've already pulled out the results, just return them. - if !self.cached_results.nil? - return self.cached_results - end + return self.cached_results if !self.cached_results.nil? docs = [] self.runtime += Benchmark::realtime { @@ -476,7 +490,9 @@ def initialize(model_classes, query_string, options = {}, user_query = nil) new_model_classes = [] model_classes = [model_classes] if model_classes.class != Array for model_class in model_classes - raise "pass in the model class itself, or a string containing its name" if model_class.class != Class && model_class.class != String + if model_class.class != Class && model_class.class != String + raise "pass in the model class itself, or a string containing its name" + end model_class = model_class.constantize if model_class.class == String new_model_classes.push(model_class) end @@ -513,11 +529,15 @@ def words_to_highlight(opts = {}) # Reject all prefixes other than Z, which we know is reserved for stems terms = query.terms.reject { |t| t.term.first.match(/^[A-Y]$/) } # Collect the stems including the Z prefix - raw_stems = terms.map { |t| t.term if t.term.start_with?('Z') }.compact.uniq.sort + raw_stems = terms.map { |t| if t.term.start_with?('Z') + t.term + end }.compact.uniq.sort # Collect stems, chopping the Z prefix off stems = raw_stems.map { |t| t[1..-1] }.compact.sort # Collect the non-stem terms - words = terms.map { |t| t.term unless t.term.start_with?('Z') }.compact.sort + words = terms.map { |t| unless t.term.start_with?('Z') + t.term + end }.compact.sort # Add the unstemmed words from the original query # Sometimes stems can be unhelpful with the :regex option, for example @@ -756,7 +776,9 @@ def self.update_index(flush = false, verbose = false) end def self.run_job(job, flush, verbose) - STDOUT.puts("ActsAsXapian.update_index #{job.action} #{job.model} #{job.model_id.to_s} #{Time.now.to_s}") if verbose + if verbose + STDOUT.puts("ActsAsXapian.update_index #{job.action} #{job.model} #{job.model_id.to_s} #{Time.now.to_s}") + end begin if job.action == 'update' @@ -776,9 +798,7 @@ def self.run_job(job, flush, verbose) job.action = 'destroy' retry end - if flush - ActsAsXapian.writable_db.flush - end + ActsAsXapian.writable_db.flush if flush job.destroy end @@ -817,12 +837,12 @@ def self.destroy_and_rebuild_index(model_classes, verbose = false, terms = true, new_path = ActsAsXapian.db_path + ".new" old_path = ActsAsXapian.db_path if File.exist?(new_path) - raise "found existing " + new_path + " which is not Xapian chert or glass database, please delete for me" if not ActsAsXapian._is_xapian_db(new_path) + if not ActsAsXapian._is_xapian_db(new_path) + raise "found existing " + new_path + " which is not Xapian chert or glass database, please delete for me" + end FileUtils.rm_r(new_path) end - if update_existing - FileUtils.cp_r(old_path, new_path) - end + FileUtils.cp_r(old_path, new_path) if update_existing ActsAsXapian.writable_init ActsAsXapian.writable_db.close # just to make an empty one to read # Index everything @@ -833,9 +853,13 @@ def self.destroy_and_rebuild_index(model_classes, verbose = false, terms = true, ActsAsXapian.writable_init # Save time by running the indexing in one go and in-process for model_class in model_classes - STDOUT.puts("ActsAsXapian.destroy_and_rebuild_index: Rebuilding #{model_class.to_s}") if verbose + if verbose + STDOUT.puts("ActsAsXapian.destroy_and_rebuild_index: Rebuilding #{model_class.to_s}") + end model_class.find_each do |model| - STDOUT.puts("ActsAsXapian.destroy_and_rebuild_index #{model_class} #{model.id}") if verbose + if verbose + STDOUT.puts("ActsAsXapian.destroy_and_rebuild_index #{model_class} #{model.id}") + end model.xapian_index(terms, values, texts) end end @@ -847,12 +871,12 @@ def self.destroy_and_rebuild_index(model_classes, verbose = false, terms = true, temp_path = old_path + ".tmp" if File.exist?(temp_path) @@db_path = old_path - raise "temporary database found " + temp_path + " which is not Xapian chert or glass database, please delete for me" if not ActsAsXapian._is_xapian_db(temp_path) + if not ActsAsXapian._is_xapian_db(temp_path) + raise "temporary database found " + temp_path + " which is not Xapian chert or glass database, please delete for me" + end FileUtils.rm_r(temp_path) end - if File.exist?(old_path) - FileUtils.mv old_path, temp_path - end + FileUtils.mv old_path, temp_path if File.exist?(old_path) FileUtils.mv new_path, old_path # Delete old database @@ -883,9 +907,7 @@ def self._destroy_and_rebuild_index_safely(model_classes, verbose, terms, values pid = Process.fork # TODO: this will only work on Unix, tough if pid Process.waitpid(pid) - if not $?.success? - raise "batch fork child failed, exiting also" - end + raise "batch fork child failed, exiting also" if not $?.success? # database connection doesn't survive a fork, rebuild it else # fully reopen the database each time (with a new object) @@ -893,9 +915,13 @@ def self._destroy_and_rebuild_index_safely(model_classes, verbose, terms, values ActiveRecord::Base.establish_connection @@db_path = ActsAsXapian.db_path + ".new" ActsAsXapian.writable_init - STDOUT.puts("ActsAsXapian.destroy_and_rebuild_index: New batch. #{model_class.to_s} from #{i} to #{i + batch_size} of #{model_class_count} pid #{Process.pid.to_s}") if verbose + if verbose + STDOUT.puts("ActsAsXapian.destroy_and_rebuild_index: New batch. #{model_class.to_s} from #{i} to #{i + batch_size} of #{model_class_count} pid #{Process.pid.to_s}") + end model_class.limit(batch_size).offset(i).order(:id).each do |model| - STDOUT.puts("ActsAsXapian.destroy_and_rebuild_index #{model_class} #{model.id}") if verbose + if verbose + STDOUT.puts("ActsAsXapian.destroy_and_rebuild_index #{model_class} #{model.id}") + end model.xapian_index(terms, values, texts) end ActsAsXapian.writable_db.flush @@ -1092,7 +1118,9 @@ def xapian_mark_needs_destroy # Allow reindexing to be skipped if a flag is set def xapian_mark_needs_index_if_reindex - return true if (self.respond_to?(:no_xapian_reindex) && self.no_xapian_reindex == true) + if (self.respond_to?(:no_xapian_reindex) && self.no_xapian_reindex == true) + return true + end xapian_mark_needs_index end @@ -1110,7 +1138,9 @@ def xapian_create_job(action, model, model_id) rescue ActiveRecord::RecordNotUnique => e # Given the error handling in ActsAsXapian::update_index, we can just fail silently if # another process has inserted an acts_as_xapian_jobs record for this model. - raise unless (e.message =~ /duplicate key value violates unique constraint "index_acts_as_xapian_jobs_on_model_and_model_id"/) + unless (e.message =~ /duplicate key value violates unique constraint "index_acts_as_xapian_jobs_on_model_and_model_id"/) + raise + end end end @@ -1127,9 +1157,7 @@ module ActsMethods # See top of this file for docs def acts_as_xapian(options) # Give error only on queries if bindings not available - if not ActsAsXapian.bindings_available - return - end + return if not ActsAsXapian.bindings_available include InstanceMethods diff --git a/lib/acts_as_xapian/tasks/xapian.rake b/lib/acts_as_xapian/tasks/xapian.rake index fee2ccf49d..01e3c0facf 100644 --- a/lib/acts_as_xapian/tasks/xapian.rake +++ b/lib/acts_as_xapian/tasks/xapian.rake @@ -39,7 +39,9 @@ namespace :xapian do return arg end end - raise "specify ALL your models with models=\"ModelName1 ModelName2\" as parameter" if ENV['models'].nil? + if ENV['models'].nil? + raise "specify ALL your models with models=\"ModelName1 ModelName2\" as parameter" + end ActsAsXapian.destroy_and_rebuild_index( ENV['models'].split(" ").map { |m| m.constantize }, coerce_arg(ENV['verbose'], false), @@ -52,7 +54,9 @@ namespace :xapian do # collapse_by_prefix desc 'Run a query, return YAML of results' task :query => :environment do - raise "specify models=\"ModelName1 ModelName2\" as parameter" if ENV['models'].nil? + if ENV['models'].nil? + raise "specify models=\"ModelName1 ModelName2\" as parameter" + end raise "specify query=\"your terms\" as parameter" if ENV['query'].nil? s = ActsAsXapian::Search.new(ENV['models'].split(" ").map { |m| m.constantize }, ENV['query'], diff --git a/lib/alaveteli_external_command.rb b/lib/alaveteli_external_command.rb index 3363d8cd6c..89b9e14b48 100644 --- a/lib/alaveteli_external_command.rb +++ b/lib/alaveteli_external_command.rb @@ -36,9 +36,7 @@ def run(*args) # TODO: calling code should be able to specify error stream - may want to log it or # otherwise act upon it. opts = {} - if !args.empty? && args.last.is_a?(Hash) - opts = args.last - end + opts = args.last if !args.empty? && args.last.is_a?(Hash) program_path = find_program! xc = ExternalCommand.new(program_path, *command_args, *args) diff --git a/lib/alaveteli_file_types.rb b/lib/alaveteli_file_types.rb index 7442702549..1d6d35d612 100644 --- a/lib/alaveteli_file_types.rb +++ b/lib/alaveteli_file_types.rb @@ -38,9 +38,7 @@ def all_extensions def filename_and_content_to_mimetype(filename, content) # Try filename ret = filename_to_mimetype(filename) - if !ret.nil? - return ret - end + return ret if !ret.nil? # Otherwise look inside the file to work out the type. # Mahoro is a Ruby binding for libmagic. @@ -49,29 +47,21 @@ def filename_and_content_to_mimetype(filename, content) mahoro_type.strip! # TODO: we shouldn't have to check empty? here, but Mahoro sometimes returns a blank line :( # e.g. for InfoRequestEvent 17930 - if mahoro_type.nil? || mahoro_type.empty? - return nil - end + return nil if mahoro_type.nil? || mahoro_type.empty? # text/plain types sometimes come with a charset mahoro_type.match(/^(.*);/) - if $1 - mahoro_type = $1 - end + mahoro_type = $1 if $1 # see if looks like a content type, or has something in it that does # and return that # mahoro returns junk "\012- application/msword" as mime type. mahoro_type.match(/([a-z0-9.-]+\/[a-z0-9.-]+)/) - if $1 - return $1 - end + return $1 if $1 # otherwise we got junk back from mahoro return nil end def filename_to_mimetype(filename) - if !filename - return nil - end + return nil if !filename if filename.match(/\.([^.]+)$/i) lext = $1.downcase if FileExtensionToMimeType.include?(lext) diff --git a/lib/alaveteli_mail_poller.rb b/lib/alaveteli_mail_poller.rb index dc7b0cb64d..27a1f4f984 100644 --- a/lib/alaveteli_mail_poller.rb +++ b/lib/alaveteli_mail_poller.rb @@ -113,13 +113,9 @@ def start(&block) yield pop3 rescue StandardError => error - if send_exception_notifications? - ExceptionNotifier.notify_exception(error) - end + ExceptionNotifier.notify_exception(error) if send_exception_notifications? ensure - if defined?(pop3) && pop3 && pop3.started? - pop3.finish - end + pop3.finish if defined?(pop3) && pop3 && pop3.started? end def default_pop3 diff --git a/lib/attachment_to_html.rb b/lib/attachment_to_html.rb index 34164e9bdb..928eb56aaa 100644 --- a/lib/attachment_to_html.rb +++ b/lib/attachment_to_html.rb @@ -17,7 +17,9 @@ def to_html(attachment, opts = {}) end view = View.new(adapter) - view.wrapper = 'wrapper_google_embed' if adapter.is_a?(Adapters::GoogleDocsViewer) + if adapter.is_a?(Adapters::GoogleDocsViewer) + view.wrapper = 'wrapper_google_embed' + end view.render do opts.fetch(:content_for, []).each do |k,v| diff --git a/lib/attachment_to_html/adapters/rtf.rb b/lib/attachment_to_html/adapters/rtf.rb index 0657133b3b..0d98a1b19d 100644 --- a/lib/attachment_to_html/adapters/rtf.rb +++ b/lib/attachment_to_html/adapters/rtf.rb @@ -55,9 +55,7 @@ def sanitize_converted(html) invalid = %Q() valid = %Q(") - if html.include?(invalid) - html.sub!(invalid, valid) - end + html.sub!(invalid, valid) if html.include?(invalid) html end end diff --git a/lib/confidence_intervals.rb b/lib/confidence_intervals.rb index b482897c0c..a0b06a72cd 100644 --- a/lib/confidence_intervals.rb +++ b/lib/confidence_intervals.rb @@ -19,9 +19,7 @@ require 'statistics2' def ci_bounds(successes, total, power) - if total == 0 - raise RuntimeError, "Can't calculate the CI for 0 observations" - end + raise RuntimeError, "Can't calculate the CI for 0 observations" if total == 0 z = Statistics2.pnormaldist(1 - power/2) phat = successes.to_f/total offset = z*Math.sqrt((phat*(1 - phat) + z*z/(4*total))/total) diff --git a/lib/mail_handler.rb b/lib/mail_handler.rb index 397e3fa05f..218bdae694 100644 --- a/lib/mail_handler.rb +++ b/lib/mail_handler.rb @@ -20,9 +20,7 @@ def tnef_attachments(content) IO.popen("tnef -K -C #{dir} 2> /dev/null", "wb") do |f| f.write(content) f.close - if $?.signaled? - raise IOError, "tnef exited with signal #{$?.termsig}" - end + raise IOError, "tnef exited with signal #{$?.termsig}" if $?.signaled? if $?.exited? && $?.exitstatus != 0 raise TNEFParsingError, "tnef exited with status #{$?.exitstatus}" end @@ -36,9 +34,7 @@ def tnef_attachments(content) found += 1 end end - if found == 0 - raise TNEFParsingError, "tnef produced no attachments" - end + raise TNEFParsingError, "tnef produced no attachments" if found == 0 end attachments end diff --git a/lib/mail_handler/backends/mail_backend.rb b/lib/mail_handler/backends/mail_backend.rb index fd00e1eabf..98581ee9e1 100644 --- a/lib/mail_handler/backends/mail_backend.rb +++ b/lib/mail_handler/backends/mail_backend.rb @@ -66,9 +66,7 @@ def mail_from_outlook(content) def get_subject(mail) subject = mail.subject - if subject - convert_string_to_utf8(subject).string - end + convert_string_to_utf8(subject).string if subject end def get_within_rfc822_subject(leaf) @@ -252,17 +250,13 @@ def expand_and_normalize_parts(part, parent_mail) part_body = get_part_body(part) calc_mime = AlaveteliFileTypes.filename_and_content_to_mimetype(part_filename, part_body) - if calc_mime - part.content_type = calc_mime - end + part.content_type = calc_mime if calc_mime end # Use standard content types for Word documents etc. part.content_type = normalise_content_type(get_content_type(part)) decode_attached_part(part, parent_mail) - if original_charset - part.charset = original_charset - end + part.charset = original_charset if original_charset end end @@ -285,9 +279,7 @@ def count_parts(part, parent_mail) # Choose the best part from alternatives def choose_best_alternative(mail) - if mail.parts.any?(&:multipart?) - return mail.parts.detect(&:multipart?) - end + return mail.parts.detect(&:multipart?) if mail.parts.any?(&:multipart?) if mail.html_part return mail.html_part elsif mail.text_part @@ -397,9 +389,7 @@ def address_from_name_and_email(name, email) if !MySociety::Validate.is_valid_email(email) raise "invalid email " + email + " passed to address_from_name_and_email" end - if name.nil? - return Mail::Address.new(email.dup).to_s - end + return Mail::Address.new(email.dup).to_s if name.nil? address = Mail::Address.new address.display_name = name.dup address.address = email.dup diff --git a/lib/mail_handler/reply_handler.rb b/lib/mail_handler/reply_handler.rb index e9137bac51..5161baebb8 100644 --- a/lib/mail_handler/reply_handler.rb +++ b/lib/mail_handler/reply_handler.rb @@ -64,32 +64,18 @@ def self.is_oof?(message) subject = MailHandler.get_header_string("Subject", message).downcase if MailHandler.empty_return_path?(message) - if subject.start_with? "out of office: " - return true - end - if subject.start_with? "automatic reply: " - return true - end + return true if subject.start_with? "out of office: " + return true if subject.start_with? "automatic reply: " end if MailHandler.get_header_string("Auto-Submitted", message) == "auto-generated" - if subject =~ /out of( the)? office/ - return true - end + return true if subject =~ /out of( the)? office/ end - if subject.start_with? "out of office autoreply:" - return true - end - if subject == "out of office" - return true - end - if subject == "out of office reply" - return true - end - if subject.end_with? "is out of the office" - return true - end + return true if subject.start_with? "out of office autoreply:" + return true if subject == "out of office" + return true if subject == "out of office reply" + return true if subject.end_with? "is out of the office" return false end diff --git a/lib/memory_profiler.rb b/lib/memory_profiler.rb index a8e0267368..b418a777f4 100644 --- a/lib/memory_profiler.rb +++ b/lib/memory_profiler.rb @@ -35,9 +35,7 @@ def self.start(opt={}) ObjectSpace.each_object do |o| curr[o.class] += 1 #Marshal.dump(o).size rescue 1 - if opt[:string_debug] and o.class == String - curr_strings.push o - end + curr_strings.push o if opt[:string_debug] and o.class == String end if opt[:string_debug] diff --git a/lib/routing_filters.rb b/lib/routing_filters.rb index a875166de9..0a5f4f2458 100644 --- a/lib/routing_filters.rb +++ b/lib/routing_filters.rb @@ -13,11 +13,18 @@ def prepend_locale?(locale) # what FastGettext and other POSIX-based systems use, and will # look like `en_US` def around_generate(*args, &block) - params = args.extract_options! # this is because we might get a call like forum_topics_path(forum, topic, :locale => :en) - - locale = params.delete(:locale) # extract the passed :locale option - locale = AlaveteliLocalization.locale if locale.nil? # default to underscore locale when locale is nil (could also be false) - locale = nil unless valid_locale?(locale) # reset to no locale when locale is not valid + # this is because we might get a call like forum_topics_path(forum, topic, :locale => :en) + params = args.extract_options! + # extract the passed :locale option + locale = params.delete(:locale) + if locale.nil? + # default to underscore locale when locale is nil (could also be false) + locale = AlaveteliLocalization.locale + end + unless valid_locale?(locale) + # reset to no locale when locale is not valid + locale = nil + end args << params yield.tap do |result| diff --git a/lib/tasks/cleanup.rake b/lib/tasks/cleanup.rake index 0e1ad91044..9b85695c3f 100644 --- a/lib/tasks/cleanup.rake +++ b/lib/tasks/cleanup.rake @@ -3,17 +3,13 @@ namespace :cleanup do desc 'Clean up all message redelivery and destroy actions from the holding pen to make admin actions there faster' task :holding_pen => :environment do dryrun = ENV['DRYRUN'] != '0' if ENV['DRYRUN'] - if dryrun - $stderr.puts "This is a dryrun - nothing will be deleted" - end + $stderr.puts "This is a dryrun - nothing will be deleted" if dryrun holding_pen = InfoRequest.holding_pen_request holding_pen.info_request_events. where(:event_type => %w(redeliver_incoming destroy_incoming)). find_each do |event| $stderr.puts event.inspect if verbose or dryrun - if not dryrun - event.destroy - end + event.destroy if not dryrun end end diff --git a/lib/tasks/config_files.rake b/lib/tasks/config_files.rake index e9b41368b1..be32028121 100644 --- a/lib/tasks/config_files.rake +++ b/lib/tasks/config_files.rake @@ -188,9 +188,7 @@ namespace :config_files do example = 'rake config_files:set_reject_incoming_at_mta REJECTED_THRESHOLD=5 AGE_IN_MONTHS=12' check_for_env_vars(['REJECTED_THRESHOLD', 'AGE_IN_MONTHS'], example) dryrun = ENV['DRYRUN'] != '0' - if dryrun - STDERR.puts "Only a dry run; info_requests will not be updated" - end + STDERR.puts "Only a dry run; info_requests will not be updated" if dryrun options = {:rejection_threshold => ENV['REJECTED_THRESHOLD'], :age_in_months => ENV['AGE_IN_MONTHS'], :dryrun => dryrun} diff --git a/lib/tasks/geoip.rake b/lib/tasks/geoip.rake index 08dd7fe688..42fda379c8 100644 --- a/lib/tasks/geoip.rake +++ b/lib/tasks/geoip.rake @@ -58,9 +58,7 @@ namespace :geoip do `tar -xzf #{downloaded_location} -C #{tmp_dir}` - unless File.exist?(target_dir) - FileUtils.mkdir target_dir - end + FileUtils.mkdir target_dir unless File.exist?(target_dir) extracted_folder = Dir["#{tmp_dir}/GeoLite2-Country_*"].last FileUtils.mv("#{extracted_folder}/GeoLite2-Country.mmdb", destination) diff --git a/lib/tasks/gettext.rake b/lib/tasks/gettext.rake index 7d6bb7ebc4..94b1e69f77 100644 --- a/lib/tasks/gettext.rake +++ b/lib/tasks/gettext.rake @@ -121,7 +121,9 @@ namespace :gettext do lines << line end end - puts "Mappings unused in #{po_file}: #{lang_mappings.keys}" unless lang_mappings.empty? + unless lang_mappings.empty? + puts "Mappings unused in #{po_file}: #{lang_mappings.keys}" + end File.open(po_file, "w") { |f| f.puts(lines) } end end diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake index 8e1d410511..6126cb7261 100644 --- a/lib/tasks/import.rake +++ b/lib/tasks/import.rake @@ -5,9 +5,7 @@ namespace :import do desc 'Import public bodies from CSV provided on standard input' task :import_csv => :environment do dryrun = ENV['DRYRUN'] != '0' - if dryrun - STDERR.puts 'Only a dry run; public bodies will not be created' - end + STDERR.puts 'Only a dry run; public bodies will not be created' if dryrun tmp_csv = nil Tempfile.open('alaveteli') do |f| diff --git a/lib/tasks/themes.rake b/lib/tasks/themes.rake index b2b84106c2..247ee02c40 100644 --- a/lib/tasks/themes.rake +++ b/lib/tasks/themes.rake @@ -31,9 +31,7 @@ namespace :themes do def uninstall(theme_name, verbose=false) possible_theme_dirs(theme_name).each do |dir| - if File.directory?(dir) - run_hook(theme_name, 'uninstall', verbose) - end + run_hook(theme_name, 'uninstall', verbose) if File.directory?(dir) end end @@ -164,9 +162,7 @@ namespace :themes do locale_extensions(locale).each do |locale_extension| filename = "#{template_name}#{locale_extension}.html.erb" filepath = "lib/themes/#{theme_name}/lib/views/help/#{filename}" - if File.exist?(filepath) - return filepath - end + return filepath if File.exist?(filepath) end nil end @@ -258,9 +254,7 @@ EOF missing = true end end - if !missing - puts "No missing templates or sections" - end + puts "No missing templates or sections" if !missing end end diff --git a/lib/tasks/usage.rb b/lib/tasks/usage.rb index 470f8997ed..491bfb6194 100644 --- a/lib/tasks/usage.rb +++ b/lib/tasks/usage.rb @@ -10,15 +10,11 @@ def usage_message message def check_for_env_vars(env_vars, example) missing = [] env_vars.each do |env_var| - unless ENV[env_var] - missing << env_var - end + missing << env_var unless ENV[env_var] end if !missing.empty? usage = "Usage: This task requires #{env_vars.to_sentence} - missing #{missing.to_sentence}" - if example - usage += "\nExample: #{example}" - end + usage += "\nExample: #{example}" if example usage_message usage end end diff --git a/lib/tasks/users.rake b/lib/tasks/users.rake index 4ea8229cbc..5e25d73658 100644 --- a/lib/tasks/users.rake +++ b/lib/tasks/users.rake @@ -99,9 +99,7 @@ namespace :users do end end_date = - if ENV['END_DATE'] - Time.zone.parse(ENV['END_DATE']).at_end_of_day - end + (Time.zone.parse(ENV['END_DATE']).at_end_of_day if ENV['END_DATE']) # Only auto-calculate missing dates if one has been provided without the # other diff --git a/lib/typeahead_search.rb b/lib/typeahead_search.rb index ac14a2522e..79fb122520 100644 --- a/lib/typeahead_search.rb +++ b/lib/typeahead_search.rb @@ -58,9 +58,7 @@ def check_query end # don't run a search if there's no query - if @query.blank? - @run_search = false - end + @run_search = false if @query.blank? end diff --git a/lib/xapian_queries.rb b/lib/xapian_queries.rb index e95ea8ef0c..451e8dbb18 100644 --- a/lib/xapian_queries.rb +++ b/lib/xapian_queries.rb @@ -20,9 +20,7 @@ def get_request_variety_from_params(params) varieties << ['variety:comment'] end end - if !varieties.empty? - query = " (#{varieties.join(' OR ')})" - end + query = " (#{varieties.join(' OR ')})" if !varieties.empty? return query end @@ -54,9 +52,7 @@ def get_status_from_params(params) if params[:latest_status].include? "gone_postal" statuses << ['latest_status:gone_postal'] end - if !statuses.empty? - query = " (#{statuses.join(' OR ')})" - end + query = " (#{statuses.join(' OR ')})" if !statuses.empty? end return query end diff --git a/script/handle-mail-replies.rb b/script/handle-mail-replies.rb index 5d1462412b..d751772166 100755 --- a/script/handle-mail-replies.rb +++ b/script/handle-mail-replies.rb @@ -91,7 +91,9 @@ def main(in_test_mode) return 2 if MailHandler::ReplyHandler.is_oof?(message) # Otherwise forward the message on - MailHandler::ReplyHandler.forward_on(raw_message, message) unless in_test_mode + unless in_test_mode + MailHandler::ReplyHandler.forward_on(raw_message, message) + end return 0 end end diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb index f99559e7dc..232f50400e 100644 --- a/spec/models/info_request_spec.rb +++ b/spec/models/info_request_spec.rb @@ -3431,9 +3431,7 @@ def create_old_unclassified_holding_pen request_events, request_events_all_successful = InfoRequest.recent_requests previous = nil request_events.each do |event| - if previous - expect(previous.created_at).to be >= event.created_at - end + expect(previous.created_at).to be >= event.created_at if previous expect(['sent', 'response'].include?(event.event_type)).to be true if event.event_type == 'response' expect(['successful', 'partially_successful'].include?(event.calculated_state)).to be true diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ac559e9903..fc08296aac 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -86,9 +86,7 @@ # Clean up raw emails directory config.after(:suite) do raw_email_dir = File.join(Rails.root, 'files/raw_email_test') - if File.directory?(raw_email_dir) - FileUtils.rm_rf(raw_email_dir) - end + FileUtils.rm_rf(raw_email_dir) if File.directory?(raw_email_dir) FileUtils.rm_rf(Rails.root.join('tmp', 'storage')) end @@ -101,9 +99,7 @@ config.before(:suite) do if ENV['ALAVETELI_USE_OINK'] oink_log = Rails.root + 'log/oink.log' - if File.exist?(oink_log) - File.write(oink_log, '') - end + File.write(oink_log, '') if File.exist?(oink_log) end BCrypt::Engine.cost = 1 @@ -129,11 +125,15 @@ # Turn routing-filter off in functional and unit tests as per # https://github.com/svenfuchs/routing-filter/blob/master/README.markdown#testing config.before(:each) do |example| - RoutingFilter.active = false if [:controller, :helper, :model].include? example.metadata[:type] + if [:controller, :helper, :model].include? example.metadata[:type] + RoutingFilter.active = false + end end config.after(:each) do |example| - RoutingFilter.active = true if [:controller, :helper, :model].include? example.metadata[:type] + if [:controller, :helper, :model].include? example.metadata[:type] + RoutingFilter.active = true + end end # This section makes the garbage collector run less often to speed up tests From 7a0c7ec219a0a877f9eb69205d561749157a0330 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 3 Feb 2023 13:00:35 +0000 Subject: [PATCH 073/289] Refactor: Redundant self removed --- app/controllers/admin_controller.rb | 2 +- app/controllers/track_controller.rb | 10 +-- app/mailers/notification_mailer.rb | 6 +- app/mailers/request_mailer.rb | 4 +- .../alaveteli_pro/draft_info_request_batch.rb | 4 +- app/models/alaveteli_pro/embargo.rb | 6 +- app/models/alaveteli_pro/request_summary.rb | 6 +- .../alaveteli_pro/request_summaries.rb | 6 +- app/models/concerns/message_prominence.rb | 2 +- app/models/draft_info_request.rb | 4 +- app/models/foi_attachment.rb | 18 ++--- app/models/holiday_import.rb | 2 +- app/models/incoming_message.rb | 54 +++++++-------- app/models/info_request/state/transitions.rb | 2 +- app/models/info_request_batch.rb | 30 ++++---- app/models/info_request_event.rb | 6 +- app/models/notification.rb | 10 +-- app/models/outgoing_message.rb | 6 +- .../template/initial_request.rb | 2 +- app/models/profile_photo.rb | 2 +- app/models/public_body.rb | 18 ++--- app/models/public_body_change_request.rb | 6 +- app/models/user.rb | 6 +- app/validators/change_email_validator.rb | 2 +- .../lib/alaveteli_features.rb | 2 +- .../install/install_generator.rb | 2 +- lib/acts_as_xapian/acts_as_xapian.rb | 68 +++++++++---------- lib/mail_handler/backends/mail_backend.rb | 6 +- lib/mail_handler/reply_handler.rb | 4 +- lib/world_foi_websites.rb | 2 +- spec/mailers/application_mailer_spec.rb | 2 +- spec/models/customstates.rb | 18 ++--- 32 files changed, 159 insertions(+), 159 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index f0201bf022..5c5eb81f03 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -59,7 +59,7 @@ def authenticate session[:using_admin] = nil session[:user_id] = nil session[:admin_name] = nil - self.authenticate + authenticate end end else diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb index 65fdbf5165..165e4b79d1 100644 --- a/app/controllers/track_controller.rb +++ b/app/controllers/track_controller.rb @@ -19,7 +19,7 @@ def track_request return atom_feed_internal if params[:feed] == 'feed' - if self.track_set + if track_set if AlaveteliConfiguration.enable_widgets && cookies[:widget_vote] @info_request. widget_votes. @@ -45,7 +45,7 @@ def track_list return atom_feed_internal if params[:feed] == 'feed' - if self.track_set || @track_thing.errors.any? + if track_set || @track_thing.errors.any? redirect_to request_list_url(:view => @view) end end @@ -68,7 +68,7 @@ def track_public_body return atom_feed_internal if params[:feed] == 'feed' - if self.track_set || @track_thing.errors.any? + if track_set || @track_thing.errors.any? redirect_to public_body_url(@public_body) end end @@ -81,7 +81,7 @@ def track_user return atom_feed_internal if params[:feed] == 'feed' - if self.track_set || @track_thing.errors.any? + if track_set || @track_thing.errors.any? redirect_to user_url(@track_user) end end @@ -100,7 +100,7 @@ def track_search_query return atom_feed_internal if params[:feed] == 'feed' - if self.track_set || @track_thing.errors.any? + if track_set || @track_thing.errors.any? if @query.scan("variety").length == 1 # we're making a track for a simple filter, for which # there's an expression in the UI (rather than relying diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb index 101909e6e2..4d4db92687 100644 --- a/app/mailers/notification_mailer.rb +++ b/app/mailers/notification_mailer.rb @@ -53,8 +53,8 @@ def self.send_instant_notifications end def self.send_notifications - sent_instant_notifications = self.send_instant_notifications - sent_daily_notifications = self.send_daily_notifications + sent_instant_notifications = send_instant_notifications + sent_daily_notifications = send_daily_notifications sent_instant_notifications || sent_daily_notifications end @@ -95,7 +95,7 @@ def daily_summary(user, notifications) def instant_notification(notification) event_type = notification.info_request_event.event_type method = "#{event_type}_notification".to_sym - self.send(method, notification) + send(method, notification) end def response_notification(notification) diff --git a/app/mailers/request_mailer.rb b/app/mailers/request_mailer.rb index d995eb6b93..210838dad1 100644 --- a/app/mailers/request_mailer.rb +++ b/app/mailers/request_mailer.rb @@ -242,7 +242,7 @@ def receive(email, raw_email, source = :mailin) opts = { :source => source } # Find which info requests the email is for - reply_info_requests = self.requests_matching_email(email) + reply_info_requests = requests_matching_email(email) # Nothing found, so save in holding pen if reply_info_requests.size == 0 @@ -348,7 +348,7 @@ def self.alert_overdue_requests # it goes out 3 days after last update of event, then after 10, then after 24. def self.alert_new_response_reminders AlaveteliConfiguration::new_response_reminder_after_days.each_with_index do |days, i| - self.alert_new_response_reminders_internal(days, "new_response_reminder_#{i+1}") + alert_new_response_reminders_internal(days, "new_response_reminder_#{i+1}") end end def self.alert_new_response_reminders_internal(days_since, type_code) diff --git a/app/models/alaveteli_pro/draft_info_request_batch.rb b/app/models/alaveteli_pro/draft_info_request_batch.rb index 9c14e28e25..d34faf6c52 100644 --- a/app/models/alaveteli_pro/draft_info_request_batch.rb +++ b/app/models/alaveteli_pro/draft_info_request_batch.rb @@ -37,7 +37,7 @@ def set_default_body template_options = {} template_options[:info_request_title] = title if title self.body = template.body(template_options) - self.body += self.user.name if self.user + self.body += user.name if user end end @@ -48,7 +48,7 @@ def request_summary_body # @see RequestSummaries#request_summary_public_body_names def request_summary_public_body_names - self.public_bodies.pluck(:name).join(" ") + public_bodies.pluck(:name).join(" ") end # @see RequestSummaries#request_summary_categories diff --git a/app/models/alaveteli_pro/embargo.rb b/app/models/alaveteli_pro/embargo.rb index e40124e470..4b502fcb38 100644 --- a/app/models/alaveteli_pro/embargo.rb +++ b/app/models/alaveteli_pro/embargo.rb @@ -138,10 +138,10 @@ def self.log_expiring_events private def add_set_embargo_event - publish_at_changed = self.publish_at_changed? + publish_at_changed = publish_at_changed? yield if publish_at_changed - params = { :embargo_id => self.id } + params = { :embargo_id => id } params[:embargo_extension_id] = extension.id if extension info_request.log_event('set_embargo', params) end @@ -154,7 +154,7 @@ def set_publish_at_from_duration end def set_expiring_notification_at - unless self.expiring_notification_at.present? + unless expiring_notification_at.present? self.expiring_notification_at = calculate_expiring_notification_at end end diff --git a/app/models/alaveteli_pro/request_summary.rb b/app/models/alaveteli_pro/request_summary.rb index 0c7ed441ef..dd8498d9ad 100644 --- a/app/models/alaveteli_pro/request_summary.rb +++ b/app/models/alaveteli_pro/request_summary.rb @@ -41,7 +41,7 @@ def self.category(category_slug) end def self.not_category(category_slug) - summary_ids_to_exclude = self.category(category_slug).pluck(:id) + summary_ids_to_exclude = category(category_slug).pluck(:id) results = includes(:request_summary_categories) unless summary_ids_to_exclude.blank? results = results. @@ -61,7 +61,7 @@ def self.create_or_update_from(request) request.request_summary.update_from(request) request.request_summary else - self.create_from(request) + create_from(request) end end @@ -72,7 +72,7 @@ def update_from(request) private def self.create_from(request) - self.create(attributes_from_request(request)) + create(attributes_from_request(request)) end def self.attributes_from_request(request) diff --git a/app/models/concerns/alaveteli_pro/request_summaries.rb b/app/models/concerns/alaveteli_pro/request_summaries.rb index 74c74ad33f..daa0e6b1fc 100644 --- a/app/models/concerns/alaveteli_pro/request_summaries.rb +++ b/app/models/concerns/alaveteli_pro/request_summaries.rb @@ -14,11 +14,11 @@ module RequestSummaries # Creates a RequestSummary item for this model on first save, or updates # the existing one otherwise. def create_or_update_request_summary - if self.should_summarise? + if should_summarise? self.request_summary = AlaveteliPro::RequestSummary.create_or_update_from(self) - elsif self.should_update_parent_summary? - parent = self.request_summary_parent + elsif should_update_parent_summary? + parent = request_summary_parent parent.create_or_update_request_summary unless parent.blank? end end diff --git a/app/models/concerns/message_prominence.rb b/app/models/concerns/message_prominence.rb index b54f8a53cf..bdca038d8d 100644 --- a/app/models/concerns/message_prominence.rb +++ b/app/models/concerns/message_prominence.rb @@ -3,7 +3,7 @@ module MessageProminence included do strip_attributes only: [:prominence_reason] - validates_inclusion_of :prominence, in: self.prominence_states + validates_inclusion_of :prominence, in: prominence_states end def indexed_by_search? diff --git a/app/models/draft_info_request.rb b/app/models/draft_info_request.rb index bc67e78342..e8b1031add 100644 --- a/app/models/draft_info_request.rb +++ b/app/models/draft_info_request.rb @@ -27,12 +27,12 @@ class DraftInfoRequest < ApplicationRecord # @see RequestSummaries#request_summary_body def request_summary_body - self.body + body end # @see RequestSummaries#request_summary_public_body_names def request_summary_public_body_names - self.public_body.name unless self.public_body.blank? + public_body.name unless public_body.blank? end # @see RequestSummaries#request_summary_categories diff --git a/app/models/foi_attachment.rb b/app/models/foi_attachment.rb index d9586628e7..d4b74a2537 100644 --- a/app/models/foi_attachment.rb +++ b/app/models/foi_attachment.rb @@ -79,7 +79,7 @@ def body(tries: 0, delay: 1) raise if tries > BODY_MAX_TRIES sleep [delay, BODY_MAX_DELAY].min - self.incoming_message.parse_raw_email!(true) + incoming_message.parse_raw_email!(true) reload body(tries: tries + 1, delay: delay * 2) @@ -188,7 +188,7 @@ def old_display_filename # make another old_display_filename see above def display_filename filename = self.filename - if !self.incoming_message.nil? + if !incoming_message.nil? filename = incoming_message.info_request.apply_censor_rules_to_text(filename) end # Sometimes filenames have e.g. %20 in - no point butchering that @@ -210,11 +210,11 @@ def display_filename def ensure_filename! - if self.filename.blank? - calc_ext = AlaveteliFileTypes.mimetype_to_extension(self.content_type) + if filename.blank? + calc_ext = AlaveteliFileTypes.mimetype_to_extension(content_type) calc_ext = "bin" if !calc_ext - if !self.within_rfc822_subject.nil? - computed = self.within_rfc822_subject + "." + calc_ext + if !within_rfc822_subject.nil? + computed = within_rfc822_subject + "." + calc_ext else computed = "attachment." + calc_ext end @@ -224,7 +224,7 @@ def ensure_filename! def filename=(filename) filename.try(:delete!, "\0") - calc_ext = AlaveteliFileTypes.mimetype_to_extension(self.content_type) + calc_ext = AlaveteliFileTypes.mimetype_to_extension(content_type) # Put right extension on if missing if !filename.nil? && !filename.match(/\.#{calc_ext}$/) && calc_ext computed = filename + "." + calc_ext @@ -236,7 +236,7 @@ def filename=(filename) # Size to show next to the download link for the attachment def update_display_size! - s = self.body.size + s = body.size if s > 1024 * 1024 self.display_size = sprintf("%.1f", s.to_f / 1024 / 1024) + 'M' @@ -289,7 +289,7 @@ def name_of_content_type 'application/vnd.ms-excel' => "Excel spreadsheet", 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => "Excel spreadsheet", - }[self.content_type] + }[content_type] end # For "View as HTML" of attachment diff --git a/app/models/holiday_import.rb b/app/models/holiday_import.rb index d7e5a8d14e..8b2aff6bc4 100644 --- a/app/models/holiday_import.rb +++ b/app/models/holiday_import.rb @@ -50,7 +50,7 @@ def save! end def holidays_attributes=(incoming_data) - incoming_data.each { |offset, incoming| self.holidays << Holiday.new(incoming) } + incoming_data.each { |offset, incoming| holidays << Holiday.new(incoming) } end def holidays diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index dd6b19fb81..629b5f6d9d 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -95,8 +95,8 @@ def parse_raw_email!(force = nil) # The following fields may be absent; we treat them as cached # values in case we want to regenerate them (due to mail # parsing bugs, etc). - raise "Incoming message id=#{id} has no raw_email" if self.raw_email.nil? - if (!force.nil? || self.last_parsed.nil?) + raise "Incoming message id=#{id} has no raw_email" if raw_email.nil? + if (!force.nil? || last_parsed.nil?) ActiveRecord::Base.transaction do extract_attachments self.sent_at = raw_email.date || created_at @@ -106,7 +106,7 @@ def parse_raw_email!(force = nil) self.from_email_domain = raw_email.from_email_domain || '' self.valid_to_reply_to = raw_email.valid_to_reply_to? self.last_parsed = Time.zone.now - self.save! + save! end end end @@ -228,8 +228,8 @@ def apply_masks(text, content_type) # Lotus notes quoting yeuch! def remove_lotus_quoting(text, replacement = "FOLDED_QUOTED_SECTION") text = text.dup - return text if self.info_request.user_name.nil? - name = Regexp.escape(self.info_request.user_name) + return text if info_request.user_name.nil? + name = Regexp.escape(info_request.user_name) # To end of message sections text.gsub!(/^\s?#{name}[^\n]+\n([^\n]+\n)?\s?Sent by:[^\n]+\n.*/im, "\n\n" + replacement) @@ -329,14 +329,14 @@ def clear_in_database_caches! self.cached_attachment_text_clipped = nil self.cached_main_body_text_unfolded = nil self.cached_main_body_text_folded = nil - self.save! + save! end # Internal function to cache two sorts of main body text. # Cached as loading raw_email can be quite huge, and need this for just # search results def _cache_main_body_text - text = self.get_main_body_text_internal + text = get_main_body_text_internal # Strip the uudecode parts from main text # - this also effectively does a .dup as well, so text mods don't alter original text = text.split(/^begin.+^`\n^end\n/m).join(" ") @@ -349,24 +349,24 @@ def _cache_main_body_text text = apply_masks(text, 'text/html') # Remove existing quoted sections - folded_quoted_text = self.remove_lotus_quoting(text, 'FOLDED_QUOTED_SECTION') + folded_quoted_text = remove_lotus_quoting(text, 'FOLDED_QUOTED_SECTION') folded_quoted_text = IncomingMessage.remove_quoted_sections(folded_quoted_text, "FOLDED_QUOTED_SECTION") self.cached_main_body_text_unfolded = text.delete("\0") self.cached_main_body_text_folded = folded_quoted_text.delete("\0") - self.save! + save! end # Returns body text from main text part of email, converted to UTF-8, with uudecode removed, # emails and privacy sensitive things remove, censored, and folded to remove excess quoted text # (marked with FOLDED_QUOTED_SECTION) # TODO: returns a .dup of the text, so calling functions can in place modify it def get_main_body_text_folded - self._cache_main_body_text if self.cached_main_body_text_folded.nil? - return self.cached_main_body_text_folded + _cache_main_body_text if cached_main_body_text_folded.nil? + return cached_main_body_text_folded end def get_main_body_text_unfolded - self._cache_main_body_text if self.cached_main_body_text_unfolded.nil? - return self.cached_main_body_text_unfolded + _cache_main_body_text if cached_main_body_text_unfolded.nil? + return cached_main_body_text_unfolded end # Returns body text from main text part of email, converted to UTF-8 def get_main_body_text_internal @@ -411,7 +411,7 @@ def _convert_part_body_to_text(part) # from a set of foi_attachments. If the leaves parameter is empty or not # supplied, uses its own foi_attachments. def get_main_body_text_part(leaves=[]) - leaves = self.foi_attachments if leaves.empty? + leaves = foi_attachments if leaves.empty? # Find first part which is text/plain or text/html # (We have to include HTML, as increasingly there are mail clients that @@ -477,7 +477,7 @@ def get_attachments_for_display # return what user would consider attachments, i.e. not the main body main_part = get_main_body_text_part attachments = [] - for attachment in self.foi_attachments + for attachment in foi_attachments attachments << attachment if attachment != main_part end return attachments @@ -549,13 +549,13 @@ def get_body_for_html_display(collapse_quoted_sections = true) text.strip! # if there is nothing but quoted stuff, then show the subject if text == "FOLDED_QUOTED_SECTION" - text = "[Subject only] " + CGI.escapeHTML(self.subject || '') + text + text = "[Subject only] " + CGI.escapeHTML(subject || '') + text end # and display link for quoted stuff - text = text.gsub(/FOLDED_QUOTED_SECTION/, "\n\n" + ''+_("show quoted sections")+'' + "\n\n") + text = text.gsub(/FOLDED_QUOTED_SECTION/, "\n\n" + ''+_("show quoted sections")+'' + "\n\n") else if folded_quoted_text.include?('FOLDED_QUOTED_SECTION') - text = text + "\n\n" + ''+_("hide quoted sections")+'' + text = text + "\n\n" + ''+_("hide quoted sections")+'' end end text.strip! @@ -581,14 +581,14 @@ def get_body_for_quoting # Returns text version of attachment text def get_attachment_text_full - text = self._get_attachment_text_internal + text = _get_attachment_text_internal text = apply_masks(text, 'text/html') # This can be useful for memory debugging #STDOUT.puts 'xxx '+ MySociety::DebugHelpers::allocated_string_size_around_gc # Save clipped version for snippets - if self.cached_attachment_text_clipped.nil? + if cached_attachment_text_clipped.nil? clipped = text.mb_chars[0..MAX_ATTACHMENT_TEXT_CLIPPED].delete("\0") self.cached_attachment_text_clipped = clipped save! @@ -599,18 +599,18 @@ def get_attachment_text_full # Returns a version reduced to a sensible maximum size - this # is for performance reasons when showing snippets in search results. def get_attachment_text_clipped - if self.cached_attachment_text_clipped.nil? + if cached_attachment_text_clipped.nil? # As side effect, get_attachment_text_full makes snippet text - attachment_text = self.get_attachment_text_full - raise "internal error" if self.cached_attachment_text_clipped.nil? + attachment_text = get_attachment_text_full + raise "internal error" if cached_attachment_text_clipped.nil? end - return self.cached_attachment_text_clipped + return cached_attachment_text_clipped end def _extract_text # Extract text from each attachment - self.get_attachments_for_display.reduce('') { |memo, attachment| + get_attachments_for_display.reduce('') { |memo, attachment| return memo if Ability.guest.cannot?(:read, attachment) memo += MailHandler.get_attachment_text_one_file(attachment.content_type, @@ -634,7 +634,7 @@ def get_text_for_indexing_clipped # Has message arrived "recently"? def recently_arrived - (Time.zone.now - self.created_at) <= 3.days + (Time.zone.now - created_at) <= 3.days end # Search all info requests for @@ -658,7 +658,7 @@ def self.find_all_unknown_mime_types # the normal extension for known mime type, otherwise uses other extensions. def get_present_file_extensions ret = {} - for attachment in self.get_attachments_for_display + for attachment in get_attachments_for_display ext = AlaveteliFileTypes.mimetype_to_extension(attachment.content_type) if ext.nil? && !attachment.filename.nil? ext = File.extname(attachment.filename).gsub(/^[.]/, "") diff --git a/app/models/info_request/state/transitions.rb b/app/models/info_request/state/transitions.rb index e49a9fef83..9efd6a1acf 100644 --- a/app/models/info_request/state/transitions.rb +++ b/app/models/info_request/state/transitions.rb @@ -52,7 +52,7 @@ def self.transition_label(to_state, opts = {}) def self.labelled_hash(states, opts = {}) hash = {} states.each do |state| - hash[state] = self.transition_label(state, opts) + hash[state] = transition_label(state, opts) end hash end diff --git a/app/models/info_request_batch.rb b/app/models/info_request_batch.rb index 528be63668..0a8d08431f 100644 --- a/app/models/info_request_batch.rb +++ b/app/models/info_request_batch.rb @@ -91,7 +91,7 @@ def self.find_existing(user, title, body, public_body_ids, id: nil) # Create a new batch from the supplied draft version def self.from_draft(draft) - self.new(:user => draft.user, + new(:user => draft.user, :public_bodies => draft.public_bodies, :title => draft.title, :body => draft.body, @@ -162,17 +162,17 @@ def sent? # Build an InfoRequest object which is an example of this batch. def example_request - public_body = self.public_bodies.first + public_body = public_bodies.first body = OutgoingMessage.fill_in_salutation(self.body, public_body) info_request = InfoRequest.build_from_attributes( - { :title => self.title, :public_body => public_body }, + { :title => title, :public_body => public_body }, { :body => body }, - self.user + user ) - unless self.embargo_duration.blank? + unless embargo_duration.blank? info_request.embargo = AlaveteliPro::Embargo.new( :info_request => info_request, - :embargo_duration => self.embargo_duration + :embargo_duration => embargo_duration ) end info_request @@ -223,41 +223,41 @@ def request_phases_summary { :in_progress => { :label => _('In progress'), - :count => self.info_requests.in_progress.count + :count => info_requests.in_progress.count }, :action_needed => { :label => _('Action needed'), - :count => self.info_requests.action_needed.count + :count => info_requests.action_needed.count }, :complete => { :label => _('Complete'), - :count => self.info_requests.complete.count + :count => info_requests.complete.count }, :other => { :label => _('Other'), - :count => self.info_requests.other.count + :count => info_requests.other.count } } end # @see RequestSummaries#request_summary_body def request_summary_body - self.body + body end # @see RequestSummaries#request_summary_public_body_names def request_summary_public_body_names - self.public_bodies.pluck(:name).join(" ") + public_bodies.pluck(:name).join(" ") end # @see RequestSummaries#request_summary_categories def request_summary_categories categories = [] - if self.embargo_expiring? + if embargo_expiring? categories << AlaveteliPro::RequestSummaryCategory.embargo_expiring end - if self.sent_at - phase_slugs = self.request_phases.map(&:to_s).uniq + if sent_at + phase_slugs = request_phases.map(&:to_s).uniq phases = AlaveteliPro::RequestSummaryCategory.where(slug: phase_slugs) categories.concat phases else diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index 73fcad12ef..9f9e0e1903 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -89,7 +89,7 @@ class InfoRequestEvent < ApplicationRecord end after_create :update_request, :if => :response? - after_commit -> { self.info_request.create_or_update_request_summary }, + after_commit -> { info_request.create_or_update_request_summary }, :on => [:create] validates_inclusion_of :event_type, :in => EVENT_TYPES @@ -514,7 +514,7 @@ def previous_events(opts = {}) events = self. class. where(:info_request_id => info_request_id). - where('created_at < ?', self.created_at). + where('created_at < ?', created_at). order(order) end @@ -524,7 +524,7 @@ def subsequent_events(opts = {}) events = self. class. where(:info_request_id => info_request_id). - where('created_at > ?', self.created_at). + where('created_at > ?', created_at). order(order) end diff --git a/app/models/notification.rb b/app/models/notification.rb index dc3cc7d024..817287df04 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -32,9 +32,9 @@ class Notification < ApplicationRecord # Set the send_at timestamp based on the chosen frequency def calculate_send_after - unless self.persisted? || self.send_after.present? - if self.daily? - self.send_after = self.user.next_daily_summary_time + unless persisted? || send_after.present? + if daily? + self.send_after = user.next_daily_summary_time else self.send_after = Time.zone.now end @@ -88,14 +88,14 @@ def expire_embargo_expired end def overdue_expired - info_request = self.info_request_event.info_request + info_request = info_request_event.info_request user = info_request.user status = info_request.calculate_status !(user.can_make_followup? && status == 'waiting_response_overdue') end def very_overdue_expired - info_request = self.info_request_event.info_request + info_request = info_request_event.info_request user = info_request.user status = info_request.calculate_status !(user.can_make_followup? && status == 'waiting_response_very_overdue') diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb index 6f42118031..5ec9905c7e 100644 --- a/app/models/outgoing_message.rb +++ b/app/models/outgoing_message.rb @@ -71,7 +71,7 @@ class OutgoingMessage < ApplicationRecord admin_columns include: [:to, :from, :subject] - self.default_url_options[:host] = AlaveteliConfiguration.domain + default_url_options[:host] = AlaveteliConfiguration.domain scope :followup, -> { where(message_type: 'followup') } scope :is_searchable, -> { where(prominence: 'normal') } @@ -358,7 +358,7 @@ def get_text_for_indexing(strip_salutation = true, opts = {}) end # Remove email addresses from display/index etc. - self.remove_privacy_sensitive_things!(text) + remove_privacy_sensitive_things!(text) text end @@ -366,7 +366,7 @@ def get_text_for_indexing(strip_salutation = true, opts = {}) # Return body for display as HTML def get_body_for_html_display text = body.strip - self.remove_privacy_sensitive_things!(text) + remove_privacy_sensitive_things!(text) text = CGI.escapeHTML(text) text = MySociety::Format.make_clickable(text, { :contract => 1, :nofollow => true }) text.gsub!(/\[(email address|mobile number)\]/, '[\1]') diff --git a/app/models/outgoing_message/template/initial_request.rb b/app/models/outgoing_message/template/initial_request.rb index 48380f0a0d..eec008f877 100644 --- a/app/models/outgoing_message/template/initial_request.rb +++ b/app/models/outgoing_message/template/initial_request.rb @@ -8,7 +8,7 @@ def body(opts = {}) def self.placeholder_salutation _('Dear {{placeholder_body_name}},', - placeholder_body_name: self.placeholder_body_name) + placeholder_body_name: placeholder_body_name) end # Separate so that it can be referred to directly elsewhere (e.g. to diff --git a/app/models/profile_photo.rb b/app/models/profile_photo.rb index ba4621f17c..fb225c02ca 100644 --- a/app/models/profile_photo.rb +++ b/app/models/profile_photo.rb @@ -42,7 +42,7 @@ def convert_image # convert to PNG if it isn't, and to right size altered = false if image.type != 'PNG' - self.image.format('PNG') + image.format('PNG') altered = true end diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 6dfa05bad8..3a32a6750f 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -151,11 +151,11 @@ class Translation strip_attributes allow_empty: true, only: %i[request_email] end - self.non_versioned_columns << 'created_at' << 'updated_at' << 'first_letter' << 'api_key' - self.non_versioned_columns << 'info_requests_count' << 'info_requests_successful_count' - self.non_versioned_columns << 'info_requests_count' << 'info_requests_visible_classified_count' - self.non_versioned_columns << 'info_requests_not_held_count' << 'info_requests_overdue' - self.non_versioned_columns << 'info_requests_overdue_count' << 'info_requests_visible_count' + non_versioned_columns << 'created_at' << 'updated_at' << 'first_letter' << 'api_key' + non_versioned_columns << 'info_requests_count' << 'info_requests_successful_count' + non_versioned_columns << 'info_requests_count' << 'info_requests_visible_classified_count' + non_versioned_columns << 'info_requests_not_held_count' << 'info_requests_overdue' + non_versioned_columns << 'info_requests_overdue_count' << 'info_requests_visible_count' # Cannot be defined directly under `include` statements as this is opening # the PublicBody::Version class dynamically defined by the @@ -187,7 +187,7 @@ def copy_translated_attributes end def last_edit_comment_for_html_display - text = self.last_edit_comment.strip + text = last_edit_comment.strip text = CGI.escapeHTML(text) text = MySociety::Format.make_clickable(text) text = text.gsub(/\n/, '
') @@ -206,7 +206,7 @@ def compare(previous = nil, &block) created_at updated_at).include?(c.name) from = previous.send(c.name) - to = self.send(c.name) + to = send(c.name) memo << { :name => c.name.humanize, :from => from, :to => to } if from != to @@ -938,8 +938,8 @@ def read_attribute_value(name, locale) def request_email_if_requestable # Request_email can be blank, meaning we don't have details - if self.is_requestable? - unless MySociety::Validate.is_valid_email(self.request_email) + if is_requestable? + unless MySociety::Validate.is_valid_email(request_email) errors.add(:request_email, "Request email doesn't look like a valid email address") end diff --git a/app/models/public_body_change_request.rb b/app/models/public_body_change_request.rb index 785491442f..e9d3a18970 100644 --- a/app/models/public_body_change_request.rb +++ b/app/models/public_body_change_request.rb @@ -139,19 +139,19 @@ def default_response_subject def close! self.is_open = false - self.save! + save! end private def body_email_format - unless MySociety::Validate.is_valid_email(self.public_body_email) + unless MySociety::Validate.is_valid_email(public_body_email) errors.add(:public_body_email, _("The authority email doesn't look like a valid address")) end end def user_email_format - unless MySociety::Validate.is_valid_email(self.user_email) + unless MySociety::Validate.is_valid_email(user_email) errors.add(:user_email, _("Your email doesn't look like a valid address")) end end diff --git a/app/models/user.rb b/app/models/user.rb index 9234366c52..6f8b30a0f4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -222,7 +222,7 @@ def self.authenticate_from_form(params, specific_user_login = false) # Case-insensitively find a user from their email def self.find_user_by_email(email) return nil if email.blank? - self.where('lower(email) = lower(?)', email.strip).first + where('lower(email) = lower(?)', email.strip).first end # The "internal admin" is a special user for internal use. @@ -576,14 +576,14 @@ def indexed_by_search? def notify(info_request_event) Notification.create( info_request_event: info_request_event, - frequency: Notification.frequencies[self.notification_frequency], + frequency: Notification.frequencies[notification_frequency], user: self ) end # Return a timestamp for the next time a user should be sent a daily summary def next_daily_summary_time - summary_time = Time.zone.now.change(self.daily_summary_time) + summary_time = Time.zone.now.change(daily_summary_time) summary_time += 1.day if summary_time < Time.zone.now summary_time end diff --git a/app/validators/change_email_validator.rb b/app/validators/change_email_validator.rb index 1efdf53673..58ed734279 100644 --- a/app/validators/change_email_validator.rb +++ b/app/validators/change_email_validator.rb @@ -32,7 +32,7 @@ def initialize(attributes = {}) end def changing_email - self.user_circumstance == 'change_email' + user_circumstance == 'change_email' end private diff --git a/gems/alaveteli_features/lib/alaveteli_features.rb b/gems/alaveteli_features/lib/alaveteli_features.rb index e578691f58..66c1bbf65f 100644 --- a/gems/alaveteli_features/lib/alaveteli_features.rb +++ b/gems/alaveteli_features/lib/alaveteli_features.rb @@ -19,7 +19,7 @@ def self.groups def self.backend return @backend if @backend - if self.tables_exist? + if tables_exist? @backend = Flipper.new(Flipper::Adapters::ActiveRecord.new) else if defined?(Rails) diff --git a/gems/alaveteli_features/lib/alaveteli_features/generators/alaveteli_features/install/install_generator.rb b/gems/alaveteli_features/lib/alaveteli_features/generators/alaveteli_features/install/install_generator.rb index 9c5db8ac0d..f3461f1e71 100644 --- a/gems/alaveteli_features/lib/alaveteli_features/generators/alaveteli_features/install/install_generator.rb +++ b/gems/alaveteli_features/lib/alaveteli_features/generators/alaveteli_features/install/install_generator.rb @@ -5,7 +5,7 @@ class InstallGenerator < Rails::Generators::Base class_option :migrate, type: :boolean, default: true, banner: 'Run AlaveteliFeatures migrations' def self.source_paths - paths = self.superclass.source_paths + paths = superclass.source_paths paths << File.expand_path('../templates', "../../#{__FILE__}") paths << File.expand_path('../templates', "../#{__FILE__}") paths << File.expand_path('../templates', __FILE__) diff --git a/lib/acts_as_xapian/acts_as_xapian.rb b/lib/acts_as_xapian/acts_as_xapian.rb index 34caf8d98a..f84f20556e 100644 --- a/lib/acts_as_xapian/acts_as_xapian.rb +++ b/lib/acts_as_xapian/acts_as_xapian.rb @@ -331,7 +331,7 @@ def initialize_query(options) sort_by_ascending = options[:sort_by_ascending].nil? ? true : options[:sort_by_ascending] collapse_by_prefix = options[:collapse_by_prefix] || nil - ActsAsXapian.enquire.query = self.query + ActsAsXapian.enquire.query = query if sort_by_prefix.nil? ActsAsXapian.enquire.sort_by_relevance! @@ -382,14 +382,14 @@ def initialize_query(options) # Return a description of the query def description - self.query.description + query.description end # Does the query have non-prefixed search terms in it? def has_normal_search_terms? ret = false #x = '' - for t in self.query.terms + for t in query.terms term = t.term #x = x + term.to_yaml + term.size.to_s + term[0..0] + "*" if term.size >= 2 && term[0..0] == 'Z' @@ -402,7 +402,7 @@ def has_normal_search_terms? # Estimate total number of results def matches_estimated - self.matches.matches_estimated + matches.matches_estimated end # Return query string with spelling correction @@ -415,13 +415,13 @@ def spelling_correction # Return array of models found def results # If they've already pulled out the results, just return them. - return self.cached_results if !self.cached_results.nil? + return cached_results if !cached_results.nil? docs = [] self.runtime += Benchmark::realtime { # Pull out all the results - iter = self.matches._begin - while not iter.equals(self.matches._end) + iter = matches._begin + while not iter.equals(matches._end) docs.push({:data => iter.document.data, :percent => iter.percent, :weight => iter.weight, @@ -432,7 +432,7 @@ def results # Log time taken, excluding database lookups below which will be displayed separately by ActiveRecord if ActiveRecord::Base.logger - ActiveRecord::Base.logger.add(Logger::DEBUG, " Xapian query (#{'%.5fs' % self.runtime}) #{self.log_description}") + ActiveRecord::Base.logger.add(Logger::DEBUG, " Xapian query (#{'%.5fs' % self.runtime}) #{log_description}") end # Look up without too many SQL queries @@ -499,7 +499,7 @@ def initialize(model_classes, query_string, options = {}, user_query = nil) model_classes = new_model_classes # Set things up - self.initialize_db + initialize_db # Case of a string, searching for a Google-like syntax query self.query_string = query_string @@ -516,7 +516,7 @@ def initialize(model_classes, query_string, options = {}, user_query = nil) self.query = Xapian::Query.new(Xapian::Query::OP_AND, model_query, user_query) # Call base class constructor - self.initialize_query(options) + initialize_query(options) end # Return just normal words in the query i.e. Not operators, ones in @@ -562,7 +562,7 @@ def words_to_highlight(opts = {}) # Text for lines in log file def log_description - "Search: " + self.query_string + "Search: " + query_string end private @@ -583,7 +583,7 @@ class Similar < QueryBase # model_classes - model classes to search within, e.g. [PublicBody, User] # query_models - list of models you want to find things similar to def initialize(model_classes, query_models, options = {}) - self.initialize_db + initialize_db self.runtime += Benchmark::realtime { # Case of an array, searching for models similar to those models in the array @@ -612,10 +612,10 @@ def initialize(model_classes, query_models, options = {}) self.important_terms = [] iter = eset._begin while not iter.equals(eset._end) - self.important_terms.push(iter.term) + important_terms.push(iter.term) iter.next end - similar_query = Xapian::Query.new(Xapian::Query::OP_OR, self.important_terms) + similar_query = Xapian::Query.new(Xapian::Query::OP_OR, important_terms) # Exclude original combined_query = Xapian::Query.new(Xapian::Query::OP_AND_NOT, similar_query, input_models_query) @@ -625,12 +625,12 @@ def initialize(model_classes, query_models, options = {}) } # Call base class constructor - self.initialize_query(options) + initialize_query(options) end # Text for lines in log file def log_description - "Similar: " + self.query_models.to_s + "Similar: " + query_models.to_s end end @@ -944,16 +944,16 @@ def self._destroy_and_rebuild_index_safely(model_classes, verbose, terms, values module InstanceMethods # Used internally def xapian_document_term - self.class.to_s + "-" + self.id.to_s + self.class.to_s + "-" + id.to_s end def xapian_value(field, type = nil, index_translations = false) - if index_translations && self.respond_to?("translations") + if index_translations && respond_to?("translations") if type == :date or type == :boolean value = single_xapian_value(field, type = type) else values = [] - for locale in self.translations.map { |x| x.locale } + for locale in translations.map { |x| x.locale } AlaveteliLocalization.with_locale(locale) do values << single_xapian_value(field, type=type) end @@ -974,7 +974,7 @@ def xapian_value(field, type = nil, index_translations = false) # Extract value of a field from the model def single_xapian_value(field, type = nil) - value = self.send(field.to_sym) || self[field] + value = send(field.to_sym) || self[field] if type == :date if value.kind_of?(Time) value.utc.strftime("%Y%m%d") @@ -1001,12 +1001,12 @@ def xapian_index(terms = true, values = true, texts = true) if self.class.xapian_options.include?(:if) if_value = xapian_value(self.class.xapian_options[:if], :boolean) if not if_value - self.xapian_destroy + xapian_destroy return end end - existing_query = Xapian::Query.new("I" + self.xapian_document_term) + existing_query = Xapian::Query.new("I" + xapian_document_term) ActsAsXapian.enquire.query = existing_query match = ActsAsXapian.enquire.mset(0,1,1).matches[0] @@ -1014,7 +1014,7 @@ def xapian_index(terms = true, values = true, texts = true) doc = match.document else doc = Xapian::Document.new - doc.data = self.xapian_document_term + doc.data = xapian_document_term doc.add_term("M" + self.class.to_s) doc.add_term("I" + doc.data) end @@ -1022,11 +1022,11 @@ def xapian_index(terms = true, values = true, texts = true) # 1. Which terms to index? We allow the user to specify particular ones terms_to_index = [] drop_all_terms = false - if terms and self.xapian_options[:terms] - terms_to_index = self.xapian_options[:terms].dup + if terms and xapian_options[:terms] + terms_to_index = xapian_options[:terms].dup if terms.is_a?(String) terms_to_index.reject! { |term| !terms.include?(term[1]) } - if terms_to_index.length == self.xapian_options[:terms].length + if terms_to_index.length == xapian_options[:terms].length drop_all_terms = true end else @@ -1035,13 +1035,13 @@ def xapian_index(terms = true, values = true, texts = true) end # 2. Texts to index? Currently, it's all or nothing texts_to_index = [] - if texts and self.xapian_options[:texts] - texts_to_index = self.xapian_options[:texts] + if texts and xapian_options[:texts] + texts_to_index = xapian_options[:texts] end # 3. Values to index? Currently, it's all or nothing values_to_index = [] - if values and self.xapian_options[:values] - values_to_index = self.xapian_options[:values] + if values and xapian_options[:values] + values_to_index = xapian_options[:values] end # clear any existing data that we might want to replace @@ -1104,21 +1104,21 @@ def xapian_index(terms = true, values = true, texts = true) # Delete record from the Xapian database def xapian_destroy - ActsAsXapian.writable_db.delete_document("I" + self.xapian_document_term) + ActsAsXapian.writable_db.delete_document("I" + xapian_document_term) end # Used to mark changes needed by batch indexer def xapian_mark_needs_index - xapian_create_job('update', self.class.base_class.to_s, self.id) + xapian_create_job('update', self.class.base_class.to_s, id) end def xapian_mark_needs_destroy - xapian_create_job('destroy', self.class.base_class.to_s, self.id) + xapian_create_job('destroy', self.class.base_class.to_s, id) end # Allow reindexing to be skipped if a flag is set def xapian_mark_needs_index_if_reindex - if (self.respond_to?(:no_xapian_reindex) && self.no_xapian_reindex == true) + if (respond_to?(:no_xapian_reindex) && no_xapian_reindex == true) return true end xapian_mark_needs_index diff --git a/lib/mail_handler/backends/mail_backend.rb b/lib/mail_handler/backends/mail_backend.rb index 98581ee9e1..42b34cc87c 100644 --- a/lib/mail_handler/backends/mail_backend.rb +++ b/lib/mail_handler/backends/mail_backend.rb @@ -17,16 +17,16 @@ class Message alias_method :old_cc, :cc def clean_addresses(old_method, val) - old_result = self.send(old_method, val) + old_result = send(old_method, val) old_result.class == Mail::AddressContainer ? old_result : nil end def to(val = nil) - self.clean_addresses :old_to, val + clean_addresses :old_to, val end def cc(val = nil) - self.clean_addresses :old_cc, val + clean_addresses :old_cc, val end end diff --git a/lib/mail_handler/reply_handler.rb b/lib/mail_handler/reply_handler.rb index 5161baebb8..2612977a85 100644 --- a/lib/mail_handler/reply_handler.rb +++ b/lib/mail_handler/reply_handler.rb @@ -80,7 +80,7 @@ def self.is_oof?(message) end def self.forward_on(raw_message, message = nil) - forward_to = self.get_forward_to_address(message) + forward_to = get_forward_to_address(message) IO.popen(%Q(/usr/sbin/sendmail -i "#{forward_to}"), 'wb') do |f| f.write(raw_message); f.close; @@ -132,7 +132,7 @@ def self.load_rails end def self.record_bounce(email_address, bounce_message) - self.load_rails + load_rails User.record_bounce_for_email(email_address, bounce_message) end end diff --git a/lib/world_foi_websites.rb b/lib/world_foi_websites.rb index 9dff21c045..61828eaaae 100644 --- a/lib/world_foi_websites.rb +++ b/lib/world_foi_websites.rb @@ -146,7 +146,7 @@ def self.world_foi_websites end def self.by_code(code) - result = self.world_foi_websites.find { |x| x[:country_iso_code].downcase == code.downcase } + result = world_foi_websites.find { |x| x[:country_iso_code].downcase == code.downcase } return result end diff --git a/spec/mailers/application_mailer_spec.rb b/spec/mailers/application_mailer_spec.rb index e615a041dc..9ba567888c 100644 --- a/spec/mailers/application_mailer_spec.rb +++ b/spec/mailers/application_mailer_spec.rb @@ -7,7 +7,7 @@ def set_base_views ApplicationMailer.class_eval do - @previous_view_paths = self.view_paths.dup + @previous_view_paths = view_paths.dup self.view_paths = [File.join(Rails.root, 'spec', 'fixtures', 'theme_views', 'core')] end end diff --git a/spec/models/customstates.rb b/spec/models/customstates.rb index 6f2f9045fd..a02c0488f0 100644 --- a/spec/models/customstates.rb +++ b/spec/models/customstates.rb @@ -6,20 +6,20 @@ def self.included(base) # Mixin methods for InfoRequest def theme_calculate_status - return 'waiting_classification' if self.awaiting_description - waiting_response = self.described_state == "waiting_response" || self.described_state == "deadline_extended" - return self.described_state unless waiting_response - if self.described_state == 'deadline_extended' + return 'waiting_classification' if awaiting_description + waiting_response = described_state == "waiting_response" || described_state == "deadline_extended" + return described_state unless waiting_response + if described_state == 'deadline_extended' return 'deadline_extended' if - Time.zone.now.strftime("%Y-%m-%d") < self.date_deadline_extended.strftime("%Y-%m-%d") + Time.zone.now.strftime("%Y-%m-%d") < date_deadline_extended.strftime("%Y-%m-%d") return 'waiting_response_very_overdue' if - Time.zone.now.strftime("%Y-%m-%d") > Holiday.due_date_from_working_days(self.date_deadline_extended, 15).strftime("%Y-%m-%d") + Time.zone.now.strftime("%Y-%m-%d") > Holiday.due_date_from_working_days(date_deadline_extended, 15).strftime("%Y-%m-%d") return 'waiting_response_overdue' end return 'waiting_response_very_overdue' if - Time.zone.now.strftime("%Y-%m-%d") > self.date_very_overdue_after.strftime("%Y-%m-%d") + Time.zone.now.strftime("%Y-%m-%d") > date_very_overdue_after.strftime("%Y-%m-%d") return 'waiting_response_overdue' if - Time.zone.now.strftime("%Y-%m-%d") > self.date_response_required_by.strftime("%Y-%m-%d") + Time.zone.now.strftime("%Y-%m-%d") > date_response_required_by.strftime("%Y-%m-%d") return 'waiting_response' end @@ -27,7 +27,7 @@ def date_deadline_extended # TODO: shouldn't this be 15 days after the date the status was # changed to "deadline extended"? Or perhaps 15 days ater the # initial request due date? - return Holiday.due_date_from_working_days(self.date_response_required_by, 15) + return Holiday.due_date_from_working_days(date_response_required_by, 15) end module ClassMethods From f612a16917b803f1c553e7a8f0524de4a41d8311 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Feb 2023 04:02:02 +0000 Subject: [PATCH 074/289] Bump rolify from 5.3.0 to 6.0.1 Bumps [rolify](https://github.com/RolifyCommunity/rolify) from 5.3.0 to 6.0.1. - [Release notes](https://github.com/RolifyCommunity/rolify/releases) - [Changelog](https://github.com/RolifyCommunity/rolify/blob/master/CHANGELOG.rdoc) - [Commits](https://github.com/RolifyCommunity/rolify/compare/v5.3.0...v6.0.1) --- updated-dependencies: - dependency-name: rolify dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index cc36002b61..f4e5dfc0c6 100644 --- a/Gemfile +++ b/Gemfile @@ -111,7 +111,7 @@ gem 'rack-utf8_sanitizer', '~> 1.8.0' gem 'recaptcha', '~> 5.12.3', require: 'recaptcha/rails' gem 'matrix', '~> 0.4.2' gem 'mini_magick', '~> 4.12.0' -gem 'rolify', '~> 5.3.0' +gem 'rolify', '~> 6.0.1' gem 'ruby-msg', '~> 1.5.0', :git => 'https://github.com/mysociety/ruby-msg.git', :branch => 'ascii-encoding' gem 'rubyzip', '~> 2.3.2' gem 'secure_headers', '~> 6.5.0' diff --git a/Gemfile.lock b/Gemfile.lock index 8fd1aeed95..2072166534 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -413,7 +413,7 @@ GEM rack (>= 1.4) retriable (3.1.2) rexml (3.2.5) - rolify (5.3.0) + rolify (6.0.1) rotp (6.2.0) routing-filter (0.7.0) actionpack (>= 6.1) @@ -599,7 +599,7 @@ DEPENDENCIES rails-controller-testing rails-i18n (~> 7.0.5) recaptcha (~> 5.12.3) - rolify (~> 5.3.0) + rolify (~> 6.0.1) routing-filter (~> 0.7.0) rspec-activemodel-mocks (~> 1.1.0) rspec-rails (~> 6.0.0) From 337f7b9b0894839fe52bfbd12438c56fe898695c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Feb 2023 04:09:59 +0000 Subject: [PATCH 075/289] Bump rubocop-performance from 1.15.2 to 1.16.0 Bumps [rubocop-performance](https://github.com/rubocop/rubocop-performance) from 1.15.2 to 1.16.0. - [Release notes](https://github.com/rubocop/rubocop-performance/releases) - [Changelog](https://github.com/rubocop/rubocop-performance/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-performance/compare/v1.15.2...v1.16.0) --- updated-dependencies: - dependency-name: rubocop-performance dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8fd1aeed95..aa7c4ea80d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -451,7 +451,7 @@ GEM unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.24.1) parser (>= 3.1.1.0) - rubocop-performance (1.15.2) + rubocop-performance (1.16.0) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) rubocop-rails (2.17.4) From d7233e4b96f69374d12b24d8c70e4ba60343e962 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Feb 2023 04:13:12 +0000 Subject: [PATCH 076/289] Bump mail from 2.8.0.1 to 2.8.1 Bumps [mail](https://github.com/mikel/mail) from 2.8.0.1 to 2.8.1. - [Release notes](https://github.com/mikel/mail/releases) - [Changelog](https://github.com/mikel/mail/blob/2.8.1/CHANGELOG.rdoc) - [Commits](https://github.com/mikel/mail/compare/2.8.0.1...2.8.1) --- updated-dependencies: - dependency-name: mail dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index cc36002b61..9e117ce5e4 100644 --- a/Gemfile +++ b/Gemfile @@ -101,7 +101,7 @@ gem 'jquery-ui-rails', '~> 6.0.0' gem 'json', '~> 2.6.2' gem 'holidays', '~> 8.6.0' gem 'iso_country_codes', '~> 0.7.8' -gem 'mail', '~> 2.8.0' +gem 'mail', '~> 2.8.1' gem 'maxmind-db', '~> 1.0.0' gem 'mahoro', '~> 0.5' gem 'nokogiri', '~> 1.14.0' diff --git a/Gemfile.lock b/Gemfile.lock index 8fd1aeed95..103b1a0aec 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -293,7 +293,7 @@ GEM crass (~> 1.0.2) nokogiri (>= 1.5.9) mahoro (0.5) - mail (2.8.0.1) + mail (2.8.1) mini_mime (>= 0.1.1) net-imap net-pop @@ -579,7 +579,7 @@ DEPENDENCIES listen (>= 3.0.5, < 3.8.1) locale (~> 2.1.3) mahoro (~> 0.5) - mail (~> 2.8.0) + mail (~> 2.8.1) matrix (~> 0.4.2) maxmind-db (~> 1.0.0) mime-types (< 3.0.0) From 1427b1f96d9ae9c70646102e6c7ad71875ddac73 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Feb 2023 04:17:30 +0000 Subject: [PATCH 077/289] Bump nokogiri from 1.14.0 to 1.14.1 Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.14.0 to 1.14.1. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.14.0...v1.14.1) --- updated-dependencies: - dependency-name: nokogiri dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index cc36002b61..7129c7920b 100644 --- a/Gemfile +++ b/Gemfile @@ -104,7 +104,7 @@ gem 'iso_country_codes', '~> 0.7.8' gem 'mail', '~> 2.8.0' gem 'maxmind-db', '~> 1.0.0' gem 'mahoro', '~> 0.5' -gem 'nokogiri', '~> 1.14.0' +gem 'nokogiri', '~> 1.14.1' gem 'open4', '~> 1.3.0' gem 'rack', '~> 2.2.6' gem 'rack-utf8_sanitizer', '~> 1.8.0' diff --git a/Gemfile.lock b/Gemfile.lock index 8fd1aeed95..cd11d51f78 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -331,16 +331,16 @@ GEM net-ssh-gateway (2.0.0) net-ssh (>= 4.0.0) nio4r (2.5.8) - nokogiri (1.14.0) + nokogiri (1.14.1) mini_portile2 (~> 2.8.0) racc (~> 1.4) - nokogiri (1.14.0-aarch64-linux) + nokogiri (1.14.1-aarch64-linux) racc (~> 1.4) - nokogiri (1.14.0-arm64-darwin) + nokogiri (1.14.1-arm64-darwin) racc (~> 1.4) - nokogiri (1.14.0-x86_64-darwin) + nokogiri (1.14.1-x86_64-darwin) racc (~> 1.4) - nokogiri (1.14.0-x86_64-linux) + nokogiri (1.14.1-x86_64-linux) racc (~> 1.4) oink (0.10.1) activerecord @@ -588,7 +588,7 @@ DEPENDENCIES money (~> 6.16.0) net-ssh (~> 7.0.1) net-ssh-gateway (>= 1.1.0, < 3.0.0) - nokogiri (~> 1.14.0) + nokogiri (~> 1.14.1) oink (~> 0.10.1) open4 (~> 1.3.0) pg (~> 1.4.5) From c35ec06d646f07f489ec8b76939260de86be9032 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 9 Feb 2023 09:38:56 +0000 Subject: [PATCH 078/289] Add rubocop flags to display useful information - Display cop names in offense messages. - Display extra details in offense messages. - Display style guide URLs in offense messages. --- .github/workflows/rubocop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index 4707f2017e..07e47da243 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -20,6 +20,7 @@ jobs: uses: reviewdog/action-rubocop@v1 with: github_token: ${{ secrets.github_token }} + rubocop_flags: -DES rubocop_version: gemfile rubocop_extensions: rubocop-performance:gemfile rubocop-rails:gemfile level: warning From aa866268f7f3b3d928befd273a1e31cc1f7f9771 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 9 Feb 2023 09:49:21 +0000 Subject: [PATCH 079/289] Remove PublicBody::Version#notes column This column has already been removed on `PublicBody` and replaced with a separate `Note` model. --- app/models/public_body.rb | 2 +- .../20230209094128_remove_public_body_version_notes.rb | 5 +++++ spec/factories/public_bodies.rb | 2 +- spec/fixtures/public_bodies.yml | 2 +- spec/fixtures/public_body_versions.yml | 6 ------ spec/models/public_body_spec.rb | 2 +- 6 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 db/migrate/20230209094128_remove_public_body_version_notes.rb diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 3a32a6750f..eb752f567d 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 20220928093559 +# Schema version: 20230209094128 # # Table name: public_bodies # diff --git a/db/migrate/20230209094128_remove_public_body_version_notes.rb b/db/migrate/20230209094128_remove_public_body_version_notes.rb new file mode 100644 index 0000000000..b99dba1c09 --- /dev/null +++ b/db/migrate/20230209094128_remove_public_body_version_notes.rb @@ -0,0 +1,5 @@ +class RemovePublicBodyVersionNotes < ActiveRecord::Migration[7.0] + def change + remove_column :public_body_versions, :notes, :text + end +end diff --git a/spec/factories/public_bodies.rb b/spec/factories/public_bodies.rb index 0f7dd29acb..4bfcd433fd 100644 --- a/spec/factories/public_bodies.rb +++ b/spec/factories/public_bodies.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 20220928093559 +# Schema version: 20230209094128 # # Table name: public_bodies # diff --git a/spec/fixtures/public_bodies.yml b/spec/fixtures/public_bodies.yml index 25a2752d05..de6edb1960 100644 --- a/spec/fixtures/public_bodies.yml +++ b/spec/fixtures/public_bodies.yml @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 20220928093559 +# Schema version: 20230209094128 # # Table name: public_bodies # diff --git a/spec/fixtures/public_body_versions.yml b/spec/fixtures/public_body_versions.yml index f5ede78207..e1264430b0 100644 --- a/spec/fixtures/public_body_versions.yml +++ b/spec/fixtures/public_body_versions.yml @@ -19,7 +19,6 @@ humpadink_public_body_update: request_email: humpadink-requests@localhost public_body_id: "3" id: "6" - notes: "An albatross told me!!!" version: "2" last_edit_editor: "francis" short_name: DfH @@ -33,7 +32,6 @@ geraldine_public_body_initial: request_email: geraldine-requests@localhost public_body_id: "2" id: 1 - notes: "-" version: "1" last_edit_editor: "mark" short_name: TGQ @@ -47,7 +45,6 @@ forlorn_public_body_initial: request_email: forlorn-requests@localhost public_body_id: "4" id: 2 - notes: A very lonely public body that no one has corresponded with version: "1" last_edit_editor: "robin" short_name: DoL @@ -61,7 +58,6 @@ silly_walks_public_body_intitial: request_email: silly-walks-requests@localhost public_body_id: 5 id: 3 - notes: You know the one. version: 1 last_edit_editor: robin short_name: MSW @@ -75,7 +71,6 @@ sensible_walks_public_body_initial: request_email: sensible-walks-requests@localhost public_body_id: 6 id: 4 - notes: I bet you’ve never heard of it. version: 1 last_edit_editor: robin short_name: SenseWalk @@ -89,7 +84,6 @@ other_public_body_initial: request_email: other@localhost public_body_id: 7 id: 7 - notes: More notes version: 1 last_edit_editor: louise short_name: Another Public Body diff --git a/spec/models/public_body_spec.rb b/spec/models/public_body_spec.rb index af1d3b3e5c..72794056c8 100644 --- a/spec/models/public_body_spec.rb +++ b/spec/models/public_body_spec.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 20220928093559 +# Schema version: 20230209094128 # # Table name: public_bodies # From 4ec03ffe4bc33f4a02cd5309ebebe13d3bd56b11 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 9 Feb 2023 12:50:56 +0000 Subject: [PATCH 080/289] Revert "Add support for Mail v2.8.x" This reverts commit 5bbdd57633ce8e8d969483613f5937ae2e04f5d2. --- config/environments/production.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 80ca3e4c5b..8962c5835b 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -118,8 +118,7 @@ config.action_mailer.delivery_method = AlaveteliConfiguration.production_mailer_delivery_method.to_sym - case AlaveteliConfiguration.production_mailer_delivery_method.to_sym - when :smtp + if AlaveteliConfiguration.production_mailer_delivery_method.to_sym == :smtp config.action_mailer.smtp_settings = { :address => AlaveteliConfiguration.smtp_mailer_address, :port => AlaveteliConfiguration.smtp_mailer_port, @@ -129,11 +128,6 @@ :authentication => AlaveteliConfiguration.smtp_mailer_authentication, :enable_starttls_auto => AlaveteliConfiguration.smtp_mailer_enable_starttls_auto } - when :sendmail - config.action_mailer.sendmail_settings = { - location: '/usr/sbin/sendmail', - arguments: %w[-i] - } end exception_notifier_prefix = '[ERROR] ' From ebf592a2936c6e43c79ae39346e3be5107ef57ec Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 9 Feb 2023 13:25:38 +0000 Subject: [PATCH 081/289] Update supported Rubies README link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bb044984fc..455a6b5088 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ see [the project website](http://alaveteli.org) for instructions on installing A ## Compatibility -Every Alaveteli commit is tested by GitHub Actions on the [following Ruby platforms](https://github.com/mysociety/alaveteli/blob/develop/.github/workflows/ci.yml#L15) +Every Alaveteli commit is tested by GitHub Actions on the [following Ruby platforms](https://github.com/mysociety/alaveteli/blob/develop/.github/workflows/ci.yml#L27-L29) * ruby-3.0 * ruby-3.1 From 9c9dff5fa9eecd90fec829c81b61f55dd5382898 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Mon, 13 Feb 2023 10:09:37 +0000 Subject: [PATCH 082/289] Update Phusion Passenger config Updated for latest version or Passenger/Apache. --- config/httpd.conf-example | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/httpd.conf-example b/config/httpd.conf-example index d545c419b1..8701159eea 100644 --- a/config/httpd.conf-example +++ b/config/httpd.conf-example @@ -23,7 +23,6 @@ # App server configuration PassengerAppRoot /var/www/alaveteli - PassengerResolveSymlinksInDocumentRoot on # Uncomment the following line if you want to run Alaveteli # with the ruby set by rbenv @@ -149,7 +148,7 @@ # Include optional configuration - Include vhost.d/alaveteli/*.conf + IncludeOptional vhost.d/alaveteli/*.conf From 9ff558560f95a56df11bd87b0f79b88116216600 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Mon, 13 Feb 2023 10:12:32 +0000 Subject: [PATCH 083/289] Remove unused CI conditionals GitHub Actions doesn't run `script/rails-post-deploy` so this is unneeded. --- script/rails-deploy-before-down | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/script/rails-deploy-before-down b/script/rails-deploy-before-down index d7a68a21f7..ada0f9411e 100755 --- a/script/rails-deploy-before-down +++ b/script/rails-deploy-before-down @@ -100,10 +100,7 @@ BUNDLE_PATH="${OPTION_BUNDLE_PATH:-vendor/bundle}" bundle_install_options="--path $BUNDLE_PATH" -if [ "$CI" = "true" ] -then - bundle_install_options="$bundle_install_options --deployment" -elif [ "$STAGING_SITE" = "0" ] +if [ "$STAGING_SITE" = "0" ] then bundle_install_options="$bundle_install_options --without development debug test --deployment" else @@ -117,10 +114,7 @@ bundle exec rake submodules:check bundle exec rake themes:install -if ! [ "$CI" = "true" ] -then - bundle exec rake geoip:download_data -fi +bundle exec rake geoip:download_data if [ "$STAGING_SITE" = "0" ] then From 99c3dbe98bdd480efd8fecaab54ac09f937b0d0f Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Mon, 13 Feb 2023 10:52:11 +0000 Subject: [PATCH 084/289] Remove configuration of Ruby 2.7 option on install Not needed now we've dropped support for Ruby 2.7. --- script/install-as-user | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/script/install-as-user b/script/install-as-user index 3d2d1ae4c0..eb72f8cf7b 100755 --- a/script/install-as-user +++ b/script/install-as-user @@ -110,24 +110,6 @@ if [ $USE_RBENV = true ]; then gem install bundler fi -# Prevent extreme deprecation warnings on Ruby 2.7.0 provided by Ubuntu Focal -# (Fixed in Ruby 2.7.2). ensure_line_present is not available here, so just do -# this as it's pretty temporary. -RUBY27_OPT_COMMENT="Set Ruby options for Ruby 2.7" -RUBY27_OPT_START="# START $RUBY27_OPT_COMMENT" -RUBY27_OPT_END="# END $RUBY27_OPT_COMMENT" -if ruby -v | grep "2.7.[01]" > /dev/null && ! grep "$RUBY27_OPT_START" "$BASHRC" > /dev/null -then - cat >>$BASHRC < /dev/null; then - export RUBYOPT='-W:no-deprecated -W:no-experimental' -fi -$RUBY27_OPT_END -EOF -fi - # Speed up the installation of gems: echo 'gem: --no-ri --no-rdoc' > "$HOME/.gemrc" From 303c14c1b7fb58776316d84c21c2db8aa6e4d48a Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 23 Jan 2023 11:41:15 +0000 Subject: [PATCH 085/289] Refactor: FormatString --- app/models/mail_server_log/delivery_status.rb | 2 +- app/models/mail_server_log/exim_line.rb | 2 +- app/models/mail_server_log/postfix_line.rb | 2 +- spec/models/mail_server_log/delivery_status_spec.rb | 2 +- spec/models/mail_server_log/exim_line_spec.rb | 2 +- spec/models/mail_server_log/postfix_line_spec.rb | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/models/mail_server_log/delivery_status.rb b/app/models/mail_server_log/delivery_status.rb index 3da8638d4d..b3ac1ed8fe 100644 --- a/app/models/mail_server_log/delivery_status.rb +++ b/app/models/mail_server_log/delivery_status.rb @@ -58,7 +58,7 @@ def capitalize end def inspect - obj_id = "0x00%x" % (object_id << 1) + obj_id = format("0x00%x", (object_id << 1)) %Q(#<#{self.class}:#{obj_id} @status=:#{ status }>) end diff --git a/app/models/mail_server_log/exim_line.rb b/app/models/mail_server_log/exim_line.rb index 46d8e93b21..bf54e23a01 100644 --- a/app/models/mail_server_log/exim_line.rb +++ b/app/models/mail_server_log/exim_line.rb @@ -68,7 +68,7 @@ def to_s end def inspect - %Q(#<#{self.class}:#{"0x00%x" % (object_id << 1)} @line="#{ line }">) + %Q(#<#{self.class}:#{format("0x00%x", (object_id << 1))} @line="#{ line }">) end private diff --git a/app/models/mail_server_log/postfix_line.rb b/app/models/mail_server_log/postfix_line.rb index 9aa0beb4c2..3c4d0625f7 100644 --- a/app/models/mail_server_log/postfix_line.rb +++ b/app/models/mail_server_log/postfix_line.rb @@ -55,7 +55,7 @@ def to_s end def inspect - %Q(#<#{self.class}:#{"0x00%x" % (object_id << 1)} @line="#{ line }">) + %Q(#<#{self.class}:#{format("0x00%x", (object_id << 1))} @line="#{ line }">) end private diff --git a/spec/models/mail_server_log/delivery_status_spec.rb b/spec/models/mail_server_log/delivery_status_spec.rb index e2e81abdea..6f10924724 100644 --- a/spec/models/mail_server_log/delivery_status_spec.rb +++ b/spec/models/mail_server_log/delivery_status_spec.rb @@ -56,7 +56,7 @@ it 'returns the default format' do subject = described_class.new(:delivered) - obj_id = "0x00%x" % (subject.object_id << 1) + obj_id = format("0x00%x", (subject.object_id << 1)) expected = %Q(#<#{described_class}:#{obj_id} @status=:delivered>) expect(subject.inspect).to eq(expected) diff --git a/spec/models/mail_server_log/exim_line_spec.rb b/spec/models/mail_server_log/exim_line_spec.rb index fac905057b..290805b5ae 100644 --- a/spec/models/mail_server_log/exim_line_spec.rb +++ b/spec/models/mail_server_log/exim_line_spec.rb @@ -41,7 +41,7 @@ it 'returns the default format' do subject = described_class.new('log line') - obj_id = "0x00%x" % (subject.object_id << 1) + obj_id = format("0x00%x", (subject.object_id << 1)) expected = %Q(#<#{described_class}:#{obj_id} @line="log line">) expect(subject.inspect).to eq(expected) diff --git a/spec/models/mail_server_log/postfix_line_spec.rb b/spec/models/mail_server_log/postfix_line_spec.rb index 51f9930f66..63cd2654cc 100644 --- a/spec/models/mail_server_log/postfix_line_spec.rb +++ b/spec/models/mail_server_log/postfix_line_spec.rb @@ -23,7 +23,7 @@ it 'returns the default format' do subject = described_class.new('log line') - obj_id = "0x00%x" % (subject.object_id << 1) + obj_id = format("0x00%x", (subject.object_id << 1)) expected = %Q(#<#{described_class}:#{obj_id} @line="log line">) expect(subject.inspect).to eq(expected) From 297315da47de2bb4c1bb83151ba314c6d6d915b6 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 23 Jan 2023 13:23:03 +0000 Subject: [PATCH 086/289] Refactor: FormatString --- lib/acts_as_xapian/acts_as_xapian.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/acts_as_xapian/acts_as_xapian.rb b/lib/acts_as_xapian/acts_as_xapian.rb index f84f20556e..73b3fd4a31 100644 --- a/lib/acts_as_xapian/acts_as_xapian.rb +++ b/lib/acts_as_xapian/acts_as_xapian.rb @@ -432,7 +432,7 @@ def results # Log time taken, excluding database lookups below which will be displayed separately by ActiveRecord if ActiveRecord::Base.logger - ActiveRecord::Base.logger.add(Logger::DEBUG, " Xapian query (#{'%.5fs' % self.runtime}) #{log_description}") + ActiveRecord::Base.logger.add(Logger::DEBUG, format(" Xapian query (%.5fs) %s", self.runtime, self.log_description)) end # Look up without too many SQL queries From 1cfdb47c87c5943c99718dede2fc52dfca21ebc4 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 3 Feb 2023 14:48:34 +0000 Subject: [PATCH 087/289] Refactor: FormatString --- app/mailers/outgoing_mailer.rb | 2 +- app/models/foi_attachment.rb | 2 +- spec/controllers/attachments_controller_spec.rb | 2 +- spec/support/email_helpers.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/mailers/outgoing_mailer.rb b/app/mailers/outgoing_mailer.rb index ebee8e4762..b61d43ed84 100644 --- a/app/mailers/outgoing_mailer.rb +++ b/app/mailers/outgoing_mailer.rb @@ -91,7 +91,7 @@ def self.is_followupable?(info_request, incoming_message_followup) def self.id_for_message(outgoing_message) message_id = "ogm-" + outgoing_message.id.to_s t = Time.zone.now - message_id += "+" + '%08x%05x-%04x' % [t.to_i, t.tv_usec, rand(0xffff)] + message_id += "+" + format('%08x%05x-%04x', t.to_i, t.tv_usec, rand(0xffff)) message_id += "@" + AlaveteliConfiguration::incoming_email_domain return "<" + message_id + ">" end diff --git a/app/models/foi_attachment.rb b/app/models/foi_attachment.rb index d4b74a2537..ab21db2f76 100644 --- a/app/models/foi_attachment.rb +++ b/app/models/foi_attachment.rb @@ -239,7 +239,7 @@ def update_display_size! s = body.size if s > 1024 * 1024 - self.display_size = sprintf("%.1f", s.to_f / 1024 / 1024) + 'M' + self.display_size = format("%.1f", s.to_f / 1024 / 1024) + 'M' else self.display_size = (s / 1024).to_s + 'K' end diff --git a/spec/controllers/attachments_controller_spec.rb b/spec/controllers/attachments_controller_spec.rb index 889e8d57d5..5858755901 100644 --- a/spec/controllers/attachments_controller_spec.rb +++ b/spec/controllers/attachments_controller_spec.rb @@ -57,7 +57,7 @@ def show(params = {}) # check the file permissions key_path = @controller.send(:cache_key_path) - octal_stat = sprintf("%o", File.stat(key_path).mode)[-4..-1] + octal_stat = format("%o", File.stat(key_path).mode)[-4..-1] expect(octal_stat).to eq('0644') # clean up and remove the file diff --git a/spec/support/email_helpers.rb b/spec/support/email_helpers.rb index 0627e4c7a9..518c0848c8 100644 --- a/spec/support/email_helpers.rb +++ b/spec/support/email_helpers.rb @@ -2,7 +2,7 @@ def load_raw_emails_data raw_emails_yml = File.join(RSpec.configuration.fixture_path, "raw_emails.yml") for raw_email_id in YAML::load_file(raw_emails_yml).map { |k,v| v["id"] } do raw_email = RawEmail.find(raw_email_id) - raw_email.data = load_file_fixture("raw_emails/%d.email" % [raw_email_id]) + raw_email.data = load_file_fixture(format("raw_emails/%d.email", raw_email_id)) end end From 1226462642a7a500c6dec1292788c6f2cd2f94a4 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Mon, 13 Feb 2023 10:57:25 +0000 Subject: [PATCH 088/289] Set STAGING_SITE when generating initial config We need this configuration value in `script/rails-deploy-before-down` to correctly set `RAILS_ENV` to `production` when not doing a development install. Fixes #7583 --- script/install-as-user | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/script/install-as-user b/script/install-as-user index 3d2d1ae4c0..a456bb2d98 100755 --- a/script/install-as-user +++ b/script/install-as-user @@ -141,6 +141,12 @@ RANDOM_EMAIL_SECRET=$(random_alphanumerics 32) RANDOM_EMERGENCY_PASSWORD=$(random_alphanumerics 10) RANDOM_COOKIE_SECRET=$(random_alphanumerics 100) +if [ "$DEVELOPMENT_INSTALL" = true ]; then + STAGING_SITE=1 +else + STAGING_SITE=0 +fi + if ! [ -f config/general.yml ] then sed -r \ @@ -158,6 +164,7 @@ then -e "s,^( *CONTACT_EMAIL:).*,\\1 'postmaster@$HOST'," \ -e "s,^( *TRACK_SENDER_EMAIL:).*,\\1 'postmaster@$HOST'," \ -e "s,^( *SECRET_KEY_BASE:).*,\\1 '$RANDOM_COOKIE_SECRET'," \ + -e "s,^( *STAGING_SITE:).*,\\1 '$STAGING_SITE'," \ -e "s,^( *FORWARD_NONBOUNCE_RESPONSES_TO:).*,\\1 'user-support@$HOST'," \ -e "s,^( *HTML_TO_PDF_COMMAND:).*,\\1 '/usr/local/bin/wkhtmltopdf'," \ -e "s,^( *EXCEPTION_NOTIFICATIONS_FROM:).*,\\1 'do-not-reply-to-this-address@$HOST'," \ From 527493042dd66f953a9a4e83ae9a1a0a9c5cc4bd Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 14 Feb 2023 11:54:03 +0000 Subject: [PATCH 089/289] Fix bundler deprecation warnings Also ensures when switch from a production to development install that the correct gems are installed by unsetting the `deployment` and `without` options. Fixes #6417 --- script/rails-deploy-before-down | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/script/rails-deploy-before-down b/script/rails-deploy-before-down index d7a68a21f7..0a41cf6f79 100755 --- a/script/rails-deploy-before-down +++ b/script/rails-deploy-before-down @@ -97,21 +97,25 @@ fi OPTION_BUNDLE_PATH=$(bin/config BUNDLE_PATH) BUNDLE_PATH="${OPTION_BUNDLE_PATH:-vendor/bundle}" - -bundle_install_options="--path $BUNDLE_PATH" +bundle config set --local path $BUNDLE_PATH if [ "$CI" = "true" ] then - bundle_install_options="$bundle_install_options --deployment" + bundle config set --local deployment 'true' elif [ "$STAGING_SITE" = "0" ] then - bundle_install_options="$bundle_install_options --without development debug test --deployment" + bundle config set --local deployment 'true' + bundle config set --local without 'development debug test' else - bundle_install_options="$bundle_install_options" + bundle config unset --local deployment + bundle config unset --local without fi -echo "Running bundle install with options: $bundle_install_options" -bundle install $bundle_install_options +echo "Bundle install options:" +bundle config list + +echo "Running bundle install:" +bundle install bundle exec rake submodules:check From d70283f987c7842f39a5062212590894149f7b3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Feb 2023 05:02:38 +0000 Subject: [PATCH 090/289] Bump rubocop from 1.44.1 to 1.45.1 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.44.1 to 1.45.1. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.44.1...v1.45.1) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .ruby-style.yml | 7 +++++-- Gemfile | 2 +- Gemfile.lock | 12 ++++++------ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.ruby-style.yml b/.ruby-style.yml index ee6ea7fde2..fdb65ea814 100644 --- a/.ruby-style.yml +++ b/.ruby-style.yml @@ -24,8 +24,8 @@ AllCops: - node_modules/**/* - vendor/**/* - ".git/**/*" - - "bin/bundle" - - "bin/rubocop" + - bin/bundle + - bin/rubocop DisplayCopNames: false StyleGuideCopsOnly: false DisabledByDefault: true @@ -1966,6 +1966,9 @@ Style/RedundantFileExtensionInRequire: Style/RedundantFreeze: Enabled: true +Style/RedundantHeredocDelimiterQuotes: + Enabled: false + Style/RedundantInitialize: Enabled: false diff --git a/Gemfile b/Gemfile index a808f9a387..3d36861d68 100644 --- a/Gemfile +++ b/Gemfile @@ -188,7 +188,7 @@ group :development do gem 'launchy', '< 2.6.0' gem 'listen', '>= 3.0.5', '< 3.8.1' gem 'web-console', '>= 3.3.0' - gem 'rubocop', '~> 1.44.1', require: false + gem 'rubocop', '~> 1.45.1', require: false gem 'rubocop-performance', require: false gem 'rubocop-rails', require: false end diff --git a/Gemfile.lock b/Gemfile.lock index 97b2a05c40..787c6f4d4b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -348,7 +348,7 @@ GEM open4 (1.3.4) os (1.1.4) parallel (1.22.1) - parser (3.2.0.0) + parser (3.2.1.0) ast (~> 2.4.1) pg (1.4.5) prime (0.1.2) @@ -404,7 +404,7 @@ GEM ffi (~> 1.0) recaptcha (5.12.3) json - regexp_parser (2.6.2) + regexp_parser (2.7.0) representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) @@ -439,7 +439,7 @@ GEM rspec-mocks (~> 3.11) rspec-support (~> 3.11) rspec-support (3.11.1) - rubocop (1.44.1) + rubocop (1.45.1) json (~> 2.3) parallel (~> 1.10) parser (>= 3.2.0.0) @@ -449,8 +449,8 @@ GEM rubocop-ast (>= 1.24.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.24.1) - parser (>= 3.1.1.0) + rubocop-ast (1.26.0) + parser (>= 3.2.1.0) rubocop-performance (1.16.0) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -603,7 +603,7 @@ DEPENDENCIES routing-filter (~> 0.7.0) rspec-activemodel-mocks (~> 1.1.0) rspec-rails (~> 6.0.0) - rubocop (~> 1.44.1) + rubocop (~> 1.45.1) rubocop-performance rubocop-rails ruby-msg (~> 1.5.0)! From 8da34dbe9a4963a571d85d2884bb3837a627c505 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 16 Feb 2023 18:01:22 +0000 Subject: [PATCH 091/289] Reduce default visibility of sign-in tracking IP addresses are quite identifying, and in WhatDoTheyKnow's privacy policy [1] we say that we don't ordinarily look at them while administering the site. Making it an active decision by an admin to reveal these preserves this position of default privacy, but makes it much easier to investigate issues without developer involvement. [1] https://www.whatdotheyknow.com/help/privacy#our_logging --- app/views/admin/users/_sign_in_table.html.erb | 81 ++++++++++++------- 1 file changed, 53 insertions(+), 28 deletions(-) diff --git a/app/views/admin/users/_sign_in_table.html.erb b/app/views/admin/users/_sign_in_table.html.erb index 7bc3185d39..c7fa11a9d6 100644 --- a/app/views/admin/users/_sign_in_table.html.erb +++ b/app/views/admin/users/_sign_in_table.html.erb @@ -10,38 +10,63 @@ <% end %> <% if sign_ins.any? %> - - <% sign_ins.each do |sign_in| %> - - +
+
+
+

+ Sign in tracking records the IP address and date of sign in, as well + as a geolocation estimation, and links this IP address to sign ins + from other user accounts using the same IP address. This can be + useful for investigating misuse, but may also reveal legitimate use + of alternative accounts. Care should be taken when revealing this + information. +

-
+

+ + Reveal Sign Ins + +

+ - +
+
+
<%= user_both_links(sign_in.user) %> - - <%= link_to sign_in.ip, admin_sign_ins_path(query: sign_in.ip) %> - - - - <% if sign_in.country %> - <%= link_to admin_sign_ins_path(query: sign_in.country) do %> - <%= sign_in.country %> - <% end %> - <% else %> - ?? - <% end %> - -
+ <% sign_ins.each do |sign_in| %> + + + + + + - + - - - <% end %> -
<%= user_both_links(sign_in.user) %> + + <%= link_to sign_in.ip, admin_sign_ins_path(query: sign_in.ip) %> + + + + <% if sign_in.country %> + <%= link_to admin_sign_ins_path(query: sign_in.country) do %> + <%= sign_in.country %> + <% end %> + <% else %> + ?? + <% end %> + + <%= admin_date(sign_in.created_at, ago_only: true) %><%= admin_date(sign_in.created_at, ago_only: true) %> - <%= sign_in.other_users.size %> others using this - IP -
+
+ <%= sign_in.other_users.size %> others using this + IP +
+
+ + + <% elsif User::SignIn.retain_signins? %>

None yet.

<% end %> From 568d040aa3c6850fa25b24f4842fca1e20bf56e3 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 17 Feb 2023 10:09:47 +0000 Subject: [PATCH 092/289] Use both_links for admin bodies index It's now convention to use `both_links` when displaying admin records, so update this partial to use it. We can now quickly get to the public page from the admin bodies index. --- app/views/admin_public_body/_public_body.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin_public_body/_public_body.html.erb b/app/views/admin_public_body/_public_body.html.erb index 036ea5f598..9ab3762c25 100644 --- a/app/views/admin_public_body/_public_body.html.erb +++ b/app/views/admin_public_body/_public_body.html.erb @@ -2,7 +2,7 @@
<%= chevron_right %> - <%= link_to(public_body.name, admin_body_path(public_body), :title => "view full details")%> + <%= both_links(public_body) %>
diff --git a/app/views/request/new.html.erb b/app/views/request/new.html.erb index 512c28e2de..e30eb74958 100644 --- a/app/views/request/new.html.erb +++ b/app/views/request/new.html.erb @@ -133,6 +133,11 @@ <%= _('To') %> <%= h(@info_request.public_body.name) %>

+ +

+ <%= _('From') %> + <%= @user&.name || '…' %> +

<% end %> <% unless @batch %> diff --git a/app/views/request/preview.html.erb b/app/views/request/preview.html.erb index 5ba0c770bc..3f8ea1df4f 100644 --- a/app/views/request/preview.html.erb +++ b/app/views/request/preview.html.erb @@ -35,8 +35,13 @@ <% else %> <%=h(@info_request.public_body.name)%> <% end %> +

+

+ <%= _('From') %> + <%= @user&.name || '…' %>

+

<%= _('Subject') %> <%= @info_request.email_subject_request %>

From 1d44961d8c0db2a94f0964eca321b52c413dce46 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Tue, 21 Feb 2023 15:39:35 +0000 Subject: [PATCH 120/289] Add stub user messages limit check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don’t currently record the sending of user messages, but want to be able to fine-tune their use. This at least gives us a method to override in the theme and key off to render a rate limit message. --- app/models/user.rb | 6 ++++++ spec/models/user_spec.rb | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index 62d4f049f2..ccf4d66cc0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -457,6 +457,8 @@ def can_contact_other_users? end def exceeded_limit?(content) + return exceeded_user_message_limit? if content == :user_messages + return false if no_limit? return false if can_make_batch_requests? return false if content_limit(content).blank? @@ -668,4 +670,8 @@ def update_pro_account def content_limit(content) CONTENT_LIMIT[content] end + + def exceeded_user_message_limit? + false + end end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 9b0b7cb7f0..cb266419f7 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1982,5 +1982,13 @@ def create_user(options = {}) expect(subject).to eq(true) end end + + context 'limiting user messages' do + let(:content) { :user_messages } + + it 'always returns false' do + expect(subject).to eq(false) + end + end end end From 8922bcded10ac76e77802baae7229f3819ea361d Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Tue, 21 Feb 2023 15:50:13 +0000 Subject: [PATCH 121/289] Add basic user message rate limiting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Doesn’t do anything for now as we don’t have a rate monitor, but we can hack that in to theme code by overriding `User#exceeded_user_message_limit?` --- app/controllers/users/messages_controller.rb | 10 +++++--- app/models/user.rb | 2 +- .../users/messages/rate_limited.html.erb | 7 ++++++ .../users/messages_controller_spec.rb | 24 +++++++++++++++++++ 4 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 app/views/users/messages/rate_limited.html.erb diff --git a/app/controllers/users/messages_controller.rb b/app/controllers/users/messages_controller.rb index 2877205c83..da4146e49d 100644 --- a/app/controllers/users/messages_controller.rb +++ b/app/controllers/users/messages_controller.rb @@ -33,11 +33,15 @@ def set_recipient end def check_can_send_messages - # Banned from messaging users? return unless authenticated? && !authenticated_user.can_contact_other_users? - @details = authenticated_user.can_fail_html - render template: 'user/banned' + if authenticated_user.exceeded_limit?(:user_messages) + render template: 'users/messages/rate_limited' + else + # Banned user + @details = authenticated_user.can_fail_html + render template: 'user/banned' + end end def check_logged_in diff --git a/app/models/user.rb b/app/models/user.rb index ccf4d66cc0..3687d971a9 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -453,7 +453,7 @@ def can_make_comments? end def can_contact_other_users? - active? + active? && !exceeded_limit?(:user_messages) end def exceeded_limit?(content) diff --git a/app/views/users/messages/rate_limited.html.erb b/app/views/users/messages/rate_limited.html.erb new file mode 100644 index 0000000000..70271df2d0 --- /dev/null +++ b/app/views/users/messages/rate_limited.html.erb @@ -0,0 +1,7 @@ +<% @title = _('Cannot send messages') %> + +

<%= @title %>

+ +

+ <%= _('User messages cannot be sent right now. Please try again later.') %> +

diff --git a/spec/controllers/users/messages_controller_spec.rb b/spec/controllers/users/messages_controller_spec.rb index ddcf15be05..fd0157f3c2 100644 --- a/spec/controllers/users/messages_controller_spec.rb +++ b/spec/controllers/users/messages_controller_spec.rb @@ -35,6 +35,14 @@ }.to raise_error ActiveRecord::RecordNotFound end + it 'prevents messages from users who have reached their rate limit' do + allow_any_instance_of(User). + to receive(:exceeded_limit?).with(:user_messages).and_return(true) + + get :contact, params: { url_name: recipient.url_name } + + expect(response).to render_template('users/messages/rate_limited') + end end describe 'POST contact' do @@ -51,6 +59,22 @@ expect(response).to render_template('contact') end + it 'prevents messages from users who have reached their rate limit' do + allow_any_instance_of(User). + to receive(:exceeded_limit?).with(:user_messages).and_return(true) + + post :contact, params: { + url_name: recipient.url_name, + contact: { + subject: 'Foo', + message: 'Bar' + }, + submitted_contact_form: 1 + } + + expect(response).to render_template('users/messages/rate_limited') + end + context 'the site is configured to require a captcha' do before do allow(AlaveteliConfiguration). From b341f133beef801c16f8673b92ae6bd2859d4006 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 22 Feb 2023 15:53:18 +0000 Subject: [PATCH 122/289] Add UserMessage A simple record associated with User to record when user messages are sent. --- app/models/user.rb | 5 +++++ app/models/user_message.rb | 14 ++++++++++++++ db/migrate/20230222154014_create_user_messages.rb | 8 ++++++++ spec/factories/user_messages.rb | 15 +++++++++++++++ spec/models/user_message_spec.rb | 14 ++++++++++++++ 5 files changed, 56 insertions(+) create mode 100644 app/models/user_message.rb create mode 100644 db/migrate/20230222154014_create_user_messages.rb create mode 100644 spec/factories/user_messages.rb create mode 100644 spec/models/user_message_spec.rb diff --git a/app/models/user.rb b/app/models/user.rb index 3687d971a9..ceffc1b0a7 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -144,6 +144,11 @@ class User < ApplicationRecord inverse_of: :user, dependent: :destroy + has_many :user_messages, + -> { order(created_at: :desc) }, + inverse_of: :user, + dependent: :destroy + scope :active, -> { not_banned.not_closed } scope :banned, -> { where.not(ban_text: '') } scope :not_banned, -> { where(ban_text: '') } diff --git a/app/models/user_message.rb b/app/models/user_message.rb new file mode 100644 index 0000000000..828467b4e0 --- /dev/null +++ b/app/models/user_message.rb @@ -0,0 +1,14 @@ +# == Schema Information +# Schema version: 20230222154014 +# +# Table name: user_messages +# +# id :bigint not null, primary key +# user_id :bigint +# created_at :datetime not null +# updated_at :datetime not null +# +class UserMessage < ApplicationRecord + belongs_to :user, + inverse_of: :user_messages +end diff --git a/db/migrate/20230222154014_create_user_messages.rb b/db/migrate/20230222154014_create_user_messages.rb new file mode 100644 index 0000000000..917d95e809 --- /dev/null +++ b/db/migrate/20230222154014_create_user_messages.rb @@ -0,0 +1,8 @@ +class CreateUserMessages < ActiveRecord::Migration[7.0] + def change + create_table :user_messages do |t| + t.references :user, foreign_key: true + t.timestamps + end + end +end diff --git a/spec/factories/user_messages.rb b/spec/factories/user_messages.rb new file mode 100644 index 0000000000..b4536b5f62 --- /dev/null +++ b/spec/factories/user_messages.rb @@ -0,0 +1,15 @@ +# == Schema Information +# Schema version: 20230222154014 +# +# Table name: user_messages +# +# id :bigint not null, primary key +# user_id :bigint +# created_at :datetime not null +# updated_at :datetime not null +# +FactoryBot.define do + factory :user_message do + user + end +end diff --git a/spec/models/user_message_spec.rb b/spec/models/user_message_spec.rb new file mode 100644 index 0000000000..658d635b68 --- /dev/null +++ b/spec/models/user_message_spec.rb @@ -0,0 +1,14 @@ +# == Schema Information +# Schema version: 20230222154014 +# +# Table name: user_messages +# +# id :bigint not null, primary key +# user_id :bigint +# created_at :datetime not null +# updated_at :datetime not null +# +require 'spec_helper' + +RSpec.describe UserMessage, type: :model do +end From 7b99d0fd26f0fcbfa466534bc5adc96c97c45ef9 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 22 Feb 2023 15:53:45 +0000 Subject: [PATCH 123/289] Record when a User sends a UserMessage We can later use this to moderate use of the system. --- app/controllers/users/messages_controller.rb | 2 ++ spec/controllers/users/messages_controller_spec.rb | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/app/controllers/users/messages_controller.rb b/app/controllers/users/messages_controller.rb index da4146e49d..ac748f7bc1 100644 --- a/app/controllers/users/messages_controller.rb +++ b/app/controllers/users/messages_controller.rb @@ -18,6 +18,8 @@ def contact end send_message(@user, @recipient_user) + @user.user_messages.create + flash[:notice] = _('Your message to {{recipient_user_name}} has ' \ 'been sent!', recipient_user_name: @recipient_user.name.html_safe) diff --git a/spec/controllers/users/messages_controller_spec.rb b/spec/controllers/users/messages_controller_spec.rb index fd0157f3c2..efd3db2413 100644 --- a/spec/controllers/users/messages_controller_spec.rb +++ b/spec/controllers/users/messages_controller_spec.rb @@ -122,6 +122,18 @@ expect(mail.header['Reply-To'].to_s).to match(sender.email) end + it 'records the message' do + post :contact, params: { + url_name: recipient.url_name, + contact: { + subject: 'Dearest you', + message: 'Just a test!' + }, + submitted_contact_form: 1 + } + + expect(UserMessage.last.user).to eq(sender) + end end describe 'when sending a message that looks like spam' do From e3a2070c0cd275f5194287d4bd93c2bc805e7757 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 22 Feb 2023 16:20:34 +0000 Subject: [PATCH 124/289] Increase comment both_links truncate length Adds a little more visibility of what a comment contains. Makes it less likely you need to click in to _every_ comment to find an issue. The default value is 30. --- app/helpers/admin/link_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/admin/link_helper.rb b/app/helpers/admin/link_helper.rb index bd4480413d..02c8557ce2 100644 --- a/app/helpers/admin/link_helper.rb +++ b/app/helpers/admin/link_helper.rb @@ -81,7 +81,7 @@ def comment_both_links(comment) icon = prominence_icon(comment) link_to(icon, comment_path(comment), title: title) + ' ' + - link_to(truncate(comment.body), edit_admin_comment_path(comment), + link_to(truncate(comment.body, length: 60), edit_admin_comment_path(comment), title: admin_title) end From 8ad71126c3969d29d5c3c6be493a1c3183f7016a Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 23 Feb 2023 15:31:28 +0000 Subject: [PATCH 125/289] Add basic user message opt out Adds initial handling of opting out of the user messaging system. All users are opted in by default, as they are prior to this commit, but now developers can at least switch this flag on request. A basic version of https://github.com/mysociety/alaveteli/issues/1971. --- app/controllers/users/messages_controller.rb | 14 ++++++++-- app/models/user.rb | 3 ++- app/views/users/messages/opted_out.html.erb | 7 +++++ ...45243_add_receive_user_messages_to_user.rb | 6 +++++ .../users/messages_controller_spec.rb | 27 +++++++++++++++++++ spec/factories/users.rb | 3 ++- spec/fixtures/users.yml | 3 ++- spec/models/user_spec.rb | 3 ++- 8 files changed, 60 insertions(+), 6 deletions(-) create mode 100644 app/views/users/messages/opted_out.html.erb create mode 100644 db/migrate/20230223145243_add_receive_user_messages_to_user.rb diff --git a/app/controllers/users/messages_controller.rb b/app/controllers/users/messages_controller.rb index ac748f7bc1..4a6af1c9c0 100644 --- a/app/controllers/users/messages_controller.rb +++ b/app/controllers/users/messages_controller.rb @@ -1,8 +1,12 @@ # Allowing users to send user-to-user messages class Users::MessagesController < UserController - before_action :set_recipient, :check_can_send_messages, :check_logged_in, - :set_contact, :set_recaptcha_required + before_action :set_recipient, + :check_recipient_accepts_messages, + :check_can_send_messages, + :check_logged_in, + :set_contact, + :set_recaptcha_required # Send a message to another user def contact @@ -34,6 +38,12 @@ def set_recipient @recipient_user = User.find_by!(url_name: params[:url_name]) end + def check_recipient_accepts_messages + return if @recipient_user.receive_user_messages? + + render template: 'users/messages/opted_out' + end + def check_can_send_messages return unless authenticated? && !authenticated_user.can_contact_other_users? diff --git a/app/models/user.rb b/app/models/user.rb index ceffc1b0a7..190b86f538 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 20220210114052 +# Schema version: 20230223145243 # # Table name: users # @@ -35,6 +35,7 @@ # daily_summary_minute :integer # closed_at :datetime # login_token :string +# receive_user_messages :boolean default(TRUE), not null # class User < ApplicationRecord diff --git a/app/views/users/messages/opted_out.html.erb b/app/views/users/messages/opted_out.html.erb new file mode 100644 index 0000000000..e7c5a49cc8 --- /dev/null +++ b/app/views/users/messages/opted_out.html.erb @@ -0,0 +1,7 @@ +<% @title = _('Cannot send messages') %> + +

<%= @title %>

+ +

+ <%= _('This user does not accept user to user messages.') %> +

diff --git a/db/migrate/20230223145243_add_receive_user_messages_to_user.rb b/db/migrate/20230223145243_add_receive_user_messages_to_user.rb new file mode 100644 index 0000000000..6771349e4e --- /dev/null +++ b/db/migrate/20230223145243_add_receive_user_messages_to_user.rb @@ -0,0 +1,6 @@ +class AddReceiveUserMessagesToUser < ActiveRecord::Migration[7.0] + def change + add_column :users, :receive_user_messages, :boolean, + default: true, null: false + end +end diff --git a/spec/controllers/users/messages_controller_spec.rb b/spec/controllers/users/messages_controller_spec.rb index efd3db2413..999ca4a21a 100644 --- a/spec/controllers/users/messages_controller_spec.rb +++ b/spec/controllers/users/messages_controller_spec.rb @@ -35,6 +35,15 @@ }.to raise_error ActiveRecord::RecordNotFound end + context 'when the recipient has opted out' do + before { recipient.update!(receive_user_messages: false) } + + it 'prevents user messages' do + get :contact, params: { url_name: recipient.url_name } + expect(response).to render_template('users/messages/opted_out') + end + end + it 'prevents messages from users who have reached their rate limit' do allow_any_instance_of(User). to receive(:exceeded_limit?).with(:user_messages).and_return(true) @@ -59,6 +68,24 @@ expect(response).to render_template('contact') end + context 'when the recipient has opted out' do + before { recipient.update!(receive_user_messages: false) } + + it 'prevents the submission' do + post :contact, params: { + url_name: recipient.url_name, + contact: { + subject: 'Hi', + message: 'Gah' + }, + submitted_contact_form: 1 + } + + expect(ActionMailer::Base.deliveries).to be_empty + expect(response).to render_template('users/messages/opted_out') + end + end + it 'prevents messages from users who have reached their rate limit' do allow_any_instance_of(User). to receive(:exceeded_limit?).with(:user_messages).and_return(true) diff --git a/spec/factories/users.rb b/spec/factories/users.rb index 2be8ac0041..e1cc18af33 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 20220210114052 +# Schema version: 20230223145243 # # Table name: users # @@ -35,6 +35,7 @@ # daily_summary_minute :integer # closed_at :datetime # login_token :string +# receive_user_messages :boolean default(TRUE), not null # FactoryBot.define do diff --git a/spec/fixtures/users.yml b/spec/fixtures/users.yml index 5fb397fc70..5fab021194 100644 --- a/spec/fixtures/users.yml +++ b/spec/fixtures/users.yml @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 20220210114052 +# Schema version: 20230223145243 # # Table name: users # @@ -35,6 +35,7 @@ # daily_summary_minute :integer # closed_at :datetime # login_token :string +# receive_user_messages :boolean default(TRUE), not null # # If sample data has been loaded you can log in as any of these users with their diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index cb266419f7..cf001bdfd4 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 20220210114052 +# Schema version: 20230223145243 # # Table name: users # @@ -35,6 +35,7 @@ # daily_summary_minute :integer # closed_at :datetime # login_token :string +# receive_user_messages :boolean default(TRUE), not null # require 'spec_helper' From 2e8c339c41ed03289a943ede65eff40ca298e652 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Tue, 21 Feb 2023 13:54:21 +0000 Subject: [PATCH 126/289] Organise new request form sidebar Group into clearer sections to aid comprehension. Pro new request sidebar is different; this only applies to the regular user version. --- app/views/request/new.html.erb | 73 +++++++++++++++++++++------------- 1 file changed, 45 insertions(+), 28 deletions(-) diff --git a/app/views/request/new.html.erb b/app/views/request/new.html.erb index e30eb74958..a288e381a9 100644 --- a/app/views/request/new.html.erb +++ b/app/views/request/new.html.erb @@ -187,39 +187,34 @@
- <% unless @batch %> -

- <% if @info_request.public_body.info_requests.is_public.any? %> - <%= _("Browse other requests to '{{public_body_name}}' for examples of how to word your request.", :public_body_name=>h(@info_request.public_body.name), :url=>public_body_path(@info_request.public_body)) %> - <% else %> - <%= _("Browse other requests for examples of how to word your request.", :url=>request_list_successful_url) %> - <% end %> -

- <% end %> +
+

<%= _('Before you start') %>

-

- <%= raw(_('Everything that you enter on this page, including ' \ - 'your name, will be displayed ' \ - 'publicly on this website ' \ - 'forever', - :url => help_privacy_path(:anchor => "public_request").html_safe)) %>. -

- - <% unless @user %> -

- <%= raw(_('Thinking of using a pseudonym?', - :url => help_privacy_path(:anchor => "real_name").html_safe)) %> -

- <% end %> +
    +
  • <%= _('Make sure the information you are asking for is not ' \ + 'already publicly available.') %>
  • -

    - <%= raw(_("Can I request information about myself? " \ - "No!", - :url => help_requesting_path(:anchor => "data_protection").html_safe)) %> -

    + <% unless @batch %> +
  • + <% if @info_request.public_body.info_requests.is_public.any? %> + <%= _("Browse other requests to '{{public_body_name}}' for examples of how to word your request.", :public_body_name=>h(@info_request.public_body.name), :url=>public_body_path(@info_request.public_body)) %> + <% else %> + <%= _("Browse other requests for examples of how to word your request.", :url=>request_list_successful_url) %> + <% end %> +
  • + <% end %> +
+
+

<%= _('Writing your request') %>

+
    +
  • + <%= raw(_("Can I request information about myself? " \ + "No!", + :url => help_requesting_path(:anchor => "data_protection").html_safe)) %> +
  • <%= _('Write your request in simple, precise language.') %>
  • <%= _('Ask for specific documents or ' \ 'information, this site is not suitable for general ' \ @@ -231,6 +226,28 @@ 'already publicly available.') %>
+ +
+

<%= _('Signing your request') %>

+ +
    +
  • + <%= raw(_('Everything that you enter on this page, including ' \ + 'your name, will be displayed ' \ + 'publicly on this website ' \ + 'forever', + :url => help_privacy_path(:anchor => "public_request").html_safe)) %>. +
  • + + <% unless @user %> +
  • + <%= raw(_('Thinking of using a pseudonym?', + :url => help_privacy_path(:anchor => "real_name").html_safe)) %> +
  • + <% end %> + +
+
From e34e49a9a1cd37fb1c7fc607bd66afe561daf513 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Tue, 21 Feb 2023 14:01:49 +0000 Subject: [PATCH 127/289] Highlight advice that requests will be public An attempt at reducing cases around https://github.com/mysociety/alaveteli/issues/6154 --- app/assets/stylesheets/responsive/_new_request_style.scss | 7 +++++++ app/views/request/new.html.erb | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/responsive/_new_request_style.scss b/app/assets/stylesheets/responsive/_new_request_style.scss index b7770a29da..a799525d9f 100644 --- a/app/assets/stylesheets/responsive/_new_request_style.scss +++ b/app/assets/stylesheets/responsive/_new_request_style.scss @@ -58,6 +58,7 @@ @include respond-min( $main_menu-mobile_menu_cutoff ){ font-size: 1em; } + .advice-panel { margin-top: 1.5em; } @@ -78,6 +79,12 @@ } } +.advice-panel.advice-panel--warning { + background: #fff08a; + border: 1px solid #baad1d; + padding: 0.1em 0.5em; +} + #request_search_ahead_results { background-color: #f4f4f4; padding: 1.5em; diff --git a/app/views/request/new.html.erb b/app/views/request/new.html.erb index a288e381a9..83e61ec5bf 100644 --- a/app/views/request/new.html.erb +++ b/app/views/request/new.html.erb @@ -227,7 +227,7 @@
-
+

<%= _('Signing your request') %>

    From e43110fb38c82a4c7c7dac1033b1e54cc7d9a85e Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Tue, 21 Feb 2023 14:07:55 +0000 Subject: [PATCH 128/289] Include name to be published in warning Make it as obvious as possible that they're going to be making a published request under their user name. Fixes https://github.com/mysociety/alaveteli/issues/6154 --- app/views/request/new.html.erb | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/app/views/request/new.html.erb b/app/views/request/new.html.erb index 83e61ec5bf..34fb9c3ea2 100644 --- a/app/views/request/new.html.erb +++ b/app/views/request/new.html.erb @@ -232,11 +232,20 @@
    • - <%= raw(_('Everything that you enter on this page, including ' \ - 'your name, will be displayed ' \ - 'publicly on this website ' \ - 'forever', - :url => help_privacy_path(:anchor => "public_request").html_safe)) %>. + <% if @user %> + <%= raw(_('Everything that you enter on this page, including ' \ + 'your name ({{user_name}}), will ' \ + 'be displayed publicly on this ' \ + 'website forever', + user_name: @user.name, + url: help_privacy_path(anchor: 'public_request').html_safe)) %>. + <% else %> + <%= raw(_('Everything that you enter on this page, including ' \ + 'your name, will be displayed ' \ + 'publicly on this website ' \ + 'forever', + :url => help_privacy_path(:anchor => "public_request").html_safe)) %>. + <% end %>
    • <% unless @user %> @@ -245,7 +254,6 @@ :url => help_privacy_path(:anchor => "real_name").html_safe)) %> <% end %> -
From 9f8f5fbcf4c7b4a6e7e6db9947292b404e720656 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Tue, 21 Feb 2023 16:04:25 +0000 Subject: [PATCH 129/289] Update changelog --- doc/CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 0ccaa37b19..6029c7b981 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -2,6 +2,7 @@ ## Highlighted Features +* Make it clearer that usernames are published (Gareth Rees) * Add spam term checking to user to user messages (Gareth Rees) * Add support for Ruby 3.2 (Graeme Porteous) * Add support for Ruby 3.1 (Graeme Porteous) From 45e727a09c7cf48ee885637e35ce8c36b4392cb8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Feb 2023 04:59:49 +0000 Subject: [PATCH 130/289] Build(deps): Bump pg from 1.4.5 to 1.4.6 Bumps [pg](https://github.com/ged/ruby-pg) from 1.4.5 to 1.4.6. - [Release notes](https://github.com/ged/ruby-pg/releases) - [Changelog](https://github.com/ged/ruby-pg/blob/master/History.md) - [Commits](https://github.com/ged/ruby-pg/compare/v1.4.5...v1.4.6) --- updated-dependencies: - dependency-name: pg dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 969146a9d3..9669f8e97a 100644 --- a/Gemfile +++ b/Gemfile @@ -81,7 +81,7 @@ source 'https://rubygems.org' gem 'rails', '~> 7.0.4' -gem 'pg', '~> 1.4.5' +gem 'pg', '~> 1.4.6' # New gem releases aren't being done. master is newer and supports Rails > 3.0 gem 'acts_as_versioned', git: 'https://github.com/mysociety/acts_as_versioned.git', diff --git a/Gemfile.lock b/Gemfile.lock index 787c6f4d4b..3b4547bf61 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -350,7 +350,7 @@ GEM parallel (1.22.1) parser (3.2.1.0) ast (~> 2.4.1) - pg (1.4.5) + pg (1.4.6) prime (0.1.2) forwardable singleton @@ -591,7 +591,7 @@ DEPENDENCIES nokogiri (~> 1.14.1) oink (~> 0.10.1) open4 (~> 1.3.0) - pg (~> 1.4.5) + pg (~> 1.4.6) pry (~> 0.14.2) rack (~> 2.2.6) rack-utf8_sanitizer (~> 1.8.0) From a87987c31b903e89603b753f14080b9fb100f2ae Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 28 Feb 2023 09:49:58 +0000 Subject: [PATCH 131/289] Add git safe directory config to Docker image When running the app via Docker errors are being raised due to how the repository is mounted in the container which results in a mismatch in file ownership. Fixes #7612 --- docker/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 5e82880071..e6a7aa6f17 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -22,7 +22,8 @@ RUN git clone https://github.com/vishnubob/wait-for-it.git /tmp/wait-for-it && \ chmod +x /tmp/wait-for-it/wait-for-it.sh && \ ln -s /tmp/wait-for-it/wait-for-it.sh /bin/wait-for-it -WORKDIR /alaveteli/ +WORKDIR /alaveteli +RUN git config --global --add safe.directory /alaveteli RUN gem update --system RUN gem install mailcatcher From a9e7d42524b74cc5d4df06cd17567ade514e9448 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 28 Feb 2023 11:29:19 +0000 Subject: [PATCH 132/289] Update how we source docker/env Works in `sh` as well as `bash`. Fixes #7614 --- docker/reset | 2 +- docker/server | 2 +- docker/setup | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/reset b/docker/reset index 2549a1db70..1d12dec910 100755 --- a/docker/reset +++ b/docker/reset @@ -4,7 +4,7 @@ set -e cd "$(dirname "$0")/.." -source docker/env +. docker/env docker compose down diff --git a/docker/server b/docker/server index d4f8d0a05f..980fff0f6f 100755 --- a/docker/server +++ b/docker/server @@ -5,7 +5,7 @@ set -e cd "$(dirname "$0")/.." if [ -z "$DOCKER" ]; then - source docker/env + . docker/env docker compose up exit fi diff --git a/docker/setup b/docker/setup index 45cdf93ffd..a107e5032a 100755 --- a/docker/setup +++ b/docker/setup @@ -5,7 +5,7 @@ set -e cd "$(dirname "$0")/.." if [ -z "$DOCKER" ]; then - source docker/env + . docker/env ./docker/bootstrap docker compose run --rm app ./docker/setup "$@" exit From ed5c4b66b40599f2f450b45b87263b756adcc5e8 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 1 Mar 2023 11:19:00 +0000 Subject: [PATCH 133/289] Add User#user_messages counter cache Precursor to showing the value in the admin UI for user records. --- app/models/user.rb | 3 ++- app/models/user_message.rb | 3 ++- .../20230301110831_add_user_messages_count_to_users.rb | 5 +++++ spec/factories/users.rb | 3 ++- spec/fixtures/users.yml | 3 ++- spec/models/user_spec.rb | 3 ++- 6 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 db/migrate/20230301110831_add_user_messages_count_to_users.rb diff --git a/app/models/user.rb b/app/models/user.rb index 190b86f538..8a07d0bec9 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 20230223145243 +# Schema version: 20230301110831 # # Table name: users # @@ -36,6 +36,7 @@ # closed_at :datetime # login_token :string # receive_user_messages :boolean default(TRUE), not null +# user_messages_count :integer default(0), not null # class User < ApplicationRecord diff --git a/app/models/user_message.rb b/app/models/user_message.rb index 828467b4e0..bb65c330c6 100644 --- a/app/models/user_message.rb +++ b/app/models/user_message.rb @@ -10,5 +10,6 @@ # class UserMessage < ApplicationRecord belongs_to :user, - inverse_of: :user_messages + inverse_of: :user_messages, + counter_cache: true end diff --git a/db/migrate/20230301110831_add_user_messages_count_to_users.rb b/db/migrate/20230301110831_add_user_messages_count_to_users.rb new file mode 100644 index 0000000000..8d5d014913 --- /dev/null +++ b/db/migrate/20230301110831_add_user_messages_count_to_users.rb @@ -0,0 +1,5 @@ +class AddUserMessagesCountToUsers < ActiveRecord::Migration[7.0] + def change + add_column :users, :user_messages_count, :integer, default: 0, null: false + end +end diff --git a/spec/factories/users.rb b/spec/factories/users.rb index e1cc18af33..3b8c6ccdf2 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 20230223145243 +# Schema version: 20230301110831 # # Table name: users # @@ -36,6 +36,7 @@ # closed_at :datetime # login_token :string # receive_user_messages :boolean default(TRUE), not null +# user_messages_count :integer default(0), not null # FactoryBot.define do diff --git a/spec/fixtures/users.yml b/spec/fixtures/users.yml index 5fab021194..a9eda3156c 100644 --- a/spec/fixtures/users.yml +++ b/spec/fixtures/users.yml @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 20230223145243 +# Schema version: 20230301110831 # # Table name: users # @@ -36,6 +36,7 @@ # closed_at :datetime # login_token :string # receive_user_messages :boolean default(TRUE), not null +# user_messages_count :integer default(0), not null # # If sample data has been loaded you can log in as any of these users with their diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index cf001bdfd4..a098be54a1 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1,5 +1,5 @@ # == Schema Information -# Schema version: 20230223145243 +# Schema version: 20230301110831 # # Table name: users # @@ -36,6 +36,7 @@ # closed_at :datetime # login_token :string # receive_user_messages :boolean default(TRUE), not null +# user_messages_count :integer default(0), not null # require 'spec_helper' From 334ded6b198281e49e1c6ece0cafbe3db061e8ea Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 1 Mar 2023 11:24:45 +0000 Subject: [PATCH 134/289] Show User#user_messages_count in the Admin UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gives us a quick way of seeing if a user has sent any user messages. Needs to be explicitly added to `admin_columns` as counter caches are not “content columns”, which automatically get presented. --- app/models/user.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 8a07d0bec9..f4cb040c71 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -57,7 +57,8 @@ class User < ApplicationRecord after_remove: :assign_role_features strip_attributes allow_empty: true - admin_columns exclude: [:otp_secret_key] + admin_columns include: [:user_messages_count], + exclude: [:otp_secret_key] attr_accessor :no_xapian_reindex From 9621e8efc4cb7344bfd6b9203b81afd69b63d1b6 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Mon, 27 Feb 2023 17:54:27 +0000 Subject: [PATCH 135/289] Add ProfilePhoto factory For use in other specs. Had to change `after_initialize` to `before_validation` so that records built via FactoryBot were valid. This also affects normal records: data = load_file_fixture('parrot.jpg') a = ProfilePhoto.new(data: data, user: User.first) a.valid? # => true data = load_file_fixture('parrot.jpg') a = ProfilePhoto.new(user: User.first) a.data = data a.valid? # => false With this change, both examples now return `true`. --- app/models/profile_photo.rb | 2 +- spec/factories/profile_photos.rb | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 spec/factories/profile_photos.rb diff --git a/app/models/profile_photo.rb b/app/models/profile_photo.rb index 51a61e05f7..0f70ad2578 100644 --- a/app/models/profile_photo.rb +++ b/app/models/profile_photo.rb @@ -32,7 +32,7 @@ class ProfilePhoto < ApplicationRecord attr_accessor :x, :y, :w, :h attr_accessor :image - after_initialize :convert_data_to_image + before_validation :convert_data_to_image # make image valid format and size def convert_image diff --git a/spec/factories/profile_photos.rb b/spec/factories/profile_photos.rb new file mode 100644 index 0000000000..b3973e7778 --- /dev/null +++ b/spec/factories/profile_photos.rb @@ -0,0 +1,23 @@ +# == Schema Information +# Schema version: 20230223145243 +# +# Table name: profile_photos +# +# id :integer not null, primary key +# data :binary not null +# user_id :integer +# draft :boolean default(FALSE), not null +# created_at :datetime +# updated_at :datetime +# +FactoryBot.define do + factory :profile_photo do + user + data { load_file_fixture('parrot.jpg') } + draft { false } + + trait :draft do + draft { true } + end + end +end From 78aec0f59af8650b6d6dc0436c28aaa4d138fde0 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 24 Feb 2023 13:23:17 +0000 Subject: [PATCH 136/289] Refactor User#close spec Tweak the spec such that it'll be easier to add forthcoming examples. --- spec/models/user_spec.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index cf001bdfd4..c8525473a2 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1168,12 +1168,19 @@ def create_user(options = {}) end describe '#close' do + subject { user.close } + let(:user) { FactoryBot.build(:user) } - it 'closes the user account' do - user.close + before { subject } + + it 'closes the account' do expect(user).to be_closed end + + it 'sets closed_at' do + expect(user.closed_at).to be_present + end end describe '#closed?' do From 21dcc744463e696ac489ca4c0c255a2e0ac7ab51 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 1 Mar 2023 16:11:26 +0000 Subject: [PATCH 137/289] Update spec variable Extracted requests will be in a classified state. --- spec/models/project_spec.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 9f15598b18..e18522e2e2 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -47,7 +47,13 @@ described_state: 'successful' ) end - let(:extracted_request) { FactoryBot.build(:info_request) } + let(:extracted_request) do + FactoryBot.build( + :info_request, + awaiting_description: false, + described_state: 'successful' + ) + end before do FactoryBot.create( From 0b56049ae6d9d286107e838403ef23a26576a957 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 1 Mar 2023 14:10:24 +0000 Subject: [PATCH 138/289] Add failing specs Prove `Project#extraction_progress` is returning the wrong number. This is due to the `InfoRequest.extractable` and `InfoRequest.extracted` scopes not taking into account requests which have been extracted as part of a different project. --- spec/models/project_spec.rb | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index e18522e2e2..d8b8180514 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -34,7 +34,15 @@ let(:project) do FactoryBot.create( :project, requests: [ - unclassified_request, classified_request, extracted_request + unclassified_request, classified_request, extracted_request, + other_project_extracted_request + ] + ) + end + let(:other_project) do + FactoryBot.create( + :project, requests: [ + other_project_extracted_request ] ) end @@ -54,6 +62,13 @@ described_state: 'successful' ) end + let(:other_project_extracted_request) do + FactoryBot.build( + :info_request, + awaiting_description: false, + described_state: 'successful' + ) + end before do FactoryBot.create( @@ -64,6 +79,10 @@ :project_submission, :for_extraction, project: project, info_request: extracted_request ) + FactoryBot.create( + :project_submission, :for_extraction, + project: other_project, info_request: other_project_extracted_request + ) end end @@ -341,6 +360,10 @@ it 'excludes extracted requests' do is_expected.not_to include extracted_request end + + it 'includes requests extracted in other projects' do + is_expected.to include other_project_extracted_request + end end describe '#info_requests.extracted' do @@ -363,6 +386,10 @@ it 'includes extracted requests' do is_expected.to include extracted_request end + + it 'excludes requests extracted in different projects' do + is_expected.not_to include other_project_extracted_request + end end describe '#extraction_progress' do From 2e9c40dd3be177fe562405a51822ea1715a837db Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 1 Mar 2023 15:58:48 +0000 Subject: [PATCH 139/289] Fix project request scopes Check the project submissions belong to the current project when calling `Project#extractable` or `Project#extracted`. This fixes an issue where requests which have been added to more than one project appears to be extracted due to being processed in the other project. Fixes #7618 --- app/models/project/info_request_extension.rb | 17 ++++++++++++++--- .../projects/extracts_controller_spec.rb | 1 + 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/models/project/info_request_extension.rb b/app/models/project/info_request_extension.rb index 42dba46a63..d749800067 100644 --- a/app/models/project/info_request_extension.rb +++ b/app/models/project/info_request_extension.rb @@ -15,14 +15,25 @@ def classified end def extractable - where(described_state: EXTRACTABLE_STATES). + scope = where(described_state: EXTRACTABLE_STATES). left_joins(:extraction_project_submissions). - where(project_submissions: { id: nil }). classified + + scope.where(project_submissions: { id: nil }).or( + scope.where.not(project_submissions: { project: project }) + ) end def extracted - joins(:extraction_project_submissions).distinct + joins(:extraction_project_submissions). + where(project_submissions: { project: project }). + distinct + end + + private + + def project + proxy_association.owner end end end diff --git a/spec/controllers/projects/extracts_controller_spec.rb b/spec/controllers/projects/extracts_controller_spec.rb index 49eed8cc26..e976cff679 100644 --- a/spec/controllers/projects/extracts_controller_spec.rb +++ b/spec/controllers/projects/extracts_controller_spec.rb @@ -79,6 +79,7 @@ project.info_requests.each do |info_request| FactoryBot.create(:project_submission, :for_extraction, + project: project, info_request: info_request) end From 09debe28bc72aef82fea2c8135ae4edb72668a4a Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 2 Mar 2023 09:44:53 +0000 Subject: [PATCH 140/289] Add MailHog Docker container Replace MailCatcher gem as it isn't compatible with Ruby 3.2 yet. Uses a separate container instead of running multiple processes in the app container. Maps the web UI port to the same used by MailCatcher. --- config/environments/development.rb | 3 ++- docker-compose.yml | 8 +++++++- docker/Dockerfile | 2 -- docker/entrypoint.sh | 2 -- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index a987b201e9..636e5e4909 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -92,7 +92,8 @@ if AlaveteliConfiguration.use_mailcatcher_in_development # So is queued, rather than giving immediate errors config.action_mailer.delivery_method = :smtp - config.action_mailer.smtp_settings = { address: "localhost", port: 1025 } + smtp = URI.parse(ENV.fetch('SMTP_URL', 'smtp://localhost:1025')) + config.action_mailer.smtp_settings = { address: smtp.host, port: smtp.port } else config.action_mailer.delivery_method = :sendmail end diff --git a/docker-compose.yml b/docker-compose.yml index a1a3f3a515..52e4fe69ef 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,15 +10,16 @@ services: environment: - BUNDLE_PATH=/bundle/vendor - DATABASE_URL=postgres://postgres:password@db/ + - SMTP_URL=smtp://smtp:1025 ports: - 3000:3000 - - 1080:1080 volumes: - ./:/alaveteli - ../alaveteli-themes:/alaveteli-themes - bundle:/bundle depends_on: - db + - smtp db: build: @@ -31,6 +32,11 @@ services: volumes: - postgres:/var/lib/postgresql/data + smtp: + image: mailhog/mailhog + ports: + - 1080:8025 + volumes: bundle: {} postgres: {} diff --git a/docker/Dockerfile b/docker/Dockerfile index e6a7aa6f17..c2b7f245e0 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -26,8 +26,6 @@ WORKDIR /alaveteli RUN git config --global --add safe.directory /alaveteli RUN gem update --system -RUN gem install mailcatcher EXPOSE 3000 -EXPOSE 1080 CMD wait-for-it db:5432 --strict -- ./docker/entrypoint.sh diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 21da58236e..a947e94b7d 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,6 +1,4 @@ #!/bin/sh -mailcatcher --ip=0.0.0.0 - rm -f tmp/pids/server.pid bin/rails server -b 0.0.0.0 From f3dcb792101a627d3ad7fa916b97dd162c47a6ad Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 8 Dec 2022 11:45:02 +0000 Subject: [PATCH 141/289] Allow ex-pro users to followup to private requests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ex-pro users should still be able to manage requests even if they're still private; they just can't extend privacy periods or create new ones. We don't need to check that the `current_user` is a Pro here; we first search the user's requests, irrespective of privacy state, and assign to the instance variable. If that isn't found – which means the user is trying to follow up to someone else's request – we only search public requests in order to display the notice to sign in to the request author's account. Fixes https://github.com/mysociety/alaveteli/issues/7456. --- app/controllers/followups_controller.rb | 3 ++- doc/CHANGES.md | 2 ++ spec/controllers/followups_controller_spec.rb | 9 +++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/controllers/followups_controller.rb b/app/controllers/followups_controller.rb index ae5b7bbd48..dd1135d3b6 100644 --- a/app/controllers/followups_controller.rb +++ b/app/controllers/followups_controller.rb @@ -188,10 +188,11 @@ def set_incoming_message end def set_info_request - if current_user && current_user.is_pro? + if current_user @info_request = current_user.info_requests.find_by(id: params[:request_id].to_i) end + @info_request ||= InfoRequest.not_embargoed.find(params[:request_id].to_i) end diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 6029c7b981..a5c0572fec 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -2,6 +2,8 @@ ## Highlighted Features +* Fix bug preventing ex-pro users follow up to still-private requests (Gareth + Rees, Graeme Porteous) * Make it clearer that usernames are published (Gareth Rees) * Add spam term checking to user to user messages (Gareth Rees) * Add support for Ruby 3.2 (Graeme Porteous) diff --git a/spec/controllers/followups_controller_spec.rb b/spec/controllers/followups_controller_spec.rb index d29168a41d..50b429302a 100644 --- a/spec/controllers/followups_controller_spec.rb +++ b/spec/controllers/followups_controller_spec.rb @@ -100,6 +100,15 @@ expect(response).to render_template('new') end + context 'the request is still embargoed but the user is no longer pro' do + before { request.create_embargo!(embargo_duration: '3_months') } + + it 'shows the followup form' do + get :new, params: { request_id: request.id } + expect(response).to render_template('new') + end + end + context 'the request has responses' do let(:message_id) { request.incoming_messages[0].id } From 5d5945fff3c2052d008cd3e6e2dcf833cce9a7b9 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 22 Feb 2023 14:15:58 +0000 Subject: [PATCH 142/289] Admins should always be allowed to make comments --- app/models/user.rb | 5 ++++- spec/models/user_spec.rb | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 190b86f538..8a653ae5ab 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -455,7 +455,10 @@ def can_make_followup? end def can_make_comments? - active? && !exceeded_limit?(:comments) + return false unless active? + return true if is_admin? || is_pro_admin? + + !exceeded_limit?(:comments) end def can_contact_other_users? diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index cf001bdfd4..ba870e8ed8 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1910,6 +1910,30 @@ def create_user(options = {}) it { is_expected.to eq(false) } end + context 'when the user is an admin' do + let(:user) { FactoryBot.create(:user, :admin) } + + # Irrespective of how many comments they've made + before do + allow(user). + to receive(:exceeded_limit?).with(:comments).and_return(true) + end + + it { is_expected.to eq(true) } + end + + context 'when the user is a pro_admin' do + let(:user) { FactoryBot.create(:user, :pro_admin) } + + # Irrespective of how many comments they've made + before do + allow(user). + to receive(:exceeded_limit?).with(:comments).and_return(true) + end + + it { is_expected.to eq(true) } + end + context 'when the user has reached their rate limit' do let(:user) { FactoryBot.build(:user) } From 15c39d0f0cac448d157175479fc26f9b028d0f35 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 22 Feb 2023 14:19:02 +0000 Subject: [PATCH 143/289] Clarify spec phrasing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This spec is testing against a daily cap rather than a creation interval. We’ll add the latter soon, so this just clarifies the existing spec description. --- spec/models/user_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index ba870e8ed8..b75161db75 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1934,7 +1934,7 @@ def create_user(options = {}) it { is_expected.to eq(true) } end - context 'when the user has reached their rate limit' do + context 'when the user has reached their daily limit' do let(:user) { FactoryBot.build(:user) } before do From 19eac20fa18c22bcf01b76065e9834e682255933 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 22 Feb 2023 18:25:55 +0000 Subject: [PATCH 144/289] Clarify logic checking whether user can comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A previous version [1] of this check was defined as: if authenticated? && !authenticated_user.can_make_comments? # render the correct view for not being able to comment The condition was moved to a guard clause [2] to improve code style, but the move to using `unless` makes it less human readable. The way I’d describe the clause naturally is: > Skip the check if there isn’t a signed in user, or if the signed in user can make comments. This commit tweaks the implementation to match this more natural phrasing. [1] 9c28c412 [2] e895b773 --- app/controllers/comment_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/comment_controller.rb b/app/controllers/comment_controller.rb index dd337ec6af..b889545824 100644 --- a/app/controllers/comment_controller.rb +++ b/app/controllers/comment_controller.rb @@ -117,7 +117,7 @@ def reject_unless_comments_allowed # Banned from adding comments? def reject_if_user_banned - return unless authenticated? && !authenticated_user.can_make_comments? + return if !authenticated? || authenticated_user.can_make_comments? if authenticated_user.exceeded_limit?(:comments) render template: 'comment/rate_limited' From 2afcca9bdd27939adcba4f50daaa41f69eb6442a Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 22 Feb 2023 13:53:34 +0000 Subject: [PATCH 145/289] Add comment creation interval rate limit Calculates whether too many comments are being created too quickly. We don't want to allow a user to sign up and smash through their daily limit in 5 minutes, then create a new account to do the same, and so on. This ensures that the allocation is used sensibly. It hopefully won't affect the majority of genuine users. Inverts the logic of `CommentController#reject_if_user_banned` now that the daily limit and rate limit are checked in `User#can_make_comments?`. Now, the user being banned is the edge case. This doesn't quite make sense for inactive users, but that wasn't handled in `User#can_fail_html` either. --- app/controllers/comment_controller.rb | 6 +- app/models/comment.rb | 21 ++++ app/models/user.rb | 3 +- app/views/comment/rate_limited.html.erb | 6 ++ doc/CHANGES.md | 1 + spec/controllers/comment_controller_spec.rb | 4 + spec/models/comment_spec.rb | 101 ++++++++++++++++++++ spec/models/user_spec.rb | 36 +++++++ 8 files changed, 174 insertions(+), 4 deletions(-) diff --git a/app/controllers/comment_controller.rb b/app/controllers/comment_controller.rb index b889545824..1d96061325 100644 --- a/app/controllers/comment_controller.rb +++ b/app/controllers/comment_controller.rb @@ -119,11 +119,11 @@ def reject_unless_comments_allowed def reject_if_user_banned return if !authenticated? || authenticated_user.can_make_comments? - if authenticated_user.exceeded_limit?(:comments) - render template: 'comment/rate_limited' - else + if authenticated_user.banned? @details = authenticated_user.can_fail_html render template: 'user/banned' + else + render template: 'comment/rate_limited' end end diff --git a/app/models/comment.rb b/app/models/comment.rb index 256c56c520..4b4c540d1f 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -24,6 +24,19 @@ class Comment < ApplicationRecord include Rails.application.routes.url_helpers include LinkToHelper + DEFAULT_CREATION_RATE_LIMITS = { + 1 => 2.seconds, + 2 => 5.minutes, + 4 => 30.minutes, + 6 => 1.hour + }.freeze + + cattr_accessor :creation_rate_limits, + instance_reader: false, + instance_writer: false, + instance_accessor: false, + default: DEFAULT_CREATION_RATE_LIMITS + strip_attributes allow_empty: true belongs_to :user, @@ -87,6 +100,14 @@ def self.find_existing(info_request_id, body) end end + def self.exceeded_creation_rate?(comments) + comments = comments.reorder(created_at: :desc) + + creation_rate_limits.any? do |limit, duration| + comments.where(created_at: duration.ago..).size >= limit + end + end + def body ret = read_attribute(:body) return ret if ret.nil? diff --git a/app/models/user.rb b/app/models/user.rb index 8a653ae5ab..98d78c1ea8 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -458,7 +458,8 @@ def can_make_comments? return false unless active? return true if is_admin? || is_pro_admin? - !exceeded_limit?(:comments) + !exceeded_limit?(:comments) && + !Comment.exceeded_creation_rate?(comments) end def can_contact_other_users? diff --git a/app/views/comment/rate_limited.html.erb b/app/views/comment/rate_limited.html.erb index 9e9291ec47..d9cbf08470 100644 --- a/app/views/comment/rate_limited.html.erb +++ b/app/views/comment/rate_limited.html.erb @@ -17,6 +17,12 @@ help_contact_path: help_contact_path) %>

+

+ <%= _('There is also a limit on the speed at which you are able to create ' \ + 'annotations. Please try again later if you have not hit your daily ' \ + 'limit.') %> +

+ <% if @comment %>

<%= _('Here is the message you wrote, in case you would like to copy ' \ diff --git a/doc/CHANGES.md b/doc/CHANGES.md index a5c0572fec..bb38ad1d5e 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -2,6 +2,7 @@ ## Highlighted Features +* Add rate limiting to comment creation (Gareth Rees) * Fix bug preventing ex-pro users follow up to still-private requests (Gareth Rees, Graeme Porteous) * Make it clearer that usernames are published (Gareth Rees) diff --git a/spec/controllers/comment_controller_spec.rb b/spec/controllers/comment_controller_spec.rb index c61a5335d9..77624b40a5 100644 --- a/spec/controllers/comment_controller_spec.rb +++ b/spec/controllers/comment_controller_spec.rb @@ -125,6 +125,10 @@ it 'errors if the same comment is submitted twice' do user = FactoryBot.build(:user) + + # Ignore rate limiting + allow_any_instance_of(User).to receive(:can_make_comments?).and_return(true) + info_request = FactoryBot.build(:info_request, user: user) comment = FactoryBot.create(:comment, info_request: info_request, user: user) diff --git a/spec/models/comment_spec.rb b/spec/models/comment_spec.rb index 5d2b4f231c..608793c437 100644 --- a/spec/models/comment_spec.rb +++ b/spec/models/comment_spec.rb @@ -87,6 +87,107 @@ end + # rubocop:disable Layout/FirstArrayElementIndentation + describe '.exceeded_creation_rate?' do + subject { described_class.exceeded_creation_rate?(comments) } + + context 'when there are no comments' do + let(:comments) { described_class.where(id: nil) } + it { is_expected.to eq(false) } + end + + context 'when the last comment was created in the last 2 seconds' do + let(:comments) do + described_class.where(id: [ + FactoryBot.create(:comment, created_at: 1.second.ago) + ]) + end + + it { is_expected.to eq(true) } + end + + context 'when the last comment was created a few seconds ago' do + let(:comments) do + described_class.where(id: [ + FactoryBot.create(:comment, created_at: 3.seconds.ago) + ]) + end + + it { is_expected.to eq(false) } + end + + context 'when the last 2 comments were created in the last 5 minutes' do + let(:comments) do + described_class.where(id: [ + FactoryBot.create(:comment, created_at: 1.second.ago), + FactoryBot.create(:comment, created_at: 2.minutes.ago), + FactoryBot.create(:comment, created_at: 3.days.ago) + ]) + end + + it { is_expected.to eq(true) } + end + + context 'when the last 4 comments were created in the last 30 minutes' do + let(:comments) do + described_class.where(id: [ + FactoryBot.create(:comment, created_at: 1.second.ago), + FactoryBot.create(:comment, created_at: 2.minutes.ago), + FactoryBot.create(:comment, created_at: 5.minutes.ago), + FactoryBot.create(:comment, created_at: 10.minutes.ago), + FactoryBot.create(:comment, created_at: 3.days.ago) + ]) + end + + it { is_expected.to eq(true) } + end + + context 'when the last 6 comments were created in the last hour' do + let(:comments) do + described_class.where(id: [ + FactoryBot.create(:comment, created_at: 1.second.ago), + FactoryBot.create(:comment, created_at: 2.minutes.ago), + FactoryBot.create(:comment, created_at: 5.minutes.ago), + FactoryBot.create(:comment, created_at: 10.minutes.ago), + FactoryBot.create(:comment, created_at: 40.minutes.ago), + FactoryBot.create(:comment, created_at: 50.minutes.ago), + FactoryBot.create(:comment, created_at: 3.days.ago) + ]) + end + + it { is_expected.to eq(true) } + end + + context 'when the comments are reasonably spaced' do + let(:comments) do + described_class.where(id: [ + FactoryBot.create(:comment, created_at: 15.minutes.ago), + FactoryBot.create(:comment, created_at: 12.minutes.ago), + FactoryBot.create(:comment, created_at: 40.minutes.ago), + FactoryBot.create(:comment, created_at: 3.hours.ago), + FactoryBot.create(:comment, created_at: 8.hours.ago), + FactoryBot.create(:comment, created_at: 1.day.ago), + FactoryBot.create(:comment, created_at: 3.days.ago) + ]) + end + + it { is_expected.to eq(false) } + end + + context 'when the comments are provided out of order' do + let(:comments) do + described_class.where(id: [ + FactoryBot.create(:comment, created_at: 3.days.ago), + FactoryBot.create(:comment, created_at: 2.minutes.ago), + FactoryBot.create(:comment, created_at: 1.second.ago) + ]).order(created_at: :asc) + end + + it { is_expected.to eq(true) } + end + end + # rubocop:enable Layout/FirstArrayElementIndentation + describe '#prominence' do subject { comment.prominence } diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index b75161db75..e05bf5b41c 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1917,6 +1917,11 @@ def create_user(options = {}) before do allow(user). to receive(:exceeded_limit?).with(:comments).and_return(true) + + allow(Comment). + to receive(:exceeded_creation_rate?). + with(user.comments). + and_return(true) end it { is_expected.to eq(true) } @@ -1929,6 +1934,11 @@ def create_user(options = {}) before do allow(user). to receive(:exceeded_limit?).with(:comments).and_return(true) + + allow(Comment). + to receive(:exceeded_creation_rate?). + with(user.comments). + and_return(true) end it { is_expected.to eq(true) } @@ -1944,6 +1954,32 @@ def create_user(options = {}) it { is_expected.to eq(false) } end + + context 'when the user has not reached their rate limit' do + let(:user) { FactoryBot.build(:user) } + + before do + allow(Comment). + to receive(:exceeded_creation_rate?). + with(user.comments). + and_return(false) + end + + it { is_expected.to eq(true) } + end + + context 'when the user has reached their rate limit' do + let(:user) { FactoryBot.build(:user) } + + before do + allow(Comment). + to receive(:exceeded_creation_rate?). + with(user.comments). + and_return(true) + end + + it { is_expected.to eq(false) } + end end describe '#exceeded_limit?' do From ba42eac9c7492b095c4f47dcf61c7394aa34a9f1 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 14 Feb 2023 11:15:01 +0000 Subject: [PATCH 146/289] Update setting RAILS_ENV in install scripts When re/running the installer: 1. update `RAILS_ENV` file based on the `STAGING_SITE` configuration 2. don't nuke customised settings in `config/rails_env.rb`. --- script/rails-deploy-before-down | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/script/rails-deploy-before-down b/script/rails-deploy-before-down index d7a68a21f7..97c7d8517a 100755 --- a/script/rails-deploy-before-down +++ b/script/rails-deploy-before-down @@ -77,9 +77,8 @@ OPTION_STAGING_SITE=$(bin/config STAGING_SITE) STAGING_SITE="${OPTION_STAGING_SITE:-1}" # Force appropriate environment in production -if [ "$STAGING_SITE" = "0" ] -then - cat <<-END +if [ ! -f config/rails_env.rb ]; then + [ "$STAGING_SITE" = "0" ] && cat <<-END ***************************************************************** WARNING: About to make config/rails_env.rb which, via special @@ -92,7 +91,19 @@ then ***************************************************************** END - echo "ENV['RAILS_ENV'] ||= 'production'" > config/rails_env.rb + +else + RAILS_ENV=$(ruby -r ./config/rails_env.rb -e "puts ENV['RAILS_ENV']") + if ([ "$STAGING_SITE" = "0" ] && [ "$RAILS_ENV" != "production" ]) || + ([ "$STAGING_SITE" = "1" ] && [ "$RAILS_ENV" = "production" ]); then + # STAGING_SITE and RAILS_ENV mismatch - remove line + sed -i "/^ENV\['RAILS_ENV'\]/d" config/rails_env.rb + fi +fi + +if [ "$STAGING_SITE" = "0" ] && [ "$RAILS_ENV" != "production" ]; then + # Set RAILS_ENV to production + echo "ENV['RAILS_ENV'] ||= 'production'" >> config/rails_env.rb fi OPTION_BUNDLE_PATH=$(bin/config BUNDLE_PATH) From 26a58e3c6a4a74618bf218be86b1d34f02e524f4 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 16 Feb 2023 09:56:04 +0000 Subject: [PATCH 147/289] Fix example usage --- lib/tasks/config_files.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/config_files.rake b/lib/tasks/config_files.rake index 08a3b0f566..d01f9b2222 100644 --- a/lib/tasks/config_files.rake +++ b/lib/tasks/config_files.rake @@ -122,7 +122,7 @@ namespace :config_files do 'VHOST_DIR=/dir/above/alaveteli VCSPATH=alaveteli ' \ 'SITE=alaveteli CRONTAB=config/crontab-example ' \ 'MAILTO=cron-alaveteli@example.org ' \ - 'RUBY_VERSION=3.0.4 ' + 'RUBY_VERSION=3.0.4 ' \ 'USE_RBENV=false ' check_for_env_vars(%w[DEPLOY_USER VHOST_DIR VCSPATH SITE CRONTAB], example) replacements = { @@ -199,7 +199,7 @@ namespace :config_files do desc 'Set reject_incoming_at_mta on a list of requests identified by ' \ 'request address' task set_reject_incoming_at_mta_from_list: :environment do - example = 'rake temp:set_reject_incoming_at_mta_from_list ' \ + example = 'rake config_files:set_reject_incoming_at_mta_from_list ' \ 'FILE=/tmp/rejection_list.txt' check_for_env_vars(['FILE'], example) From 002c0af1c7a701789963ad58f19224b7194fd2cb Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 16 Feb 2023 11:53:06 +0000 Subject: [PATCH 148/289] Remove config_files:get_config_value task This can be replaced with a call to our `bin/config` command. --- lib/tasks/config_files.rake | 12 ------------ script/site-specific-install.sh | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/tasks/config_files.rake b/lib/tasks/config_files.rake index d01f9b2222..56813f729d 100644 --- a/lib/tasks/config_files.rake +++ b/lib/tasks/config_files.rake @@ -44,18 +44,6 @@ namespace :config_files do puts daemons end - desc 'Return the value of a config param' - task get_config_value: :environment do - example = 'rake config_files:get_config_value ' \ - 'KEY=PRODUCTION_MAILER_RETRIEVER_METHOD' - check_for_env_vars(['KEY'], example) - key = ENV['KEY'] - if AlaveteliConfiguration::DEFAULTS.key?(key.to_sym) - puts MySociety::Config. - get(key, AlaveteliConfiguration::DEFAULTS[key.to_sym]) - end - end - desc 'Convert wrapper example in config to a form suitable for running mail handling scripts with rbenv' task convert_wrapper: :environment do example = 'rake config_files:convert_wrapper DEPLOY_USER=deploy SCRIPT_FILE=config/run-with-rbenv-path.example' diff --git a/script/site-specific-install.sh b/script/site-specific-install.sh index 9a45617090..3b7bc49f19 100755 --- a/script/site-specific-install.sh +++ b/script/site-specific-install.sh @@ -213,7 +213,7 @@ su -l -c "$BIN_DIRECTORY/install-as-user '$UNIX_USER' '$HOST' '$DIRECTORY' '$RUB echo "ALTER USER \"$UNIX_USER\" WITH NOSUPERUSER;" | su -l -c 'psql' postgres -RETRIEVER_METHOD=$(su -l -c "cd '$REPOSITORY' && bundle exec rake config_files:get_config_value KEY=PRODUCTION_MAILER_RETRIEVER_METHOD" "$UNIX_USER") +RETRIEVER_METHOD=$(su -l -c "cd '$REPOSITORY' && bin/config PRODUCTION_MAILER_RETRIEVER_METHOD" "$UNIX_USER") if [ x"$RETRIEVER_METHOD" = x"pop" ] && [ "$DEVELOPMENT_INSTALL" = true ]; then # Install dovecot From 7487f36c760020802ef33ddb38b2d3cd0949f329 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 16 Feb 2023 13:09:44 +0000 Subject: [PATCH 149/289] Extract config file replacements Use a single line with all the variables with sensible defaults. --- lib/tasks/config_files.rake | 60 +++++++++++++------------------------ 1 file changed, 20 insertions(+), 40 deletions(-) diff --git a/lib/tasks/config_files.rake b/lib/tasks/config_files.rake index 56813f729d..2909a8d782 100644 --- a/lib/tasks/config_files.rake +++ b/lib/tasks/config_files.rake @@ -24,6 +24,20 @@ namespace :config_files do ExampleERBRenderer.new(file, **replacements).lines end + def default_replacements + { + cpus: ENV.fetch('CPUS') { '1' }, + mailto: ENV.fetch('MAILTO') { "#{ ENV['DEPLOY_USER'] }@localhost" }, + rails_env: ENV.fetch('RAILS_ENV') { 'development' }, + ruby_version: ENV.fetch('RUBY_VERSION') { '3.0.4' }, + site: ENV.fetch('SITE') { 'foi' }, + user: ENV.fetch('DEPLOY_USER') { 'alaveteli' }, + vcspath: ENV.fetch('VCSPATH') { 'alaveteli' }, + vhost_dir: ENV.fetch('VHOST_DIR') { '/var/www/alaveteli' }, + use_rbenv?: ENV.fetch('USE_RBENV', 'false') == 'true' + } + end + def daemons(only_active = false) daemons = %w[alert-tracks send-notifications] if AlaveteliConfiguration.production_mailer_retriever_method == 'pop' || @@ -49,12 +63,7 @@ namespace :config_files do example = 'rake config_files:convert_wrapper DEPLOY_USER=deploy SCRIPT_FILE=config/run-with-rbenv-path.example' check_for_env_vars(%w[DEPLOY_USER SCRIPT_FILE], example) - replacements = { - user: ENV['DEPLOY_USER'] - } - - # Generate the template for potential further processing - convert_erb(ENV['SCRIPT_FILE'], **replacements).each do |line| + convert_erb(ENV['SCRIPT_FILE'], **default_replacements).each do |line| puts line end end @@ -71,22 +80,12 @@ namespace :config_files do 'USE_RBENV=false ' check_for_env_vars(%w[DEPLOY_USER VHOST_DIR SCRIPT_FILE], example) - replacements = { - user: ENV['DEPLOY_USER'], - vhost_dir: ENV['VHOST_DIR'], - vcspath: ENV.fetch('VCSPATH') { 'alaveteli' }, - site: ENV.fetch('SITE') { 'foi' }, - cpus: ENV.fetch('CPUS') { '1' }, - rails_env: ENV.fetch('RAILS_ENV') { 'development' }, - ruby_version: ENV.fetch('RUBY_VERSION') { '' }, - use_rbenv?: ENV['USE_RBENV'] == 'true' - } - # Use the filename for the $daemon_name ugly variable daemon_name = File.basename(ENV['SCRIPT_FILE'], '-debian.example') - replacements.update(daemon_name: "#{ replacements[:site] }-#{ daemon_name }") + replacements = default_replacements.merge( + daemon_name: "#{default_replacements[:site]}-#{daemon_name}" + ) - # Generate the template for potential further processing converted = convert_erb(ENV['SCRIPT_FILE'], **replacements) # uncomment RAILS_ENV in to the generated template if its not set by the @@ -113,18 +112,9 @@ namespace :config_files do 'RUBY_VERSION=3.0.4 ' \ 'USE_RBENV=false ' check_for_env_vars(%w[DEPLOY_USER VHOST_DIR VCSPATH SITE CRONTAB], example) - replacements = { - user: ENV['DEPLOY_USER'], - vhost_dir: ENV['VHOST_DIR'], - vcspath: ENV['VCSPATH'], - site: ENV['SITE'], - mailto: ENV.fetch('MAILTO') { "#{ ENV['DEPLOY_USER'] }@localhost" }, - ruby_version: ENV.fetch('RUBY_VERSION') { '' }, - use_rbenv?: ENV['USE_RBENV'] == 'true' - } lines = [] - convert_erb(ENV['CRONTAB'], **replacements).each do |line| + convert_erb(ENV['CRONTAB'], **default_replacements).each do |line| lines << line end @@ -138,17 +128,7 @@ namespace :config_files do example = 'rake config_files:convert_script SCRIPT_FILE=config/run-with-rbenv-path.example' check_for_env_vars(['SCRIPT_FILE'], example) - replacements = { - user: ENV.fetch('DEPLOY_USER') { 'alaveteli' }, - vhost_dir: ENV.fetch('VHOST_DIR') { '/var/www/alaveteli' }, - vcspath: ENV.fetch('VCSPATH') { 'alaveteli' }, - site: ENV.fetch('SITE') { 'foi' }, - cpus: ENV.fetch('CPUS') { '1' }, - rails_env: ENV.fetch('RAILS_ENV') { 'development' } - } - - # Generate the template for potential further processing - converted = convert_erb(ENV['SCRIPT_FILE'], **replacements) + converted = convert_erb(ENV['SCRIPT_FILE'], **default_replacements) # uncomment RAILS_ENV in to the generated template if its not set by the # hard coded config file From 0087495d996afd3bfc135e183e0f38a6062dc5c6 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 16 Feb 2023 12:21:03 +0000 Subject: [PATCH 150/289] Remove comments from debian scripts examples These comments we're dynamically uncommented when `config/rails_env.rb` doesn't exist. Instead add a variable `rails_env_defined?` variable and use ERB templating. --- config/alert-tracks-debian.example | 8 +++++--- config/poll-for-incoming-debian.example | 8 +++++--- config/send-notifications-debian.example | 8 +++++--- config/sysvinit-thin.example | 8 +++++--- lib/tasks/config_files.rake | 21 ++------------------- script/site-specific-install.sh | 10 ++++++++-- 6 files changed, 30 insertions(+), 33 deletions(-) diff --git a/config/alert-tracks-debian.example b/config/alert-tracks-debian.example index eb9886147c..81ef1147f1 100755 --- a/config/alert-tracks-debian.example +++ b/config/alert-tracks-debian.example @@ -22,9 +22,11 @@ LOGDIR=<%= vhost_dir %>/<%= vcspath %>/log LOGFILE=$LOGDIR/<%= daemon_name %>.log DUSER=<%= user %> SITE_HOME=<%= vhost_dir %>/<%= vcspath %> -# Set RAILS_ENV - not needed if using config/rails_env.rb -# RAILS_ENV=<%= rails_env %> -# export RAILS_ENV + +<% unless rails_env_defined? %> +RAILS_ENV=<%= rails_env %> +export RAILS_ENV +<% end %> <% if use_rbenv? %> RBENV_ROOT="/home/<%= user %>/.rbenv" diff --git a/config/poll-for-incoming-debian.example b/config/poll-for-incoming-debian.example index 01403e3955..45922c2d06 100755 --- a/config/poll-for-incoming-debian.example +++ b/config/poll-for-incoming-debian.example @@ -22,9 +22,11 @@ LOGDIR=<%= vhost_dir %>/<%= vcspath %>/log LOGFILE=$LOGDIR/<%= daemon_name %>.log DUSER=<%= user %> SITE_HOME=<%= vhost_dir %>/<%= vcspath %> -# Set RAILS_ENV - not needed if using config/rails_env.rb -# RAILS_ENV=<%= rails_env %> -# export RAILS_ENV + +<% unless rails_env_defined? %> +RAILS_ENV=<%= rails_env %> +export RAILS_ENV +<% end %> <% if use_rbenv? %> RBENV_ROOT="/home/<%= user %>/.rbenv" diff --git a/config/send-notifications-debian.example b/config/send-notifications-debian.example index 08fe801ef0..a62b11c003 100755 --- a/config/send-notifications-debian.example +++ b/config/send-notifications-debian.example @@ -22,9 +22,11 @@ LOGDIR=<%= vhost_dir %>/<%= vcspath %>/log LOGFILE=$LOGDIR/<%= daemon_name %>.log DUSER=<%= user %> SITE_HOME=<%= vhost_dir %>/<%= vcspath %> -# Set RAILS_ENV - not needed if using config/rails_env.rb -# RAILS_ENV=<%= rails_env %> -# export RAILS_ENV + +<% unless rails_env_defined? %> +RAILS_ENV=<%= rails_env %> +export RAILS_ENV +<% end %> <% if use_rbenv? %> RBENV_ROOT="/home/<%= user %>/.rbenv" diff --git a/config/sysvinit-thin.example b/config/sysvinit-thin.example index 987f3ac233..f42ba66152 100755 --- a/config/sysvinit-thin.example +++ b/config/sysvinit-thin.example @@ -19,9 +19,11 @@ SITE_HOME=<%= vhost_dir %>/<%= vcspath %> DESC="Alaveteli app server" USER=<%= user %> CPUS=<%= cpus %> -# Set RAILS_ENV - not needed if using config/rails_env.rb -# RAILS_ENV=<%= rails_env %> -# export RAILS_ENV + +<% unless rails_env_defined? %> +RAILS_ENV=<%= rails_env %> +export RAILS_ENV +<% end %> CMD="bundle exec thin" diff --git a/lib/tasks/config_files.rake b/lib/tasks/config_files.rake index 2909a8d782..2105eb08ab 100644 --- a/lib/tasks/config_files.rake +++ b/lib/tasks/config_files.rake @@ -34,7 +34,8 @@ namespace :config_files do user: ENV.fetch('DEPLOY_USER') { 'alaveteli' }, vcspath: ENV.fetch('VCSPATH') { 'alaveteli' }, vhost_dir: ENV.fetch('VHOST_DIR') { '/var/www/alaveteli' }, - use_rbenv?: ENV.fetch('USE_RBENV', 'false') == 'true' + use_rbenv?: ENV.fetch('USE_RBENV', 'false') == 'true', + rails_env_defined?: ENV['RAILS_ENV_DEFINED'] == 'true' } end @@ -88,15 +89,6 @@ namespace :config_files do converted = convert_erb(ENV['SCRIPT_FILE'], **replacements) - # uncomment RAILS_ENV in to the generated template if its not set by the - # hard coded config file - unless File.exist?("#{ Rails.root }/config/rails_env.rb") - converted.each do |line| - line.gsub!(/^#\s*RAILS_ENV=/, "RAILS_ENV=") - line.gsub!(/^#\s*export RAILS_ENV/, "export RAILS_ENV") - end - end - converted.each do |line| puts line end @@ -130,15 +122,6 @@ namespace :config_files do converted = convert_erb(ENV['SCRIPT_FILE'], **default_replacements) - # uncomment RAILS_ENV in to the generated template if its not set by the - # hard coded config file - unless File.exist?("#{ Rails.root }/config/rails_env.rb") - converted.each do |line| - line.gsub!(/^#\s*RAILS_ENV=/, "RAILS_ENV=") - line.gsub!(/^#\s*export RAILS_ENV/, "export RAILS_ENV") - end - end - converted.each do |line| puts line end diff --git a/script/site-specific-install.sh b/script/site-specific-install.sh index 3b7bc49f19..f6a18aa379 100755 --- a/script/site-specific-install.sh +++ b/script/site-specific-install.sh @@ -34,7 +34,7 @@ clear_daemon() { install_daemon() { echo -n "Creating /etc/init.d/$SITE-$1... " - (su -l -c "cd '$REPOSITORY' && bundle exec rake config_files:convert_init_script DEPLOY_USER='$UNIX_USER' VHOST_DIR='$DIRECTORY' VCSPATH='$SITE' SITE='$SITE' RUBY_VERSION='$RUBY_VERSION' USE_RBENV=$USE_RBENV RAILS_ENV='$RAILS_ENV' SCRIPT_FILE=config/$1-debian.example" "$UNIX_USER") > /etc/init.d/"$SITE-$1" + (su -l -c "cd '$REPOSITORY' && bundle exec rake config_files:convert_init_script DEPLOY_USER='$UNIX_USER' VHOST_DIR='$DIRECTORY' VCSPATH='$SITE' SITE='$SITE' RUBY_VERSION='$RUBY_VERSION' USE_RBENV=$USE_RBENV RAILS_ENV='$RAILS_ENV' RAILS_ENV_DEFINED='$RAILS_ENV_DEFINED' SCRIPT_FILE=config/$1-debian.example" "$UNIX_USER") > /etc/init.d/"$SITE-$1" chgrp "$UNIX_USER" /etc/init.d/"$SITE-$1" chmod 754 /etc/init.d/"$SITE-$1" @@ -250,6 +250,12 @@ fi cd "$REPOSITORY" +if [ -f config/rails_env.rb ]; then + RAILS_ENV_DEFINED=$(ruby -r ./config/rails_env.rb -e "puts ENV.keys.include?('RAILS_ENV')") +else + RAILS_ENV_DEFINED=false +fi + if [ "$DEVELOPMENT_INSTALL" = true ]; then RAILS_ENV=development else @@ -287,7 +293,7 @@ echo $DONE_MSG if [ ! "$DEVELOPMENT_INSTALL" = true ]; then echo -n "Creating /etc/init.d/$SITE... " - (su -l -c "cd '$REPOSITORY' && bundle exec rake config_files:convert_init_script DEPLOY_USER='$UNIX_USER' VHOST_DIR='$DIRECTORY' VCSPATH='$SITE' SITE='$SITE' RUBY_VERSION='$RUBY_VERSION' USE_RBENV=$USE_RBENV RAILS_ENV='$RAILS_ENV' SCRIPT_FILE=config/sysvinit-thin.example" "$UNIX_USER") > /etc/init.d/"$SITE" + (su -l -c "cd '$REPOSITORY' && bundle exec rake config_files:convert_init_script DEPLOY_USER='$UNIX_USER' VHOST_DIR='$DIRECTORY' VCSPATH='$SITE' SITE='$SITE' RUBY_VERSION='$RUBY_VERSION' USE_RBENV=$USE_RBENV RAILS_ENV='$RAILS_ENV' RAILS_ENV_DEFINED='$RAILS_ENV_DEFINED' SCRIPT_FILE=config/sysvinit-thin.example" "$UNIX_USER") > /etc/init.d/"$SITE" chgrp "$UNIX_USER" /etc/init.d/"$SITE" chmod 754 /etc/init.d/"$SITE" echo $DONE_MSG From 0f3c209ce72e989419115b04a838066d4861c92c Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 16 Feb 2023 13:38:42 +0000 Subject: [PATCH 151/289] Refactor config file output Use a single `puts` statement instead of looping over each line. --- lib/tasks/config_files.rake | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/lib/tasks/config_files.rake b/lib/tasks/config_files.rake index 2105eb08ab..1835f81999 100644 --- a/lib/tasks/config_files.rake +++ b/lib/tasks/config_files.rake @@ -21,7 +21,7 @@ namespace :config_files do end def convert_erb(file, **replacements) - ExampleERBRenderer.new(file, **replacements).lines + puts ExampleERBRenderer.new(file, **replacements).lines end def default_replacements @@ -64,9 +64,7 @@ namespace :config_files do example = 'rake config_files:convert_wrapper DEPLOY_USER=deploy SCRIPT_FILE=config/run-with-rbenv-path.example' check_for_env_vars(%w[DEPLOY_USER SCRIPT_FILE], example) - convert_erb(ENV['SCRIPT_FILE'], **default_replacements).each do |line| - puts line - end + convert_erb(ENV['SCRIPT_FILE'], **default_replacements) end desc 'Convert Debian example init script in config to a form suitable for installing in /etc/init.d' @@ -87,11 +85,7 @@ namespace :config_files do daemon_name: "#{default_replacements[:site]}-#{daemon_name}" ) - converted = convert_erb(ENV['SCRIPT_FILE'], **replacements) - - converted.each do |line| - puts line - end + convert_erb(ENV['SCRIPT_FILE'], **replacements) end desc 'Convert Debian example crontab file in config to a form suitable for installing in /etc/cron.d' @@ -104,27 +98,14 @@ namespace :config_files do 'RUBY_VERSION=3.0.4 ' \ 'USE_RBENV=false ' check_for_env_vars(%w[DEPLOY_USER VHOST_DIR VCSPATH SITE CRONTAB], example) - - lines = [] - convert_erb(ENV['CRONTAB'], **default_replacements).each do |line| - lines << line - end - - lines.each do |line| - puts line - end + convert_erb(ENV['CRONTAB'], **default_replacements) end desc 'Convert miscellaneous example scripts. This does not check for required environment variables for the script, so please check the script file itself.' task convert_script: :environment do example = 'rake config_files:convert_script SCRIPT_FILE=config/run-with-rbenv-path.example' check_for_env_vars(['SCRIPT_FILE'], example) - - converted = convert_erb(ENV['SCRIPT_FILE'], **default_replacements) - - converted.each do |line| - puts line - end + convert_erb(ENV['SCRIPT_FILE'], **default_replacements) end desc 'Set reject_incoming_at_mta on old requests that are rejecting incoming mail' From 7cd9ab1b3469681fa7d723eaf90ec75f1b897014 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 16 Feb 2023 11:55:33 +0000 Subject: [PATCH 152/289] Refactor daemon definitions --- lib/tasks/config_files.rake | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/lib/tasks/config_files.rake b/lib/tasks/config_files.rake index 1835f81999..a2e291ffd9 100644 --- a/lib/tasks/config_files.rake +++ b/lib/tasks/config_files.rake @@ -39,24 +39,38 @@ namespace :config_files do } end - def daemons(only_active = false) - daemons = %w[alert-tracks send-notifications] - if AlaveteliConfiguration.production_mailer_retriever_method == 'pop' || - !only_active - daemons << 'poll-for-incoming' - end - daemons + def daemons + [ + { + name: 'alert-tracks', + template: 'config/alert-tracks-debian.example' + }, + { + name: 'send-notifications', + template: 'config/send-notifications-debian.example' + }, + { + name: 'poll-for-incoming', + template: 'config/poll-for-incoming-debian.example', + condition: -> do + AlaveteliConfiguration.production_mailer_retriever_method == 'pop' + end + } + ] end desc 'Return list of daemons to install based on the settings defined in general.yml' task active_daemons: :environment do - puts daemons(true) + puts daemons. + select { |d| d.fetch(:condition, -> { true }).call }. + map { |d| d[:name] } end desc 'Return list of all daemons the application defines' task all_daemons: :environment do - puts daemons + puts daemons. + map { |d| d[:name] } end desc 'Convert wrapper example in config to a form suitable for running mail handling scripts with rbenv' From 82e7961c9821532b2ddb2ac3e8d161a42caa09d2 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 16 Feb 2023 12:59:28 +0000 Subject: [PATCH 153/289] Add config_files:convert_daemon task Delegates to the existing `convert_init_script` which was previously used. The `convert_init_script` has been kept so it can be used for other scripts, such as `config/sysvinit-passenger.example`. --- lib/tasks/config_files.rake | 28 ++++++++++++++++++++++++++-- script/site-specific-install.sh | 2 +- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/lib/tasks/config_files.rake b/lib/tasks/config_files.rake index a2e291ffd9..415cf23361 100644 --- a/lib/tasks/config_files.rake +++ b/lib/tasks/config_files.rake @@ -93,8 +93,10 @@ namespace :config_files do 'USE_RBENV=false ' check_for_env_vars(%w[DEPLOY_USER VHOST_DIR SCRIPT_FILE], example) - # Use the filename for the $daemon_name ugly variable - daemon_name = File.basename(ENV['SCRIPT_FILE'], '-debian.example') + daemon_name = ENV.fetch('DAEMON_NAME') do + File.basename(ENV['SCRIPT_FILE'], '-debian.example') + end + replacements = default_replacements.merge( daemon_name: "#{default_replacements[:site]}-#{daemon_name}" ) @@ -102,6 +104,28 @@ namespace :config_files do convert_erb(ENV['SCRIPT_FILE'], **replacements) end + desc 'Convert example daemon in config to a form suitable for installing ' \ + 'on a server' + task convert_daemon: :environment do + example = 'rake config_files:convert_daemon ' \ + 'DEPLOY_USER=deploy ' \ + 'VHOST_DIR=/dir/above/alaveteli ' \ + 'VCSPATH=alaveteli ' \ + 'SITE=alaveteli ' \ + 'DAEMON=alert-tracks ' \ + 'RUBY_VERSION=3.0.4 ' \ + 'USE_RBENV=false ' + check_for_env_vars(%w[DEPLOY_USER VHOST_DIR DAEMON], example) + + daemon = daemons.find { |d| d[:name] == ENV['DAEMON'] } + raise 'Unknown daemon' unless daemon + + ENV['SCRIPT_FILE'] = daemon[:template] + ENV['DAEMON_NAME'] = daemon[:name] + + Rake::Task['config_files:convert_init_script'].invoke + end + desc 'Convert Debian example crontab file in config to a form suitable for installing in /etc/cron.d' task convert_crontab: :environment do example = 'rake config_files:convert_crontab ' \ diff --git a/script/site-specific-install.sh b/script/site-specific-install.sh index f6a18aa379..a97897dc8d 100755 --- a/script/site-specific-install.sh +++ b/script/site-specific-install.sh @@ -34,7 +34,7 @@ clear_daemon() { install_daemon() { echo -n "Creating /etc/init.d/$SITE-$1... " - (su -l -c "cd '$REPOSITORY' && bundle exec rake config_files:convert_init_script DEPLOY_USER='$UNIX_USER' VHOST_DIR='$DIRECTORY' VCSPATH='$SITE' SITE='$SITE' RUBY_VERSION='$RUBY_VERSION' USE_RBENV=$USE_RBENV RAILS_ENV='$RAILS_ENV' RAILS_ENV_DEFINED='$RAILS_ENV_DEFINED' SCRIPT_FILE=config/$1-debian.example" "$UNIX_USER") > /etc/init.d/"$SITE-$1" + (su -l -c "cd '$REPOSITORY' && bundle exec rake config_files:convert_daemon DEPLOY_USER='$UNIX_USER' VHOST_DIR='$DIRECTORY' VCSPATH='$SITE' SITE='$SITE' RUBY_VERSION='$RUBY_VERSION' USE_RBENV=$USE_RBENV RAILS_ENV='$RAILS_ENV' RAILS_ENV_DEFINED='$RAILS_ENV_DEFINED' DAEMON=$1" "$UNIX_USER") > /etc/init.d/"$SITE-$1" chgrp "$UNIX_USER" /etc/init.d/"$SITE-$1" chmod 754 /etc/init.d/"$SITE-$1" From 0ee0a44a025998cae0830f704c29e758ef8fdb32 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 2 Mar 2023 17:32:31 +0000 Subject: [PATCH 154/289] Update generation of main application service Combine generation of main application init.d services with the other daemons. --- lib/tasks/config_files.rake | 5 +++++ script/site-specific-install.sh | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/tasks/config_files.rake b/lib/tasks/config_files.rake index 415cf23361..3a2452a9b6 100644 --- a/lib/tasks/config_files.rake +++ b/lib/tasks/config_files.rake @@ -41,6 +41,11 @@ namespace :config_files do def daemons [ + { + name: 'thin', + template: 'config/sysvinit-thin.example', + condition: -> { ENV['RAILS_ENV'] == 'production' } + }, { name: 'alert-tracks', template: 'config/alert-tracks-debian.example' diff --git a/script/site-specific-install.sh b/script/site-specific-install.sh index a97897dc8d..948349f1e7 100755 --- a/script/site-specific-install.sh +++ b/script/site-specific-install.sh @@ -291,11 +291,12 @@ sed -r \ -i /etc/cron.d/alaveteli echo $DONE_MSG -if [ ! "$DEVELOPMENT_INSTALL" = true ]; then - echo -n "Creating /etc/init.d/$SITE... " - (su -l -c "cd '$REPOSITORY' && bundle exec rake config_files:convert_init_script DEPLOY_USER='$UNIX_USER' VHOST_DIR='$DIRECTORY' VCSPATH='$SITE' SITE='$SITE' RUBY_VERSION='$RUBY_VERSION' USE_RBENV=$USE_RBENV RAILS_ENV='$RAILS_ENV' RAILS_ENV_DEFINED='$RAILS_ENV_DEFINED' SCRIPT_FILE=config/sysvinit-thin.example" "$UNIX_USER") > /etc/init.d/"$SITE" - chgrp "$UNIX_USER" /etc/init.d/"$SITE" - chmod 754 /etc/init.d/"$SITE" +# Clear existing legacy daemons if present +if [ -f /etc/init.d/$SITE ] +then + echo "Clearing any legacy daemons" + echo -n "Removing /etc/init.d/$SITE... " + rm -f "/etc/init.d/$SITE" echo $DONE_MSG fi From b960ff93f50703fbf9269f3b04206a764612188d Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 16 Feb 2023 14:06:41 +0000 Subject: [PATCH 155/289] Add support for systemd services This will be needed to add services for Puma and Sidekiq. --- lib/tasks/config_files.rake | 16 ++++++++-- script/site-specific-install.sh | 52 ++++++++++++++++++++------------- 2 files changed, 45 insertions(+), 23 deletions(-) diff --git a/lib/tasks/config_files.rake b/lib/tasks/config_files.rake index 3a2452a9b6..3619bd0f66 100644 --- a/lib/tasks/config_files.rake +++ b/lib/tasks/config_files.rake @@ -42,19 +42,23 @@ namespace :config_files do def daemons [ { + path: '/etc/init.d', name: 'thin', template: 'config/sysvinit-thin.example', condition: -> { ENV['RAILS_ENV'] == 'production' } }, { + path: '/etc/init.d', name: 'alert-tracks', template: 'config/alert-tracks-debian.example' }, { + path: '/etc/init.d', name: 'send-notifications', template: 'config/send-notifications-debian.example' }, { + path: '/etc/init.d', name: 'poll-for-incoming', template: 'config/poll-for-incoming-debian.example', condition: -> do @@ -65,16 +69,24 @@ namespace :config_files do end desc 'Return list of daemons to install based on the settings defined - in general.yml' + in general.yml for a given path' task active_daemons: :environment do + example = 'rake config_files:active_daemons PATH=/etc/init.d' + check_for_env_vars(['PATH'], example) + puts daemons. + select { |d| d[:path] == ENV['PATH'] }. select { |d| d.fetch(:condition, -> { true }).call }. map { |d| d[:name] } end - desc 'Return list of all daemons the application defines' + desc 'Return list of all daemons the application defines for a given path' task all_daemons: :environment do + example = 'rake config_files:all_daemons PATH=/etc/init.d' + check_for_env_vars(['PATH'], example) + puts daemons. + select { |d| d[:path] == ENV['PATH'] }. map { |d| d[:name] } end diff --git a/script/site-specific-install.sh b/script/site-specific-install.sh index 948349f1e7..6302e962c6 100755 --- a/script/site-specific-install.sh +++ b/script/site-specific-install.sh @@ -27,20 +27,28 @@ install_mailutils() { } clear_daemon() { - echo -n "Removing /etc/init.d/$SITE-$1... " - rm -f "/etc/init.d/$SITE-$1" + path=$1 + if [ $path = "/etc/init.d" ]; then name="$SITE-$2"; fi + if [ $path = "/etc/systemd/system" ]; then name="$SITE.$2"; fi + + echo -n "Removing $path/$name... " + rm -f "$path/$name" echo $DONE_MSG } install_daemon() { - echo -n "Creating /etc/init.d/$SITE-$1... " - (su -l -c "cd '$REPOSITORY' && bundle exec rake config_files:convert_daemon DEPLOY_USER='$UNIX_USER' VHOST_DIR='$DIRECTORY' VCSPATH='$SITE' SITE='$SITE' RUBY_VERSION='$RUBY_VERSION' USE_RBENV=$USE_RBENV RAILS_ENV='$RAILS_ENV' RAILS_ENV_DEFINED='$RAILS_ENV_DEFINED' DAEMON=$1" "$UNIX_USER") > /etc/init.d/"$SITE-$1" - chgrp "$UNIX_USER" /etc/init.d/"$SITE-$1" - chmod 754 /etc/init.d/"$SITE-$1" + path=$1 + if [ $path = "/etc/init.d" ]; then name="$SITE-$2"; fi + if [ $path = "/etc/systemd/system" ]; then name="$SITE.$2"; fi + + echo -n "Creating $path/$name... " + (su -l -c "cd '$REPOSITORY' && bundle exec rake config_files:convert_daemon DEPLOY_USER='$UNIX_USER' VHOST_DIR='$DIRECTORY' VCSPATH='$SITE' SITE='$SITE' RUBY_VERSION='$RUBY_VERSION' USE_RBENV=$USE_RBENV RAILS_ENV='$RAILS_ENV' RAILS_ENV_DEFINED='$RAILS_ENV_DEFINED' DAEMON=$2" "$UNIX_USER") > $path/$name + chgrp "$UNIX_USER" $path/$name + chmod 754 $path/$name if which systemctl > /dev/null then - systemctl enable "$SITE-$1" + systemctl enable "$name" fi echo $DONE_MSG @@ -300,20 +308,22 @@ then echo $DONE_MSG fi -# Clear existing daemons -all_daemons=$(su -l -c "cd '$REPOSITORY' && bundle exec rake config_files:all_daemons" "$UNIX_USER") -echo "Clearing any existing daemons" -for daemon in $all_daemons -do - clear_daemon $daemon -done - -# Install required daemons -active_daemons=$(su -l -c "cd '$REPOSITORY' && bundle exec rake config_files:active_daemons" "$UNIX_USER") -echo "Creating daemons for active daemons" -for daemon in $active_daemons -do - install_daemon $daemon +for path in "/etc/init.d" "/etc/systemd/system"; do + # Clear existing daemons + all_daemons=$(su -l -c "cd '$REPOSITORY' && bundle exec rake config_files:all_daemons PATH='$path'" "$UNIX_USER") + echo "Clearing any existing $path daemons" + for daemon in $all_daemons + do + clear_daemon $path $daemon + done + + # Install required daemons + active_daemons=$(su -l -c "cd '$REPOSITORY' && bundle exec rake config_files:active_daemons PATH='$path'" "$UNIX_USER") + echo "Creating daemons for active $path daemons" + for daemon in $active_daemons + do + install_daemon $path $daemon + done done if which systemctl > /dev/null From 502945cc9437e3969caf62d2c9fc729b39a5d1af Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Fri, 3 Mar 2023 11:16:12 +0000 Subject: [PATCH 156/289] Add STAGING_SITE and DEVELOPMENT_INSTALL check If these values aren't compatible with each other then error, ask the user to make a change and exit early. --- script/site-specific-install.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/script/site-specific-install.sh b/script/site-specific-install.sh index 6302e962c6..db02316e16 100755 --- a/script/site-specific-install.sh +++ b/script/site-specific-install.sh @@ -71,6 +71,28 @@ install_daemon() { [ -z "$DEVELOPMENT_INSTALL" ] && misuse DEVELOPMENT_INSTALL [ -z "$BIN_DIRECTORY" ] && misuse BIN_DIRECTORY +if [ -f $REPOSITORY/config/general.yml ]; then + STAGING_SITE=$(su -l -c "cd '$REPOSITORY' && bin/config STAGING_SITE" "$UNIX_USER") + if ([ "$STAGING_SITE" = "0" ] && [ "$DEVELOPMENT_INSTALL" = "true" ]) || + ([ "$STAGING_SITE" = "1" ] && [ "$DEVELOPMENT_INSTALL" != "true" ]); then + cat <<-END + + ***************************************************************** + ERROR: Configuration mismatch + + In config/general.yml you have STAGING_SITE set to $STAGING_SITE but you're + running the install script with DEVELOPMENT_INSTALL set to $DEVELOPMENT_INSTALL + + Please either update config/general.yml or change the flags used + when invoking the install script + ***************************************************************** + +END + + exit 1 + fi +fi + update_mysociety_apt_sources apt-get -y update From 9a2982aedd35c304966cdbaa31bec2a3551aabfe Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Fri, 3 Mar 2023 13:18:17 +0000 Subject: [PATCH 157/289] Extract conditional loading of config/rails_env.rb This will mean we can just require `config/load_env.rb` when loading Rails, Sidekiq or Puma. --- config/boot.rb | 7 +------ config/load_env.rb | 7 +++++++ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 config/load_env.rb diff --git a/config/boot.rb b/config/boot.rb index e6a5f1c48d..662856d3b3 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -2,9 +2,4 @@ require "bundler/setup" # Set up gems listed in the Gemfile. -# TODO: Remove this. This is a hacky system for having a default environment. -# It looks for a config/rails_env.rb file, and reads stuff from there if -# it exists. Put just a line like this in there: -# ENV['RAILS_ENV'] = 'production' -rails_env_file = File.expand_path(File.join(File.dirname(__FILE__), 'rails_env.rb')) -require rails_env_file if File.exist?(rails_env_file) +require File.expand_path('load_env.rb', __dir__) diff --git a/config/load_env.rb b/config/load_env.rb new file mode 100644 index 0000000000..3b257efd3a --- /dev/null +++ b/config/load_env.rb @@ -0,0 +1,7 @@ +# TODO: Remove this. This is a hacky system for having a default environment. +# It looks for a config/rails_env.rb file, and reads stuff from there if +# it exists. Put just a line like this in there: +# ENV['RAILS_ENV'] = 'production' + +rails_env_file = File.expand_path('rails_env.rb', __dir__) +require rails_env_file if File.exist?(rails_env_file) From 9d64507bf70d57c4366866df1fbc81c90aa4fe0a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 05:03:42 +0000 Subject: [PATCH 158/289] Build(deps): Bump cancancan from 3.4.0 to 3.5.0 Bumps [cancancan](https://github.com/CanCanCommunity/cancancan) from 3.4.0 to 3.5.0. - [Release notes](https://github.com/CanCanCommunity/cancancan/releases) - [Changelog](https://github.com/CanCanCommunity/cancancan/blob/develop/CHANGELOG.md) - [Commits](https://github.com/CanCanCommunity/cancancan/compare/3.4.0...3.5.0) --- updated-dependencies: - dependency-name: cancancan dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 969146a9d3..2d88ebf622 100644 --- a/Gemfile +++ b/Gemfile @@ -88,7 +88,7 @@ gem 'acts_as_versioned', git: 'https://github.com/mysociety/acts_as_versioned.gi ref: '13e928b' gem 'active_model_otp' gem 'bcrypt', '~> 3.1.18' -gem 'cancancan', '~> 3.4.0' +gem 'cancancan', '~> 3.5.0' gem 'charlock_holmes', '~> 0.7.7' gem 'dalli', '~> 3.2.3' gem 'exception_notification', '~> 4.5.0' diff --git a/Gemfile.lock b/Gemfile.lock index 787c6f4d4b..23518da528 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -152,7 +152,7 @@ GEM bullet (7.0.7) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) - cancancan (3.4.0) + cancancan (3.5.0) capistrano (2.15.9) highline net-scp (>= 1.0.0) @@ -551,7 +551,7 @@ DEPENDENCIES bcrypt (~> 3.1.18) bootstrap-sass (~> 2.3.2.2) bullet (~> 7.0.7) - cancancan (~> 3.4.0) + cancancan (~> 3.5.0) capistrano (~> 2.15.0, < 3.0.0) capybara (~> 3.38.0) charlock_holmes (~> 0.7.7) From 282d115953f74111e9518ca91c26fc5d43643927 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Fri, 3 Feb 2023 10:43:30 +0000 Subject: [PATCH 159/289] Add background job processing Use Redis/Sidekiq job queue via ActiveJob. Adds configuration option to allow jobs to be performed either, inline, embedded in the web process, or by the Sidekiq server daemon. --- .ruby-style.yml | 2 ++ Gemfile | 2 ++ Gemfile.lock | 12 ++++++++++-- app/jobs/application_job.rb | 13 +++++++++++++ bin/sidekiq | 27 +++++++++++++++++++++++++++ bin/sidekiqmon | 27 +++++++++++++++++++++++++++ config/application.rb | 5 ++++- config/environments/test.rb | 3 +++ config/general.yml-example | 16 ++++++++++++++++ config/initializers/sidekiq.rb | 26 ++++++++++++++++++++++++++ config/packages | 1 + config/packages.generic | 1 + config/packages.ubuntu-focal | 1 + config/rails_env.rb-example | 1 + config/routes.rb | 14 +++++++++++++- config/sidekiq.service.example | 22 ++++++++++++++++++++++ config/sidekiq.yml | 6 ++++++ config/test.yml | 2 ++ docker-compose.yml | 28 ++++++++++++++++++++++++++++ lib/configuration.rb | 7 +++++++ lib/tasks/config_files.rake | 6 ++++++ 21 files changed, 218 insertions(+), 4 deletions(-) create mode 100644 app/jobs/application_job.rb create mode 100755 bin/sidekiq create mode 100755 bin/sidekiqmon create mode 100644 config/initializers/sidekiq.rb create mode 100644 config/rails_env.rb-example create mode 100644 config/sidekiq.service.example create mode 100644 config/sidekiq.yml diff --git a/.ruby-style.yml b/.ruby-style.yml index fdb65ea814..34b5c4d9f4 100644 --- a/.ruby-style.yml +++ b/.ruby-style.yml @@ -26,6 +26,8 @@ AllCops: - ".git/**/*" - bin/bundle - bin/rubocop + - bin/sidekiq + - bin/sidekiqmon DisplayCopNames: false StyleGuideCopsOnly: false DisabledByDefault: true diff --git a/Gemfile b/Gemfile index 969146a9d3..8238652c8e 100644 --- a/Gemfile +++ b/Gemfile @@ -111,10 +111,12 @@ gem 'rack-utf8_sanitizer', '~> 1.8.0' gem 'recaptcha', '~> 5.12.3', require: 'recaptcha/rails' gem 'matrix', '~> 0.4.2' gem 'mini_magick', '~> 4.12.0' +gem 'redis', '~> 4.8.1' gem 'rolify', '~> 6.0.1' gem 'ruby-msg', '~> 1.5.0', git: 'https://github.com/mysociety/ruby-msg.git', branch: 'ascii-encoding' gem 'rubyzip', '~> 2.3.2' gem 'secure_headers', '~> 6.5.0' +gem 'sidekiq', '~> 6.5.8' gem 'statistics2', '~> 0.54' gem 'strip_attributes', git: 'https://github.com/mysociety/strip_attributes.git', branch: 'globalize3-rails7' gem 'stripe', '~> 5.55.0' diff --git a/Gemfile.lock b/Gemfile.lock index 787c6f4d4b..de71292f8c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -170,7 +170,8 @@ GEM xpath (~> 3.2) charlock_holmes (0.7.7) coderay (1.1.3) - concurrent-ruby (1.2.0) + concurrent-ruby (1.2.2) + connection_pool (2.3.0) crack (0.4.5) rexml crass (1.0.6) @@ -207,7 +208,7 @@ GEM flipper-active_record (0.24.1) activerecord (>= 4.2, < 8) flipper (~> 0.24.1) - forwardable (1.3.2) + forwardable (1.3.3) gender_detector (2.0.0) gettext (3.4.3) erubi @@ -404,6 +405,7 @@ GEM ffi (~> 1.0) recaptcha (5.12.3) json + redis (4.8.1) regexp_parser (2.7.0) representable (3.2.0) declarative (< 0.1.0) @@ -469,6 +471,10 @@ GEM sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) secure_headers (6.5.0) + sidekiq (6.5.8) + connection_pool (>= 2.2.5, < 3) + rack (~> 2.0) + redis (>= 4.5.0, < 5) signet (0.17.0) addressable (~> 2.8) faraday (>= 0.17.5, < 3.a) @@ -599,6 +605,7 @@ DEPENDENCIES rails-controller-testing rails-i18n (~> 7.0.5) recaptcha (~> 5.12.3) + redis (~> 4.8.1) rolify (~> 6.0.1) routing-filter (~> 0.7.0) rspec-activemodel-mocks (~> 1.1.0) @@ -610,6 +617,7 @@ DEPENDENCIES rubyzip (~> 2.3.2) sass-rails (~> 5.0.8) secure_headers (~> 6.5.0) + sidekiq (~> 6.5.8) simplecov (~> 0.22.0) simplecov-lcov (~> 0.7.0) statistics2 (~> 0.54) diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb new file mode 100644 index 0000000000..7a81d6b20f --- /dev/null +++ b/app/jobs/application_job.rb @@ -0,0 +1,13 @@ +class ApplicationJob < ActiveJob::Base # :nodoc: + # Automatically retry jobs that encountered a deadlock + retry_on ActiveRecord::Deadlocked + + # Most jobs are safe to ignore if the underlying records are no longer + # available + discard_on ActiveJob::DeserializationError + + def self.perform_later(*args) + return super unless AlaveteliConfiguration.background_jobs == 'inline' + perform_now(*args) + end +end diff --git a/bin/sidekiq b/bin/sidekiq new file mode 100755 index 0000000000..e7af7e7eb5 --- /dev/null +++ b/bin/sidekiq @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'sidekiq' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("sidekiq", "sidekiq") diff --git a/bin/sidekiqmon b/bin/sidekiqmon new file mode 100755 index 0000000000..0c907984ee --- /dev/null +++ b/bin/sidekiqmon @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'sidekiqmon' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("sidekiq", "sidekiqmon") diff --git a/config/application.rb b/config/application.rb index bebb8ac6f1..b878c700ce 100644 --- a/config/application.rb +++ b/config/application.rb @@ -3,7 +3,7 @@ require "rails" # Pick the frameworks you want: require "active_model/railtie" -# require "active_job/railtie" +require "active_job/railtie" require "active_record/railtie" require "active_storage/engine" require "action_controller/railtie" @@ -70,6 +70,9 @@ class Application < Rails::Application { namespace: "#{AlaveteliConfiguration.domain}_#{RUBY_VERSION}" } config.action_dispatch.rack_cache = nil + # Use a real queuing backend for Active Job + config.active_job.queue_adapter = :sidekiq + config.after_initialize do |app| # Add a catch-all route to force routing errors to be handled by the application, # rather than by middleware. diff --git a/config/environments/test.rb b/config/environments/test.rb index fb51a02272..b8109c174c 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -26,6 +26,9 @@ config.action_controller.perform_caching = false config.cache_store = :null_store + # Use inline processing for Active Job + config.active_job.queue_adapter = :test + # Raise exceptions instead of rendering exception templates. config.action_dispatch.show_exceptions = false diff --git a/config/general.yml-example b/config/general.yml-example index 30dbf84cb7..5f3811de7e 100644 --- a/config/general.yml-example +++ b/config/general.yml-example @@ -1289,3 +1289,19 @@ SURVEY_URL: '' # # --- USER_SIGN_IN_ACTIVITY_RETENTION_DAYS: 0 + +# Background jobs are processed by Rails' ActiveJob using Sidekiq. There are +# various ways to run Sidekiq depending to server resources and technical +# knowledge in order to run and maintain a Redis server. +# +# Can either be set to: +# - 'inline' to process jobs within the web application process, this was the +# default option up until Alaveteli 0.42 and doesn't require Redis to be. +# installed. Due to issues with requests with web requests timing out this has +# been superseded by the other options. +# - 'server' to process job by a server running as a system daemon. +# +# BACKGROUND_JOBS – String (default: 'server') +# +# --- +BACKGROUND_JOBS: 'server' diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb new file mode 100644 index 0000000000..171e7d8c8e --- /dev/null +++ b/config/initializers/sidekiq.rb @@ -0,0 +1,26 @@ +require File.expand_path('../load_env.rb', __dir__) + +def redis_config + { url: ENV['REDIS_URL'], password: ENV['REDIS_PASSWORD'] }. + merge(redis_sentinel_config) +end + +def redis_sentinel_config + return {} unless ENV['REDIS_SENTINELS'] + + sentinels = ENV['REDIS_SENTINELS'].split(',').map do |ip_and_port| + ip, port = ip_and_port.split(/:(\d+)$/) + ip = Regexp.last_match[1] if ip =~ /\[(.*?)\]/ + { host: ip, port: port&.to_i || 26_379 } + end + + { sentinels: sentinels, role: :master } +end + +Sidekiq.configure_client do |config| + config.redis = redis_config +end + +Sidekiq.configure_server do |config| + config.redis = redis_config +end diff --git a/config/packages b/config/packages index cc263a015f..fbccd7733a 100644 --- a/config/packages +++ b/config/packages @@ -26,6 +26,7 @@ pdftk (>> 1.41+dfsg-1) | pdftk (<< 1.41+dfsg-1) # that version has a non-functio poppler-utils rake (>= 0.9.2.2) rdoc +redis ruby ruby-dev sqlite3 diff --git a/config/packages.generic b/config/packages.generic index 8fc93212d4..c57c7f05a0 100644 --- a/config/packages.generic +++ b/config/packages.generic @@ -22,6 +22,7 @@ poppler-utils postgresql postgresql-client rake +redis ruby ruby-dev sqlite3 diff --git a/config/packages.ubuntu-focal b/config/packages.ubuntu-focal index 3d110d05da..cdf44a01b9 100644 --- a/config/packages.ubuntu-focal +++ b/config/packages.ubuntu-focal @@ -22,6 +22,7 @@ poppler-utils postgresql postgresql-client rake +redis ruby ruby-dev sqlite3 diff --git a/config/rails_env.rb-example b/config/rails_env.rb-example new file mode 100644 index 0000000000..98950617ae --- /dev/null +++ b/config/rails_env.rb-example @@ -0,0 +1 @@ +# This file is needed for the mySociety deployment system diff --git a/config/routes.rb b/config/routes.rb index 2c3ac6875f..c7c4ef7db5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,6 +4,8 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: hello@mysociety.org; WWW: http://www.mysociety.org/ +require 'sidekiq/web' + include AlaveteliFeatures::Constraints # Allow easy extension from themes. Note these will have the highest priority. @@ -11,8 +13,18 @@ load File.join('config', f) end +class AdminConstraint # :nodoc: + def matches?(request) + user = User.find_by( + id: request.session[:user_id], + login_token: request.session[:user_login_token] + ) + user && user.is_admin? + end +end + Rails.application.routes.draw do - admin_constraint = lambda { |request| request.session[:using_admin] } + mount Sidekiq::Web => '/sidekiq', constraints: AdminConstraint.new root to: 'general#frontpage' diff --git a/config/sidekiq.service.example b/config/sidekiq.service.example new file mode 100644 index 0000000000..167d7c8200 --- /dev/null +++ b/config/sidekiq.service.example @@ -0,0 +1,22 @@ +[Unit] +Description=<%= daemon_name %> +After=syslog.target network.target + +[Service] +Type=notify + +WatchdogSec=10 + +User=<%= user %> +Group=<%= user %> +UMask=0002 + +WorkingDirectory=<%= vhost_dir %>/<%= vcspath %> + +ExecStart=/bin/bash -lc 'bundle exec sidekiq -e <%= rails_env %>' + +RestartSec=1 +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/config/sidekiq.yml b/config/sidekiq.yml new file mode 100644 index 0000000000..8c67045671 --- /dev/null +++ b/config/sidekiq.yml @@ -0,0 +1,6 @@ +development: + :concurrency: 1 +production: + :concurrency: 1 +:queues: + - default diff --git a/config/test.yml b/config/test.yml index ff5c415084..1f596a1600 100644 --- a/config/test.yml +++ b/config/test.yml @@ -120,3 +120,5 @@ MAX_REQUESTS_PER_USER_PER_DAY: 2 SKIP_ADMIN_AUTH: true UTILITY_SEARCH_PATH: [] + +BACKGROUND_JOBS: 'server' diff --git a/docker-compose.yml b/docker-compose.yml index a1a3f3a515..ff32e651a1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,7 @@ services: environment: - BUNDLE_PATH=/bundle/vendor - DATABASE_URL=postgres://postgres:password@db/ + - REDIS_URL=redis://redis:6379 ports: - 3000:3000 - 1080:1080 @@ -19,6 +20,26 @@ services: - bundle:/bundle depends_on: - db + - redis + + sidekiq: + build: + context: . + dockerfile: docker/Dockerfile + args: + RUBY_VERSION: '${RUBY_VERSION:-3.0}' + command: bundle exec sidekiq + volumes: + - ./:/alaveteli + - ../alaveteli-themes:/alaveteli-themes + - bundle:/bundle + environment: + - BUNDLE_PATH=/bundle/vendor + - DATABASE_URL=postgres://postgres:password@db/ + - REDIS_URL=redis://redis:6379 + depends_on: + - 'db' + - 'redis' db: build: @@ -31,6 +52,13 @@ services: volumes: - postgres:/var/lib/postgresql/data + redis: + image: library/redis + command: redis-server + volumes: + - redis:/data + volumes: bundle: {} postgres: {} + redis: {} diff --git a/lib/configuration.rb b/lib/configuration.rb index 554b680493..84b57c13fb 100644 --- a/lib/configuration.rb +++ b/lib/configuration.rb @@ -21,6 +21,7 @@ module AlaveteliConfiguration ADMIN_USERNAME: '', AUTHORITY_MUST_RESPOND: true, AVAILABLE_LOCALES: 'en', + BACKGROUND_JOBS: 'server', BLACKHOLE_PREFIX: 'do-not-reply-to-this-address', BLOCK_RATE_LIMITED_IPS: false, BLOCK_RESTRICTED_COUNTRY_IPS: false, @@ -135,6 +136,12 @@ module AlaveteliConfiguration # rubocop:enable Layout/LineLength end + def self.background_jobs + value = MySociety::Config.get('BACKGROUND_JOBS', DEFAULTS[:BACKGROUND_JOBS]) + return value if %w[inline server].include?(value) + raise 'Unknown value for BACKGROUND_JOBS. Please check config/general.yml' + end + def self.method_missing(name) key = name.to_s.upcase if DEFAULTS.has_key?(key.to_sym) diff --git a/lib/tasks/config_files.rake b/lib/tasks/config_files.rake index 3619bd0f66..5dfa0cbb99 100644 --- a/lib/tasks/config_files.rake +++ b/lib/tasks/config_files.rake @@ -64,6 +64,12 @@ namespace :config_files do condition: -> do AlaveteliConfiguration.production_mailer_retriever_method == 'pop' end + }, + { + path: '/etc/systemd/system', + name: 'sidekiq.service', + template: 'config/sidekiq.service.example', + condition: -> { AlaveteliConfiguration.background_jobs == 'server' } } ] end From eb4a5cca7e37a442072eb738a8682cbcc52e039e Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 15 Feb 2023 17:32:53 +0000 Subject: [PATCH 160/289] Add background job for expiring requests Job to expire requests when censor rules are created/updated and when requester/public body URL name has changed. --- app/jobs/info_request_expire_job.rb | 25 +++++++++++ app/models/censor_rule.rb | 10 ++--- app/models/public_body.rb | 2 +- app/models/user.rb | 2 +- spec/integration/admin_censor_rule_spec.rb | 26 +++++++++++ spec/jobs/info_request_expire_job_spec.rb | 51 ++++++++++++++++++++++ spec/models/censor_rule_spec.rb | 25 +++++------ spec/models/public_body_spec.rb | 17 +++----- spec/models/user_spec.rb | 14 ++---- spec/models/xapian_spec.rb | 7 +++ 10 files changed, 135 insertions(+), 44 deletions(-) create mode 100644 app/jobs/info_request_expire_job.rb create mode 100644 spec/jobs/info_request_expire_job_spec.rb diff --git a/app/jobs/info_request_expire_job.rb b/app/jobs/info_request_expire_job.rb new file mode 100644 index 0000000000..394d21bf1f --- /dev/null +++ b/app/jobs/info_request_expire_job.rb @@ -0,0 +1,25 @@ +## +# Job to expire InfoRequest objects. Can expire single requests, all requests or +# a collection of requests through an model associations. +# +# Examples: +# InfoRequestExpireJob.perform(InfoRequest.first) +# InfoRequestExpireJob.perform(InfoRequest, :all) +# InfoRequestExpireJob.perform(PublicBody.first, :info_requests) +# +class InfoRequestExpireJob < ApplicationJob + queue_as :default + + def perform(object, method = nil) + return object.expire if object.is_a?(InfoRequest) + + if object == InfoRequest && method == :all + enumerator = InfoRequest.all + else + association = object.association(method) + enumerator = association.reader if association.klass == InfoRequest + end + + enumerator.find_each { |request| perform(request) } + end +end diff --git a/app/models/censor_rule.rb b/app/models/censor_rule.rb index 71e319f30c..0e42ce3ea5 100644 --- a/app/models/censor_rule.rb +++ b/app/models/censor_rule.rb @@ -74,15 +74,13 @@ def is_global? def expire_requests if info_request - info_request.expire + InfoRequestExpireJob.perform_later(info_request) elsif user - user.expire_requests + InfoRequestExpireJob.perform_later(user, :info_requests) elsif public_body - public_body.expire_requests + InfoRequestExpireJob.perform_later(public_body, :info_requests) else # global rule - InfoRequest.find_in_batches do |group| - group.each(&:expire) - end + InfoRequestExpireJob.perform_later(InfoRequest, :all) end end diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 3154a0c8dc..ec91425ef1 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -705,7 +705,7 @@ def json_for_api end def expire_requests - info_requests.find_each(&:expire) + InfoRequestExpireJob.perform_later(self, :info_requests) end def self.where_clause_for_stats(minimum_requests, total_column) diff --git a/app/models/user.rb b/app/models/user.rb index f4cb040c71..60652b8ef8 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -327,7 +327,7 @@ def reindex_referencing_models end def expire_requests - info_requests.find_each(&:expire) + InfoRequestExpireJob.perform_later(self, :info_requests) end def expire_comments diff --git a/spec/integration/admin_censor_rule_spec.rb b/spec/integration/admin_censor_rule_spec.rb index 97c3eb11f9..e8a4e8f687 100644 --- a/spec/integration/admin_censor_rule_spec.rb +++ b/spec/integration/admin_censor_rule_spec.rb @@ -2,6 +2,8 @@ require 'integration/alaveteli_dsl' RSpec.describe 'Updating censor rules' do + include ActiveJob::TestHelper + let!(:admin) do confirm(:admin_user) login(:admin_user) @@ -57,6 +59,8 @@ click_button 'Create' end + perform_enqueued_jobs + visit show_request_path url_title: url_title expect(page).not_to have_content "I have a rubbish answer for you" expect(page).to have_content "I have [REDACTED] for you" @@ -81,6 +85,8 @@ click_button 'Save' end + perform_enqueued_jobs + visit show_request_path url_title: url_title expect(page).not_to have_content "I have a [REDACTED] answer for you" expect(page).to have_content "I have a rubbish [REDACTED] for you" @@ -102,6 +108,8 @@ click_link 'Destroy censor rule' end + perform_enqueued_jobs + visit show_request_path url_title: url_title expect(page).not_to have_content "I have a [REDACTED] answer for you" expect(page).to have_content "I have a rubbish answer for you" @@ -125,6 +133,8 @@ click_button 'Create' end + perform_enqueued_jobs + visit show_request_path url_title: url_title expect(page).not_to have_content "I have a rubbish answer for you" expect(page).to have_content "I have [REDACTED] for you" @@ -149,6 +159,8 @@ click_button 'Save' end + perform_enqueued_jobs + visit show_request_path url_title: url_title expect(page).not_to have_content "I have a [REDACTED] answer for you" expect(page).to have_content "I have a rubbish [REDACTED] for you" @@ -170,6 +182,8 @@ click_link 'Destroy censor rule' end + perform_enqueued_jobs + visit show_request_path url_title: url_title expect(page).not_to have_content "I have a [REDACTED] answer for you" expect(page).to have_content "I have a rubbish answer for you" @@ -194,6 +208,8 @@ click_button 'Create' end + perform_enqueued_jobs + visit show_request_path url_title: url_title expect(page).not_to have_content "I have a rubbish answer for you" expect(page).to have_content "I have [REDACTED] for you" @@ -219,6 +235,8 @@ click_button 'Save' end + perform_enqueued_jobs + visit show_request_path url_title: url_title expect(page).not_to have_content "I have a [REDACTED] answer for you" expect(page).to have_content "I have a rubbish [REDACTED] for you" @@ -241,6 +259,8 @@ click_link 'Destroy censor rule' end + perform_enqueued_jobs + visit show_request_path url_title: url_title expect(page).not_to have_content "I have a [REDACTED] answer for you" expect(page).to have_content "I have a rubbish answer for you" @@ -264,6 +284,8 @@ click_button 'Create' end + perform_enqueued_jobs + visit show_request_path url_title: url_title expect(page).not_to have_content "I have a rubbish answer for you" expect(page).to have_content "I have [REDACTED] for you" @@ -287,6 +309,8 @@ click_button 'Save' end + perform_enqueued_jobs + visit show_request_path url_title: url_title expect(page).not_to have_content "I have a [REDACTED] answer for you" expect(page).to have_content "I have a rubbish [REDACTED] for you" @@ -307,6 +331,8 @@ click_link 'Destroy censor rule' end + perform_enqueued_jobs + visit show_request_path url_title: url_title expect(page).not_to have_content "I have a [REDACTED] answer for you" expect(page).to have_content "I have a rubbish answer for you" diff --git a/spec/jobs/info_request_expire_job_spec.rb b/spec/jobs/info_request_expire_job_spec.rb new file mode 100644 index 0000000000..ab875aafa4 --- /dev/null +++ b/spec/jobs/info_request_expire_job_spec.rb @@ -0,0 +1,51 @@ +require 'spec_helper' + +RSpec.describe InfoRequestExpireJob, type: :job do + let(:args) { [] } + subject(:perform) { described_class.new.perform(*args) } + + let(:request_1) { FactoryBot.build(:info_request) } + let(:request_2) { FactoryBot.build(:info_request) } + + context 'when called with a request' do + let(:args) { [request_1] } + + it 'calls expire on the request' do + expect(request_1).to receive(:expire) + perform + end + end + + context 'when called with an object with a info_requests association' do + let(:user) do + FactoryBot.build(:user, info_requests: [request_1, request_2]) + end + + let(:args) { [user, :info_requests] } + + it 'calls expire on the associated requests' do + association = double(klass: InfoRequest) + allow(user).to receive(:association).with(:info_requests). + and_return(association) + allow(association).to receive_message_chain(:reader, :find_each). + and_yield(request_1).and_yield(request_2) + + expect(request_1).to receive(:expire) + expect(request_2).to receive(:expire) + perform + end + end + + context 'when called with the InfoRequest class' do + let(:args) { [InfoRequest, :all] } + + it 'calls expire on the all requests' do + allow(InfoRequest).to receive_message_chain(:all, :find_each). + and_yield(request_1).and_yield(request_2) + + expect(request_1).to receive(:expire) + expect(request_2).to receive(:expire) + perform + end + end +end diff --git a/spec/models/censor_rule_spec.rb b/spec/models/censor_rule_spec.rb index 0d165521fd..7ca697f288 100644 --- a/spec/models/censor_rule_spec.rb +++ b/spec/models/censor_rule_spec.rb @@ -160,37 +160,34 @@ describe '#expire_requests' do - it 'calls expire on the request if it is a request rule' do + it 'create expire job for the request if it is a request rule' do request = FactoryBot.create(:info_request) rule = FactoryBot.create(:info_request_censor_rule, info_request: request) - expect(request).to receive(:expire) + expect(InfoRequestExpireJob).to receive(:perform_later).with(request) rule.expire_requests end - it 'calls expire_requests on the user if it is a user rule' do + it 'create expire job for the user if it is a user rule' do user = FactoryBot.create(:user) rule = FactoryBot.create(:user_censor_rule, user: user) - expect(user).to receive(:expire_requests) + expect(InfoRequestExpireJob).to receive(:perform_later). + with(user, :info_requests) rule.expire_requests end - it 'calls expire_requests on the public body if it is a public body rule' do + it 'create expire job for the public body if it is a public body rule' do body = FactoryBot.create(:public_body) rule = FactoryBot.create(:public_body_censor_rule, public_body: body) - expect(body).to receive(:expire_requests) + expect(InfoRequestExpireJob).to receive(:perform_later). + with(body, :info_requests) rule.expire_requests end - it 'calls expire on all public requests if it is a global rule' do + it 'create expire job for all requests if it is a global rule' do rule = FactoryBot.build(:global_censor_rule) - requests = [double, double] - expect(InfoRequest).to receive(:find_in_batches).and_yield(requests) - - requests.each do |request| - expect(request).to receive(:expire) - end - + expect(InfoRequestExpireJob).to receive(:perform_later). + with(InfoRequest, :all) rule.expire_requests end diff --git a/spec/models/public_body_spec.rb b/spec/models/public_body_spec.rb index 45dab953a3..6c61f5aaa9 100644 --- a/spec/models/public_body_spec.rb +++ b/spec/models/public_body_spec.rb @@ -753,18 +753,10 @@ end describe '#expire_requests' do - it 'calls expire on all associated requests' do + it 'create expire job for the public body' do public_body = FactoryBot.build(:public_body) - - request_1 = double(:info_request) - request_2 = double(:info_request) - - allow(public_body).to receive_message_chain(:info_requests, :find_each). - and_yield(request_1).and_yield(request_2) - - expect(request_1).to receive(:expire) - expect(request_2).to receive(:expire) - + expect(InfoRequestExpireJob).to receive(:perform_later). + with(public_body, :info_requests) public_body.expire_requests end end @@ -1109,6 +1101,8 @@ end RSpec.describe PublicBody, " when saving" do + include ActiveJob::TestHelper + before do @public_body = PublicBody.new end @@ -1191,6 +1185,7 @@ def set_default_attributes(public_body) ActsAsXapian::ActsAsXapianJob.destroy_all body.update!(url_name: 'baz-bar-foo') + perform_enqueued_jobs expected_events = ActsAsXapian::ActsAsXapianJob. diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index a098be54a1..645b844163 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -791,18 +791,10 @@ def create_user(options = {}) end describe '#expire_requests' do - it 'calls expire on all associated requests' do + it 'create expire job for the user' do user = FactoryBot.build(:user) - - request_1 = double(:info_request) - request_2 = double(:info_request) - - allow(user).to receive_message_chain(:info_requests, :find_each). - and_yield(request_1).and_yield(request_2) - - expect(request_1).to receive(:expire) - expect(request_2).to receive(:expire) - + expect(InfoRequestExpireJob).to receive(:perform_later). + with(user, :info_requests) user.expire_requests end end diff --git a/spec/models/xapian_spec.rb b/spec/models/xapian_spec.rb index 2e39e45aea..60773b98b6 100644 --- a/spec/models/xapian_spec.rb +++ b/spec/models/xapian_spec.rb @@ -67,6 +67,8 @@ RSpec.describe PublicBody, " when indexing requests by body they are to" do + include ActiveJob::TestHelper + before(:each) do load_raw_emails_data update_xapian_index @@ -88,6 +90,7 @@ body.short_name = 'GQ' body.save! expect(body.url_name).to eq('gq') + perform_enqueued_jobs update_xapian_index # check we get results expected @@ -108,6 +111,7 @@ body.short_name = 'The Uncensored, Complete Name of the Quasi-Autonomous Public Body Also Known As Geraldine' body.save! expect(body.url_name.size).to be > 70 + perform_enqueued_jobs update_xapian_index # check we get results expected @@ -122,6 +126,8 @@ end RSpec.describe User, " when indexing requests by user they are from" do + include ActiveJob::TestHelper + before(:each) do load_raw_emails_data update_xapian_index @@ -243,6 +249,7 @@ u.name = 'Robert Smith' u.save! expect(u.url_name).to eq('robert_smith') + perform_enqueued_jobs update_xapian_index # check we get results expected From b64f99c7a244552d1f67b4e8bf642bdf58110bfe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Feb 2023 04:58:29 +0000 Subject: [PATCH 161/289] Build(deps-dev): Bump rubocop-rails from 2.17.4 to 2.18.0 Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.17.4 to 2.18.0. - [Release notes](https://github.com/rubocop/rubocop-rails/releases) - [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.17.4...v2.18.0) --- updated-dependencies: - dependency-name: rubocop-rails dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .ruby-style.yml | 3 +++ Gemfile.lock | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.ruby-style.yml b/.ruby-style.yml index fdb65ea814..700b99e505 100644 --- a/.ruby-style.yml +++ b/.ruby-style.yml @@ -1313,6 +1313,9 @@ Rails/RequestReferer: Rails/RequireDependency: Enabled: false +Rails/ResponseParsedBody: + Enabled: false + Rails/ReversibleMigration: Enabled: false diff --git a/Gemfile.lock b/Gemfile.lock index 787c6f4d4b..eae3bda673 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -170,7 +170,7 @@ GEM xpath (~> 3.2) charlock_holmes (0.7.7) coderay (1.1.3) - concurrent-ruby (1.2.0) + concurrent-ruby (1.2.2) crack (0.4.5) rexml crass (1.0.6) @@ -454,7 +454,7 @@ GEM rubocop-performance (1.16.0) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - rubocop-rails (2.17.4) + rubocop-rails (2.18.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) From 0510d63c17660fc6856bad5e36c5b058eba6c6c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 04:57:24 +0000 Subject: [PATCH 162/289] Build(deps-dev): Bump rubocop from 1.45.1 to 1.48.0 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.45.1 to 1.48.0. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.45.1...v1.48.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .ruby-style.yml | 9 +++++++++ Gemfile | 2 +- Gemfile.lock | 10 +++++----- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.ruby-style.yml b/.ruby-style.yml index fdb65ea814..9bcf093122 100644 --- a/.ruby-style.yml +++ b/.ruby-style.yml @@ -807,6 +807,9 @@ Metrics/BlockNesting: Metrics/ClassLength: Enabled: false +Metrics/CollectionLiteralLength: + Enabled: false + Metrics/CyclomaticComplexity: Enabled: false @@ -1556,6 +1559,9 @@ Style/DefWithParentheses: Style/Dir: Enabled: false +Style/DirEmpty: + Enabled: false + Style/DisableCopsWithinSourceCodeDirective: Enabled: false @@ -1635,6 +1641,9 @@ Style/ExponentialNotation: Style/FetchEnvVar: Enabled: false +Style/FileEmpty: + Enabled: false + Style/FileRead: Enabled: false diff --git a/Gemfile b/Gemfile index 969146a9d3..fcf7838a75 100644 --- a/Gemfile +++ b/Gemfile @@ -188,7 +188,7 @@ group :development do gem 'launchy', '< 2.6.0' gem 'listen', '>= 3.0.5', '< 3.8.1' gem 'web-console', '>= 3.3.0' - gem 'rubocop', '~> 1.45.1', require: false + gem 'rubocop', '~> 1.48.0', require: false gem 'rubocop-performance', require: false gem 'rubocop-rails', require: false end diff --git a/Gemfile.lock b/Gemfile.lock index 787c6f4d4b..4e7e80287c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -439,17 +439,17 @@ GEM rspec-mocks (~> 3.11) rspec-support (~> 3.11) rspec-support (3.11.1) - rubocop (1.45.1) + rubocop (1.48.0) json (~> 2.3) parallel (~> 1.10) parser (>= 3.2.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.24.1, < 2.0) + rubocop-ast (>= 1.26.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.26.0) + rubocop-ast (1.27.0) parser (>= 3.2.1.0) rubocop-performance (1.16.0) rubocop (>= 1.7.0, < 2.0) @@ -459,7 +459,7 @@ GEM rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) ruby-ole (1.2.12.1) - ruby-progressbar (1.11.0) + ruby-progressbar (1.13.0) rubyzip (2.3.2) sass (3.4.25) sass-rails (5.0.8) @@ -603,7 +603,7 @@ DEPENDENCIES routing-filter (~> 0.7.0) rspec-activemodel-mocks (~> 1.1.0) rspec-rails (~> 6.0.0) - rubocop (~> 1.45.1) + rubocop (~> 1.48.0) rubocop-performance rubocop-rails ruby-msg (~> 1.5.0)! From 11de6d21f623a8513d5343948b0e7bab0bc29109 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Tue, 7 Mar 2023 18:16:02 +0000 Subject: [PATCH 163/289] Add daily limit to user message creation Follows the same pattern as comments. --- app/models/user.rb | 9 ++------- app/views/users/messages/rate_limited.html.erb | 15 +++++++++++++-- doc/CHANGES.md | 1 + spec/models/user_spec.rb | 9 ++++++++- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 5fd869c4ce..77d930107e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -49,7 +49,8 @@ class User < ApplicationRecord CONTENT_LIMIT = { info_requests: AlaveteliConfiguration.max_requests_per_user_per_day, - comments: AlaveteliConfiguration.max_requests_per_user_per_day + comments: AlaveteliConfiguration.max_requests_per_user_per_day, + user_messages: AlaveteliConfiguration.max_requests_per_user_per_day }.freeze rolify before_add: :setup_pro_account, @@ -469,8 +470,6 @@ def can_contact_other_users? end def exceeded_limit?(content) - return exceeded_user_message_limit? if content == :user_messages - return false if no_limit? return false if can_make_batch_requests? return false if content_limit(content).blank? @@ -682,8 +681,4 @@ def update_pro_account def content_limit(content) CONTENT_LIMIT[content] end - - def exceeded_user_message_limit? - false - end end diff --git a/app/views/users/messages/rate_limited.html.erb b/app/views/users/messages/rate_limited.html.erb index 70271df2d0..15771d8aeb 100644 --- a/app/views/users/messages/rate_limited.html.erb +++ b/app/views/users/messages/rate_limited.html.erb @@ -1,7 +1,18 @@ -<% @title = _('Cannot send messages') %> +<% @title = _('Too many messages') %>

<%= @title %>

- <%= _('User messages cannot be sent right now. Please try again later.') %> + <%= _('You have hit the rate limit on user messages. Users are ordinarily ' \ + 'limited to {{message_limit}} messages per day.', + message_limit: User::CONTENT_LIMIT[:user_messages]) %> +

+ +

+ <%= _("There is a limit on the number of messages you can send in a day " \ + "because we don’t want users to be bombarded with " \ + "large numbers of inappropriate messages. If you feel you have a " \ + "good reason to ask for the limit to be lifted in your case, " \ + "please get in touch.", + help_contact_path: help_contact_path) %>

diff --git a/doc/CHANGES.md b/doc/CHANGES.md index bb38ad1d5e..d01ebc4b6e 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -2,6 +2,7 @@ ## Highlighted Features +* Add daily limit to user message creation (Gareth Rees) * Add rate limiting to comment creation (Gareth Rees) * Fix bug preventing ex-pro users follow up to still-private requests (Gareth Rees, Graeme Porteous) diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 7e08f5fb35..179b343872 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -2039,10 +2039,17 @@ def create_user(options = {}) context 'limiting user messages' do let(:content) { :user_messages } + before { FactoryBot.create(:user_message, user: user) } - it 'always returns false' do + it 'returns false if the user has not submitted more than the limit' do + allow(user).to receive(:content_limit).with(content).and_return(2) expect(subject).to eq(false) end + + it 'returns true if the user has submitted more than the limit' do + allow(user).to receive(:content_limit).with(content).and_return(0) + expect(subject).to eq(true) + end end end end From c77640ae043526c343ee6a251b057a97bbdc45f1 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Fri, 10 Mar 2023 09:44:50 +0000 Subject: [PATCH 164/289] Fix Project request extractable scope Requests were being returned in this scope when they has already been extracted. This was due to the query matching the extract submission for different project. Moving the project conditional from the `WHERE NOT` into the `LEFT JOIN` limits the submission objects we're inspecting to the current project. Fixes #7631 --- app/models/project/info_request_extension.rb | 16 +++++++++----- spec/models/project_spec.rb | 23 ++++++++++++++++++-- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/app/models/project/info_request_extension.rb b/app/models/project/info_request_extension.rb index d749800067..750801ec1c 100644 --- a/app/models/project/info_request_extension.rb +++ b/app/models/project/info_request_extension.rb @@ -15,13 +15,17 @@ def classified end def extractable - scope = where(described_state: EXTRACTABLE_STATES). - left_joins(:extraction_project_submissions). + where(described_state: EXTRACTABLE_STATES). + joins( + <<~SQL.squish + LEFT OUTER JOIN "project_submissions" ON + "project_submissions"."resource_type" = 'Dataset::ValueSet' AND + "project_submissions"."info_request_id" = "info_requests"."id" AND + "project_submissions"."project_id" = #{project.id} + SQL + ). + where(project_submissions: { id: nil }). classified - - scope.where(project_submissions: { id: nil }).or( - scope.where.not(project_submissions: { project: project }) - ) end def extracted diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index d8b8180514..0d59ac252a 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -35,14 +35,14 @@ FactoryBot.create( :project, requests: [ unclassified_request, classified_request, extracted_request, - other_project_extracted_request + other_project_extracted_request, both_projects_extracted_request ] ) end let(:other_project) do FactoryBot.create( :project, requests: [ - other_project_extracted_request + other_project_extracted_request, both_projects_extracted_request ] ) end @@ -69,6 +69,13 @@ described_state: 'successful' ) end + let(:both_projects_extracted_request) do + FactoryBot.build( + :info_request, + awaiting_description: false, + described_state: 'successful' + ) + end before do FactoryBot.create( @@ -83,6 +90,14 @@ :project_submission, :for_extraction, project: other_project, info_request: other_project_extracted_request ) + FactoryBot.create( + :project_submission, :for_extraction, + project: project, info_request: both_projects_extracted_request + ) + FactoryBot.create( + :project_submission, :for_extraction, + project: other_project, info_request: both_projects_extracted_request + ) end end @@ -364,6 +379,10 @@ it 'includes requests extracted in other projects' do is_expected.to include other_project_extracted_request end + + it 'excludes requests extracted in both projects' do + is_expected.not_to include both_projects_extracted_request + end end describe '#info_requests.extracted' do From 9f26e490bcd75a45d3ce3d9373faee52eddb4779 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 04:59:16 +0000 Subject: [PATCH 165/289] Build(deps-dev): Bump net-ssh from 7.0.1 to 7.1.0 Bumps [net-ssh](https://github.com/net-ssh/net-ssh) from 7.0.1 to 7.1.0. - [Release notes](https://github.com/net-ssh/net-ssh/releases) - [Changelog](https://github.com/net-ssh/net-ssh/blob/master/CHANGES.txt) - [Commits](https://github.com/net-ssh/net-ssh/compare/v7.0.1...v7.1.0) --- updated-dependencies: - dependency-name: net-ssh dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 657a313781..bb5c05bf50 100644 --- a/Gemfile +++ b/Gemfile @@ -185,7 +185,7 @@ end group :development do gem 'annotate', '< 3.2.1' gem 'capistrano', '~> 2.15.0', '< 3.0.0' - gem 'net-ssh', '~> 7.0.1' + gem 'net-ssh', '~> 7.1.0' gem 'net-ssh-gateway', '>= 1.1.0', '< 3.0.0' gem 'launchy', '< 2.6.0' gem 'listen', '>= 3.0.5', '< 3.8.1' diff --git a/Gemfile.lock b/Gemfile.lock index 6dd3671a86..641cbcd83b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -328,7 +328,7 @@ GEM net-ssh (>= 2.6.5) net-smtp (0.3.3) net-protocol - net-ssh (7.0.1) + net-ssh (7.1.0) net-ssh-gateway (2.0.0) net-ssh (>= 4.0.0) nio4r (2.5.8) @@ -592,7 +592,7 @@ DEPENDENCIES mini_magick (~> 4.12.0) mini_racer (~> 0.6.3) money (~> 6.16.0) - net-ssh (~> 7.0.1) + net-ssh (~> 7.1.0) net-ssh-gateway (>= 1.1.0, < 3.0.0) nokogiri (~> 1.14.1) oink (~> 0.10.1) From 3e261c233e07d55a0162a6f5d6dbc4cb03562d44 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 9 Mar 2023 14:48:34 +0000 Subject: [PATCH 166/289] Refactor blog specs Place specs under an single top-level describe block and within that a 'GET blog' describe and context blocks. Increasing the indentation where needed. Also rewrites `context` and `it` titles to match current style, EG: `context "when ..."` and remove `it "should"` These specs will soon be rewritten with further refactoring. --- spec/controllers/general_controller_spec.rb | 110 +++++++++++--------- 1 file changed, 63 insertions(+), 47 deletions(-) diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb index 3ced23cfd9..bf0fd7b66f 100644 --- a/spec/controllers/general_controller_spec.rb +++ b/spec/controllers/general_controller_spec.rb @@ -21,69 +21,85 @@ expect(response.media_type).to eq('application/json') end end -end -RSpec.describe GeneralController, "when trying to show the blog" do - it "should fail silently if the blog is returning an error" do - allow(AlaveteliConfiguration).to receive(:blog_feed). - and_return("http://blog.example.com") - stub_request(:get, %r|blog.example.com|).to_return(status: 500) - get :blog - expect(response.status).to eq(200) - expect(assigns[:blog_items].count).to eq(0) - end -end + describe 'GET blog' do + context 'when feed is configured' do + before do + allow(AlaveteliConfiguration).to receive(:blog_feed). + and_return('http://blog.example.com') + allow(controller).to receive(:quietly_try_to_open).and_return('') + end -RSpec.describe GeneralController, 'when getting the blog feed' do + it 'adds lang query param correctly' do + get :blog + expect(assigns[:feed_url]).to eq('http://blog.example.com?lang=en') + end + end - before do - allow(AlaveteliConfiguration).to receive(:blog_feed).and_return("http://blog.example.com") - # Don't call out to external url during tests - allow(controller).to receive(:quietly_try_to_open).and_return('') - end + context 'when feed is configured with existing query param' do + before do + allow(AlaveteliConfiguration).to receive(:blog_feed). + and_return('http://blog.example.com?alt=rss') + allow(controller).to receive(:quietly_try_to_open).and_return('') + end - it 'should add a lang param correctly to a url with no querystring' do - get :blog - expect(assigns[:feed_url]).to eq("http://blog.example.com?lang=en") - end + it 'adds lang query param correctly' do + get :blog + expect(assigns[:feed_url]).to eq( + 'http://blog.example.com?alt=rss&lang=en' + ) + end + end - it 'should add a lang param correctly to a url with an existing querystring' do - allow(AlaveteliConfiguration).to receive(:blog_feed).and_return("http://blog.example.com?alt=rss") - get :blog - expect(assigns[:feed_url]).to eq("http://blog.example.com?alt=rss&lang=en") - end + context 'when blog has entries' do + render_views - it 'should parse an item from an example feed' do - allow(controller).to receive(:quietly_try_to_open).and_return(load_file_fixture("blog_feed.atom")) - get :blog - expect(assigns[:blog_items].count).to eq(1) - end + before do + allow(AlaveteliConfiguration).to receive(:blog_feed). + and_return('http://blog.example.com') + allow(controller).to receive(:quietly_try_to_open). + and_return(load_file_fixture('blog_feed.atom')) + end - context 'if no feed is configured' do + it 'parses item from an example feed' do + get :blog + expect(assigns[:blog_items].count).to eq(1) + end - before do - allow(AlaveteliConfiguration).to receive(:blog_feed).and_return('') + it 'escapes any javascript from the entries' do + get :blog + expect(response.body).not_to include( + '' + ) + end end - it 'should raise an ActiveRecord::RecordNotFound error' do - expect { + context 'when feed returns an error' do + before do + allow(AlaveteliConfiguration).to receive(:blog_feed). + and_return('http://blog.example.com') + stub_request(:get, %r|blog.example.com|).to_return(status: 500) + end + + it 'should fail silently if the blog is returning an error' do get :blog - }.to raise_error(ActiveRecord::RecordNotFound) + expect(response.status).to eq(200) + expect(assigns[:blog_items].count).to eq(0) + end end - end - context 'when the blog has entries' do - - render_views + context 'when feed is not configured' do + before do + allow(AlaveteliConfiguration).to receive(:blog_feed).and_return('') + end - it 'should escape any javascript from the entries' do - allow(controller).to receive(:quietly_try_to_open).and_return(load_file_fixture("blog_feed.atom")) - get :blog - expect(response.body).not_to include('') + it 'should raise an ActiveRecord::RecordNotFound error' do + expect { + get :blog + }.to raise_error(ActiveRecord::RecordNotFound) + end end - end - end RSpec.describe GeneralController, "when showing the frontpage" do From 0de57394cdab7ec3b225ad943e94efe4373c88b3 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 9 Mar 2023 15:00:13 +0000 Subject: [PATCH 167/289] Add Blog.enabled? This helper method can be used instead of checking the configuration through the codebase. --- app/controllers/general_controller.rb | 4 +--- app/models/blog.rb | 13 ++++++++++ .../alaveteli_pro/general/_nav_items.html.erb | 2 +- app/views/general/_nav_items.html.erb | 2 +- spec/models/blog_spec.rb | 24 +++++++++++++++++++ 5 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 app/models/blog.rb create mode 100644 spec/models/blog_spec.rb diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index 1b8e4af052..d55e695fc4 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -29,9 +29,7 @@ def frontpage # Display blog entries def blog - if AlaveteliConfiguration.blog_feed.empty? - raise ActiveRecord::RecordNotFound, "Page not enabled" - end + raise(ActiveRecord::RecordNotFound, "Page not enabled") unless Blog.enabled? medium_cache diff --git a/app/models/blog.rb b/app/models/blog.rb new file mode 100644 index 0000000000..4f6a660037 --- /dev/null +++ b/app/models/blog.rb @@ -0,0 +1,13 @@ +## +# Class responsible for loading external blog content +# +# Requires `BLOG_FEED` to be configured in config/general.yml +# +# Currently WordPress is the only "officially supported" external blog feed, +# but other feeds may work if they use the same data format. +# +class Blog + def self.enabled? + AlaveteliConfiguration.blog_feed.present? + end +end diff --git a/app/views/alaveteli_pro/general/_nav_items.html.erb b/app/views/alaveteli_pro/general/_nav_items.html.erb index 7147aca890..b2f5662b4c 100644 --- a/app/views/alaveteli_pro/general/_nav_items.html.erb +++ b/app/views/alaveteli_pro/general/_nav_items.html.erb @@ -39,7 +39,7 @@ AnalyticsEvent::Action::PRO_NAV_VIEW_AUTHORITIES) %> -<% unless AlaveteliConfiguration::blog_feed.empty? %> +<% if Blog.enabled? %>
  • <%= link_to _("Read blog"), blog_path, diff --git a/app/views/general/_nav_items.html.erb b/app/views/general/_nav_items.html.erb index 4597d8ca2c..b9580fcff3 100644 --- a/app/views/general/_nav_items.html.erb +++ b/app/views/general/_nav_items.html.erb @@ -10,7 +10,7 @@ <%= link_to _("View authorities"), list_public_bodies_default_path %>
  • -<% unless AlaveteliConfiguration::blog_feed.empty? %> +<% if Blog.enabled? %>
  • <%= link_to _("Read blog"), blog_path %>
  • <% end %> diff --git a/spec/models/blog_spec.rb b/spec/models/blog_spec.rb new file mode 100644 index 0000000000..2d19109e4c --- /dev/null +++ b/spec/models/blog_spec.rb @@ -0,0 +1,24 @@ +require 'spec_helper' + +RSpec.describe Blog do + describe '.enabled?' do + subject { described_class.enabled? } + + context 'when feed is configured' do + before do + allow(AlaveteliConfiguration).to receive(:blog_feed). + and_return('http://blog.example.com') + end + + it { is_expected.to eq(true) } + end + + context 'when feed is not configured' do + before do + allow(AlaveteliConfiguration).to receive(:blog_feed).and_return('') + end + + it { is_expected.to eq(false) } + end + end +end From 1a7b9c7ad01a56df5098da95cb6e93faf2e984b5 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 9 Mar 2023 15:00:42 +0000 Subject: [PATCH 168/289] Refactor Blog content loading Move out of the controller into the Blog class. Minial changes made to keep the implementation and current specs working. Further refactoring of the specs will come next. --- app/controllers/general_controller.rb | 27 ++--------------- app/models/blog.rb | 32 +++++++++++++++++++++ app/views/general/blog.html.erb | 2 +- spec/controllers/general_controller_spec.rb | 20 ++++++++----- spec/views/general/blog.html.erb_spec.rb | 2 +- 5 files changed, 49 insertions(+), 34 deletions(-) diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index d55e695fc4..ea19c533de 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -32,33 +32,10 @@ def blog raise(ActiveRecord::RecordNotFound, "Page not enabled") unless Blog.enabled? medium_cache - - get_blog_content - end - - def get_blog_content - @feed_autodetect = [] - @feed_url = AlaveteliConfiguration.blog_feed - separator = @feed_url.include?('?') ? '&' : '?' - @feed_url = "#{ @feed_url }#{ separator }lang=" \ - "#{ AlaveteliLocalization.html_lang }" - @blog_items = [] - unless @feed_url.empty? - timeout = if AlaveteliConfiguration.blog_timeout.blank? - 60 - else - AlaveteliConfiguration.blog_timeout - end - content = quietly_try_to_open(@feed_url, timeout) - unless content.empty? - @data = XmlSimple.xml_in(content) - @channel = @data['channel'][0] - @blog_items = @channel.fetch('item') { [] } - @feed_autodetect = [{url: @feed_url, title: "#{site_name} blog"}] - end - end + @blog = Blog.new @twitter_user = AlaveteliConfiguration.twitter_username @facebook_user = AlaveteliConfiguration.facebook_username + @feed_autodetect = @blog.feeds end # Just does a redirect from ?query= search to /query diff --git a/app/models/blog.rb b/app/models/blog.rb index 4f6a660037..66869228f9 100644 --- a/app/models/blog.rb +++ b/app/models/blog.rb @@ -7,7 +7,39 @@ # but other feeds may work if they use the same data format. # class Blog + include ConfigHelper + def self.enabled? AlaveteliConfiguration.blog_feed.present? end + + def items + return [] if content.empty? + + data = XmlSimple.xml_in(content) + channel = data['channel'][0] + channel.fetch('item') { [] } + end + + def feeds + [{ url: feed_url, title: "#{site_name} blog" }] + end + + def feed_url + uri = URI(AlaveteliConfiguration.blog_feed) + uri.query = URI.decode_www_form(uri.query || '').to_h.merge( + lang: AlaveteliLocalization.html_lang.to_s + ).to_param + uri.to_s + end + + private + + def content + @content ||= quietly_try_to_open(feed_url, timeout) + end + + def timeout + AlaveteliConfiguration.blog_timeout.presence || 60 + end end diff --git a/app/views/general/blog.html.erb b/app/views/general/blog.html.erb index 1e80cebc50..8c24cbdbea 100644 --- a/app/views/general/blog.html.erb +++ b/app/views/general/blog.html.erb @@ -4,7 +4,7 @@

    <%=@title %>

    - <% @blog_items.each do |item| %> + <% @blog.items.each do |item| %>
    <% date = Time.zone.parse(item['pubDate'][0]) %> diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb index bf0fd7b66f..3c549dcdb9 100644 --- a/spec/controllers/general_controller_spec.rb +++ b/spec/controllers/general_controller_spec.rb @@ -23,16 +23,22 @@ end describe 'GET blog' do + let(:blog) { Blog.new } + + before do + allow(Blog).to receive(:new).and_return(blog) + end + context 'when feed is configured' do before do allow(AlaveteliConfiguration).to receive(:blog_feed). and_return('http://blog.example.com') - allow(controller).to receive(:quietly_try_to_open).and_return('') + allow(blog).to receive(:quietly_try_to_open).and_return('') end it 'adds lang query param correctly' do get :blog - expect(assigns[:feed_url]).to eq('http://blog.example.com?lang=en') + expect(assigns[:blog].feed_url).to eq('http://blog.example.com?lang=en') end end @@ -40,12 +46,12 @@ before do allow(AlaveteliConfiguration).to receive(:blog_feed). and_return('http://blog.example.com?alt=rss') - allow(controller).to receive(:quietly_try_to_open).and_return('') + allow(blog).to receive(:quietly_try_to_open).and_return('') end it 'adds lang query param correctly' do get :blog - expect(assigns[:feed_url]).to eq( + expect(assigns[:blog].feed_url).to eq( 'http://blog.example.com?alt=rss&lang=en' ) end @@ -57,13 +63,13 @@ before do allow(AlaveteliConfiguration).to receive(:blog_feed). and_return('http://blog.example.com') - allow(controller).to receive(:quietly_try_to_open). + allow(blog).to receive(:quietly_try_to_open). and_return(load_file_fixture('blog_feed.atom')) end it 'parses item from an example feed' do get :blog - expect(assigns[:blog_items].count).to eq(1) + expect(assigns[:blog].items.count).to eq(1) end it 'escapes any javascript from the entries' do @@ -84,7 +90,7 @@ it 'should fail silently if the blog is returning an error' do get :blog expect(response.status).to eq(200) - expect(assigns[:blog_items].count).to eq(0) + expect(assigns[:blog].items.count).to eq(0) end end diff --git a/spec/views/general/blog.html.erb_spec.rb b/spec/views/general/blog.html.erb_spec.rb index ccc583ac2c..71dc0ee8ae 100644 --- a/spec/views/general/blog.html.erb_spec.rb +++ b/spec/views/general/blog.html.erb_spec.rb @@ -4,7 +4,7 @@ subject { rendered } before do - assign :blog_items, blog_items + assign :blog, double(items: blog_items) assign :twitter_user, double.as_null_object assign :facebook_user, double.as_null_object render From 8ddf3d99f74b5a8a100a9a413d564fbe20ae6df8 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 9 Mar 2023 16:41:10 +0000 Subject: [PATCH 169/289] Add specs for Blog class Bring over the old specs from the controller and update for current styling of model specs. Also updates the controller specs so we're not looking into the blog. Although we do still stub the content of the blog feed to ensure content is properly sanitized in the view. --- spec/controllers/general_controller_spec.rb | 51 ++------------ spec/models/blog_spec.rb | 76 +++++++++++++++++++++ 2 files changed, 83 insertions(+), 44 deletions(-) diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb index 3c549dcdb9..6a459a4eca 100644 --- a/spec/controllers/general_controller_spec.rb +++ b/spec/controllers/general_controller_spec.rb @@ -30,34 +30,6 @@ end context 'when feed is configured' do - before do - allow(AlaveteliConfiguration).to receive(:blog_feed). - and_return('http://blog.example.com') - allow(blog).to receive(:quietly_try_to_open).and_return('') - end - - it 'adds lang query param correctly' do - get :blog - expect(assigns[:blog].feed_url).to eq('http://blog.example.com?lang=en') - end - end - - context 'when feed is configured with existing query param' do - before do - allow(AlaveteliConfiguration).to receive(:blog_feed). - and_return('http://blog.example.com?alt=rss') - allow(blog).to receive(:quietly_try_to_open).and_return('') - end - - it 'adds lang query param correctly' do - get :blog - expect(assigns[:blog].feed_url).to eq( - 'http://blog.example.com?alt=rss&lang=en' - ) - end - end - - context 'when blog has entries' do render_views before do @@ -67,9 +39,14 @@ and_return(load_file_fixture('blog_feed.atom')) end - it 'parses item from an example feed' do + it 'assigns blog' do + get :blog + expect(assigns[:blog]).to eq(blog) + end + + it 'assigns feed_autodetect' do get :blog - expect(assigns[:blog].items.count).to eq(1) + expect(assigns[:feed_autodetect]).to eq(blog.feeds) end it 'escapes any javascript from the entries' do @@ -80,20 +57,6 @@ end end - context 'when feed returns an error' do - before do - allow(AlaveteliConfiguration).to receive(:blog_feed). - and_return('http://blog.example.com') - stub_request(:get, %r|blog.example.com|).to_return(status: 500) - end - - it 'should fail silently if the blog is returning an error' do - get :blog - expect(response.status).to eq(200) - expect(assigns[:blog].items.count).to eq(0) - end - end - context 'when feed is not configured' do before do allow(AlaveteliConfiguration).to receive(:blog_feed).and_return('') diff --git a/spec/models/blog_spec.rb b/spec/models/blog_spec.rb index 2d19109e4c..176157ab0e 100644 --- a/spec/models/blog_spec.rb +++ b/spec/models/blog_spec.rb @@ -21,4 +21,80 @@ it { is_expected.to eq(false) } end end + + describe '#items' do + let(:blog) { described_class.new } + subject(:items) { blog.items } + + context 'when feed is fetched successfully' do + before do + allow(AlaveteliConfiguration).to receive(:blog_feed). + and_return('http://blog.example.com') + + allow(blog).to receive(:quietly_try_to_open). + and_return(load_file_fixture('blog_feed.atom')) + end + + it 'parses an item from an example feed' do + expect(items.count).to eq(1) + end + end + + context 'when feed returns an error' do + before do + allow(AlaveteliConfiguration).to receive(:blog_feed). + and_return('http://blog.example.com') + stub_request(:get, %r|blog.example.com|).to_return(status: 500) + end + + it 'should fail silently if the blog is returning an error' do + expect(items.count).to eq(0) + end + end + end + + describe '#feeds' do + let(:blog) { described_class.new } + subject(:feeds) { blog.feeds } + + before do + allow(AlaveteliConfiguration).to receive(:blog_feed). + and_return('http://blog.example.com') + allow(AlaveteliConfiguration).to receive(:site_name). + and_return('My site') + end + + it 'returns an array with a url (with lang query param) and title hash' do + is_expected.to include( + { url: 'http://blog.example.com?lang=en', title: 'My site blog' } + ) + end + end + + describe '#feed_url' do + let(:blog) { described_class.new } + subject(:feed_url) { blog.feed_url } + + context 'when feed is configured' do + before do + allow(AlaveteliConfiguration).to receive(:blog_feed). + and_return('http://blog.example.com') + end + + it 'add lang query param correctly' do + is_expected.to eq('http://blog.example.com?lang=en') + end + end + + context 'when feed is configured with existing query param' do + before do + allow(AlaveteliConfiguration).to receive(:blog_feed). + and_return('http://blog.example.com?alt=rss') + end + + it 'adds lang query param correctly' do + is_expected.to eq('http://blog.example.com?alt=rss&lang=en') + end + end + end end From 0048a249fe11488a4b60339ac5b8acb58cf3c2bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Mar 2023 11:28:18 +0000 Subject: [PATCH 170/289] Build(deps): Bump rack from 2.2.6.2 to 2.2.6.4 Bumps [rack](https://github.com/rack/rack) from 2.2.6.2 to 2.2.6.4. - [Release notes](https://github.com/rack/rack/releases) - [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md) - [Commits](https://github.com/rack/rack/compare/v2.2.6.2...v2.2.6.4) --- updated-dependencies: - dependency-name: rack dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6dd3671a86..772e541c50 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -360,7 +360,7 @@ GEM method_source (~> 1.0) public_suffix (5.0.1) racc (1.6.2) - rack (2.2.6.2) + rack (2.2.6.4) rack-test (2.0.2) rack (>= 1.3) rack-utf8_sanitizer (1.8.0) From 0f9cf138d0c26054f55ea6ab871ca954c8338f8c Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Wed, 15 Mar 2023 13:27:03 +0000 Subject: [PATCH 171/289] Feat: add leaderboards to project page Two separate leaderboards, one for the whole project to date, and one for the last 28 days --- .../projects/projects_controller.rb | 1 + app/models/project/leaderboard.rb | 58 +++++++++++++++++++ app/views/projects/projects/show.html.erb | 33 +++++++++++ 3 files changed, 92 insertions(+) create mode 100644 app/models/project/leaderboard.rb diff --git a/app/controllers/projects/projects_controller.rb b/app/controllers/projects/projects_controller.rb index 883e094016..2e6cb5e89b 100644 --- a/app/controllers/projects/projects_controller.rb +++ b/app/controllers/projects/projects_controller.rb @@ -4,6 +4,7 @@ class Projects::ProjectsController < Projects::BaseController def show authorize! :read, @project + @leaderboard = Project::Leaderboard.new(@project) end private diff --git a/app/models/project/leaderboard.rb b/app/models/project/leaderboard.rb new file mode 100644 index 0000000000..afa5a2a5f4 --- /dev/null +++ b/app/models/project/leaderboard.rb @@ -0,0 +1,58 @@ +## +# Export a project's leaderboard of classifications and data extractions to CSV. +# +class Project::Leaderboard + include DownloadHelper + + attr_reader :project + protected :project + + def initialize(project) + @project = project + end + + def all_time + @leaderboard_all_time ||= data.first(5) + end + + def twenty_eight_days + @leaderboard_28_days ||= data( + project.submissions.where(created_at: 28.days.ago..) + ).first(5) + end + + def name + generate_download_filename( + resource: 'project-leaderboard', + id: project.id, + title: project.title, + ext: 'csv' + ) + end + + def to_csv + CSV.generate do |csv| + header = data.first + csv << header.keys.map(&:to_s) if header + data.each do |row| + row[:user] = row[:user].name + csv << row.values + end + end + end + + private + + def data(scope = project.submissions) + leaderboard = project.members.map do |user| + user_scope = scope.where(user_id: user.id) + { + user: user, + classifications: user_scope.classification.size, + extractions: user_scope.extraction.size, + total_contributions: user_scope.size + } + end + leaderboard.sort_by { |row| row[:total_contributions] }.reverse + end +end diff --git a/app/views/projects/projects/show.html.erb b/app/views/projects/projects/show.html.erb index 7b12a9d3a7..cee883a335 100644 --- a/app/views/projects/projects/show.html.erb +++ b/app/views/projects/projects/show.html.erb @@ -124,6 +124,39 @@ class: 'button-tertiary' %>
    <% end %> + +
    +

    <%= _("Top recent contributors") %>

    + + <% @leaderboard.twenty_eight_days.each_with_index do |row, index| %> + + + + + + <% end %> +
    <%= index += 1 %>. <%= user_link(row[:user]) %> + <%= n_('{{number_of_contributions}} contribution', + '{{number_of_contributions}} contributions', + row[:total_contributions], + number_of_contributions: row[:total_contributions]) %> +
    +

    <%= _("All time best contributors") %>

    + + <% @leaderboard.all_time.each_with_index do |row, index| %> + + + + + + <% end %> +
    <%= index += 1 %>. <%= user_link(row[:user]) %> + <%= n_('{{number_of_contributions}} contribution', + '{{number_of_contributions}} contributions', + row[:total_contributions], + number_of_contributions: row[:total_contributions]) %> +
    +
    From 25d496a5edea541adb32b25b676a99d9a9167761 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Wed, 15 Mar 2023 13:22:31 +0000 Subject: [PATCH 172/289] Feat: add download button for project leaderboards This is only visible if the user has the permissions needed to download the project data --- .../projects/leaderboards_controller.rb | 16 ++++++++++++++++ app/views/projects/projects/show.html.erb | 8 ++++++++ config/routes.rb | 1 + 3 files changed, 25 insertions(+) create mode 100644 app/controllers/projects/leaderboards_controller.rb diff --git a/app/controllers/projects/leaderboards_controller.rb b/app/controllers/projects/leaderboards_controller.rb new file mode 100644 index 0000000000..eb42822689 --- /dev/null +++ b/app/controllers/projects/leaderboards_controller.rb @@ -0,0 +1,16 @@ +# View and manage Project Leaderboards +class Projects::LeaderboardsController < Projects::BaseController + skip_before_action :html_response + + def show + authorize! :download, @project + + respond_to do |format| + format.csv do + leaderboard = Project::Leaderboard.new(@project) + send_data leaderboard.to_csv, filename: leaderboard.name, + type: 'text/csv' + end + end + end +end diff --git a/app/views/projects/projects/show.html.erb b/app/views/projects/projects/show.html.erb index cee883a335..4fd810c628 100644 --- a/app/views/projects/projects/show.html.erb +++ b/app/views/projects/projects/show.html.erb @@ -157,6 +157,14 @@ <% end %> + + <% if can? :download, @project %> +
    + <%= link_to _('Download Leaderboard Data'), + project_leaderboard_path(@project, format: :csv), + class: 'button-tertiary' %> +
    + <% end %> diff --git a/config/routes.rb b/config/routes.rb index c7c4ef7db5..f336546f7b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -209,6 +209,7 @@ def matches?(request) resources :contributors, only: [:destroy] resource :download, only: [:show], format: true + resource :leaderboard, only: [:show], format: true end end end From d1ec12340a70dbdc6a1513b82558d1c9c1b7a262 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Wed, 15 Mar 2023 13:12:55 +0000 Subject: [PATCH 173/289] Test: add tests for new project leaderboard classes --- .../projects/leaderboards_controller_spec.rb | 73 +++++++++++ spec/models/project/leaderboard_spec.rb | 114 ++++++++++++++++++ 2 files changed, 187 insertions(+) create mode 100644 spec/controllers/projects/leaderboards_controller_spec.rb create mode 100644 spec/models/project/leaderboard_spec.rb diff --git a/spec/controllers/projects/leaderboards_controller_spec.rb b/spec/controllers/projects/leaderboards_controller_spec.rb new file mode 100644 index 0000000000..1ea5398d2a --- /dev/null +++ b/spec/controllers/projects/leaderboards_controller_spec.rb @@ -0,0 +1,73 @@ +require 'spec_helper' + +spec_meta = { + type: :controller, + feature: :projects +} + +RSpec.describe Projects::LeaderboardsController, spec_meta do + describe 'GET #show' do + def show(format: 'csv') + get :show, params: { project_id: '1', format: format } + end + + let(:project) { FactoryBot.create(:project) } + let(:ability) { Object.new.extend(CanCan::Ability) } + + before do + allow(Project).to receive(:find).with('1').and_return(project) + allow(controller).to receive(:current_ability).and_return(ability) + end + + context 'when not authorised to download project' do + before { ability.cannot :download, project } + + it 'raises access denied expection' do + expect { show }.to raise_error(CanCan::AccessDenied) + end + end + + shared_context 'when authorised to download project' do + before { ability.can :download, project } + end + + context 'when HTML format' do + include_context 'when authorised to download project' + + it 'raises unknown format error' do + expect { show(format: 'html') }.to raise_error( + ActionController::UnknownFormat + ) + end + end + + context 'when CSV format' do + include_context 'when authorised to download project' + + before do + allow(Project::Leaderboard).to receive(:new).with(project).and_return( + double(to_csv: 'CSV_DATA', name: 'NAME') + ) + show + end + + it 'is a successful request' do + expect(response).to be_successful + end + + it 'returns CSV data' do + expect(response.body).to eq 'CSV_DATA' + end + + it 'returns content disposition' do + expect(response.header['Content-Disposition']).to( + eq 'attachment; filename="NAME"; filename*=UTF-8\'\'NAME' + ) + end + + it 'returns CSV content type' do + expect(response.header['Content-Type']).to eq 'text/csv' + end + end + end +end diff --git a/spec/models/project/leaderboard_spec.rb b/spec/models/project/leaderboard_spec.rb new file mode 100644 index 0000000000..9153eb23c3 --- /dev/null +++ b/spec/models/project/leaderboard_spec.rb @@ -0,0 +1,114 @@ +require 'spec_helper' + +RSpec.describe Project::Leaderboard do + let(:project) { instance_double('Project') } + let(:instance) { described_class.new(project) } + + shared_context 'project submissions' do + let(:project) { FactoryBot.create(:project, contributors_count: 2) } + let(:user_1) { project.members[1] } # member 0 is the project owner + let(:user_2) { project.members[2] } + + before do + FactoryBot.create( + :project_submission, :for_classification, project: project, user: user_1 + ) + FactoryBot.create( + :project_submission, :for_extraction, project: project, user: user_1 + ) + + travel_to 28.days.ago + FactoryBot.create( + :project_submission, :for_extraction, project: project, user: user_2 + ) + travel_back + end + end + + describe '#all_time' do + include_context 'project submissions' + + subject(:data) { instance.all_time } + + it 'returns the data that we would expect' do + is_expected.to include( + classifications: 1, extractions: 1, total_contributions: 2, user: user_1 + ) + is_expected.to include( + classifications: 0, extractions: 1, total_contributions: 1, user: user_2 + ) + end + + it 'orders the data by descending total contributions' do + expect(data[0][:total_contributions]).to eq(2) + expect(data[1][:total_contributions]).to eq(1) + expect(data[2][:total_contributions]).to eq(0) + end + + context 'when project has more than 5 members' do + let(:project) { FactoryBot.create(:project, contributors_count: 10) } + + it 'returns a maximum of 5 rows' do + expect(data.count).to eq(5) + end + end + end + + describe '#twenty_eight_days' do + include_context 'project submissions' + + subject(:data) { instance.twenty_eight_days } + + it 'returns the data that we would expect from the last 28 days' do + is_expected.to include( + classifications: 1, extractions: 1, total_contributions: 2, user: user_1 + ) + is_expected.to include( + classifications: 0, extractions: 0, total_contributions: 0, user: user_2 + ) + end + + it 'orders the data by descending total contributions' do + expect(data[0][:total_contributions]).to eq(2) + expect(data[1][:total_contributions]).to eq(0) + end + + context 'when project has more than 5 members' do + let(:project) { FactoryBot.create(:project, contributors_count: 10) } + + it 'returns a maximum of 5 rows' do + expect(data.count).to eq(5) + end + end + end + + describe '#name' do + let(:project) { instance_double('Project', id: 1, title: 'Test Project') } + subject { instance.name } + + it 'returns a useful filename' do + travel_to Time.utc(2019, 11, 18, 10, 30) + is_expected.to( + eq 'project-leaderboard-1-test_project-2019-11-18-103000.csv' + ) + travel_back + end + end + + describe '#to_csv' do + subject { instance.to_csv } + + let(:user) { instance_double('User', name: 'Bob') } + + it 'returns CSV string from leaderboard' do + allow(instance).to receive(:data).and_return( + [{ foo: 'Foo', bar: 'Bar', user: user }] + ) + + is_expected.to eq <<~CSV + foo,bar,user + Foo,Bar,Bob + CSV + end + end +end From bc317932d522e200a216d272a643f18126e6a5e9 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Tue, 17 Jan 2023 09:30:03 +0000 Subject: [PATCH 174/289] Fix code style AdminUserController#show * Line breaks --- app/controllers/admin_user_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin_user_controller.rb b/app/controllers/admin_user_controller.rb index b3fec5b511..53c4410a70 100644 --- a/app/controllers/admin_user_controller.rb +++ b/app/controllers/admin_user_controller.rb @@ -49,12 +49,13 @@ def index def show @info_requests = @admin_user.info_requests @comments = @admin_user.comments + if cannot? :admin, AlaveteliPro::Embargo @info_requests = @info_requests.not_embargoed @comments = @admin_user.comments.not_embargoed end - @info_requests = @info_requests.paginate(page: params[:page], - per_page: 100) + + @info_requests = @info_requests.paginate(page: params[:page], per_page: 100) end def edit From baec3be6322880d9e2111f1271582597f3a6503b Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Tue, 17 Jan 2023 09:56:25 +0000 Subject: [PATCH 175/289] Add InfoRequestBatch.not_embargoed Allow us to filter out private batches for users without the `pro_admin` role. --- app/models/info_request_batch.rb | 2 ++ spec/models/info_request_batch_spec.rb | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/app/models/info_request_batch.rb b/app/models/info_request_batch.rb index d51bd9c9dd..9e2451d9a8 100644 --- a/app/models/info_request_batch.rb +++ b/app/models/info_request_batch.rb @@ -46,6 +46,8 @@ class InfoRequestBatch < ApplicationRecord strip_attributes only: %i[embargo_duration] + scope :not_embargoed, -> { where(embargo_duration: nil) } + def self.send_batches where(sent_at: nil).find_each do |info_request_batch| AlaveteliLocalization.with_locale(info_request_batch.user.locale) do diff --git a/spec/models/info_request_batch_spec.rb b/spec/models/info_request_batch_spec.rb index 40bf919b73..d09bd2c444 100644 --- a/spec/models/info_request_batch_spec.rb +++ b/spec/models/info_request_batch_spec.rb @@ -64,6 +64,16 @@ end end + describe '.not_embargoed' do + subject { described_class.not_embargoed } + + let(:not_embargoed) { FactoryBot.create(:info_request_batch) } + let(:embargoed) { FactoryBot.create(:info_request_batch, :embargoed) } + + it { is_expected.to include(not_embargoed) } + it { is_expected.not_to include(embargoed) } + end + context '.with_body' do let(:batch) do FactoryBot.create(:info_request_batch, body: "foo\n\nbar") From 269b2b094f3ad567c45bcb2dd7fbc817e8845c98 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Tue, 17 Jan 2023 09:59:58 +0000 Subject: [PATCH 176/289] Add list of batch requests to admin user page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make it easier to see distinct batches when viewing a user record. Currently you have to open up requests to get to the batch record, and there's always the possibility that the user has created to batches with identical titles – maybe after missing some authorities from the initial list. --- app/controllers/admin_user_controller.rb | 2 ++ .../_info_request_batch.html.erb | 35 +++++++++++++++++++ .../admin/info_request_batches/_list.html.erb | 9 +++++ app/views/admin_user/show.html.erb | 7 ++++ doc/CHANGES.md | 1 + spec/views/admin_user/show.html.erb_spec.rb | 1 + 6 files changed, 55 insertions(+) create mode 100644 app/views/admin/info_request_batches/_info_request_batch.html.erb create mode 100644 app/views/admin/info_request_batches/_list.html.erb diff --git a/app/controllers/admin_user_controller.rb b/app/controllers/admin_user_controller.rb index 53c4410a70..4c43fbd704 100644 --- a/app/controllers/admin_user_controller.rb +++ b/app/controllers/admin_user_controller.rb @@ -48,10 +48,12 @@ def index def show @info_requests = @admin_user.info_requests + @info_request_batches = @admin_user.info_request_batches @comments = @admin_user.comments if cannot? :admin, AlaveteliPro::Embargo @info_requests = @info_requests.not_embargoed + @info_request_batches = @info_request_batches.not_embargoed @comments = @admin_user.comments.not_embargoed end diff --git a/app/views/admin/info_request_batches/_info_request_batch.html.erb b/app/views/admin/info_request_batches/_info_request_batch.html.erb new file mode 100644 index 0000000000..4ecb0ed6a3 --- /dev/null +++ b/app/views/admin/info_request_batches/_info_request_batch.html.erb @@ -0,0 +1,35 @@ +
    +
    + + + <%= chevron_right %> + + + <%= both_links(info_request_batch) %> + + <% if info_request_batch.embargoed? %> + <%= content_tag(:span, 'embargoed', class: 'label') %> + <% end %> + + + +
    + +
    + <% info_request_batch.for_admin_column do |name, value| %> +
    + + <%= name.humanize %> + + + <%= admin_value(value) %> + +
    + <% end %> +
    +
    diff --git a/app/views/admin/info_request_batches/_list.html.erb b/app/views/admin/info_request_batches/_list.html.erb new file mode 100644 index 0000000000..7278ec87a5 --- /dev/null +++ b/app/views/admin/info_request_batches/_list.html.erb @@ -0,0 +1,9 @@ +
    + <% if info_request_batches.any? %> + <%= render partial: 'admin/info_request_batches/info_request_batch', + collection: info_request_batches %> + <% else %> +

    None yet.

    + <% end %> +
    + diff --git a/app/views/admin_user/show.html.erb b/app/views/admin_user/show.html.erb index db1e340e99..ad4bb67afa 100644 --- a/app/views/admin_user/show.html.erb +++ b/app/views/admin_user/show.html.erb @@ -133,6 +133,13 @@
    +

    Batch Requests

    + +<%= render partial: 'admin/info_request_batches/list', + locals: { info_request_batches: @info_request_batches } %> + +
    +

    Annotations

    <%= render partial: 'admin_request/some_annotations' , diff --git a/doc/CHANGES.md b/doc/CHANGES.md index d01ebc4b6e..f1b1be1089 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -2,6 +2,7 @@ ## Highlighted Features +* Add list of batch requests to admin user page (Gareth Rees) * Add daily limit to user message creation (Gareth Rees) * Add rate limiting to comment creation (Gareth Rees) * Fix bug preventing ex-pro users follow up to still-private requests (Gareth diff --git a/spec/views/admin_user/show.html.erb_spec.rb b/spec/views/admin_user/show.html.erb_spec.rb index 9d052d836d..ce7aaa6515 100644 --- a/spec/views/admin_user/show.html.erb_spec.rb +++ b/spec/views/admin_user/show.html.erb_spec.rb @@ -6,6 +6,7 @@ info_requests = [] allow(info_requests).to receive(:total_pages).and_return(0) assign :info_requests, info_requests + assign :info_request_batches, [] assign :admin_user, user_being_viewed assign :comments, [] end From 34d1117ded0183fd2cac0c310f333e99acdbbb6e Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 24 Feb 2023 13:25:12 +0000 Subject: [PATCH 177/289] User#close should disable email alerts Closing your account should stop all communications from the app. This is likely not completely true in practice [1] as some messages may ignore this flag, but this sets the intent. [1] https://github.com/mysociety/alaveteli/issues/4603 --- app/models/user.rb | 2 +- spec/factories/users.rb | 1 + spec/models/user_spec.rb | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 190b86f538..d01ff80509 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -403,7 +403,7 @@ def banned? end def close - update(closed_at: Time.zone.now) + update(closed_at: Time.zone.now, receive_email_alerts: false) end def closed? diff --git a/spec/factories/users.rb b/spec/factories/users.rb index e1cc18af33..ea36869d03 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -99,6 +99,7 @@ trait :closed do closed_at { Time.zone.now } + receive_email_alerts { false } end end end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index c8525473a2..968a4b1c3b 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1181,6 +1181,10 @@ def create_user(options = {}) it 'sets closed_at' do expect(user.closed_at).to be_present end + + it 'disables email alerts' do + expect(user.receive_email_alerts).to eq(false) + end end describe '#closed?' do From 0a211dfaf42fc092bb817602a0b4fcc986fb3b1e Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 24 Feb 2023 13:50:35 +0000 Subject: [PATCH 178/289] Add User#close! Add a version of `#close` that raises on failure, and define `#close` in terms of `#close!` as per convention. --- app/models/user.rb | 8 +++++- spec/models/user_spec.rb | 58 +++++++++++++++++++++++++++++++++++----- 2 files changed, 58 insertions(+), 8 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index d01ff80509..2aee6395e3 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -403,7 +403,13 @@ def banned? end def close - update(closed_at: Time.zone.now, receive_email_alerts: false) + close! + rescue ActiveRecord::RecordInvalid + false + end + + def close! + update!(closed_at: Time.zone.now, receive_email_alerts: false) end def closed? diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 968a4b1c3b..bace32a4a9 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1172,18 +1172,62 @@ def create_user(options = {}) let(:user) { FactoryBot.build(:user) } - before { subject } + context 'the update is successful' do + before do + expect(user).to receive(:close!).and_call_original + subject + end - it 'closes the account' do - expect(user).to be_closed + it { is_expected.to eq(true) } + + it 'closes the account' do + expect(user).to be_closed + end + end + + context 'the update is unsuccessful' do + before do + expect(user).to receive(:close!).and_raise(ActiveRecord::RecordInvalid) + subject + end + + it { is_expected.to eq(false) } + + it 'does not close the account' do + expect(user).not_to be_closed + end end + end + + describe '#close!' do + subject { user.close! } + + let(:user) { FactoryBot.build(:user) } + + context 'the update is successful' do + before { subject } + + it 'closes the account' do + expect(user).to be_closed + end - it 'sets closed_at' do - expect(user.closed_at).to be_present + it 'sets closed_at' do + expect(user.closed_at).to be_present + end + + it 'disables email alerts' do + expect(user.receive_email_alerts).to eq(false) + end end - it 'disables email alerts' do - expect(user.receive_email_alerts).to eq(false) + context 'the update is unsuccessful' do + before do + expect(user).to receive(:update!).and_raise(ActiveRecord::RecordInvalid) + end + + it 'raises an ActiveRecord::RecordInvalid error' do + expect { subject }.to raise_error(ActiveRecord::RecordInvalid) + end end end From 90306d23fda2033bf1ff5d851e6286d85a9b4e20 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 24 Feb 2023 14:07:53 +0000 Subject: [PATCH 179/289] Add User#erase and User#erase! Method to only erase PII account data to enable forthcoming composition of various close / anonymise / erase options. --- app/models/user.rb | 25 +++++++++ spec/models/user_spec.rb | 106 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index 2aee6395e3..430515c14a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -416,6 +416,31 @@ def closed? closed_at.present? end + def erase + erase! + rescue ActiveRecord::RecordInvalid + false + end + + def erase! + raise ActiveRecord::RecordInvalid unless closed? + + sha = Digest::SHA1.hexdigest(rand.to_s) + + transaction do + sign_ins.destroy_all + profile_photo&.destroy! + + update!( + name: _('[Name Removed]'), + email: "#{sha}@invalid", + url_name: sha, + about_me: '', + password: MySociety::Util.generate_token + ) + end + end + def close_and_anonymise sha = Digest::SHA1.hexdigest(rand.to_s) diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index bace32a4a9..b0a2cf21a1 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1246,6 +1246,112 @@ def create_user(options = {}) end + describe '#erase' do + subject { user.erase } + + let(:user) { FactoryBot.build(:user) } + + context 'the update is successful' do + before do + user.close! + expect(user).to receive(:erase!).and_call_original + subject + end + + it { is_expected.to eq(true) } + + it 'erases the account' do + expect(user.name).to match(/Name Removed/) + end + end + + context 'the update is unsuccessful' do + before do + expect(user).to receive(:erase!).and_raise(ActiveRecord::RecordInvalid) + subject + end + + it { is_expected.to eq(false) } + + it 'does not erase the account' do + expect(user.name).not_to match(/Name Removed/) + end + end + end + + describe '#erase!' do + subject { user.erase! } + + context 'the user account is not closed' do + let(:user) { FactoryBot.build(:user, about_me: 'Hi') } + + it 'raises an ActiveRecord::RecordInvalid' do + expect { subject }.to raise_error(ActiveRecord::RecordInvalid) + end + end + + context 'the update is successful' do + let(:user) { FactoryBot.build(:user, :closed, about_me: 'Hi') } + + before do + allow(AlaveteliConfiguration). + to receive(:user_sign_in_activity_retention_days).and_return(1) + FactoryBot.create(:user_sign_in, user: user) + FactoryBot.create(:profile_photo, user: user) + + allow(Digest::SHA1).to receive(:hexdigest).and_return('a1b2c3d4') + allow(MySociety::Util). + to receive(:generate_token).and_return('r@nd0m-pa$$w0rd') + + subject + + user.reload + end + + it 'erases the name' do + # #name currently appends "(Account suspended)". Here we specifically + # only care about the data we hold. + expect(user.read_attribute(:name)).to eq('[Name Removed]') + end + + it 'erases the url_name' do + expect(user.url_name).to eq('a1b2c3d4') + end + + it 'erases the email' do + expect(user.email).to eq('a1b2c3d4@invalid') + end + + it 'erases the password' do + expect(user.password).to eq('r@nd0m-pa$$w0rd') + end + + it 'erases the about_me' do + expect(user.about_me).to be_empty + end + + it 'destroys any sign_ins' do + expect(user.sign_ins).to be_empty + end + + it 'destroys any profile photo' do + expect(user.profile_photo).to be_nil + end + end + + context 'the update is unsuccessful' do + let(:user) { FactoryBot.build(:user, :closed, about_me: 'Hi') } + + before do + expect(user).to receive(:update!).and_raise(ActiveRecord::RecordInvalid) + end + + it 'raises an ActiveRecord::RecordInvalid error' do + expect { subject }.to raise_error(ActiveRecord::RecordInvalid) + end + end + end + describe '.closed' do it 'should not return users with closed_at timestamp' do From 0717a947b5d786c46e8d6aac220759422721bab2 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Mon, 27 Feb 2023 18:26:20 +0000 Subject: [PATCH 180/289] Add User#anonymise! Simple method to handle anonymisation via CensorRule if the user has any content to anonymise. --- app/models/user.rb | 9 +++++++++ spec/models/user_spec.rb | 26 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index 430515c14a..5231e257af 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -441,6 +441,15 @@ def erase! end end + def anonymise! + return if info_requests.none? + + censor_rules.create!(text: name, + replacement: _('[Name Removed]'), + last_edit_editor: 'User#anonymise!', + last_edit_comment: 'User#anonymise!') + end + def close_and_anonymise sha = Digest::SHA1.hexdigest(rand.to_s) diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index b0a2cf21a1..9184df3e2e 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1352,6 +1352,32 @@ def create_user(options = {}) end end + describe '#anonymise!' do + subject { user.anonymise! } + + let(:user) { FactoryBot.build(:user, name: 'Bob Smith') } + + context 'when the user has info requests' do + before { FactoryBot.create(:info_request, user: user) } + + it 'creates a censor rule for user name if the user has info requests' do + subject + censor_rule = user.censor_rules.last + expect(censor_rule.text).to eq(user.name) + expect(censor_rule.replacement).to eq ('[Name Removed]') + expect(censor_rule.last_edit_editor).to eq('User#anonymise!') + expect(censor_rule.last_edit_comment).to eq('User#anonymise!') + end + end + + context 'when the user has no info requests' do + it 'does not create a censor rule' do + subject + expect(user.censor_rules).to be_empty + end + end + end + describe '.closed' do it 'should not return users with closed_at timestamp' do From 8c25e2bb347a9c453698437df8b07c787a937ccd Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Mon, 27 Feb 2023 18:33:05 +0000 Subject: [PATCH 181/289] Refactor User#close_and_anonymise Compose from new task-specific methods to make clearer. Had to tweak the censor rule creation since closing currently appends "(Account suspended)", which then gets added to the censor rule `text`. We only want to redact the raw attribute content. Drop `User#redact_name!` since we now have `anonymise!` to do the same thing. Fixes https://github.com/mysociety/alaveteli/issues/5600 as the use of `#erase!` for this method now clears the profile photo. --- app/models/user.rb | 27 ++++----------------------- app/views/admin_user/edit.html.erb | 1 + spec/models/user_spec.rb | 5 +++-- 3 files changed, 8 insertions(+), 25 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 5231e257af..cfd8ac5620 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -444,29 +444,17 @@ def erase! def anonymise! return if info_requests.none? - censor_rules.create!(text: name, + censor_rules.create!(text: read_attribute(:name), replacement: _('[Name Removed]'), last_edit_editor: 'User#anonymise!', last_edit_comment: 'User#anonymise!') end def close_and_anonymise - sha = Digest::SHA1.hexdigest(rand.to_s) - transaction do - redact_name! if info_requests.any? - - sign_ins.destroy_all - - update( - name: _('[Name Removed]'), - email: "#{sha}@invalid", - url_name: sha, - about_me: '', - password: MySociety::Util.generate_token, - receive_email_alerts: false, - closed_at: Time.zone.now - ) + close! + anonymise! + erase! end end @@ -671,13 +659,6 @@ def flipper_id private - def redact_name! - censor_rules.create!(text: name, - replacement: _('[Name Removed]'), - last_edit_editor: 'User#close_and_anonymise', - last_edit_comment: 'User#close_and_anonymise') - end - def set_defaults return unless new_record? diff --git a/app/views/admin_user/edit.html.erb b/app/views/admin_user/edit.html.erb index 4a82ef3239..9405ed185c 100644 --- a/app/views/admin_user/edit.html.erb +++ b/app/views/admin_user/edit.html.erb @@ -43,6 +43,7 @@
  • Disables email alerts
  • Removes user from search index
  • Hides requests on the profile page
  • +
  • Clears sign ins and profile photo
  • Does not delete or set prominence of the user's requests
  • Makes a naive attempt to redact name from requests1
  • diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 9184df3e2e..7770904553 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1105,7 +1105,8 @@ def create_user(options = {}) before do allow(Digest::SHA1).to receive(:hexdigest).and_return('1234') - allow(MySociety::Util).to receive(:generate_token).and_return('ABCD') + allow(MySociety::Util). + to receive(:generate_token).and_return('r@nd0m-pa$$w0rd') allow(AlaveteliConfiguration). to receive(:user_sign_in_activity_retention_days).and_return(1) FactoryBot.create(:user_sign_in, user: user) @@ -1152,7 +1153,7 @@ def create_user(options = {}) it 'should anonymise user password' do expect { user.close_and_anonymise }. - to change(user, :password).to('ABCD') + to change(user, :password).to('r@nd0m-pa$$w0rd') end it 'should set user to not receive email alerts' do From d01888152d87389a8da669322e7d6fb585f0b80c Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 17 Mar 2023 16:23:19 +0000 Subject: [PATCH 182/289] Fix missed lints Fixes Lint/ParenthesesAsGroupedExpression --- spec/models/user_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 4d1dfe67b8..4dc429bbf6 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1111,7 +1111,7 @@ def create_user(options = {}) user.close_and_anonymise censor_rule = user.censor_rules.last expect(censor_rule.text).to eq(user_name) - expect(censor_rule.replacement).to eq ('[Name Removed]') + expect(censor_rule.replacement).to eq('[Name Removed]') end it 'does not create a censor rule for user name if the user does not have info requests' do @@ -1358,7 +1358,7 @@ def create_user(options = {}) subject censor_rule = user.censor_rules.last expect(censor_rule.text).to eq(user.name) - expect(censor_rule.replacement).to eq ('[Name Removed]') + expect(censor_rule.replacement).to eq('[Name Removed]') expect(censor_rule.last_edit_editor).to eq('User#anonymise!') expect(censor_rule.last_edit_comment).to eq('User#anonymise!') end From 5b57b2adee7c20b68be46e478fdd2a4926dbbbcd Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Tue, 3 Jan 2023 09:53:50 +0000 Subject: [PATCH 183/289] Add ability to paginate through batch requests Add "Next" and "Prev" pagination links to the sidebar of info requests that belong to a batch request. This allows users to navigate through requests in the batch without having to click "in and out" via the batch page. To minimise implementation complexity the pagination doesn't have a beginning and end. We just cycle back around to the first request in the batch when we hit the last one; same for paginating in reverse. If we didn't do this we'd have to have conditionals for disabling the particular navigation option when we hit an end. --- app/models/info_request.rb | 1 + app/models/info_request/batch_pagination.rb | 26 ++++++++++ .../info_requests/_batch.html.erb | 3 ++ .../info_request_batch/_pagination.html.erb | 2 + app/views/request/_batch.html.erb | 3 ++ doc/CHANGES.md | 1 + spec/models/info_request/batch_pagination.rb | 47 +++++++++++++++++++ spec/models/info_request_spec.rb | 2 + 8 files changed, 85 insertions(+) create mode 100644 app/models/info_request/batch_pagination.rb create mode 100644 app/views/info_request_batch/_pagination.html.erb create mode 100644 spec/models/info_request/batch_pagination.rb diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 584281fd94..f2f6d3e73b 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -46,6 +46,7 @@ class InfoRequest < ApplicationRecord include Rails.application.routes.url_helpers include AlaveteliPro::RequestSummaries include AlaveteliFeatures::Helpers + include InfoRequest::BatchPagination include InfoRequest::PublicToken include InfoRequest::Sluggable include InfoRequest::TitleValidation diff --git a/app/models/info_request/batch_pagination.rb b/app/models/info_request/batch_pagination.rb new file mode 100644 index 0000000000..91ec018ea7 --- /dev/null +++ b/app/models/info_request/batch_pagination.rb @@ -0,0 +1,26 @@ +# Methods to handle pagination within an associated InfoRequestBatch +module InfoRequest::BatchPagination + def next_in_batch + return nil unless info_request_batch + batch_sibling_requests_ordered_by_id[index_in_batch + 1] || first_in_batch + end + + def prev_in_batch + return nil unless info_request_batch + batch_sibling_requests_ordered_by_id[index_in_batch - 1] + end + + private + + def first_in_batch + batch_sibling_requests_ordered_by_id.first + end + + def index_in_batch + batch_sibling_requests_ordered_by_id.pluck(:id).index(id) + end + + def batch_sibling_requests_ordered_by_id + info_request_batch.info_requests.reorder(id: :asc) + end +end diff --git a/app/views/alaveteli_pro/info_requests/_batch.html.erb b/app/views/alaveteli_pro/info_requests/_batch.html.erb index 851f7841a4..593f09b17e 100644 --- a/app/views/alaveteli_pro/info_requests/_batch.html.erb +++ b/app/views/alaveteli_pro/info_requests/_batch.html.erb @@ -10,5 +10,8 @@ :count => @info_request.info_request_batch.public_bodies.count) %>

    + + <%= render partial: 'info_request_batch/pagination', + locals: { info_request: @info_request } %> <% end %> diff --git a/app/views/info_request_batch/_pagination.html.erb b/app/views/info_request_batch/_pagination.html.erb new file mode 100644 index 0000000000..8667331515 --- /dev/null +++ b/app/views/info_request_batch/_pagination.html.erb @@ -0,0 +1,2 @@ +<%= link_to _('Prev'), request_path(info_request.prev_in_batch) %> | +<%= link_to _('Next'), request_path(info_request.next_in_batch) %> diff --git a/app/views/request/_batch.html.erb b/app/views/request/_batch.html.erb index efb5df451a..a2a6c77c75 100644 --- a/app/views/request/_batch.html.erb +++ b/app/views/request/_batch.html.erb @@ -8,5 +8,8 @@ url: info_request_batch_path(info_request.info_request_batch), count: info_request.info_request_batch.public_bodies.size) %>

    + + <%= render partial: 'info_request_batch/pagination', + locals: { info_request: info_request } %> <% end %> diff --git a/doc/CHANGES.md b/doc/CHANGES.md index f1b1be1089..7ece89c3b3 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -2,6 +2,7 @@ ## Highlighted Features +* Add ability to paginate through requests in a batch (Gareth Rees) * Add list of batch requests to admin user page (Gareth Rees) * Add daily limit to user message creation (Gareth Rees) * Add rate limiting to comment creation (Gareth Rees) diff --git a/spec/models/info_request/batch_pagination.rb b/spec/models/info_request/batch_pagination.rb new file mode 100644 index 0000000000..08b7249441 --- /dev/null +++ b/spec/models/info_request/batch_pagination.rb @@ -0,0 +1,47 @@ +RSpec.shared_examples 'info_request/batch_pagination' do + describe '#next_in_batch' do + subject { info_request.next_in_batch } + + let(:batch) do + FactoryBot.create(:info_request_batch, :sent, public_body_count: 2) + end + + context 'the request is not part of a batch' do + let(:info_request) { FactoryBot.build(:info_request) } + it { is_expected.to be_nil } + end + + context 'the request is part of a batch' do + let(:info_request) { batch.info_requests.first } + it { is_expected.to eq(batch.info_requests.last) } + end + + context 'the request is the last of a batch' do + let(:info_request) { batch.info_requests.last } + it { is_expected.to eq(batch.info_requests.first) } + end + end + + describe '#prev_in_batch' do + subject { info_request.prev_in_batch } + + let(:batch) do + FactoryBot.create(:info_request_batch, :sent, public_body_count: 2) + end + + context 'the request is not part of a batch' do + let(:info_request) { FactoryBot.build(:info_request) } + it { is_expected.to be_nil } + end + + context 'the request is part of a batch' do + let(:info_request) { batch.info_requests.last } + it { is_expected.to eq(batch.info_requests.first) } + end + + context 'the request is the first of a batch' do + let(:info_request) { batch.info_requests.first } + it { is_expected.to eq(batch.info_requests.last) } + end + end +end diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb index f3fc72cbe9..f9c19010d6 100644 --- a/spec/models/info_request_spec.rb +++ b/spec/models/info_request_spec.rb @@ -41,12 +41,14 @@ require 'models/concerns/notable' require 'models/concerns/notable_and_taggable' require 'models/concerns/taggable' +require 'models/info_request/batch_pagination' RSpec.describe InfoRequest do it_behaves_like 'concerns/info_request/title_validation', :info_request it_behaves_like 'concerns/notable', :info_request it_behaves_like 'concerns/notable_and_taggable', :info_request it_behaves_like 'concerns/taggable', :info_request + it_behaves_like 'info_request/batch_pagination' describe '.internal' do subject { described_class.internal } From dc0e6e173869c6130dc57fdefc63288c47401221 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 3 Mar 2023 12:18:08 +0000 Subject: [PATCH 184/289] Style: Lint/UnusedMethodArgument (Rubocop) --- .../draft_info_request_batches_controller.rb | 2 +- app/controllers/user_controller.rb | 2 +- app/helpers/application_helper.rb | 2 +- app/helpers/info_request_helper.rb | 34 +++++------ app/mailers/application_mailer.rb | 2 +- app/mailers/request_mailer.rb | 2 +- app/models/info_request.rb | 6 +- .../info_request/response_gatekeeper/base.rb | 2 +- .../info_request/response_rejection/base.rb | 2 +- .../info_request/response_rejection/bounce.rb | 2 +- app/models/info_request/state/calculator.rb | 4 +- app/models/info_request/state/transitions.rb | 58 +++++++++---------- .../template/batch_request.rb | 2 +- app/models/public_body.rb | 2 +- .../lib/alaveteli_features/constraints.rb | 2 +- lib/alaveteli_mail_poller.rb | 2 +- lib/attachment_to_html/adapter.rb | 2 +- lib/routing_filters.rb | 4 +- lib/stripe_mock_patch.rb | 4 +- spec/support/mock_pop3.rb | 8 +-- 20 files changed, 72 insertions(+), 72 deletions(-) diff --git a/app/controllers/alaveteli_pro/draft_info_request_batches_controller.rb b/app/controllers/alaveteli_pro/draft_info_request_batches_controller.rb index b8588f8843..1550c296dc 100644 --- a/app/controllers/alaveteli_pro/draft_info_request_batches_controller.rb +++ b/app/controllers/alaveteli_pro/draft_info_request_batches_controller.rb @@ -40,7 +40,7 @@ def update_bodies private - def respond_or_redirect(draft) + def respond_or_redirect(_draft) @query = params[:authority_query] @page = params[:page] if request.xhr? diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 44fabfbcd0..1ea409b5c2 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -408,7 +408,7 @@ def block_restricted_country_ips? AlaveteliConfiguration.enable_anti_spam end - def blocked_ip?(country, user) + def blocked_ip?(country, _user) AlaveteliConfiguration.restricted_countries.include?(country) && country != AlaveteliConfiguration.iso_country_code end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index fd80f7ae54..e94e40f96a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -126,7 +126,7 @@ def is_admin? !session[:using_admin].nil? || (!@user.nil? && @user.is_admin?) end - def cache_if_caching_fragments(*args, &block) + def cache_if_caching_fragments(*args) if AlaveteliConfiguration.cache_fragments cache(*args) { yield } else diff --git a/app/helpers/info_request_helper.rb b/app/helpers/info_request_helper.rb index 066b8bcec9..d2879cd827 100644 --- a/app/helpers/info_request_helper.rb +++ b/app/helpers/info_request_helper.rb @@ -53,7 +53,7 @@ def status_text_awaiting_description(info_request, opts = {}) end end - def status_text_waiting_response(info_request, opts = {}) + def status_text_waiting_response(info_request, _opts = {}) str = _('Currently waiting for a response from ' \ '{{public_body_link}}, they should respond promptly and', public_body_link: public_body_link(info_request.public_body)) @@ -70,7 +70,7 @@ def status_text_waiting_response(info_request, opts = {}) str += ")." end - def status_text_waiting_response_overdue(info_request, opts = {}) + def status_text_waiting_response_overdue(info_request, _opts = {}) str = _('Response to this request is delayed.') str += ' ' if info_request.public_body.not_subject_to_law? @@ -93,7 +93,7 @@ def status_text_waiting_response_overdue(info_request, opts = {}) str += ")" end - def status_text_waiting_response_very_overdue(info_request, opts = {}) + def status_text_waiting_response_very_overdue(info_request, _opts = {}) str = _('Response to this request is long overdue.') str += ' ' if info_request.public_body.not_subject_to_law? @@ -123,22 +123,22 @@ def status_text_waiting_response_very_overdue(info_request, opts = {}) str end - def status_text_not_held(info_request, opts = {}) + def status_text_not_held(info_request, _opts = {}) _('{{authority_name}} did not have the information ' \ 'requested.', authority_name: public_body_link(info_request.public_body)) end - def status_text_rejected(info_request, opts = {}) + def status_text_rejected(info_request, _opts = {}) _('The request was refused by {{authority_name}}.', authority_name: public_body_link(info_request.public_body)) end - def status_text_successful(info_request, opts = {}) + def status_text_successful(_info_request, _opts = {}) _('The request was successful.') end - def status_text_partially_successful(info_request, opts = {}) + def status_text_partially_successful(_info_request, _opts = {}) _('The request was partially successful.') end @@ -176,50 +176,50 @@ def status_text_waiting_clarification(info_request, opts = {}) str end - def status_text_gone_postal(info_request, opts = {}) + def status_text_gone_postal(_info_request, _opts = {}) _('The authority would like to / has responded by ' \ 'postal mail to this request.') end - def status_text_internal_review(info_request, opts = {}) + def status_text_internal_review(info_request, _opts = {}) _('Waiting for an internal review by ' \ '{{public_body_link}} of their handling of this request.', public_body_link: public_body_link(info_request.public_body)) end - def status_text_error_message(info_request, opts = {}) + def status_text_error_message(_info_request, _opts = {}) _('There was a delivery error or similar, which ' \ 'needs fixing by the {{site_name}} team.', site_name: site_name) end - def status_text_requires_admin(info_request, opts = {}) + def status_text_requires_admin(_info_request, _opts = {}) _('This request has had an unusual response, and requires ' \ 'attention from the {{site_name}} team.', site_name: site_name) end - def status_text_user_withdrawn(info_request, opts = {}) + def status_text_user_withdrawn(_info_request, _opts = {}) _('This request has been withdrawn by the person ' \ 'who made it. There may be an explanation in the correspondence below.') end - def status_text_attention_requested(info_request, opts = {}) + def status_text_attention_requested(_info_request, _opts = {}) _('This request has been reported as needing ' \ 'administrator attention.') end - def status_text_vexatious(info_request, opts = {}) + def status_text_vexatious(_info_request, _opts = {}) _('This request has been reviewed by an administrator and is ' \ 'considered to be vexatious') end - def status_text_not_foi(info_request, opts = {}) + def status_text_not_foi(_info_request, _opts = {}) _('This request has been reviewed by an administrator and is ' \ 'considered not to be an FOI request') end - def custom_state_description(info_request, opts = {}) + def custom_state_description(info_request, _opts = {}) render partial: 'general/custom_state_descriptions', locals: { status: info_request.calculate_status } end @@ -258,7 +258,7 @@ def status_text_awaiting_description_other(info_request, new_responses_count) user: user_link_for_request(info_request)) end - def attachment_link(incoming_message, attachment) + def attachment_link(_incoming_message, attachment) img_filename = "icon_#{attachment.content_type.sub('/', '_')}_large.png" full_filename = File.expand_path(Rails.root.join('app', 'assets', diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index 1d9e81d2fb..3379f5ab58 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -48,7 +48,7 @@ def contact_for_user(user = nil) # Set headers that mark an email as being auto-generated and suppress out of # office responses to them - def set_auto_generated_headers(opts = {}) + def set_auto_generated_headers(_opts = {}) headers({ 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834 'X-Auto-Response-Suppress' => 'OOF' diff --git a/app/mailers/request_mailer.rb b/app/mailers/request_mailer.rb index 45f56b0fca..857645f563 100644 --- a/app/mailers/request_mailer.rb +++ b/app/mailers/request_mailer.rb @@ -48,7 +48,7 @@ def external_response(info_request, message_body, sent_at, attachment_hashes) end # Incoming message arrived for a request, but new responses have been stopped. - def stopped_responses(info_request, email, raw_email_data) + def stopped_responses(info_request, email, _raw_email_data) headers('Return-Path' => blackhole_email, # we don't care about bounces, likely from spammers 'Auto-Submitted' => 'auto-replied') # http://tools.ietf.org/html/rfc3834 diff --git a/app/models/info_request.rb b/app/models/info_request.rb index f2f6d3e73b..253387d8df 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -722,7 +722,7 @@ def prominence(opts = {}) # opts = Hash of options (default: {}) # Returns a StateCalculator - def state(opts = {}) + def state(_opts = {}) State::Calculator.new(self) end @@ -877,7 +877,7 @@ def find_existing_outgoing_message(body) end # Has this email already been received here? Based just on message id. - def already_received?(email, raw_email_data) + def already_received?(email, _raw_email_data) message_id = email.message_id raise "No message id for this message" if message_id.nil? @@ -1811,7 +1811,7 @@ def accept_incoming?(email, raw_email_data) end end - def create_response!(email, raw_email_data, rejected_reason = nil) + def create_response!(_email, raw_email_data, rejected_reason = nil) incoming_message = incoming_messages.build # To avoid a deadlock when simultaneously dealing with two diff --git a/app/models/info_request/response_gatekeeper/base.rb b/app/models/info_request/response_gatekeeper/base.rb index f147c00fb6..3ceb1d2c64 100644 --- a/app/models/info_request/response_gatekeeper/base.rb +++ b/app/models/info_request/response_gatekeeper/base.rb @@ -9,7 +9,7 @@ def initialize(info_request) @reason = nil end - def allow?(email) + def allow?(_email) allow end diff --git a/app/models/info_request/response_rejection/base.rb b/app/models/info_request/response_rejection/base.rb index edffed23e0..b6ec406c0f 100644 --- a/app/models/info_request/response_rejection/base.rb +++ b/app/models/info_request/response_rejection/base.rb @@ -9,7 +9,7 @@ def initialize(info_request, email, raw_email_data) @raw_email_data = raw_email_data end - def reject(reason = nil) + def reject(_reason = nil) true end end diff --git a/app/models/info_request/response_rejection/bounce.rb b/app/models/info_request/response_rejection/bounce.rb index e8996a2a43..93b4651f23 100644 --- a/app/models/info_request/response_rejection/bounce.rb +++ b/app/models/info_request/response_rejection/bounce.rb @@ -1,7 +1,7 @@ class InfoRequest module ResponseRejection class Bounce < Base - def reject(reason = nil) + def reject(_reason = nil) from_address = MailHandler.get_from_address(email) if from_address.nil? || from_address.downcase == info_request.incoming_email.downcase # do nothing – can't bounce the mail as there's no address to send it diff --git a/app/models/info_request/state/calculator.rb b/app/models/info_request/state/calculator.rb index 99b8cf2cda..b4109f120d 100644 --- a/app/models/info_request/state/calculator.rb +++ b/app/models/info_request/state/calculator.rb @@ -144,7 +144,7 @@ def pending_states(opts) states end - def complete_states(opts = {}) + def complete_states(_opts = {}) # States from which a request can go no further, because it's complete %w[ not_held @@ -154,7 +154,7 @@ def complete_states(opts = {}) ] end - def admin_states(opts = {}) + def admin_states(_opts = {}) # States which only an admin can put a request into, and from which # a normal user can't get the request out again %w[not_foi vexatious] diff --git a/app/models/info_request/state/transitions.rb b/app/models/info_request/state/transitions.rb index 9efd6a1acf..98f0f66836 100644 --- a/app/models/info_request/state/transitions.rb +++ b/app/models/info_request/state/transitions.rb @@ -59,31 +59,31 @@ def self.labelled_hash(states, opts = {}) private - def self.owner_waiting_response_transition_label(opts = {}) + def self.owner_waiting_response_transition_label(_opts = {}) _("I'm still waiting for my information (maybe you got an acknowledgement)") end - def self.owner_not_held_transition_label(opts = {}) + def self.owner_not_held_transition_label(_opts = {}) _("They do not have the information (maybe they say who does)") end - def self.owner_rejected_transition_label(opts = {}) + def self.owner_rejected_transition_label(_opts = {}) _("My request has been refused") end - def self.owner_partially_successful_transition_label(opts = {}) + def self.owner_partially_successful_transition_label(_opts = {}) _("I've received some of the information") end - def self.owner_successful_transition_label(opts = {}) + def self.owner_successful_transition_label(_opts = {}) _("I've received all the information") end - def self.owner_waiting_clarification_transition_label(opts = {}) + def self.owner_waiting_clarification_transition_label(_opts = {}) _("I've been asked to clarify my request") end - def self.owner_gone_postal_transition_label(opts = {}) + def self.owner_gone_postal_transition_label(_opts = {}) _("They are going to reply by postal mail") end @@ -95,48 +95,48 @@ def self.owner_internal_review_transition_label(opts = {}) end end - def self.owner_error_message_transition_label(opts = {}) + def self.owner_error_message_transition_label(_opts = {}) _("I've received an error message") end - def self.owner_requires_admin_transition_label(opts = {}) + def self.owner_requires_admin_transition_label(_opts = {}) _("This request requires administrator attention") end - def self.owner_user_withdrawn_transition_label(opts = {}) + def self.owner_user_withdrawn_transition_label(_opts = {}) _("I would like to withdraw this request") end - def self.other_user_waiting_response_transition_label(opts = {}) + def self.other_user_waiting_response_transition_label(_opts = {}) _("No response has been received (maybe " \ "there's just an acknowledgement)") end - def self.other_user_not_held_transition_label(opts = {}) + def self.other_user_not_held_transition_label(_opts = {}) _("The authority do not have the information " \ "(maybe they say who does)") end - def self.other_user_rejected_transition_label(opts = {}) + def self.other_user_rejected_transition_label(_opts = {}) _("The request has been refused") end - def self.other_user_partially_successful_transition_label(opts = {}) + def self.other_user_partially_successful_transition_label(_opts = {}) # TODO: - trailing space copied from # views/request/_other_describe_state.html.erb, will it break # translations if I fix it? _("Some of the information has been sent ") end - def self.other_user_successful_transition_label(opts = {}) + def self.other_user_successful_transition_label(_opts = {}) _("All the information has been sent") end - def self.other_user_waiting_clarification_transition_label(opts = {}) + def self.other_user_waiting_clarification_transition_label(_opts = {}) _("Clarification has been requested") end - def self.other_user_gone_postal_transition_label(opts = {}) + def self.other_user_gone_postal_transition_label(_opts = {}) _("A response will be sent by postal mail") end @@ -150,51 +150,51 @@ def self.other_user_internal_review_transition_label(opts = {}) end end - def self.other_user_error_message_transition_label(opts = {}) + def self.other_user_error_message_transition_label(_opts = {}) _("An error message has been received") end - def self.pro_waiting_response_transition_label(opts = {}) + def self.pro_waiting_response_transition_label(_opts = {}) State.short_description('waiting_response') end - def self.pro_not_held_transition_label(opts = {}) + def self.pro_not_held_transition_label(_opts = {}) State.short_description('not_held') end - def self.pro_rejected_transition_label(opts = {}) + def self.pro_rejected_transition_label(_opts = {}) State.short_description('rejected') end - def self.pro_partially_successful_transition_label(opts = {}) + def self.pro_partially_successful_transition_label(_opts = {}) State.short_description('partially_successful') end - def self.pro_successful_transition_label(opts = {}) + def self.pro_successful_transition_label(_opts = {}) State.short_description('successful') end - def self.pro_waiting_clarification_transition_label(opts = {}) + def self.pro_waiting_clarification_transition_label(_opts = {}) State.short_description('waiting_clarification') end - def self.pro_gone_postal_transition_label(opts = {}) + def self.pro_gone_postal_transition_label(_opts = {}) State.short_description('gone_postal') end - def self.pro_internal_review_transition_label(opts = {}) + def self.pro_internal_review_transition_label(_opts = {}) State.short_description('internal_review') end - def self.pro_error_message_transition_label(opts = {}) + def self.pro_error_message_transition_label(_opts = {}) State.short_description('error_message') end - def self.pro_requires_admin_transition_label(opts = {}) + def self.pro_requires_admin_transition_label(_opts = {}) State.short_description('requires_admin') end - def self.pro_user_withdrawn_transition_label(opts = {}) + def self.pro_user_withdrawn_transition_label(_opts = {}) State.short_description('user_withdrawn') end end diff --git a/app/models/outgoing_message/template/batch_request.rb b/app/models/outgoing_message/template/batch_request.rb index bfaab7962d..223f890190 100644 --- a/app/models/outgoing_message/template/batch_request.rb +++ b/app/models/outgoing_message/template/batch_request.rb @@ -9,7 +9,7 @@ def body(opts = {}) template_string(opts) end - def salutation(replacements = {}) + def salutation(_replacements = {}) self.class.placeholder_salutation end diff --git a/app/models/public_body.rb b/app/models/public_body.rb index ec91425ef1..e2aa082cad 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -193,7 +193,7 @@ def last_edit_comment_for_html_display text.gsub(/\n/, '
    ') end - def compare(previous = nil, &block) + def compare(previous = nil) if previous.nil? changes = [] else diff --git a/gems/alaveteli_features/lib/alaveteli_features/constraints.rb b/gems/alaveteli_features/lib/alaveteli_features/constraints.rb index 803f7d6a43..e68e9bf031 100644 --- a/gems/alaveteli_features/lib/alaveteli_features/constraints.rb +++ b/gems/alaveteli_features/lib/alaveteli_features/constraints.rb @@ -7,7 +7,7 @@ def initialize(feature) @feature = feature end - def matches?(request) + def matches?(_request) feature_enabled? @feature end end diff --git a/lib/alaveteli_mail_poller.rb b/lib/alaveteli_mail_poller.rb index 069093ebe5..fe6c67c8d9 100644 --- a/lib/alaveteli_mail_poller.rb +++ b/lib/alaveteli_mail_poller.rb @@ -102,7 +102,7 @@ def retrieve?(unique_id) !failed?(unique_id) || retry?(unique_id) end - def start(&block) + def start() # Start a POP3 session and ensure that it will be closed in any case. unless block_given? raise ArgumentError, "AlaveteliMailPoller#start takes a block" diff --git a/lib/attachment_to_html/adapter.rb b/lib/attachment_to_html/adapter.rb index e66298abff..51ce96d7e3 100644 --- a/lib/attachment_to_html/adapter.rb +++ b/lib/attachment_to_html/adapter.rb @@ -7,7 +7,7 @@ class Adapter # attachment - the FoiAttachment to convert to HTML # opts - a Hash of options (default: {}): # No options currently accepted - def initialize(attachment, opts = {}) + def initialize(attachment, _opts = {}) @attachment = attachment end diff --git a/lib/routing_filters.rb b/lib/routing_filters.rb index 0a5f4f2458..8648fee425 100644 --- a/lib/routing_filters.rb +++ b/lib/routing_filters.rb @@ -12,7 +12,7 @@ def prepend_locale?(locale) # internally and may look like `en-US`, whereas the former is # what FastGettext and other POSIX-based systems use, and will # look like `en_US` - def around_generate(*args, &block) + def around_generate(*args) # this is because we might get a call like forum_topics_path(forum, topic, :locale => :en) params = args.extract_options! # extract the passed :locale option @@ -48,7 +48,7 @@ def locales_pattern end ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper.class_eval do - def self.optimize_helper?(route) + def self.optimize_helper?(_route) false end end diff --git a/lib/stripe_mock_patch.rb b/lib/stripe_mock_patch.rb index d2144222ce..c8b13b8043 100644 --- a/lib/stripe_mock_patch.rb +++ b/lib/stripe_mock_patch.rb @@ -14,7 +14,7 @@ module RequestHandlers::Subscriptions # set_custom_status_from_metatdata method to set the status # from the stored info in the subscription metatdata when the # subscription is retrieved (including calling #refresh) - def retrieve_subscription(route, method_url, params, headers) + def retrieve_subscription(route, method_url, _params, _headers) route =~ method_url set_custom_status_from_metadata(subscriptions[$1]) if subscriptions[$1] @@ -25,7 +25,7 @@ def retrieve_subscription(route, method_url, params, headers) # set_custom_status_from_metatdata method to set the status # from the stored info in the subscription metatdata when multiple # subscriptions are retrieved (including from `Subscription::List`) - def retrieve_subscriptions(route, method_url, params, headers) + def retrieve_subscriptions(route, method_url, params, _headers) route =~ method_url subscriptions.values.each do |subscription| diff --git a/spec/support/mock_pop3.rb b/spec/support/mock_pop3.rb index bef1a2127e..4a3b18716f 100644 --- a/spec/support/mock_pop3.rb +++ b/spec/support/mock_pop3.rb @@ -13,22 +13,22 @@ def self.popmails @@popmails.clone end - def each_mail(*args) + def each_mail(*_args) @@popmails.each do |popmail| yield popmail end end - def mails(*args) + def mails(*_args) @@popmails.clone end - def start(*args) + def start(*_args) @@start = true block_given? ? yield(self) : self end - def enable_ssl(*args) + def enable_ssl(*_args) true end From 00e57331f5037abaa82d975000facf42f07f507f Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 3 Mar 2023 12:20:10 +0000 Subject: [PATCH 185/289] Style: Lint/UnusedBlockArgument (Rubocop) --- .../stripe_webhooks_controller.rb | 2 +- app/controllers/api_controller.rb | 2 +- app/controllers/application_controller.rb | 2 +- app/models/ability.rb | 2 +- app/models/alaveteli_pro/embargo_extension.rb | 2 +- app/models/holiday_import.rb | 2 +- app/models/info_request_event.rb | 2 +- app/models/public_body.rb | 2 +- db/migrate/096_create_translation_tables.rb | 2 +- ...1107_create_category_translation_tables.rb | 8 ++++---- lib/acts_as_xapian/acts_as_xapian.rb | 6 +++--- lib/memory_profiler.rb | 4 ++-- lib/tasks/import.rake | 2 +- lib/use_spans_for_errors.rb | 2 +- spec/factories/incoming_messages.rb | 6 +++--- spec/factories/info_request_batches.rb | 2 +- spec/factories/info_request_events.rb | 4 ++-- spec/factories/info_requests.rb | 20 +++++++++---------- spec/factories/track_things.rb | 6 +++--- spec/factories/users.rb | 2 +- spec/lib/acts_as_xapian_spec.rb | 2 +- spec/support/email_helpers.rb | 2 +- spec/support/xml_matchers.rb | 2 +- 23 files changed, 43 insertions(+), 43 deletions(-) diff --git a/app/controllers/alaveteli_pro/stripe_webhooks_controller.rb b/app/controllers/alaveteli_pro/stripe_webhooks_controller.rb index a02d0b206d..4bb9f98187 100644 --- a/app/controllers/alaveteli_pro/stripe_webhooks_controller.rb +++ b/app/controllers/alaveteli_pro/stripe_webhooks_controller.rb @@ -17,7 +17,7 @@ class UnknownPlanStripeWebhookError < StandardError; end render json: { error: exception.message }, status: 401 end - rescue_from UnknownPlanStripeWebhookError do |exception| + rescue_from UnknownPlanStripeWebhookError do |_exception| # accept it so it doesn't get resent but don't process it # (and don't generate an exception email for it) render json: { message: 'Does not appear to be one of our plans' }, diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index b5a777353a..2f646996b2 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -134,7 +134,7 @@ def add_correspondence else # In the 'response' direction, i.e. what we (Alaveteli) regard as incoming attachment_hashes = [] - (attachments || []).each_with_index do |attachment, i| + (attachments || []).each_with_index do |attachment, _i| filename = File.basename(attachment.original_filename) attachment_body = attachment.read content_type = AlaveteliFileTypes.filename_and_content_to_mimetype(filename, attachment_body) || 'application/octet-stream' diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a5782bb414..febfd15bfa 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -19,7 +19,7 @@ class RouteNotFound < StandardError skip_before_action :verify_authenticity_token, unless: :authenticated? # Deal with access denied errors from CanCan - rescue_from CanCan::AccessDenied do |exception| + rescue_from CanCan::AccessDenied do |_exception| raise PermissionDenied end diff --git a/app/models/ability.rb b/app/models/ability.rb index 7ef1689933..645fad5da5 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -106,7 +106,7 @@ def initialize(user, project: nil, public_token: false) public_token end - can :manage, OutgoingMessage::Snippet do |request| + can :manage, OutgoingMessage::Snippet do |_request| user && user.is_admin? end diff --git a/app/models/alaveteli_pro/embargo_extension.rb b/app/models/alaveteli_pro/embargo_extension.rb index 5e223b2f51..bff61e5f15 100644 --- a/app/models/alaveteli_pro/embargo_extension.rb +++ b/app/models/alaveteli_pro/embargo_extension.rb @@ -17,6 +17,6 @@ class EmbargoExtension < ApplicationRecord validates_presence_of :embargo validates_presence_of :extension_duration validates_inclusion_of :extension_duration, - in: lambda { |e| AlaveteliPro::Embargo.new.allowed_durations } + in: lambda { |_e| AlaveteliPro::Embargo.new.allowed_durations } end end diff --git a/app/models/holiday_import.rb b/app/models/holiday_import.rb index 97166e6442..bb2b954a6c 100644 --- a/app/models/holiday_import.rb +++ b/app/models/holiday_import.rb @@ -50,7 +50,7 @@ def save! end def holidays_attributes=(incoming_data) - incoming_data.each { |offset, incoming| holidays << Holiday.new(incoming) } + incoming_data.each { |_offset, incoming| holidays << Holiday.new(incoming) } end def holidays diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index 478cfd4ca3..e3451f0a7f 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -358,7 +358,7 @@ def params_diff other_params[key.to_sym] = value end end - new_params.delete_if { |key, value| ignore.keys.include?(key) } + new_params.delete_if { |key, _value| ignore.keys.include?(key) } {new: new_params, old: old_params, other: other_params} end diff --git a/app/models/public_body.rb b/app/models/public_body.rb index e2aa082cad..acffe9cd75 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -603,7 +603,7 @@ def import_values_from_csv_row(row, line, name, options) def set_locale_fields_from_csv_row(is_new, locale, row, options) changed = ActiveSupport::OrderedHash.new csv_field_names = options[:field_names] - csv_import_fields.each do |field_name, field_notes| + csv_import_fields.each do |field_name, _field_notes| localized_field_name = self.class.localized_csv_field_name(locale, field_name) column = csv_field_names[localized_field_name] value = column && row[column] diff --git a/db/migrate/096_create_translation_tables.rb b/db/migrate/096_create_translation_tables.rb index bf3d7b741c..08b6dedf7c 100644 --- a/db/migrate/096_create_translation_tables.rb +++ b/db/migrate/096_create_translation_tables.rb @@ -17,7 +17,7 @@ def self.up # copy current values across to default locale PublicBody.all.each do |publicbody| - publicbody.translated_attributes.each do |a, default| + publicbody.translated_attributes.each do |a, _default| value = publicbody.read_attribute(a) publicbody.send(:"#{a}=", value) unless value.nil? end diff --git a/db/migrate/20140716131107_create_category_translation_tables.rb b/db/migrate/20140716131107_create_category_translation_tables.rb index 84959512be..c550dffb61 100644 --- a/db/migrate/20140716131107_create_category_translation_tables.rb +++ b/db/migrate/20140716131107_create_category_translation_tables.rb @@ -14,7 +14,7 @@ def up # copy current values across to the default locale PublicBodyCategory.where(locale: default_locale).each do |category| - category.translated_attributes.each do |a, default| + category.translated_attributes.each do |a, _default| value = category.read_attribute(a) category.send(:"#{a}=", value) unless value.nil? end @@ -25,7 +25,7 @@ def up PublicBodyCategory.where('locale != ?', default_locale).each do |category| default_category = PublicBodyCategory.find_by_category_tag_and_locale(category.category_tag, default_locale) AlaveteliLocalization.with_locale(category.locale) do - category.translated_attributes.each do |a, default| + category.translated_attributes.each do |a, _default| value = category.read_attribute(a) unless value.nil? if default_category @@ -50,7 +50,7 @@ def up # copy current values across to the default locale PublicBodyHeading.where(locale: default_locale).each do |heading| - heading.translated_attributes.each do |a, default| + heading.translated_attributes.each do |a, _default| value = heading.read_attribute(a) heading.send(:"#{a}=", value) unless value.nil? end @@ -61,7 +61,7 @@ def up PublicBodyHeading.where('locale != ?', default_locale).each do |heading| default_heading = PublicBodyHeading.find_by_name_and_locale(heading.name, default_locale) AlaveteliLocalization.with_locale(heading.locale) do - heading.translated_attributes.each do |a, default| + heading.translated_attributes.each do |a, _default| value = heading.read_attribute(a) unless value.nil? if default_heading diff --git a/lib/acts_as_xapian/acts_as_xapian.rb b/lib/acts_as_xapian/acts_as_xapian.rb index 9013edf744..57f7484049 100644 --- a/lib/acts_as_xapian/acts_as_xapian.rb +++ b/lib/acts_as_xapian/acts_as_xapian.rb @@ -199,7 +199,7 @@ def self.init_query_parser @@values_by_prefix = {} @@value_ranges_store = [] - @@init_values.each do |classname, options| + @@init_values.each do |_classname, options| # go through the various field types, and tell query parser about them, # and error check them - i.e. check for consistency between models @@query_parser.add_boolean_prefix("model", "M") @@ -210,7 +210,7 @@ def self.init_query_parser end def self.init_values(values) - values.each do |method, index, prefix, value_type| + values.each do |_method, index, prefix, value_type| unless index.is_a? Integer raise "Value index '#{index}' must be an Integer, is #{index.class}" end @@ -244,7 +244,7 @@ def self.init_values(values) end def self.init_terms(terms) - terms.each do |method, term_code, prefix| + terms.each do |_method, term_code, prefix| unless term_code.match(/^[A-Z]$/) raise "Use a single capital letter for term code" end diff --git a/lib/memory_profiler.rb b/lib/memory_profiler.rb index 17f7128460..b7bd56bb78 100644 --- a/lib/memory_profiler.rb +++ b/lib/memory_profiler.rb @@ -48,12 +48,12 @@ def self.start(opt={}) end delta.clear - (curr.keys + delta.keys).uniq.each do |k,v| + (curr.keys + delta.keys).uniq.each do |k,_v| delta[k] = curr[k]-prev[k] end file.puts "Top 20" - delta.sort_by { |k,v| -v.abs }[0..19].sort_by { |k,v| -v }.each do |k,v| + delta.sort_by { |_k,v| -v.abs }[0..19].sort_by { |_k,v| -v }.each do |k,v| file.printf "%+5d: %s (%d)\n", v, k.name, curr[k] unless v == 0 end file.flush diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake index 6c14682e52..5739ccc373 100644 --- a/lib/tasks/import.rake +++ b/lib/tasks/import.rake @@ -59,7 +59,7 @@ namespace :import do import_args = [tmp_csv.path, tag, tag_behaviour, dryrun, editor, locales] errors, notes = - PublicBody.import_csv_from_file(*import_args) do |row_number, fields| + PublicBody.import_csv_from_file(*import_args) do |row_number, _fields| percent_complete = (100 * row_number.to_f / number_of_rows).to_i STDERR.print "#{row_number} out of #{number_of_rows} " STDERR.puts "(#{percent_complete}% complete)" diff --git a/lib/use_spans_for_errors.rb b/lib/use_spans_for_errors.rb index 55dc7fa853..ec394acc70 100644 --- a/lib/use_spans_for_errors.rb +++ b/lib/use_spans_for_errors.rb @@ -8,4 +8,4 @@ # # See http://dev.rubyonrails.org/ticket/2210 -ActionView::Base.field_error_proc = Proc.new { |html_tag, instance| %(#{html_tag}).html_safe } +ActionView::Base.field_error_proc = Proc.new { |html_tag, _instance| %(#{html_tag}).html_safe } diff --git a/spec/factories/incoming_messages.rb b/spec/factories/incoming_messages.rb index 8a2af65300..da264a5d54 100644 --- a/spec/factories/incoming_messages.rb +++ b/spec/factories/incoming_messages.rb @@ -30,7 +30,7 @@ last_parsed { 1.week.ago } sent_at { 1.week.ago } - after(:build) do |incoming_message, evaluator| + after(:build) do |incoming_message, _evaluator| incoming_message.foi_attachments << build( :body_text, incoming_message: incoming_message, @@ -54,7 +54,7 @@ last_parsed { nil } sent_at { nil } - after(:create) do |incoming_message, evaluator| + after(:create) do |incoming_message, _evaluator| data = load_file_fixture('incoming-request-plain.email') data.gsub!('EMAIL_FROM', 'Bob Responder ') incoming_message.raw_email.data = data @@ -63,7 +63,7 @@ end factory :incoming_message_with_html_attachment do - after(:build) do |incoming_message, evaluator| + after(:build) do |incoming_message, _evaluator| incoming_message.foi_attachments << build( :html_attachment, incoming_message: incoming_message, diff --git a/spec/factories/info_request_batches.rb b/spec/factories/info_request_batches.rb index 686d6fa1a2..1dae2e9ad3 100644 --- a/spec/factories/info_request_batches.rb +++ b/spec/factories/info_request_batches.rb @@ -26,7 +26,7 @@ trait :embargoed do embargo_duration { '3_months' } - after(:build) do |batch, evaluator| + after(:build) do |batch, _evaluator| batch.info_requests.each do |request| request.embargo = build(:embargo) end diff --git a/spec/factories/info_request_events.rb b/spec/factories/info_request_events.rb index 0f194d7e5e..3c8a2b839b 100644 --- a/spec/factories/info_request_events.rb +++ b/spec/factories/info_request_events.rb @@ -46,7 +46,7 @@ event.info_request = event.outgoing_message.info_request end - after(:create) do |evnt, evaluator| + after(:create) do |evnt, _evaluator| evnt.params = evnt.params.merge( outgoing_message_id: evnt.outgoing_message.id ) @@ -107,7 +107,7 @@ event.info_request = event.outgoing_message.info_request end - after(:create) do |evnt, evaluator| + after(:create) do |evnt, _evaluator| evnt.params = evnt.params.merge( outgoing_message_id: evnt.outgoing_message.id ) diff --git a/spec/factories/info_requests.rb b/spec/factories/info_requests.rb index 7d95524aca..41fb826f53 100644 --- a/spec/factories/info_requests.rb +++ b/spec/factories/info_requests.rb @@ -43,7 +43,7 @@ public_body user - after(:create) do |info_request, evaluator| + after(:create) do |info_request, _evaluator| initial_request = create(:initial_request, info_request: info_request, created_at: info_request.created_at) initial_request.last_sent_at = info_request.created_at @@ -156,27 +156,27 @@ end trait :with_internal_review_request do - after(:create) do |info_request, evaluator| + after(:create) do |info_request, _evaluator| outgoing_message = create(:internal_review_request, info_request: info_request) end end trait :embargoed do - after(:create) do |info_request, evaluator| + after(:create) do |info_request, _evaluator| create(:embargo, info_request: info_request) info_request.reload end end trait :embargo_expiring do - after(:create) do |info_request, evaluator| + after(:create) do |info_request, _evaluator| create(:expiring_embargo, info_request: info_request) info_request.reload end end trait :re_embargoed do - after(:create) do |info_request, evaluator| + after(:create) do |info_request, _evaluator| info_request.log_event('expire_embargo', {}) create(:embargo, info_request: info_request) info_request @@ -184,7 +184,7 @@ end trait :embargo_expired do - after(:create) do |info_request, evaluator| + after(:create) do |info_request, _evaluator| info_request.log_event('expire_embargo', info_request: info_request) info_request.reload end @@ -213,13 +213,13 @@ end trait :waiting_clarification do - after(:create) do |info_request, evaluator| + after(:create) do |info_request, _evaluator| info_request.set_described_state('waiting_clarification') end end trait :successful do - after(:create) do |info_request, evaluator| + after(:create) do |info_request, _evaluator| info_request.set_described_state('successful') end end @@ -244,7 +244,7 @@ trait :overdue do date_response_required_by { Time.zone.now - 1.day } - after(:create) do |info_request, evaluator| + after(:create) do |info_request, _evaluator| info_request.date_response_required_by = Time.zone.now - 1.day info_request.save! end @@ -253,7 +253,7 @@ trait :very_overdue do date_response_required_by { Time.zone.now - 21.days } date_very_overdue_after { Time.zone.now - 1.days } - after(:create) do |info_request, evaluator| + after(:create) do |info_request, _evaluator| info_request.date_response_required_by = Time.zone.now - 21.days info_request.date_very_overdue_after = Time.zone.now - 1.day info_request.save! diff --git a/spec/factories/track_things.rb b/spec/factories/track_things.rb index 545e52fe93..125bb499b4 100644 --- a/spec/factories/track_things.rb +++ b/spec/factories/track_things.rb @@ -26,7 +26,7 @@ factory :user_track do association :tracked_user, factory: :user track_type { 'user_updates' } - after(:create) do |track_thing, evaluator| + after(:create) do |track_thing, _evaluator| track_thing.track_query = "requested_by:#{ user.url_name }" \ " OR commented_by: #{ user.url_name }" track_thing.save! @@ -35,7 +35,7 @@ factory :public_body_track do association :public_body, factory: :public_body track_type { 'public_body_updates' } - after(:create) do |track_thing, evaluator| + after(:create) do |track_thing, _evaluator| track_thing.track_query = "requested_from:" \ "#{ track_thing.public_body.url_name }" track_thing.save! @@ -44,7 +44,7 @@ factory :request_update_track do association :info_request, factory: :info_request track_type { 'request_updates' } - after(:create) do |track_thing, evaluator| + after(:create) do |track_thing, _evaluator| track_thing.track_query = "request:" \ "#{ track_thing.info_request.url_title }" track_thing.save! diff --git a/spec/factories/users.rb b/spec/factories/users.rb index cf17872cdb..62315d415e 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -63,7 +63,7 @@ sequence(:name) { |n| "Pro User #{n}" } pro - after(:create) do |user, evaluator| + after(:create) do |user, _evaluator| create(:pro_account, user: user) end end diff --git a/spec/lib/acts_as_xapian_spec.rb b/spec/lib/acts_as_xapian_spec.rb index 9f4d844e61..e7496d9182 100644 --- a/spec/lib/acts_as_xapian_spec.rb +++ b/spec/lib/acts_as_xapian_spec.rb @@ -7,7 +7,7 @@ describe '.update_index' do it 'processes jobs that were queued after a job that errors' do - job1, job2 = Array.new(2) do |i| + job1, job2 = Array.new(2) do |_i| body = FactoryBot.create(:public_body) body.xapian_mark_needs_index ActsAsXapian::ActsAsXapianJob. diff --git a/spec/support/email_helpers.rb b/spec/support/email_helpers.rb index 1f4d84699f..64f6bf5fc9 100644 --- a/spec/support/email_helpers.rb +++ b/spec/support/email_helpers.rb @@ -1,6 +1,6 @@ def load_raw_emails_data raw_emails_yml = File.join(RSpec.configuration.fixture_path, "raw_emails.yml") - YAML.load_file(raw_emails_yml).map { |k,v| v["id"] }.each do |raw_email_id| + YAML.load_file(raw_emails_yml).map { |_k,v| v["id"] }.each do |raw_email_id| raw_email = RawEmail.find(raw_email_id) raw_email.data = load_file_fixture(format("raw_emails/%d.email", raw_email_id)) end diff --git a/spec/support/xml_matchers.rb b/spec/support/xml_matchers.rb index 2d34fd2959..498c37c4c1 100644 --- a/spec/support/xml_matchers.rb +++ b/spec/support/xml_matchers.rb @@ -17,7 +17,7 @@ "expected to find xml tag #{xpath} in:\n#{body}" end - failure_message_when_negated do |response| + failure_message_when_negated do |_response| "expected not to find xml tag #{xpath} in:\n#{body}" end From 01c41ed08e50b7af10fc51bc6c674bc2b256ef1b Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 3 Mar 2023 12:22:30 +0000 Subject: [PATCH 186/289] Style: Lint/AmbiguousRegexpLiteral (Rubocop) --- lib/tasks/import.rake | 2 +- spec/controllers/general_controller_spec.rb | 2 +- spec/controllers/request_controller_spec.rb | 8 +++---- spec/integration/localisation_spec.rb | 24 +++++++++---------- .../post_redirect_handler_spec.rb | 2 +- spec/lib/mail_handler/mail_handler_spec.rb | 2 +- .../alaveteli_pro/request_summary_spec.rb | 2 +- spec/views/request/show.html.erb_spec.rb | 4 ++-- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake index 5739ccc373..8b0531799d 100644 --- a/lib/tasks/import.rake +++ b/lib/tasks/import.rake @@ -23,7 +23,7 @@ namespace :import do name_count = Hash.new { 0 } reader = CSV.open(tmp_csv.path, 'r') header_line = reader.shift - headers = header_line.map { |h| h.gsub /^#/, '' } + headers = header_line.map { |h| h.gsub(/^#/, '') } reader.each do |row_array| row = Hash[headers.zip row_array] diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb index 3ced23cfd9..d16cc5ad27 100644 --- a/spec/controllers/general_controller_spec.rb +++ b/spec/controllers/general_controller_spec.rb @@ -160,7 +160,7 @@ it "should use our test PO files rather than the application one" do get :frontpage, params: { locale: 'es' } - expect(response.body).to match /XOXO/ + expect(response.body).to match(/XOXO/) end end diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index 7167f4a15d..e0af8a9bad 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -1732,8 +1732,8 @@ def send_request sign_in users(:bob_smith_user) get :show, params: { url_title: 'why_do_you_have_such_a_fancy_dog' } expect(response.body).to have_css("div#comment-1 h2") do |s| - expect(s).to contain /Silly.*left an annotation/m - expect(s).not_to contain /You.*left an annotation/m + expect(s).to contain(/Silly.*left an annotation/m) + expect(s).not_to contain(/You.*left an annotation/m) end end @@ -1741,8 +1741,8 @@ def send_request sign_in users(:silly_name_user) get :show, params: { url_title: 'why_do_you_have_such_a_fancy_dog' } expect(response.body).to have_css("div#comment-1 h2") do |s| - expect(s).to contain /Silly.*left an annotation/m - expect(s).not_to contain /You.*left an annotation/m + expect(s).to contain(/Silly.*left an annotation/m) + expect(s).not_to contain(/You.*left an annotation/m) end end diff --git a/spec/integration/localisation_spec.rb b/spec/integration/localisation_spec.rb index 583351e05d..c228749051 100644 --- a/spec/integration/localisation_spec.rb +++ b/spec/integration/localisation_spec.rb @@ -9,7 +9,7 @@ it "should generate URLs that include the locale when using one that includes an underscore" do AlaveteliLocalization.set_locales('es en_GB', 'es') get '/en_GB' - expect(response.body).to match /href="\/en_GB\// + expect(response.body).to match(/href="\/en_GB\//) end it "returns a 404 error if passed the locale with a hyphen instead of an underscore", local_requests: false do @@ -20,20 +20,20 @@ it "should fall back to the language if the territory is unknown" do AlaveteliLocalization.set_locales('es en', 'en') get '/', headers: { 'HTTP_ACCEPT_LANGUAGE' => 'en_US' } - expect(response.body).to match /href="\/en\// - expect(response.body).not_to match /href="\/en_US\// + expect(response.body).to match(/href="\/en\//) + expect(response.body).not_to match(/href="\/en_US\//) end it 'falls back to the default if the requested locale is unavailable' do get '/', params: { locale: "unknown" } - expect(response.body).to match /href="\/en\// - expect(response.body).not_to match /href="\/unknown\// + expect(response.body).to match(/href="\/en\//) + expect(response.body).not_to match(/href="\/unknown\//) end it "should generate URLs without a locale prepended when there's only one locale set" do AlaveteliLocalization.set_locales('en', 'en') get '/' - expect(response).not_to match /#{@home_link_regex}/ + expect(response).not_to match(/#{@home_link_regex}/) end context 'when handling public body requests' do @@ -90,8 +90,8 @@ it 'should generate URLs without a locale prepended' do get '/' - expect(response.body).to match /class="current-locale">English/ - expect(response.body).not_to match /#{@default_lang_home_link}/ + expect(response.body).to match(/class="current-locale">English/) + expect(response.body).not_to match(/#{@default_lang_home_link}/) end describe "when the default url contains an underscore" do @@ -99,7 +99,7 @@ it "generates URLs without a locale prepended" do AlaveteliLocalization.set_locales('en_GB es', 'en_GB') get '/' - expect(response.body).not_to match /href="\/en_GB\// + expect(response.body).not_to match(/href="\/en_GB\//) end end @@ -107,7 +107,7 @@ it 'should render the front page in the default language when no locale param is present and the session locale is not the default' do get '/', headers: { locale: 'es' } - expect(response.body).to match /class="current-locale">English/ + expect(response.body).to match(/class="current-locale">English/) end end @@ -120,8 +120,8 @@ it 'should generate URLs with a locale prepended' do get '/' - expect(response.body).to match /class="current-locale">English/ - expect(response.body).to match /#{@default_lang_home_link}/ + expect(response.body).to match(/class="current-locale">English/) + expect(response.body).to match(/#{@default_lang_home_link}/) end end diff --git a/spec/lib/alaveteli_pro/post_redirect_handler_spec.rb b/spec/lib/alaveteli_pro/post_redirect_handler_spec.rb index d8bd6189e3..397685f083 100644 --- a/spec/lib/alaveteli_pro/post_redirect_handler_spec.rb +++ b/spec/lib/alaveteli_pro/post_redirect_handler_spec.rb @@ -28,7 +28,7 @@ it "overrides the uri" do expect( controller.override_post_redirect_for_pro(uri, post_redirect, user) - ).to match /#{new_alaveteli_pro_info_request_path}\?draft_id=\d+/ + ).to match(/#{new_alaveteli_pro_info_request_path}\?draft_id=\d+/) end end diff --git a/spec/lib/mail_handler/mail_handler_spec.rb b/spec/lib/mail_handler/mail_handler_spec.rb index f2434312cf..9d5e302ad5 100644 --- a/spec/lib/mail_handler/mail_handler_spec.rb +++ b/spec/lib/mail_handler/mail_handler_spec.rb @@ -34,7 +34,7 @@ def create_message_from(from_field) it 'should convert an iso8859 email to utf8' do mail = get_fixture_mail('iso8859_2_raw_email.email') - expect(mail.subject).to match /gjatë/u + expect(mail.subject).to match(/gjatë/u) expect(MailHandler.get_part_body(mail).is_utf8?).to eq(true) end diff --git a/spec/models/alaveteli_pro/request_summary_spec.rb b/spec/models/alaveteli_pro/request_summary_spec.rb index d6b159511c..30da118b53 100644 --- a/spec/models/alaveteli_pro/request_summary_spec.rb +++ b/spec/models/alaveteli_pro/request_summary_spec.rb @@ -96,7 +96,7 @@ expect(updated_summary.title).to eq batch.title expect(updated_summary.body).to eq batch.body expect(updated_summary.public_body_names). - to match /.*#{public_body.name}.*/ + to match(/.*#{public_body.name}.*/) expect(updated_summary.summarisable).to eq batch expect(updated_summary.user).to eq batch.user expected_categories = [ diff --git a/spec/views/request/show.html.erb_spec.rb b/spec/views/request/show.html.erb_spec.rb index 6e1cb15c4a..3c52f840e3 100644 --- a/spec/views/request/show.html.erb_spec.rb +++ b/spec/views/request/show.html.erb_spec.rb @@ -277,7 +277,7 @@ def request_page assign :track_thing, TrackThing.create_track_for_request(request_with_attachment) render expect(rendered).to have_css(".attachment .attachment__name") do |s| - expect(s).to contain /interesting.pdf/m + expect(s).to contain(/interesting.pdf/m) end end end @@ -300,7 +300,7 @@ def request_page # Note that the censor rule applies to the original filename, # not the display_filename: expect(rendered).to have_css(".attachment .attachment__name") do |s| - expect(s).to contain /Mouse.pdf/m + expect(s).to contain(/Mouse.pdf/m) end end end From 7a9e0c053f3c1beb3447cd5b40ce46b07a539023 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 3 Mar 2023 12:24:44 +0000 Subject: [PATCH 187/289] Style: Lint/ParenthesesAsGroupedExpression (Rubocop) --- spec/controllers/request_controller_spec.rb | 4 ++-- .../public_body_change_request_spec.rb | 2 +- spec/mailers/notification_mailer_spec.rb | 2 +- .../draft_info_request_batch_spec.rb | 2 +- spec/models/info_request_batch_spec.rb | 2 +- spec/models/info_request_event_spec.rb | 4 ++-- spec/models/info_request_spec.rb | 16 ++++++++-------- .../shared_examples_for_viewing_requests.rb | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index e0af8a9bad..a7ffcfe862 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -315,7 +315,7 @@ def make_request it "should set @sidebar_template to the pro sidebar" do expect(assigns[:sidebar_template]). - to eq ("alaveteli_pro/info_requests/sidebar") + to eq("alaveteli_pro/info_requests/sidebar") end end @@ -329,7 +329,7 @@ def make_request end it "should set @sidebar_template to the normal sidebar" do - expect(assigns[:sidebar_template]).to eq ("sidebar") + expect(assigns[:sidebar_template]).to eq("sidebar") end end diff --git a/spec/integration/public_body_change_request_spec.rb b/spec/integration/public_body_change_request_spec.rb index 9e50826c8c..3f6c74b540 100644 --- a/spec/integration/public_body_change_request_spec.rb +++ b/spec/integration/public_body_change_request_spec.rb @@ -13,7 +13,7 @@ it "should not forget which public body you are updating during login" do visit show_public_body_path(url_name: public_body.url_name) click_link("Ask us to update FOI email") - click_link ("sign in") + click_link("sign in") fill_in :user_signin_email, with: user.email fill_in :user_signin_password, with: "jonespassword" diff --git a/spec/mailers/notification_mailer_spec.rb b/spec/mailers/notification_mailer_spec.rb index 69d8e6c3e5..06dc28f7ec 100644 --- a/spec/mailers/notification_mailer_spec.rb +++ b/spec/mailers/notification_mailer_spec.rb @@ -380,7 +380,7 @@ it "sets the right subject line" do mail = NotificationMailer.daily_summary(user, all_notifications) expect(mail.subject). - to eq ("Your daily request summary from Alaveteli Professional") + to eq("Your daily request summary from Alaveteli Professional") end it "matches the expected message" do diff --git a/spec/models/alaveteli_pro/draft_info_request_batch_spec.rb b/spec/models/alaveteli_pro/draft_info_request_batch_spec.rb index 5c8c104d3f..f1aaeb2ecf 100644 --- a/spec/models/alaveteli_pro/draft_info_request_batch_spec.rb +++ b/spec/models/alaveteli_pro/draft_info_request_batch_spec.rb @@ -41,7 +41,7 @@ public_bodies: [public_body1, public_body2], user: pro_user) draft.reload - expect(draft.public_bodies).to eq ([public_body2, public_body1]) + expect(draft.public_bodies).to eq([public_body2, public_body1]) end it 'returns a distinct list of associated public bodies' do diff --git a/spec/models/info_request_batch_spec.rb b/spec/models/info_request_batch_spec.rb index d09bd2c444..ba53794930 100644 --- a/spec/models/info_request_batch_spec.rb +++ b/spec/models/info_request_batch_spec.rb @@ -267,7 +267,7 @@ public_bodies: [first_public_body, third_public_body]) batch.reload - expect(batch.public_bodies).to eq ([third_public_body, + expect(batch.public_bodies).to eq([third_public_body, first_public_body]) end diff --git a/spec/models/info_request_event_spec.rb b/spec/models/info_request_event_spec.rb index a55967fd52..aa91c48e32 100644 --- a/spec/models/info_request_event_spec.rb +++ b/spec/models/info_request_event_spec.rb @@ -529,8 +529,8 @@ end describe '#destroy' do - let (:info_request) { FactoryBot.create(:info_request) } - let (:event) { InfoRequestEvent.create(info_request: info_request, + let(:info_request) { FactoryBot.create(:info_request) } + let(:event) { InfoRequestEvent.create(info_request: info_request, event_type: 'sent', params: {}) } diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb index f9c19010d6..01553af038 100644 --- a/spec/models/info_request_spec.rb +++ b/spec/models/info_request_spec.rb @@ -3614,28 +3614,28 @@ def apply_filters(filters) shared_examples_for "a situation when everything is public" do it "doesn't add a suffix for anyone" do - expect(request.make_zip_cache_path(nil)).to eq (path) - expect(request.make_zip_cache_path(non_owner)).to eq (path) - expect(request.make_zip_cache_path(admin)).to eq (path) - expect(request.make_zip_cache_path(owner)).to eq (path) + expect(request.make_zip_cache_path(nil)).to eq(path) + expect(request.make_zip_cache_path(non_owner)).to eq(path) + expect(request.make_zip_cache_path(admin)).to eq(path) + expect(request.make_zip_cache_path(owner)).to eq(path) end end shared_examples_for "a situation when anything is not public" do it "doesn't add a suffix for anonymous users" do - expect(request.make_zip_cache_path(nil)).to eq (path) + expect(request.make_zip_cache_path(nil)).to eq(path) end it "doesn't add a suffix for non owner users" do - expect(request.make_zip_cache_path(non_owner)).to eq (path) + expect(request.make_zip_cache_path(non_owner)).to eq(path) end it "adds a _hidden suffix for admin users" do - expect(request.make_zip_cache_path(admin)).to eq (hidden_path) + expect(request.make_zip_cache_path(admin)).to eq(hidden_path) end it "adds a requester_only suffix for owner users" do - expect(request.make_zip_cache_path(owner)).to eq (requester_only_path) + expect(request.make_zip_cache_path(owner)).to eq(requester_only_path) end end diff --git a/spec/support/shared_examples_for_viewing_requests.rb b/spec/support/shared_examples_for_viewing_requests.rb index 6396c5907f..bd76640831 100644 --- a/spec/support/shared_examples_for_viewing_requests.rb +++ b/spec/support/shared_examples_for_viewing_requests.rb @@ -122,7 +122,7 @@ click_button("Update") end expect(info_request.reload.described_state). - to eq ("partially_successful") + to eq("partially_successful") expect(page).to have_content("Your request has been updated!") # The form should still be there to allow us to go back if we # updated by mistake From 8a1b5b036c73bdedc43e33c7d632449ca2929b77 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 3 Mar 2023 12:33:17 +0000 Subject: [PATCH 188/289] Style: Lint/RedundantStringCoercion (Rubocop) --- app/models/public_body.rb | 2 +- config/application.rb | 4 ++-- db/migrate/099_move_raw_email_to_filesystem.rb | 2 +- lib/acts_as_xapian/acts_as_xapian.rb | 6 +++--- spec/lib/mail_handler/mail_handler_spec.rb | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/models/public_body.rb b/app/models/public_body.rb index acffe9cd75..0803b38255 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -528,7 +528,7 @@ def self.import_csv_from_file(csv_filename, tag, tag_behaviour, dry_run, editor, email.strip! unless email.nil? if !email.nil? && !email.empty? && !MySociety::Validate.is_valid_email(email) - errors.push "error: line #{line.to_s}: invalid email '#{email}' for authority '#{name}'" + errors.push "error: line #{line}: invalid email '#{email}' for authority '#{name}'" next end diff --git a/config/application.rb b/config/application.rb index b878c700ce..ef52d7f85f 100644 --- a/config/application.rb +++ b/config/application.rb @@ -79,8 +79,8 @@ class Application < Rails::Application app.routes.append { match '*path', to: 'general#not_found', via: [:get, :post] } end - config.autoload_paths << "#{Rails.root.to_s}/app/controllers/concerns" - config.autoload_paths << "#{Rails.root.to_s}/app/models/concerns" + config.autoload_paths << "#{Rails.root}/app/controllers/concerns" + config.autoload_paths << "#{Rails.root}/app/models/concerns" config.enable_dependency_loading = true diff --git a/db/migrate/099_move_raw_email_to_filesystem.rb b/db/migrate/099_move_raw_email_to_filesystem.rb index 5390f7c22b..e764579e65 100644 --- a/db/migrate/099_move_raw_email_to_filesystem.rb +++ b/db/migrate/099_move_raw_email_to_filesystem.rb @@ -2,7 +2,7 @@ class MoveRawEmailToFilesystem < ActiveRecord::Migration[4.2] # 2.3 def self.up RawEmail.find_each(batch_size: 10) do |raw_email| unless File.exist?(raw_email.filepath) - STDERR.puts "converting raw_email #{raw_email.id.to_s}" + STDERR.puts "converting raw_email #{raw_email.id}" raw_email.data = raw_email.dbdata end end diff --git a/lib/acts_as_xapian/acts_as_xapian.rb b/lib/acts_as_xapian/acts_as_xapian.rb index 57f7484049..5ca5d3f84d 100644 --- a/lib/acts_as_xapian/acts_as_xapian.rb +++ b/lib/acts_as_xapian/acts_as_xapian.rb @@ -777,7 +777,7 @@ def self.update_index(flush = false, verbose = false) def self.run_job(job, flush, verbose) if verbose - STDOUT.puts("ActsAsXapian.update_index #{job.action} #{job.model} #{job.model_id.to_s} #{Time.now.to_s}") + STDOUT.puts("ActsAsXapian.update_index #{job.action} #{job.model} #{job.model_id} #{Time.now}") end begin @@ -854,7 +854,7 @@ def self.destroy_and_rebuild_index(model_classes, verbose = false, terms = true, # Save time by running the indexing in one go and in-process model_classes.each do |model_class| if verbose - STDOUT.puts("ActsAsXapian.destroy_and_rebuild_index: Rebuilding #{model_class.to_s}") + STDOUT.puts("ActsAsXapian.destroy_and_rebuild_index: Rebuilding #{model_class}") end model_class.find_each do |model| if verbose @@ -916,7 +916,7 @@ def self._destroy_and_rebuild_index_safely(model_classes, verbose, terms, values @@db_path = ActsAsXapian.db_path + ".new" ActsAsXapian.writable_init if verbose - STDOUT.puts("ActsAsXapian.destroy_and_rebuild_index: New batch. #{model_class.to_s} from #{i} to #{i + batch_size} of #{model_class_count} pid #{Process.pid.to_s}") + STDOUT.puts("ActsAsXapian.destroy_and_rebuild_index: New batch. #{model_class} from #{i} to #{i + batch_size} of #{model_class_count} pid #{Process.pid}") end model_class.limit(batch_size).offset(i).order(:id).each do |model| if verbose diff --git a/spec/lib/mail_handler/mail_handler_spec.rb b/spec/lib/mail_handler/mail_handler_spec.rb index 9d5e302ad5..6bba6524e1 100644 --- a/spec/lib/mail_handler/mail_handler_spec.rb +++ b/spec/lib/mail_handler/mail_handler_spec.rb @@ -11,7 +11,7 @@ def create_message_from(from_field) it "should be able to parse a large email without raising an exception" do m = Mail.new m.add_file(filename: "attachment.data", content: "a" * (8 * 1024 * 1024)) - raw_email = "From jamis_buck@byu.edu Mon May 2 16:07:05 2005\r\n#{m.to_s}" + raw_email = "From jamis_buck@byu.edu Mon May 2 16:07:05 2005\r\n#{m}" expect { Mail::Message.new(raw_email) }.not_to raise_error end From 348a91bb8488b694beb333a226ed19af014c3471 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 3 Mar 2023 15:18:40 +0000 Subject: [PATCH 189/289] Style: Lint/AssignmentInCondition (Rubocop) --- app/controllers/concerns/translatable_params.rb | 2 +- app/helpers/highlight_helper.rb | 2 +- app/models/alaveteli_pro/embargo.rb | 2 +- app/models/info_request.rb | 2 +- app/models/public_body.rb | 4 ++-- app/models/public_body_heading.rb | 2 +- lib/mail_handler/backends/mail_backend.rb | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/controllers/concerns/translatable_params.rb b/app/controllers/concerns/translatable_params.rb index a1c4d79630..add0f7f0e4 100644 --- a/app/controllers/concerns/translatable_params.rb +++ b/app/controllers/concerns/translatable_params.rb @@ -44,7 +44,7 @@ def translation_keys end def slice_translations_params(sliced_params) - if translation_params = sliced_params[:translations_attributes] + if (translation_params = sliced_params[:translations_attributes]) translation_params.each do |locale, attributes| translation_params[locale] = attributes.slice(*translation_keys) end diff --git a/app/helpers/highlight_helper.rb b/app/helpers/highlight_helper.rb index d8fee963d0..ec1c77179d 100644 --- a/app/helpers/highlight_helper.rb +++ b/app/helpers/highlight_helper.rb @@ -51,7 +51,7 @@ def excerpt(text, phrase, options = {}) regex = /#{Regexp.escape(phrase)}/i end - return unless matches = text.match(regex) + return unless (matches = text.match(regex)) phrase = matches[0] unless separator.empty? diff --git a/app/models/alaveteli_pro/embargo.rb b/app/models/alaveteli_pro/embargo.rb index 588e1087ad..950ca5ca63 100644 --- a/app/models/alaveteli_pro/embargo.rb +++ b/app/models/alaveteli_pro/embargo.rb @@ -161,7 +161,7 @@ def set_expiring_notification_at def notify_expiration if info_request.use_notifications? - if event = info_request.last_embargo_expire_event + if (event = info_request.last_embargo_expire_event) info_request.user.notify(event) end end diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 253387d8df..cb6ddda4c7 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -1440,7 +1440,7 @@ def who_can_followup_to(skip_message = nil) ret = [] done = {} if skip_message - if email = OutgoingMailer.email_for_followup(self, skip_message) + if (email = OutgoingMailer.email_for_followup(self, skip_message)) done[email.downcase] = 1 end end diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 0803b38255..e192d0a131 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -422,8 +422,8 @@ def self.internal_admin_body if matching_pbs.empty? # "internal admin" exists but has the wrong default locale - fix & return - if invalid_locale = PublicBody::Translation. - find_by_url_name('internal_admin_authority') + if (invalid_locale = PublicBody::Translation. + find_by_url_name('internal_admin_authority')) found_pb = PublicBody.find(invalid_locale.public_body_id) AlaveteliLocalization. with_locale(AlaveteliLocalization.default_locale) do diff --git a/app/models/public_body_heading.rb b/app/models/public_body_heading.rb index 2ba476523b..95b9d0d73a 100644 --- a/app/models/public_body_heading.rb +++ b/app/models/public_body_heading.rb @@ -45,7 +45,7 @@ def add_category(category) end def self.next_display_order - if max = maximum(:display_order) + if (max = maximum(:display_order)) max + 1 else 0 diff --git a/lib/mail_handler/backends/mail_backend.rb b/lib/mail_handler/backends/mail_backend.rb index 03d8a7ce7f..6becb79062 100644 --- a/lib/mail_handler/backends/mail_backend.rb +++ b/lib/mail_handler/backends/mail_backend.rb @@ -350,7 +350,7 @@ def extract_attached_message_headers(leaf) if leaf.within_rfc822_attachment == leaf && get_content_type(leaf) == 'text/plain' headers = "" %w[Date Subject From To Cc].each do |header| - if header_value = get_header_string(header, leaf.within_rfc822_attachment) + if (header_value = get_header_string(header, leaf.within_rfc822_attachment)) unless header_value.blank? headers = headers + header + ": " + header_value.to_s + "\n" end From 1539b508514a8a7e4a87444a924a86f4dd003961 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 3 Mar 2023 15:26:25 +0000 Subject: [PATCH 190/289] Style: Lint/UselessAccessModifier (Rubocop) --- app/helpers/info_request_helper.rb | 2 -- app/models/alaveteli_pro/request_summary.rb | 2 -- app/models/alaveteli_pro/to_do_list/list.rb | 2 -- app/models/info_request/state/transitions.rb | 2 -- lib/data_export.rb | 2 -- 5 files changed, 10 deletions(-) diff --git a/app/helpers/info_request_helper.rb b/app/helpers/info_request_helper.rb index d2879cd827..1ef7a7cd9b 100644 --- a/app/helpers/info_request_helper.rb +++ b/app/helpers/info_request_helper.rb @@ -300,8 +300,6 @@ def details_help_link(public_body) link_to _('details'), help_requesting_path(anchor: anchor) end - private - def attachment_params(attachment, options = {}) attach_params = { incoming_message_id: attachment.incoming_message_id, diff --git a/app/models/alaveteli_pro/request_summary.rb b/app/models/alaveteli_pro/request_summary.rb index 6c5a6c2a6f..1ac859fe76 100644 --- a/app/models/alaveteli_pro/request_summary.rb +++ b/app/models/alaveteli_pro/request_summary.rb @@ -69,8 +69,6 @@ def update_from(request) update(self.class.attributes_from_request(request)) end - private - def self.create_from(request) create(attributes_from_request(request)) end diff --git a/app/models/alaveteli_pro/to_do_list/list.rb b/app/models/alaveteli_pro/to_do_list/list.rb index 506f6cbb10..4d56d0a196 100644 --- a/app/models/alaveteli_pro/to_do_list/list.rb +++ b/app/models/alaveteli_pro/to_do_list/list.rb @@ -16,8 +16,6 @@ def active_items items.select { |item| item.count > 0 } end - private - def self.item_types [ ToDoList::NewResponse, ToDoList::ExpiringEmbargo, diff --git a/app/models/info_request/state/transitions.rb b/app/models/info_request/state/transitions.rb index 98f0f66836..149719910a 100644 --- a/app/models/info_request/state/transitions.rb +++ b/app/models/info_request/state/transitions.rb @@ -57,8 +57,6 @@ def self.labelled_hash(states, opts = {}) hash end - private - def self.owner_waiting_response_transition_label(_opts = {}) _("I'm still waiting for my information (maybe you got an acknowledgement)") end diff --git a/lib/data_export.rb b/lib/data_export.rb index dda50e6bfe..085fca6cab 100644 --- a/lib/data_export.rb +++ b/lib/data_export.rb @@ -167,8 +167,6 @@ def self.is_required?(model_name, to_run) to_run.include?(model_name) end - private - def self.handle_error(err, data) p "---" puts "Error processing data:" From 1a5e0bdf5543aed8b62b96a98dde47a4ebc90ee7 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 3 Mar 2023 15:44:23 +0000 Subject: [PATCH 191/289] Style: Lint/Loop (Rubocop) --- lib/tasks/cleanup.rake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/tasks/cleanup.rake b/lib/tasks/cleanup.rake index 6ae2682505..5239dc8234 100644 --- a/lib/tasks/cleanup.rake +++ b/lib/tasks/cleanup.rake @@ -33,10 +33,11 @@ namespace :cleanup do user.with_lock do display_user(user, spam_score) - begin + loop do puts "Is this a spam account? [(Y)es/(n)o/(s)kip]" input = $stdin.gets.strip - end until %w(Y n s).include?(input) + break if %w(Y n s).include?(input) + end case input when 'Y' From 4f50ef2fc8f9ba7d6fe3254f8637149651e4e1c8 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 24 Feb 2023 17:28:05 +0000 Subject: [PATCH 192/289] Style: RedundantCapitalW (RuboCop) --- spec/models/public_body_spec.rb | 26 +++++++++---------- .../reply_to_address_validator_spec.rb | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/spec/models/public_body_spec.rb b/spec/models/public_body_spec.rb index 6c61f5aaa9..69b43d615d 100644 --- a/spec/models/public_body_spec.rb +++ b/spec/models/public_body_spec.rb @@ -1449,7 +1449,7 @@ def set_default_attributes(public_body) # csv, tag, tag_behaviour, dry_run, editor PublicBody.import_csv(csv, 'imported', 'add', false, 'someadmin') - expected = %W(imported) + expected = %w(imported) expect(PublicBody.find_by_name('Quango').tag_array_for_search).to eq(expected) end @@ -1462,7 +1462,7 @@ def set_default_attributes(public_body) # csv, tag, tag_behaviour, dry_run, editor PublicBody.import_csv(csv, 'imported', 'add', false, 'someadmin') - expected = %W(first_tag imported second_tag) + expected = %w(first_tag imported second_tag) expect(PublicBody.find_by_name('Quango').tag_array_for_search).to eq(expected) end @@ -1475,7 +1475,7 @@ def set_default_attributes(public_body) # csv, tag, tag_behaviour, dry_run, editor PublicBody.import_csv(csv, 'imported', 'replace', false, 'someadmin') - expected = %W(imported) + expected = %w(imported) expect(PublicBody.find_by_name('Quango').tag_array_for_search).to eq(expected) end @@ -1488,7 +1488,7 @@ def set_default_attributes(public_body) # csv, tag, tag_behaviour, dry_run, editor PublicBody.import_csv(csv, 'imported', 'replace', false, 'someadmin') - expected = %W(first_tag imported second_tag) + expected = %w(first_tag imported second_tag) expect(PublicBody.find_by_name('Quango').tag_array_for_search).to eq(expected) end @@ -1509,7 +1509,7 @@ def set_default_attributes(public_body) # csv, tag, tag_behaviour, dry_run, editor errors, notes = PublicBody.import_csv(csv, 'imported', 'add', false, 'someadmin') - expected = %W(imported) + expected = %w(imported) expect(errors).to include("error: line 2: Name Name is already taken for authority 'Existing Body'") end @@ -1529,7 +1529,7 @@ def set_default_attributes(public_body) # csv, tag, tag_behaviour, dry_run, editor PublicBody.import_csv(csv, 'imported', 'add', false, 'someadmin') - expected = %W(first_tag imported new_tag second_tag) + expected = %w(first_tag imported new_tag second_tag) expect(PublicBody.find(@body.id).tag_array_for_search).to eq(expected) end @@ -1542,7 +1542,7 @@ def set_default_attributes(public_body) # csv, tag, tag_behaviour, dry_run, editor PublicBody.import_csv(csv, 'imported', 'replace', false, 'someadmin') - expected = %W(first_tag imported new_tag) + expected = %w(first_tag imported new_tag) expect(PublicBody.find(@body.id).tag_array_for_search).to eq(expected) end @@ -1576,7 +1576,7 @@ def set_default_attributes(public_body) # csv, tag, tag_behaviour, dry_run, editor PublicBody.import_csv(csv, '', 'add', false, 'someadmin') - expected = %W(first_tag) + expected = %w(first_tag) expect(PublicBody.find_by_name('Quango').tag_array_for_search).to eq(expected) end @@ -1602,7 +1602,7 @@ def set_default_attributes(public_body) # csv, tag, tag_behaviour, dry_run, editor PublicBody.import_csv(csv, '', 'replace', false, 'someadmin') - expected = %W(first_tag) + expected = %w(first_tag) expect(PublicBody.find_by_name('Quango').tag_array_for_search).to eq(expected) end @@ -1636,7 +1636,7 @@ def set_default_attributes(public_body) # csv, tag, tag_behaviour, dry_run, editor PublicBody.import_csv(csv, '', 'add', false, 'someadmin') - expected = %W(new_tag) + expected = %w(new_tag) expect(PublicBody.find(@body.id).tag_array_for_search).to eq(expected) end @@ -1662,7 +1662,7 @@ def set_default_attributes(public_body) # csv, tag, tag_behaviour, dry_run, editor PublicBody.import_csv(csv, '', 'replace', false, 'someadmin') - expected = %W(new_tag) + expected = %w(new_tag) expect(PublicBody.find(@body.id).tag_array_for_search).to eq(expected) end @@ -1683,7 +1683,7 @@ def set_default_attributes(public_body) # csv, tag, tag_behaviour, dry_run, editor PublicBody.import_csv(csv, '', 'add', false, 'someadmin') - expected = %W(first_tag new_tag second_tag) + expected = %w(first_tag new_tag second_tag) expect(PublicBody.find(@body.id).tag_array_for_search).to eq(expected) end @@ -1696,7 +1696,7 @@ def set_default_attributes(public_body) # csv, tag, tag_behaviour, dry_run, editor PublicBody.import_csv(csv, '', 'replace', false, 'someadmin') - expected = %W(first_tag new_tag) + expected = %w(first_tag new_tag) expect(PublicBody.find(@body.id).tag_array_for_search).to eq(expected) end diff --git a/spec/validators/reply_to_address_validator_spec.rb b/spec/validators/reply_to_address_validator_spec.rb index 09e3fcf88a..0745c6194d 100644 --- a/spec/validators/reply_to_address_validator_spec.rb +++ b/spec/validators/reply_to_address_validator_spec.rb @@ -37,7 +37,7 @@ described_class::DEFAULT_INVALID_REPLY_ADDRESSES end - it { is_expected.to eq(%W(a@example.com)) } + it { is_expected.to eq(%w(a@example.com)) } end end From 4c450e23434bb378029778ba4853fcfb5bdd4dcc Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 24 Feb 2023 17:30:08 +0000 Subject: [PATCH 193/289] Style: Semicolon (RuboCop) --- app/controllers/admin_controller.rb | 2 +- .../alaveteli_pro/info_requests_controller.rb | 3 ++- app/controllers/public_body_controller.rb | 5 ++++- app/controllers/request_controller.rb | 5 ++++- db/migrate/053_acts_as_xapian_migration.rb | 5 ++++- lib/acts_as_xapian/acts_as_xapian.rb | 3 ++- lib/mail_handler/reply_handler.rb | 4 ++-- spec/models/post_redirect_spec.rb | 4 ++-- spec/models/public_body_spec.rb | 10 ++++++++-- 9 files changed, 29 insertions(+), 12 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 58d3eac8b0..1672a3b709 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -33,7 +33,7 @@ def admin_http_auth_user elsif request.env["HTTP_X_FORWARDED_USER"] request.env["HTTP_X_FORWARDED_USER"] else - "*unknown*"; + "*unknown*" end end diff --git a/app/controllers/alaveteli_pro/info_requests_controller.rb b/app/controllers/alaveteli_pro/info_requests_controller.rb index bbdeb30def..d751e985b4 100644 --- a/app/controllers/alaveteli_pro/info_requests_controller.rb +++ b/app/controllers/alaveteli_pro/info_requests_controller.rb @@ -30,7 +30,8 @@ def new else create_initial_objects end - check_public_body_is_requestable; return if performed? + check_public_body_is_requestable + return if performed? end def preview diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb index 6a344797ca..b4eb2eb541 100644 --- a/app/controllers/public_body_controller.rb +++ b/app/controllers/public_body_controller.rb @@ -86,7 +86,10 @@ def show has_json: true } ] respond_to do |format| - format.html { @has_json = true; render template: "public_body/show" } + format.html do + @has_json = true + render template: "public_body/show" + end format.json { render json: @public_body.json_for_api } end diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 055180c5c6..c982401635 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -95,7 +95,10 @@ def show @feed_autodetect = [ { url: do_track_url(@track_thing, 'feed'), title: @track_thing.params[:title_in_rss], has_json: true } ] respond_to do |format| - format.html { @has_json = true; render template: 'request/show' } + format.html do + @has_json = true + render template: 'request/show' + end format.json { render json: @info_request.json_for_api(true) } end end diff --git a/db/migrate/053_acts_as_xapian_migration.rb b/db/migrate/053_acts_as_xapian_migration.rb index c5965291c5..1281bb494d 100644 --- a/db/migrate/053_acts_as_xapian_migration.rb +++ b/db/migrate/053_acts_as_xapian_migration.rb @@ -11,7 +11,10 @@ def self.up remove_index :info_requests, :solr_up_to_date remove_column :info_requests, :solr_up_to_date - InfoRequest.find_each { |i| i.calculate_event_states; STDERR.puts "calculate_event_states " + i.id.to_s } + InfoRequest.find_each do |i| + i.calculate_event_states + STDERR.puts "calculate_event_states " + i.id.to_s + end end def self.down diff --git a/lib/acts_as_xapian/acts_as_xapian.rb b/lib/acts_as_xapian/acts_as_xapian.rb index 5ca5d3f84d..2e9b18c947 100644 --- a/lib/acts_as_xapian/acts_as_xapian.rb +++ b/lib/acts_as_xapian/acts_as_xapian.rb @@ -321,7 +321,8 @@ def initialize_query(options) #raise options.to_yaml self.runtime += Benchmark.realtime { - offset = options[:offset] || 0; offset = offset.to_i + offset = options[:offset] || 0 + offset = offset.to_i limit = options[:limit] unless limit raise "please specifiy maximum number of results to return with parameter :limit" diff --git a/lib/mail_handler/reply_handler.rb b/lib/mail_handler/reply_handler.rb index af7b917c43..9133437db2 100644 --- a/lib/mail_handler/reply_handler.rb +++ b/lib/mail_handler/reply_handler.rb @@ -82,8 +82,8 @@ def self.is_oof?(message) def self.forward_on(raw_message, message = nil) forward_to = get_forward_to_address(message) IO.popen(%Q(/usr/sbin/sendmail -i "#{forward_to}"), 'wb') do |f| - f.write(raw_message); - f.close; + f.write(raw_message) + f.close end end diff --git a/spec/models/post_redirect_spec.rb b/spec/models/post_redirect_spec.rb index e8f89c9ae8..cac55bd3dd 100644 --- a/spec/models/post_redirect_spec.rb +++ b/spec/models/post_redirect_spec.rb @@ -122,12 +122,12 @@ it "should generate a URL friendly token" do pr = PostRedirect.new - expect(pr.token).to match(/[a-z0-9]+/); + expect(pr.token).to match(/[a-z0-9]+/) end it "should generate an email friendly email token" do pr = PostRedirect.new - expect(pr.email_token).to match(/[a-z0-9]+/); + expect(pr.email_token).to match(/[a-z0-9]+/) end context 'when normal circumstance' do diff --git a/spec/models/public_body_spec.rb b/spec/models/public_body_spec.rb index 69b43d615d..c18e12ec92 100644 --- a/spec/models/public_body_spec.rb +++ b/spec/models/public_body_spec.rb @@ -65,7 +65,10 @@ it 'update with translated name' do body = FactoryBot.create(:public_body) - AlaveteliLocalization.with_locale(:es) { body.name = 'hola'; body.save! } + AlaveteliLocalization.with_locale(:es) do + body.name = 'hola' + body.save! + end body.reload expect(body.update('name' => nil)).to eq(false) @@ -95,7 +98,10 @@ it 'blank string update with translated name' do body = FactoryBot.create(:public_body) - AlaveteliLocalization.with_locale(:es) { body.name = 'hola'; body.save! } + AlaveteliLocalization.with_locale(:es) do + body.name = 'hola' + body.save! + end body.reload expect(body.update('name' => '')).to eq(false) From 91ad6509e9b5b65a446bf2cd1071925431a38d85 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 24 Feb 2023 17:35:18 +0000 Subject: [PATCH 194/289] Style: SelfAssignment (RuboCop) --- app/helpers/link_to_helper.rb | 2 +- app/mailers/request_mailer.rb | 2 +- app/models/alaveteli_pro/subscription_with_discount.rb | 2 +- app/models/info_request.rb | 4 ++-- app/models/info_request_event.rb | 2 +- app/models/mail_server_log.rb | 4 ++-- app/models/public_body.rb | 2 +- app/models/user.rb | 2 +- lib/alaveteli_mail_poller.rb | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb index 707a038be8..d963efe48c 100755 --- a/app/helpers/link_to_helper.rb +++ b/app/helpers/link_to_helper.rb @@ -233,7 +233,7 @@ def do_track_path(track_thing, feed = 'track', options = {}) # General pages. def search_url(query, options = nil) if query.kind_of?(Array) - query = query - ["", nil] + query -= ["", nil] query = query.join("/") end routing_info = {controller: 'general', diff --git a/app/mailers/request_mailer.rb b/app/mailers/request_mailer.rb index 857645f563..be8825ea84 100644 --- a/app/mailers/request_mailer.rb +++ b/app/mailers/request_mailer.rb @@ -490,7 +490,7 @@ def self.alert_comment_on_request info_request.user_id). first if alerted_for.nil? - count = count + 1 + count += 1 earliest_unalerted_comment_event = e else break diff --git a/app/models/alaveteli_pro/subscription_with_discount.rb b/app/models/alaveteli_pro/subscription_with_discount.rb index 456508a63a..b257c2d33d 100644 --- a/app/models/alaveteli_pro/subscription_with_discount.rb +++ b/app/models/alaveteli_pro/subscription_with_discount.rb @@ -27,7 +27,7 @@ def initialize(subscription) def amount net = BigDecimal((original_amount * 0.01), 0).round(2) - net = net - reduction(net) + net -= reduction(net) (net * 100).floor end diff --git a/app/models/info_request.rb b/app/models/info_request.rb index cb6ddda4c7..6d3e391100 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -1454,13 +1454,13 @@ def who_can_followup_to(skip_message = nil) name = OutgoingMailer.name_for_followup(self, incoming_message) unless done.include?(email.downcase) - ret = ret + [[name, email, incoming_message.id]] + ret += [[name, email, incoming_message.id]] end done[email.downcase] = 1 end unless done.include?(public_body.request_email.downcase) - ret = ret + [[public_body.name, public_body.request_email, nil]] + ret += [[public_body.name, public_body.request_email, nil]] end done[public_body.request_email.downcase] = 1 diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index e3451f0a7f..e6d9c95217 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -240,7 +240,7 @@ def search_text_main(clipped = false) text = text + outgoing_message.get_text_for_indexing + "\n\n" elsif event_type == 'response' if clipped - text = text + get_clipped_response_efficiently + text += get_clipped_response_efficiently else text = text + incoming_message.get_text_for_indexing_full + "\n\n" end diff --git a/app/models/mail_server_log.rb b/app/models/mail_server_log.rb index c2da664cad..a3266b1635 100644 --- a/app/models/mail_server_log.rb +++ b/app/models/mail_server_log.rb @@ -78,7 +78,7 @@ def self.load_file(file_name) def self.load_exim_log_data(f, done) order = 0 f.each do |line| - order = order + 1 + order += 1 create_exim_log_line(line, done, order) end end @@ -90,7 +90,7 @@ def self.load_postfix_log_data(f, done) f.rewind f.each do |line| sanitised_line = scrub(line) - order = order + 1 + order += 1 queue_id = extract_postfix_queue_id_from_syslog_line(sanitised_line) if emails.has_key?(queue_id) create_mail_server_logs(emails[queue_id], sanitised_line, order, done) diff --git a/app/models/public_body.rb b/app/models/public_body.rb index e192d0a131..0ccf755049 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -506,7 +506,7 @@ def self.import_csv_from_file(csv_filename, tag, tag_behaviour, dry_run, editor, errors: errors } CSV.foreach(csv_filename) do |row| - line = line + 1 + line += 1 # Parse the first line as a field list if it starts with '#' if line==1 and row.first.to_s =~ /^#(.*)$/ diff --git a/app/models/user.rb b/app/models/user.rb index 2e6b305453..019029dc46 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -361,7 +361,7 @@ def update_url_name conditions = id ? ["id <> ?", id] : [] while !User.where(url_name: unique_url_name).where(conditions).first.nil? unique_url_name = url_name + "_" + suffix_num.to_s - suffix_num = suffix_num + 1 + suffix_num += 1 end self.url_name = unique_url_name end diff --git a/lib/alaveteli_mail_poller.rb b/lib/alaveteli_mail_poller.rb index fe6c67c8d9..04174a2372 100644 --- a/lib/alaveteli_mail_poller.rb +++ b/lib/alaveteli_mail_poller.rb @@ -23,7 +23,7 @@ def poll_for_incoming start do |pop3| pop3.each_mail do |popmail| received = get_mail(popmail) - found_mail = found_mail || received + found_mail ||= received end end found_mail From a1ca0c6adfe5b424425e05b3d45105cc7a1c5cb0 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 24 Feb 2023 17:39:14 +0000 Subject: [PATCH 195/289] Style: LineEndConcatenation (RuboCop) --- app/models/incoming_message.rb | 8 ++++---- .../info_request/prominence/been_published_query.rb | 6 +++--- config/preinitializer.rb | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 839b8cb36e..11b5f40b4c 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -283,10 +283,10 @@ def self.remove_quoted_sections(text, replacement = "FOLDED_QUOTED_SECTION") # http://www.whatdotheyknow.com/request/235/response/513 # http://www.whatdotheyknow.com/request/445/response/743 original_message = - '(' + '''----* This is a copy of the message, including all the headers. ----*''' + - '|' + '''----*\s*Original Message\s*----*''' + - '|' + '''----*\s*Forwarded message.+----*''' + - '|' + '''----*\s*Forwarded by.+----*''' + + '(' + '''----* This is a copy of the message, including all the headers. ----*''' \ + '|' + '''----*\s*Original Message\s*----*''' \ + '|' + '''----*\s*Forwarded message.+----*''' \ + '|' + '''----*\s*Forwarded by.+----*''' \ ')' # Could have a ^ at start here, but see messed up formatting here: # http://www.whatdotheyknow.com/request/refuse_and_recycling_collection#incoming-842 diff --git a/app/models/info_request/prominence/been_published_query.rb b/app/models/info_request/prominence/been_published_query.rb index 81edbd2833..aef67c27c1 100644 --- a/app/models/info_request/prominence/been_published_query.rb +++ b/app/models/info_request/prominence/been_published_query.rb @@ -7,13 +7,13 @@ def initialize(relation = InfoRequest) def call @relation.joins( - 'LEFT JOIN "embargoes" ' + + 'LEFT JOIN "embargoes" ' \ 'ON "embargoes"."info_request_id" = "info_requests"."id"' ).joins( - 'LEFT JOIN "info_request_events" ' + + 'LEFT JOIN "info_request_events" ' \ 'ON "info_request_events"."info_request_id" = "info_requests"."id"' ).where( - '"embargoes"."id" IS NULL ' + + '"embargoes"."id" IS NULL ' \ 'OR "info_request_events"."event_type" = ?', 'expire_embargo' ) end diff --git a/config/preinitializer.rb b/config/preinitializer.rb index 9836dad79c..954a00c77f 100644 --- a/config/preinitializer.rb +++ b/config/preinitializer.rb @@ -6,7 +6,7 @@ end if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24") - raise RuntimeError, "Your bundler version is too old for Rails 2.3." + + raise RuntimeError, "Your bundler version is too old for Rails 2.3." \ "Run `gem install bundler` to upgrade." end @@ -15,6 +15,6 @@ ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__) Bundler.setup rescue Bundler::GemNotFound - raise RuntimeError, "Bundler couldn't find some gems." + + raise RuntimeError, "Bundler couldn't find some gems." \ "Did you run `bundle install`?" end From e802acad083e3f1839a44b53a40c6735bed98836 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 24 Feb 2023 17:40:23 +0000 Subject: [PATCH 196/289] Style: Alias (RuboCop) --- app/controllers/application_controller.rb | 2 +- app/models/incoming_message.rb | 2 +- app/models/info_request.rb | 4 ++-- app/models/info_request/response_gatekeeper/spam_checker.rb | 2 +- app/models/public_body.rb | 2 +- lib/mail_handler/backends/mail_backend.rb | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index febfd15bfa..19a678595a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -285,7 +285,7 @@ def authenticated_user end # For CanCanCan and other libs which need a Devise-like current_user method - alias_method :current_user, :authenticated_user + alias current_user authenticated_user helper_method :current_user # Do a POST redirect. This is a nasty hack - we store the posted values in diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 11b5f40b4c..b6bc994f75 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -111,7 +111,7 @@ def parse_raw_email!(force = nil) end end - alias_method :valid_to_reply_to?, :valid_to_reply_to + alias valid_to_reply_to? valid_to_reply_to # Public: The display name of the email sender with the associated # InfoRequest's censor rules applied. diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 6d3e391100..1be1ab511a 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -160,7 +160,7 @@ def self.admin_title scope :surveyable, Survey::InfoRequestQuery.new class << self - alias_method :in_progress, :awaiting_response + alias in_progress awaiting_response end scope :action_needed, State::ActionNeededQuery.new scope :updated_before, ->(ts) { where('"info_requests"."updated_at" < ?', ts) } @@ -788,7 +788,7 @@ def reindex_request_events end # Force reindex when tag string changes - alias_method :orig_tag_string=, :tag_string= + alias orig_tag_string= tag_string= def tag_string=(tag_string) ret = self.orig_tag_string=(tag_string) reindex_request_events diff --git a/app/models/info_request/response_gatekeeper/spam_checker.rb b/app/models/info_request/response_gatekeeper/spam_checker.rb index de023e8772..69168dad05 100644 --- a/app/models/info_request/response_gatekeeper/spam_checker.rb +++ b/app/models/info_request/response_gatekeeper/spam_checker.rb @@ -8,7 +8,7 @@ class SpamChecker } attr_reader :spam_action, :spam_header, :spam_threshold - alias_method :rejection_action, :spam_action + alias rejection_action spam_action def initialize(opts = {}) @spam_action = opts[:spam_action] || DEFAULT_CONFIGURATION[:spam_action] diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 0ccf755049..f14d2426be 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -655,7 +655,7 @@ def request_email_domain PublicBody.extract_domain_from_email(request_email) end - alias_method :foi_officer_domain_required, :request_email_domain + alias foi_officer_domain_required request_email_domain # Return the canonicalised domain part of an email address # diff --git a/lib/mail_handler/backends/mail_backend.rb b/lib/mail_handler/backends/mail_backend.rb index 6becb79062..e2c118cac4 100644 --- a/lib/mail_handler/backends/mail_backend.rb +++ b/lib/mail_handler/backends/mail_backend.rb @@ -13,8 +13,8 @@ class Message # string as an ActiveSupport::Multibyte::Chars, whereas # previously TMail would return nil. - alias_method :old_to, :to - alias_method :old_cc, :cc + alias old_to to + alias old_cc cc def clean_addresses(old_method, val) old_result = send(old_method, val) From bd22925b5b431be96b09769c3938a9f978327e83 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 24 Feb 2023 17:43:05 +0000 Subject: [PATCH 197/289] Style: ClassCheck (RuboCop) --- app/helpers/link_to_helper.rb | 4 ++-- lib/acts_as_xapian/acts_as_xapian.rb | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb index d963efe48c..d8f151f769 100755 --- a/app/helpers/link_to_helper.rb +++ b/app/helpers/link_to_helper.rb @@ -232,7 +232,7 @@ def do_track_path(track_thing, feed = 'track', options = {}) # General pages. def search_url(query, options = nil) - if query.kind_of?(Array) + if query.is_a?(Array) query -= ["", nil] query = query.join("/") end @@ -242,7 +242,7 @@ def search_url(query, options = nil) view: nil} routing_info = options.merge(routing_info) unless options.nil? - if routing_info.kind_of?(Hash) + if routing_info.is_a?(Hash) routing_info = ActionController::Parameters.new(routing_info) end diff --git a/lib/acts_as_xapian/acts_as_xapian.rb b/lib/acts_as_xapian/acts_as_xapian.rb index 2e9b18c947..063006ae52 100644 --- a/lib/acts_as_xapian/acts_as_xapian.rb +++ b/lib/acts_as_xapian/acts_as_xapian.rb @@ -959,7 +959,7 @@ def xapian_value(field, type = nil, index_translations = false) values << single_xapian_value(field, type=type) end end - if values[0].kind_of?(Array) + if values[0].is_a?(Array) values = values.flatten value = values.reject(&:nil?) else @@ -977,9 +977,9 @@ def xapian_value(field, type = nil, index_translations = false) def single_xapian_value(field, type = nil) value = send(field.to_sym) || self[field] if type == :date - if value.kind_of?(Time) + if value.is_a?(Time) value.utc.strftime("%Y%m%d") - elsif value.kind_of?(Date) + elsif value.is_a?(Date) value.to_time.utc.strftime("%Y%m%d") else raise "Only Time or Date types supported by acts_as_xapian for :date fields, got " + value.class.to_s @@ -988,7 +988,7 @@ def single_xapian_value(field, type = nil) value ? true : false else # Arrays are for terms which require multiple of them, e.g. tags - if value.kind_of?(Array) + if value.is_a?(Array) value.map(&:to_s) else value.to_s @@ -1069,7 +1069,7 @@ def xapian_index(terms = true, values = true, texts = true) terms_to_index.each do |term| value = xapian_value(term[0]) - if value.kind_of?(Array) + if value.is_a?(Array) value.each do |v| doc.add_term(term[1] + v) doc.add_posting(term[1] + v, 1, Integer(term[3])) if term[3] From ab5e8a1a3aac129a6be9f2a656dcb59df5c2c9b4 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 24 Feb 2023 17:44:17 +0000 Subject: [PATCH 198/289] Style: NegatedWhile (RuboCop) --- app/mailers/notification_mailer.rb | 2 +- app/mailers/track_mailer.rb | 2 +- app/models/user.rb | 2 +- lib/acts_as_xapian/acts_as_xapian.rb | 6 +++--- lib/alaveteli_mail_poller.rb | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb index 2e17660cd7..3a51979ff4 100644 --- a/app/mailers/notification_mailer.rb +++ b/app/mailers/notification_mailer.rb @@ -63,7 +63,7 @@ def self.send_notifications_loop # nothing to do while true sleep_seconds = 1 - while !send_notifications + until send_notifications sleep sleep_seconds sleep_seconds *= 2 sleep_seconds = 300 if sleep_seconds > 300 diff --git a/app/mailers/track_mailer.rb b/app/mailers/track_mailer.rb index f1a51a9f8d..42599fb283 100644 --- a/app/mailers/track_mailer.rb +++ b/app/mailers/track_mailer.rb @@ -138,7 +138,7 @@ def self.alert_tracks_loop # Run alert_tracks in an endless loop, sleeping when there is nothing to do while true sleep_seconds = 1 - while !alert_tracks + until alert_tracks sleep sleep_seconds sleep_seconds *= 2 sleep_seconds = 300 if sleep_seconds > 300 diff --git a/app/models/user.rb b/app/models/user.rb index 019029dc46..035fc1cc51 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -359,7 +359,7 @@ def update_url_name unique_url_name = url_name suffix_num = 2 # as there's already one without numeric suffix conditions = id ? ["id <> ?", id] : [] - while !User.where(url_name: unique_url_name).where(conditions).first.nil? + until User.where(url_name: unique_url_name).where(conditions).first.nil? unique_url_name = url_name + "_" + suffix_num.to_s suffix_num += 1 end diff --git a/lib/acts_as_xapian/acts_as_xapian.rb b/lib/acts_as_xapian/acts_as_xapian.rb index 063006ae52..ecfba4241d 100644 --- a/lib/acts_as_xapian/acts_as_xapian.rb +++ b/lib/acts_as_xapian/acts_as_xapian.rb @@ -422,7 +422,7 @@ def results self.runtime += Benchmark.realtime { # Pull out all the results iter = matches._begin - while not iter.equals(matches._end) + until iter.equals(matches._end) docs.push({data: iter.document.data, percent: iter.percent, weight: iter.weight, @@ -598,7 +598,7 @@ def initialize(model_classes, query_models, options = {}) # Get set of relevant terms for those documents selection = Xapian::RSet.new iter = matches._begin - while not iter.equals(matches._end) + until iter.equals(matches._end) selection.add_document(iter) iter.next end @@ -612,7 +612,7 @@ def initialize(model_classes, query_models, options = {}) # Do main search for them self.important_terms = [] iter = eset._begin - while not iter.equals(eset._end) + until iter.equals(eset._end) important_terms.push(iter.term) iter.next end diff --git a/lib/alaveteli_mail_poller.rb b/lib/alaveteli_mail_poller.rb index 04174a2372..713f48c94d 100644 --- a/lib/alaveteli_mail_poller.rb +++ b/lib/alaveteli_mail_poller.rb @@ -37,7 +37,7 @@ def self.poll_for_incoming_loop Rails.logger.info "Starting #{ poller } polling loop" while true sleep_seconds = 1 - while !poller.poll_for_incoming + until poller.poll_for_incoming Rails.logger.debug "#{ poller } sleeping for #{ sleep_seconds }" sleep sleep_seconds sleep_seconds *= 2 From 8e31aa846198be4f31a66dc6eaa69cc6ac9a9997 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 24 Feb 2023 17:45:36 +0000 Subject: [PATCH 199/289] Style: ParenthesesAroundCondition (RuboCop) --- app/controllers/general_controller.rb | 2 +- app/controllers/public_body_controller.rb | 2 +- app/controllers/request_controller.rb | 2 +- app/models/incoming_message.rb | 2 +- app/models/notification.rb | 4 ++-- lib/acts_as_xapian/acts_as_xapian.rb | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index 1b8e4af052..b6f20db005 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -188,7 +188,7 @@ def search # Spelling and highight words are same for all three queries @highlight_words = @request_for_spelling.words_to_highlight(regex: true, include_original: true) - unless (@request_for_spelling.spelling_correction =~ /[a-z]+:/) + unless @request_for_spelling.spelling_correction =~ /[a-z]+:/ @spelling_correction = @request_for_spelling.spelling_correction end diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb index b4eb2eb541..f116ee780d 100644 --- a/app/controllers/public_body_controller.rb +++ b/app/controllers/public_body_controller.rb @@ -64,7 +64,7 @@ def show sortby = "described" begin @xapian_requests = perform_search([InfoRequestEvent], query, sortby, 'request_collapse', requests_per_page) - if (@page > 1) + if @page > 1 @page_desc = " (page #{ @page })" else @page_desc = "" diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index c982401635..aaf7f12a8a 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -156,7 +156,7 @@ def list @filters = params.merge(latest_status: @view) - if (@page > 1) + if @page > 1 @title = _("Browse and search requests (page {{count}})", count: @page) else @title = _('Browse and search requests') diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index b6bc994f75..37a14f4245 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -96,7 +96,7 @@ def parse_raw_email!(force = nil) # values in case we want to regenerate them (due to mail # parsing bugs, etc). raise "Incoming message id=#{id} has no raw_email" if raw_email.nil? - if (!force.nil? || last_parsed.nil?) + if !force.nil? || last_parsed.nil? ActiveRecord::Base.transaction do extract_attachments self.sent_at = raw_email.date || created_at diff --git a/app/models/notification.rb b/app/models/notification.rb index 99fe083813..e240251913 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -73,8 +73,8 @@ def response_expired def embargo_expiring_expired # If someone has changed the embargo date on the request, or published it, # they might not need this notification any more. - if (info_request_event.info_request.embargo_expiring? || - info_request_event.info_request.embargo_pending_expiry?) + if info_request_event.info_request.embargo_expiring? || + info_request_event.info_request.embargo_pending_expiry? false else true diff --git a/lib/acts_as_xapian/acts_as_xapian.rb b/lib/acts_as_xapian/acts_as_xapian.rb index ecfba4241d..25fb93248b 100644 --- a/lib/acts_as_xapian/acts_as_xapian.rb +++ b/lib/acts_as_xapian/acts_as_xapian.rb @@ -1119,7 +1119,7 @@ def xapian_mark_needs_destroy # Allow reindexing to be skipped if a flag is set def xapian_mark_needs_index_if_reindex - if (respond_to?(:no_xapian_reindex) && no_xapian_reindex == true) + if respond_to?(:no_xapian_reindex) && no_xapian_reindex == true return true end xapian_mark_needs_index @@ -1139,7 +1139,7 @@ def xapian_create_job(action, model, model_id) rescue ActiveRecord::RecordNotUnique => e # Given the error handling in ActsAsXapian::update_index, we can just fail silently if # another process has inserted an acts_as_xapian_jobs record for this model. - unless (e.message =~ /duplicate key value violates unique constraint "index_acts_as_xapian_jobs_on_model_and_model_id"/) + unless e.message =~ /duplicate key value violates unique constraint "index_acts_as_xapian_jobs_on_model_and_model_id"/ raise end end From 1da6c0ec81ca6de592caaf35bedc23b930556c09 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 24 Feb 2023 17:53:10 +0000 Subject: [PATCH 200/289] Style: EmptyElse (RuboCop) --- app/helpers/application_helper.rb | 2 -- app/models/incoming_message.rb | 2 -- app/models/info_request_event.rb | 2 -- lib/mail_handler/backends/mail_backend.rb | 6 ------ 4 files changed, 12 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e94e40f96a..327427227a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -151,8 +151,6 @@ def request_list_cache_key cacheable_param_list = %w[controller action locale view] if params.keys.all? { |key| cacheable_param_list.include?(key) } "request-list-#{@view}-#{@locale}" - else - nil end end diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 37a14f4245..cff47e7cb5 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -169,8 +169,6 @@ def self.get_attachment_by_url_part_number_and_filename(attachments, found_url_p } if attachments_by_filename.length == 1 attachments_by_filename[0] - else - nil end end end diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index e6d9c95217..0cf7211a12 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -246,8 +246,6 @@ def search_text_main(clipped = false) end elsif event_type == 'comment' text = text + comment.body + "\n\n" - else - # nothing end text end diff --git a/lib/mail_handler/backends/mail_backend.rb b/lib/mail_handler/backends/mail_backend.rb index e2c118cac4..13c2115cc5 100644 --- a/lib/mail_handler/backends/mail_backend.rb +++ b/lib/mail_handler/backends/mail_backend.rb @@ -107,8 +107,6 @@ def first_from(mail) rescue mail[:from].value end - else - nil end end @@ -121,8 +119,6 @@ def get_from_address(mail) else first_from.address end - else - nil end end @@ -135,8 +131,6 @@ def get_from_name(mail) else (first_from.display_name || nil) end - else - nil end end From 0b58c5dee04fbf707c29e1fd53aedf266ded2edd Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 24 Feb 2023 17:57:15 +0000 Subject: [PATCH 201/289] Style: IdenticalConditionalBranches (RuboCop) --- app/controllers/admin_request_controller.rb | 4 +--- app/controllers/user_controller.rb | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb index 78d54a45fa..309c09dee3 100644 --- a/app/controllers/admin_request_controller.rb +++ b/app/controllers/admin_request_controller.rb @@ -104,7 +104,6 @@ def move flash[:error] = "Couldn't find user '#{params[:user_url_name]}'" end - redirect_to admin_request_url(@info_request) elsif params[:commit] == 'Move request to authority' && !params[:public_body_url_name].blank? destination_body = PublicBody.find_by_url_name( params[:public_body_url_name] @@ -116,11 +115,10 @@ def move flash[:error] = "Couldn't find public body '#{ params[:public_body_url_name] }'" end - redirect_to admin_request_url(@info_request) else flash[:error] = "Please enter the user or authority to move the request to" - redirect_to admin_request_url(@info_request) end + redirect_to admin_request_url(@info_request) end def generate_upload_url diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 1ea409b5c2..6334deca0c 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -152,7 +152,6 @@ def signup else if user_alreadyexists already_registered_mail user_alreadyexists - nil else # New unconfirmed user @@ -180,8 +179,8 @@ def signup @user_signup.email_confirmed = false @user_signup.save! send_confirmation_mail @user_signup - nil end + nil end rescue ActionController::ParameterMissing flash[:error] = _('Invalid form submission') From 09f1f2cc0568f5edc7dc2892ef56c90c283fd985 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 24 Feb 2023 17:58:16 +0000 Subject: [PATCH 202/289] Style: Not (RuboCop) --- app/controllers/user_controller.rb | 2 +- lib/mail_handler.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 6334deca0c..3ce02d1561 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -247,7 +247,7 @@ def signchangeemail # if not already, send a confirmation link to the new email address which logs # them into the old email's user account, but with special user_circumstance - if (not session[:user_circumstance]) or (session[:user_circumstance] != "change_email") + if (!(session[:user_circumstance])) or (session[:user_circumstance] != "change_email") # don't store the password in the db params[:signchangeemail].delete(:password) diff --git a/lib/mail_handler.rb b/lib/mail_handler.rb index 66a665b9ac..dec6cb8c0e 100644 --- a/lib/mail_handler.rb +++ b/lib/mail_handler.rb @@ -81,7 +81,7 @@ def get_attachment_text_one_file(content_type, body, charset = 'utf-8') AlaveteliExternalCommand.run("wvText", tempfile.path, tempfile.path + ".txt", { memory_limit: 536_870_912, timeout: 120 } ) # Try catdoc if we get into trouble (e.g. for InfoRequestEvent 2701) - if not File.exist?(tempfile.path + ".txt") + if !File.exist?(tempfile.path + ".txt") AlaveteliExternalCommand.run("catdoc", tempfile.path, default_params) else text += File.read(tempfile.path + ".txt") + "\n\n" From daa63c4cb356dfef84e150766213d65c50d0b3ee Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 24 Feb 2023 17:59:40 +0000 Subject: [PATCH 203/289] Style: Proc (RuboCop) --- app/models/alaveteli_pro/embargo.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/alaveteli_pro/embargo.rb b/app/models/alaveteli_pro/embargo.rb index 950ca5ca63..385b05d676 100644 --- a/app/models/alaveteli_pro/embargo.rb +++ b/app/models/alaveteli_pro/embargo.rb @@ -43,9 +43,9 @@ class Embargo < ApplicationRecord TWELVE_MONTHS = 364.days DURATIONS = { - "3_months" => Proc.new { THREE_MONTHS }, - "6_months" => Proc.new { SIX_MONTHS }, - "12_months" => Proc.new { TWELVE_MONTHS } + "3_months" => proc { THREE_MONTHS }, + "6_months" => proc { SIX_MONTHS }, + "12_months" => proc { TWELVE_MONTHS } }.freeze scope :expiring, -> { where("publish_at <= ?", expiring_soon_time) } From 6cfaf686509c23fa6623e6049b8e441df37f62d6 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 24 Feb 2023 18:01:42 +0000 Subject: [PATCH 204/289] Style: RedundantInterpolation (RuboCop) --- app/models/holiday_import.rb | 2 +- app/models/info_request.rb | 2 +- lib/tasks/stats.rake | 2 +- spec/factories/post_redirects.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/holiday_import.rb b/app/models/holiday_import.rb index bb2b954a6c..603ff53417 100644 --- a/app/models/holiday_import.rb +++ b/app/models/holiday_import.rb @@ -38,7 +38,7 @@ def suggestions_country_name end def period - start_year == end_year ? "#{start_year}" : "#{start_year}-#{end_year}" + start_year == end_year ? start_year.to_s : "#{start_year}-#{end_year}" end def save diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 1be1ab511a..8f0c8ab8a0 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -509,7 +509,7 @@ def self.where_old_unclassified(age_in_days=nil) end def self.download_zip_dir - File.join(Rails.root, "cache", "zips", "#{Rails.env}") + File.join(Rails.root, "cache", "zips", Rails.env) end def self.reject_incoming_at_mta(options) diff --git a/lib/tasks/stats.rake b/lib/tasks/stats.rake index 48cea8aefd..ae2fef4f77 100644 --- a/lib/tasks/stats.rake +++ b/lib/tasks/stats.rake @@ -293,7 +293,7 @@ namespace :stats do unless list.empty? puts "\n#{title}\n" list.each do |request| - request_line = "#{admin_request_url(request, host: AlaveteliConfiguration.domain)}" + request_line = admin_request_url(request, host: AlaveteliConfiguration.domain) if %w[vexatious not_foi].include? request.described_state request_line << "\t#{request.described_state}" end diff --git a/spec/factories/post_redirects.rb b/spec/factories/post_redirects.rb index 73bf58f36b..2a06c0f8ff 100644 --- a/spec/factories/post_redirects.rb +++ b/spec/factories/post_redirects.rb @@ -38,7 +38,7 @@ }, "info_request" => { "title" => "Testing the post redirect to pro things", - "public_body_id" => "#{public_body.id}" + "public_body_id" => public_body.id.to_s }, "submitted_new_request" => "1", "preview" => "0", From 0468dc060129f53b1ab1764e77d82e0860a89785 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 27 Feb 2023 10:36:23 +0000 Subject: [PATCH 205/289] Style: InfiniteLoop (RuboCop) --- app/mailers/notification_mailer.rb | 2 +- app/mailers/track_mailer.rb | 2 +- lib/alaveteli_mail_poller.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb index 3a51979ff4..f4c61a33fc 100644 --- a/app/mailers/notification_mailer.rb +++ b/app/mailers/notification_mailer.rb @@ -61,7 +61,7 @@ def self.send_notifications def self.send_notifications_loop # Run send_notifications in an endless loop, sleeping when there is # nothing to do - while true + loop do sleep_seconds = 1 until send_notifications sleep sleep_seconds diff --git a/app/mailers/track_mailer.rb b/app/mailers/track_mailer.rb index 42599fb283..1641b74b9b 100644 --- a/app/mailers/track_mailer.rb +++ b/app/mailers/track_mailer.rb @@ -136,7 +136,7 @@ def self.alert_tracks def self.alert_tracks_loop # Run alert_tracks in an endless loop, sleeping when there is nothing to do - while true + loop do sleep_seconds = 1 until alert_tracks sleep sleep_seconds diff --git a/lib/alaveteli_mail_poller.rb b/lib/alaveteli_mail_poller.rb index 713f48c94d..b7e3b2462f 100644 --- a/lib/alaveteli_mail_poller.rb +++ b/lib/alaveteli_mail_poller.rb @@ -35,7 +35,7 @@ def self.poll_for_incoming_loop if AlaveteliConfiguration.production_mailer_retriever_method == 'pop' poller = new Rails.logger.info "Starting #{ poller } polling loop" - while true + loop do sleep_seconds = 1 until poller.poll_for_incoming Rails.logger.debug "#{ poller } sleeping for #{ sleep_seconds }" From 738bc4c187191896e80cd815028223adb67dbca1 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 27 Feb 2023 10:40:02 +0000 Subject: [PATCH 206/289] Style: RedundantException (RuboCop) --- config/preinitializer.rb | 7 +++---- lib/confidence_intervals.rb | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/config/preinitializer.rb b/config/preinitializer.rb index 954a00c77f..beca9f5ac4 100644 --- a/config/preinitializer.rb +++ b/config/preinitializer.rb @@ -6,8 +6,8 @@ end if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24") - raise RuntimeError, "Your bundler version is too old for Rails 2.3." \ - "Run `gem install bundler` to upgrade." + raise "Your bundler version is too old for Rails 2.3. Run `gem install " \ + "bundler` to upgrade." end begin @@ -15,6 +15,5 @@ ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__) Bundler.setup rescue Bundler::GemNotFound - raise RuntimeError, "Bundler couldn't find some gems." \ - "Did you run `bundle install`?" + raise "Bundler couldn't find some gems. Did you run `bundle install`?" end diff --git a/lib/confidence_intervals.rb b/lib/confidence_intervals.rb index 84ea930a73..5ddfa20cde 100644 --- a/lib/confidence_intervals.rb +++ b/lib/confidence_intervals.rb @@ -19,7 +19,7 @@ require 'statistics2' def ci_bounds(successes, total, power) - raise RuntimeError, "Can't calculate the CI for 0 observations" if total == 0 + raise "Can't calculate the CI for 0 observations" if total == 0 z = Statistics2.pnormaldist(1 - power/2) phat = successes.to_f/total offset = z*Math.sqrt((phat*(1 - phat) + z*z/(4*total))/total) From 7fdeae56dada70d21f8c009d4c593cf8f35fd02c Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 27 Feb 2023 10:42:23 +0000 Subject: [PATCH 207/289] Style: RedundantParentheses (RuboCop) --- app/controllers/general_controller.rb | 6 +++--- app/controllers/user_controller.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index b6f20db005..992a1aa6ce 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -89,7 +89,7 @@ def search combined = params[:combined].split("/") @sortby = nil @bodies = @requests = @users = true - if combined.size > 0 && (['advanced'].include?(combined[-1])) + if combined.size > 0 && ['advanced'].include?(combined[-1]) combined.pop @advanced = true else @@ -97,12 +97,12 @@ def search end # TODO: currently /described isn't linked to anywhere, just used in RSS and for /list/successful # This is because it's confusingly different from /newest - but still useful for power users. - if combined.size > 0 && (%w[newest described relevant].include?(combined[-1])) + if combined.size > 0 && %w[newest described relevant].include?(combined[-1]) @sort_postfix = combined.pop @sortby = @sort_postfix end combined += [params[:view]] unless params[:view].nil? - if combined.size > 0 && (%w[bodies requests users all].include?(combined[-1])) + if combined.size > 0 && %w[bodies requests users all].include?(combined[-1]) @variety_postfix = combined.pop case @variety_postfix when 'bodies' diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 3ce02d1561..24857e9b28 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -247,7 +247,7 @@ def signchangeemail # if not already, send a confirmation link to the new email address which logs # them into the old email's user account, but with special user_circumstance - if (!(session[:user_circumstance])) or (session[:user_circumstance] != "change_email") + if !session[:user_circumstance] or (session[:user_circumstance] != "change_email") # don't store the password in the db params[:signchangeemail].delete(:password) From 6a5360029963dacccd062397156fd6c212dd7594 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 27 Feb 2023 10:44:59 +0000 Subject: [PATCH 208/289] Style: TrailingCommaInArguments (RuboCop) --- .../alaveteli_pro/draft_info_request_batches_controller.rb | 2 +- spec/controllers/admin_raw_email_controller_spec.rb | 2 +- spec/lib/alaveteli_pro/metrics_report_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/alaveteli_pro/draft_info_request_batches_controller.rb b/app/controllers/alaveteli_pro/draft_info_request_batches_controller.rb index 1550c296dc..5a6a36419c 100644 --- a/app/controllers/alaveteli_pro/draft_info_request_batches_controller.rb +++ b/app/controllers/alaveteli_pro/draft_info_request_batches_controller.rb @@ -85,7 +85,7 @@ def respond_with_partial(draft, query, page) # different params. def draft_params params.require(:alaveteli_pro_draft_info_request_batch). - permit(:title, :body, :embargo_duration, :public_body_ids, ) + permit(:title, :body, :embargo_duration, :public_body_ids ) end def draft_params_multiple_bodies diff --git a/spec/controllers/admin_raw_email_controller_spec.rb b/spec/controllers/admin_raw_email_controller_spec.rb index 0c0ee7af1d..095c21aa41 100644 --- a/spec/controllers/admin_raw_email_controller_spec.rb +++ b/spec/controllers/admin_raw_email_controller_spec.rb @@ -39,7 +39,7 @@ let(:incoming_message) do incoming_message = FactoryBot.create( :plain_incoming_message, - info_request: InfoRequest.holding_pen_request, + info_request: InfoRequest.holding_pen_request ) incoming_message.raw_email.data = raw_email_data incoming_message.raw_email.save! diff --git a/spec/lib/alaveteli_pro/metrics_report_spec.rb b/spec/lib/alaveteli_pro/metrics_report_spec.rb index 8587c98597..7d07514455 100644 --- a/spec/lib/alaveteli_pro/metrics_report_spec.rb +++ b/spec/lib/alaveteli_pro/metrics_report_spec.rb @@ -160,7 +160,7 @@ let!(:past_due_sub) do subscription = Stripe::Subscription.create(customer: customer, - plan: pro_plan.id,) + plan: pro_plan.id) StripeMock.mark_subscription_as_past_due(subscription) subscription end From 9b7b3fa24a0622912aea2169d4f40775c4f075f2 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 27 Feb 2023 13:14:28 +0000 Subject: [PATCH 209/289] Style: IfUnlessModifier (RuboCop) --- app/controllers/api_controller.rb | 4 +--- app/controllers/application_controller.rb | 4 +--- app/controllers/track_controller.rb | 4 +--- app/models/incoming_message.rb | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index 2f646996b2..d5d9521d98 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -270,9 +270,7 @@ def body_request_events protected def check_api_key - if params[:k].nil? - raise PermissionDenied, "Missing required parameter 'k'" - end + raise PermissionDenied, "Missing required parameter 'k'" if params[:k].nil? @public_body = PublicBody.find_by_api_key(params[:k].gsub(' ', '+')) raise PermissionDenied if @public_body.nil? end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 19a678595a..ddc80c855d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -471,9 +471,7 @@ def user_ip # # Returns a Hash def sanitize_path(params) - if params.key?(:path) - params.merge!(path: Rack::Utils.escape(params[:path])) - end + params.merge!(path: Rack::Utils.escape(params[:path])) if params.key?(:path) end # Collect the current and available locales for the locale switcher diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb index d26d9bd087..29c161db27 100644 --- a/app/controllers/track_controller.rb +++ b/app/controllers/track_controller.rb @@ -81,9 +81,7 @@ def track_user return atom_feed_internal if params[:feed] == 'feed' - if track_set || @track_thing.errors.any? - redirect_to user_url(@track_user) - end + redirect_to user_url(@track_user) if track_set || @track_thing.errors.any? end # Track a search term diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index cff47e7cb5..e4cc0ea360 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -167,9 +167,7 @@ def self.get_attachment_by_url_part_number_and_filename(attachments, found_url_p attachments_by_filename = attachments.select { |a| a.display_filename == display_filename } - if attachments_by_filename.length == 1 - attachments_by_filename[0] - end + attachments_by_filename[0] if attachments_by_filename.length == 1 end end From 60cf97143163fdf75b756b9b0f4f7ee72856f153 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 27 Feb 2023 13:16:20 +0000 Subject: [PATCH 210/289] Style: MethodDefParentheses (RuboCop) --- lib/tasks/usage.rb | 2 +- script/switch-theme.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/usage.rb b/lib/tasks/usage.rb index e2d9eee48c..8f760df83e 100644 --- a/lib/tasks/usage.rb +++ b/lib/tasks/usage.rb @@ -1,6 +1,6 @@ module Usage - def usage_message message + def usage_message(message) puts '' puts message puts '' diff --git a/script/switch-theme.rb b/script/switch-theme.rb index 18ba015f10..f000178310 100755 --- a/script/switch-theme.rb +++ b/script/switch-theme.rb @@ -100,7 +100,7 @@ def show_themes exit 1 end -def symlink target, link_directory, link_name +def symlink(target, link_directory, link_name) tmp = Tempfile.new link_name, link_directory full_link_name = File.join(link_directory, link_name) target = Pathname.new(target).relative_path_from(File.dirname(full_link_name)) From 76fa9fbd006fce8b15611dc1548e0e02d9b08bad Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 27 Feb 2023 13:21:15 +0000 Subject: [PATCH 211/289] Style: TrivialAccessors (RuboCop) --- lib/attachment_to_html/view.rb | 4 ++-- spec/support/mock_pop_mail.rb | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/attachment_to_html/view.rb b/lib/attachment_to_html/view.rb index 1785e605aa..7bc4a64db0 100644 --- a/lib/attachment_to_html/view.rb +++ b/lib/attachment_to_html/view.rb @@ -5,8 +5,8 @@ def self.template @template || "#{ File.dirname(__FILE__) }/template.html.erb" end - def self.template=(path) - @template = path + class << self + attr_writer :template end attr_accessor :title, :body, :template, :wrapper diff --git a/spec/support/mock_pop_mail.rb b/spec/support/mock_pop_mail.rb index 0abbce5f6e..5c9d08d746 100644 --- a/spec/support/mock_pop_mail.rb +++ b/spec/support/mock_pop_mail.rb @@ -9,9 +9,7 @@ def pop @rfc2822 end - def number - @number - end + attr_reader :number def to_s "#{number}: #{pop}" From c7898e427ede81d4872fc4c0702d96cceaaadf9a Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 27 Feb 2023 13:25:18 +0000 Subject: [PATCH 212/289] Style: WhileUntilModifier (RuboCop) --- app/models/holiday.rb | 4 +--- lib/alaveteli_gettext/fuzzy_cleaner.rb | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/models/holiday.rb b/app/models/holiday.rb index 964cd2f302..b1fbcd33e3 100644 --- a/app/models/holiday.rb +++ b/app/models/holiday.rb @@ -82,9 +82,7 @@ def self.due_date_from_calendar_days(start_date, days) start_date = start_date.to_date response_required_by = start_date + days - while weekend_or_holiday?(response_required_by) - response_required_by += 1 - end + response_required_by += 1 while weekend_or_holiday?(response_required_by) response_required_by end end diff --git a/lib/alaveteli_gettext/fuzzy_cleaner.rb b/lib/alaveteli_gettext/fuzzy_cleaner.rb index 59071cece1..34ecebbf6f 100644 --- a/lib/alaveteli_gettext/fuzzy_cleaner.rb +++ b/lib/alaveteli_gettext/fuzzy_cleaner.rb @@ -14,9 +14,7 @@ def clean_po(input) end # multiline msgstr if /^msgstr ""/.match(lines[index+1]) - while /^".+"/.match(lines[index+2]) - lines.delete_at(index+2) - end + lines.delete_at(index+2) while /^".+"/.match(lines[index+2]) lines.delete_at(index-1) end # plural msgstr From eae1ba82afbbc62156a292e0bf57fd5d8427f660 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 27 Feb 2023 14:51:50 +0000 Subject: [PATCH 213/289] Style: MultilineTernaryOperator (RuboCop) --- app/controllers/user_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 24857e9b28..73769a8cb3 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -285,9 +285,13 @@ def signchangeemail # River of News: What's happening with your tracked things def river - @results = @user.nil? ? [] : @user.track_things.collect { |thing| + @results = if @user.nil? + [] +else + @user.track_things.collect { |thing| perform_search([InfoRequestEvent], thing.track_query, thing.params[:feed_sortby], nil).results }.flatten.sort { |a,b| b[:model].created_at <=> a[:model].created_at }.first(20) +end end def set_profile_photo From 3a34bf79a59e98410d6a406a2bb7ea41e623a87d Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 27 Feb 2023 14:52:55 +0000 Subject: [PATCH 214/289] Style: RedundantFreeze (RuboCop) --- app/validators/reply_to_address_validator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/validators/reply_to_address_validator.rb b/app/validators/reply_to_address_validator.rb index d3b49fdef6..2fb2e3a40c 100644 --- a/app/validators/reply_to_address_validator.rb +++ b/app/validators/reply_to_address_validator.rb @@ -1,7 +1,7 @@ # Public: Validates that we can reply to a ReplyTo address. class ReplyToAddressValidator DEFAULT_NO_REPLY_REGEXP = - /^(postmaster|mailer-daemon|auto_reply|do.?not.?reply|no.?reply)$/.freeze + /^(postmaster|mailer-daemon|auto_reply|do.?not.?reply|no.?reply)$/ DEFAULT_INVALID_REPLY_ADDRESSES = [].freeze From 87e166e3e7e37cc15aaceeb071b0159759276c7c Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 27 Feb 2023 15:53:27 +0000 Subject: [PATCH 215/289] Style: MultilineBlockChain (RuboCop) Not an ideal solution due to line lengths, but the refactoring required to fix that is beyond the scope of this commit --- app/controllers/user_controller.rb | 15 +++++++++------ app/models/concerns/translatable.rb | 8 +++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 73769a8cb3..cfd31f948d 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -286,12 +286,15 @@ def signchangeemail # River of News: What's happening with your tracked things def river @results = if @user.nil? - [] -else - @user.track_things.collect { |thing| - perform_search([InfoRequestEvent], thing.track_query, thing.params[:feed_sortby], nil).results - }.flatten.sort { |a,b| b[:model].created_at <=> a[:model].created_at }.first(20) -end + [] + else + @user. + track_things. + collect { |thing| perform_search([InfoRequestEvent], thing.track_query, thing.params[:feed_sortby], nil).results }. + flatten. + sort { |a,b| b[:model].created_at <=> a[:model].created_at }. + first(20) + end end def set_profile_photo diff --git a/app/models/concerns/translatable.rb b/app/models/concerns/translatable.rb index 47a040ade9..6bd303e2d2 100644 --- a/app/models/concerns/translatable.rb +++ b/app/models/concerns/translatable.rb @@ -14,11 +14,9 @@ def translated_versions end def ordered_translations - translations.select do |translation| - AlaveteliLocalization.available_locales.include?(translation.locale.to_s) - end.sort_by do |translation| - AlaveteliLocalization.available_locales.index(translation.locale.to_s) - end + translations. + select { |translation| AlaveteliLocalization.available_locales.include?(translation.locale.to_s) }. + sort_by { |translation| AlaveteliLocalization.available_locales.index(translation.locale.to_s) } end def build_all_translations From e7224b23cc1eeefa56cdf7dd970c038fb945028a Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 27 Feb 2023 16:06:37 +0000 Subject: [PATCH 216/289] Style: CaseEquality (RuboCop) --- app/helpers/highlight_helper.rb | 2 +- spec/controllers/public_body_controller_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/highlight_helper.rb b/app/helpers/highlight_helper.rb index ec1c77179d..8258337f30 100644 --- a/app/helpers/highlight_helper.rb +++ b/app/helpers/highlight_helper.rb @@ -13,7 +13,7 @@ def highlight_matches(text, phrases, options = {}) text else match = Array(phrases).map do |p| - Regexp === p ? p.to_s : Regexp.escape(p) + p.is_a?(Regexp) ? p.to_s : Regexp.escape(p) end.join('|') if block_given? diff --git a/spec/controllers/public_body_controller_spec.rb b/spec/controllers/public_body_controller_spec.rb index ba9dfafb2b..a7fd6a011c 100644 --- a/spec/controllers/public_body_controller_spec.rb +++ b/spec/controllers/public_body_controller_spec.rb @@ -158,7 +158,7 @@ def make_single_language_example(locale) get :list, params: { locale: 'es' } pb_ids = assigns[:public_bodies].map(&:id) unique_pb_ids = pb_ids.uniq - expect(pb_ids.sort).to be === unique_pb_ids.sort + expect(pb_ids.sort).to eq(unique_pb_ids.sort) end it 'should show public body names in the selected locale language if present' do From 96634969cd4fc0c9f7818dc4a38e456089212ae8 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 27 Feb 2023 16:31:42 +0000 Subject: [PATCH 217/289] Style: SpecialGlobalVars (RuboCop) --- config/initializers/alaveteli.rb | 2 +- gems/alaveteli_features/alaveteli_features.gemspec | 3 ++- lib/acts_as_xapian/acts_as_xapian.rb | 3 ++- lib/mail_handler.rb | 9 +++++---- script/switch-theme.rb | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/config/initializers/alaveteli.rb b/config/initializers/alaveteli.rb index b1f3c38dcc..3965f98998 100644 --- a/config/initializers/alaveteli.rb +++ b/config/initializers/alaveteli.rb @@ -1,5 +1,5 @@ # MySociety specific helper functions -$:.push(File.join(File.dirname(__FILE__), '../../commonlib/rblib')) +$LOAD_PATH.push(File.join(File.dirname(__FILE__), '../../commonlib/rblib')) # ... if these fail to include, you need the commonlib submodule from git # (type "git submodule update --init" in the whatdotheyknow directory) diff --git a/gems/alaveteli_features/alaveteli_features.gemspec b/gems/alaveteli_features/alaveteli_features.gemspec index da07c0c89d..68a338bdb3 100644 --- a/gems/alaveteli_features/alaveteli_features.gemspec +++ b/gems/alaveteli_features/alaveteli_features.gemspec @@ -1,3 +1,4 @@ +require 'English' lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'alaveteli_features/version' @@ -12,7 +13,7 @@ Gem::Specification.new do |spec| spec.homepage = "https://alaveteli.org" spec.license = "MIT" - spec.files = `git ls-files`.split($/) + spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] diff --git a/lib/acts_as_xapian/acts_as_xapian.rb b/lib/acts_as_xapian/acts_as_xapian.rb index 25fb93248b..22d6b82d5b 100644 --- a/lib/acts_as_xapian/acts_as_xapian.rb +++ b/lib/acts_as_xapian/acts_as_xapian.rb @@ -12,6 +12,7 @@ # Make it so if Xapian isn't installed, the Rails app doesn't fail completely, # just when somebody does a search. +require 'English' begin require 'xapian' $acts_as_xapian_bindings_available = true @@ -908,7 +909,7 @@ def self._destroy_and_rebuild_index_safely(model_classes, verbose, terms, values pid = Process.fork # TODO: this will only work on Unix, tough if pid Process.waitpid(pid) - raise "batch fork child failed, exiting also" unless $?.success? + raise "batch fork child failed, exiting also" unless $CHILD_STATUS.success? # database connection doesn't survive a fork, rebuild it else # fully reopen the database each time (with a new object) diff --git a/lib/mail_handler.rb b/lib/mail_handler.rb index dec6cb8c0e..18cc6f4042 100644 --- a/lib/mail_handler.rb +++ b/lib/mail_handler.rb @@ -1,4 +1,5 @@ # Handles the parsing of email +require 'English' require 'tmpdir' module MailHandler @@ -20,9 +21,9 @@ def tnef_attachments(content) IO.popen("tnef -K -C #{dir} 2> /dev/null", "wb") do |f| f.write(content) f.close - raise IOError, "tnef exited with signal #{$?.termsig}" if $?.signaled? - if $?.exited? && $?.exitstatus != 0 - raise TNEFParsingError, "tnef exited with status #{$?.exitstatus}" + raise IOError, "tnef exited with signal #{$CHILD_STATUS.termsig}" if $CHILD_STATUS.signaled? + if $CHILD_STATUS.exited? && $CHILD_STATUS.exitstatus != 0 + raise TNEFParsingError, "tnef exited with status #{$CHILD_STATUS.exitstatus}" end end found = 0 @@ -131,7 +132,7 @@ def get_attachment_text_one_file(content_type, body, charset = 'utf-8') text += get_attachment_text_from_zip_file(zip_file) zip_file.close rescue - $stderr.puts("Error processing zip file: #{$!.inspect}") + $stderr.puts("Error processing zip file: #{$ERROR_INFO.inspect}") end end tempfile.close diff --git a/script/switch-theme.rb b/script/switch-theme.rb index f000178310..a93ae2bc96 100755 --- a/script/switch-theme.rb +++ b/script/switch-theme.rb @@ -72,7 +72,7 @@ def show_themes if ARGV.length == 1 requested_theme = ARGV[0] else - STDERR.puts "Usage: #{$0} " + STDERR.puts "Usage: #{$PROGRAM_NAME} " show_themes exit 1 end From d93b868d513a91a1947dbb9cf7e3ff3449cdf548 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 20 Feb 2023 10:34:09 +0000 Subject: [PATCH 218/289] Style: AndOr RuboCop refactor --- app/controllers/admin_public_body_controller.rb | 2 +- app/controllers/followups_controller.rb | 2 +- app/controllers/user_controller.rb | 2 +- app/mailers/application_mailer.rb | 2 +- app/models/holiday_import.rb | 2 +- app/models/incoming_message.rb | 2 +- app/models/info_request_event.rb | 2 +- app/models/public_body.rb | 4 ++-- lib/acts_as_xapian/acts_as_xapian.rb | 8 ++++---- lib/mail_handler.rb | 8 ++++---- lib/memory_profiler.rb | 2 +- lib/tasks/cleanup.rake | 2 +- lib/tasks/graphs.rake | 4 ++-- lib/tasks/themes.rake | 2 +- 14 files changed, 22 insertions(+), 22 deletions(-) diff --git a/app/controllers/admin_public_body_controller.rb b/app/controllers/admin_public_body_controller.rb index 58f0a13c50..5e35c6225c 100644 --- a/app/controllers/admin_public_body_controller.rb +++ b/app/controllers/admin_public_body_controller.rb @@ -127,7 +127,7 @@ def destroy def mass_tag lookup_query - if params[:tag] and params[:tag] != "" + if params[:tag] && (params[:tag] != "") if params[:table_name] == 'exact' bodies = @public_bodies_by_tag elsif params[:table_name] == 'substring' diff --git a/app/controllers/followups_controller.rb b/app/controllers/followups_controller.rb index dd1135d3b6..e5278ae283 100644 --- a/app/controllers/followups_controller.rb +++ b/app/controllers/followups_controller.rb @@ -63,7 +63,7 @@ def check_reedit end def check_request_matches_incoming_message - if @incoming_message and @info_request != @incoming_message.info_request + if @incoming_message && (@info_request != @incoming_message.info_request) raise ActiveRecord::RecordNotFound, "Incoming message #{@incoming_message.id} does not belong " \ "to request #{@info_request.id}" end diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index cfd31f948d..04091e9d27 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -247,7 +247,7 @@ def signchangeemail # if not already, send a confirmation link to the new email address which logs # them into the old email's user account, but with special user_circumstance - if !session[:user_circumstance] or (session[:user_circumstance] != "change_email") + if !session[:user_circumstance] || (session[:user_circumstance] != "change_email") # don't store the password in the db params[:signchangeemail].delete(:password) diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index 3379f5ab58..b89fee8b6e 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -39,7 +39,7 @@ def mail_user(user, subject, opts = {}) end def contact_for_user(user = nil) - if feature_enabled?(:alaveteli_pro) and user and user.is_pro? + if feature_enabled?(:alaveteli_pro) && user && user.is_pro? pro_contact_from_name_and_email else contact_from_name_and_email diff --git a/app/models/holiday_import.rb b/app/models/holiday_import.rb index 603ff53417..f566427781 100644 --- a/app/models/holiday_import.rb +++ b/app/models/holiday_import.rb @@ -88,7 +88,7 @@ def populate_from_ical_feed end def populate_from_ical_event(cal_event) - if cal_event.dtstart >= start_date and cal_event.dtstart <= end_date + if (cal_event.dtstart >= start_date) && (cal_event.dtstart <= end_date) holidays << Holiday.new(description: cal_event.summary, day: cal_event.dtstart) end diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index e4cc0ea360..e5e6450ef4 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -388,7 +388,7 @@ def get_main_body_text_part(leaves=[]) # instead use the first text attachment # e.g. http://www.whatdotheyknow.com/request/list_of_public_authorties) leaves.each do |p| - if p.content_type == 'text/plain' or p.content_type == 'text/html' + if (p.content_type == 'text/plain') || (p.content_type == 'text/html') return p end end diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index 0cf7211a12..492bb3a4a2 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -102,7 +102,7 @@ class InfoRequestEvent < ApplicationRecord end def must_be_valid_state - if described_state and !InfoRequest::State.all.include?(described_state) + if described_state && !InfoRequest::State.all.include?(described_state) errors.add(:described_state, "is not a valid state") end end diff --git a/app/models/public_body.rb b/app/models/public_body.rb index f14d2426be..fd97ebbf18 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -509,7 +509,7 @@ def self.import_csv_from_file(csv_filename, tag, tag_behaviour, dry_run, editor, line += 1 # Parse the first line as a field list if it starts with '#' - if line==1 and row.first.to_s =~ /^#(.*)$/ + if (line==1) && row.first.to_s =~(/^#(.*)$/) row[0] = row[0][1..-1] # Remove the # sign on first field row.each_with_index { |field, i| field_names[field] = i } next @@ -547,7 +547,7 @@ def self.import_csv_from_file(csv_filename, tag, tag_behaviour, dry_run, editor, end # Rollback if a dry run, or we had errors - raise ImportCSVDryRun if dry_run or errors.size > 0 + raise ImportCSVDryRun if dry_run || (errors.size > 0) end rescue ImportCSVDryRun # Ignore diff --git a/lib/acts_as_xapian/acts_as_xapian.rb b/lib/acts_as_xapian/acts_as_xapian.rb index 22d6b82d5b..e40894b073 100644 --- a/lib/acts_as_xapian/acts_as_xapian.rb +++ b/lib/acts_as_xapian/acts_as_xapian.rb @@ -951,7 +951,7 @@ def xapian_document_term def xapian_value(field, type = nil, index_translations = false) if index_translations && respond_to?("translations") - if type == :date or type == :boolean + if (type == :date) || (type == :boolean) value = single_xapian_value(field, type = type) else values = [] @@ -1024,7 +1024,7 @@ def xapian_index(terms = true, values = true, texts = true) # 1. Which terms to index? We allow the user to specify particular ones terms_to_index = [] drop_all_terms = false - if terms and xapian_options[:terms] + if terms && xapian_options[:terms] terms_to_index = xapian_options[:terms].dup if terms.is_a?(String) terms_to_index.reject! { |term| !terms.include?(term[1]) } @@ -1037,12 +1037,12 @@ def xapian_index(terms = true, values = true, texts = true) end # 2. Texts to index? Currently, it's all or nothing texts_to_index = [] - if texts and xapian_options[:texts] + if texts && xapian_options[:texts] texts_to_index = xapian_options[:texts] end # 3. Values to index? Currently, it's all or nothing values_to_index = [] - if values and xapian_options[:values] + if values && xapian_options[:values] values_to_index = xapian_options[:values] end diff --git a/lib/mail_handler.rb b/lib/mail_handler.rb index 18cc6f4042..7694f2f12a 100644 --- a/lib/mail_handler.rb +++ b/lib/mail_handler.rb @@ -42,13 +42,13 @@ def tnef_attachments(content) def normalise_content_type(content_type) # e.g. http://www.whatdotheyknow.com/request/93/response/250 - if content_type == 'application/excel' or content_type == 'application/msexcel' or content_type == 'application/x-ms-excel' + if (content_type == 'application/excel') || (content_type == 'application/msexcel') || (content_type == 'application/x-ms-excel') content_type = 'application/vnd.ms-excel' end - if content_type == 'application/mspowerpoint' or content_type == 'application/x-ms-powerpoint' + if (content_type == 'application/mspowerpoint') || (content_type == 'application/x-ms-powerpoint') content_type = 'application/vnd.ms-powerpoint' end - if content_type == 'application/msword' or content_type == 'application/x-ms-word' + if (content_type == 'application/msword') || (content_type == 'application/x-ms-word') content_type = 'application/vnd.ms-word' end if content_type == 'application/x-zip-compressed' @@ -56,7 +56,7 @@ def normalise_content_type(content_type) end # e.g. http://www.whatdotheyknow.com/request/copy_of_current_swessex_scr_opt#incoming-9928 - if content_type == 'application/acrobat' or content_type == 'document/pdf' + if (content_type == 'application/acrobat') || (content_type == 'document/pdf') content_type = 'application/pdf' end diff --git a/lib/memory_profiler.rb b/lib/memory_profiler.rb index b7bd56bb78..bc01745edc 100644 --- a/lib/memory_profiler.rb +++ b/lib/memory_profiler.rb @@ -35,7 +35,7 @@ def self.start(opt={}) ObjectSpace.each_object do |o| curr[o.class] += 1 #Marshal.dump(o).size rescue 1 - curr_strings.push o if opt[:string_debug] and o.class == String + curr_strings.push o if opt[:string_debug] && (o.class == String) end if opt[:string_debug] diff --git a/lib/tasks/cleanup.rake b/lib/tasks/cleanup.rake index 5239dc8234..863bb70733 100644 --- a/lib/tasks/cleanup.rake +++ b/lib/tasks/cleanup.rake @@ -8,7 +8,7 @@ namespace :cleanup do holding_pen.info_request_events. where(event_type: %w(redeliver_incoming destroy_incoming)). find_each do |event| - $stderr.puts event.inspect if verbose or dryrun + $stderr.puts event.inspect if verbose || dryrun event.destroy unless dryrun end end diff --git a/lib/tasks/graphs.rake b/lib/tasks/graphs.rake index f7acb33215..bd0511ca7a 100644 --- a/lib/tasks/graphs.rake +++ b/lib/tasks/graphs.rake @@ -94,7 +94,7 @@ namespace :graphs do all_users = select_as_columns(aggregate_signups) # nothing to do, bail - unless all_users and all_users[0].size >= minimum_data_size + unless all_users && (all_users[0].size >= minimum_data_size) if verbose exit "warning: no request data to graph, skipping task" else @@ -219,7 +219,7 @@ namespace :graphs do # nothing to do, bail # (both nil and a single datapoint will result in an undrawable graph) - unless all_requests and all_requests[0].size >= minimum_data_size + unless all_requests && (all_requests[0].size >= minimum_data_size) if verbose abort "warning: no request data to graph, skipping task" else diff --git a/lib/tasks/themes.rake b/lib/tasks/themes.rake index c23f6e6d33..3df338b827 100644 --- a/lib/tasks/themes.rake +++ b/lib/tasks/themes.rake @@ -84,7 +84,7 @@ namespace :themes do puts "Failed to find #{committish}; skipping..." if verbose end end - puts "Falling to using HEAD instead" if all_failed and verbose + puts "Falling to using HEAD instead" if all_failed && verbose end def install_theme(theme_url, verbose, deprecated=false) From 67f9db7ac3ace68808ba36cf2a5b38d8dc159463 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 20 Feb 2023 10:39:07 +0000 Subject: [PATCH 219/289] Style: TrailingCommaInArrayLiteral RuboCop --- app/controllers/admin_general_controller.rb | 2 +- app/models/foi_attachment.rb | 4 ++-- app/models/info_request_event.rb | 2 +- app/models/public_body.rb | 2 +- lib/tasks/cleanup.rake | 2 +- lib/world_foi_websites.rb | 2 +- spec/controllers/general_controller_spec.rb | 4 ++-- spec/lib/typeahead_search_spec.rb | 2 +- spec/models/incoming_message_spec.rb | 8 ++++---- spec/models/mail_server_log_spec.rb | 2 +- spec/models/public_body_spec.rb | 14 +++++++------- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/app/controllers/admin_general_controller.rb b/app/controllers/admin_general_controller.rb index 9a31fd3e36..ba9a506f79 100644 --- a/app/controllers/admin_general_controller.rb +++ b/app/controllers/admin_general_controller.rb @@ -81,7 +81,7 @@ def index @embargoed_request_tasks = [ @embargoed_requires_admin_requests, @embargoed_error_message_requests, - @embargoed_attention_requests, + @embargoed_attention_requests ].any? { |to_do_list| ! to_do_list.empty? } @embargoed_attention_comments = Comment. diff --git a/app/models/foi_attachment.rb b/app/models/foi_attachment.rb index 3529801460..f67986eed4 100644 --- a/app/models/foi_attachment.rb +++ b/app/models/foi_attachment.rb @@ -256,7 +256,7 @@ def has_google_docs_viewer? "application/vnd.openxmlformats-officedocument.presentationml.presentation", # .pptx "application/vnd.ms-excel", # .xls - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", # .xlsx + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" # .xlsx ].include?(content_type) end @@ -264,7 +264,7 @@ def has_google_docs_viewer? def has_body_as_html? [ "text/plain", - "application/rtf", + "application/rtf" ].include?(content_type) || has_google_docs_viewer? end diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index 492bb3a4a2..9fffd50cd7 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -116,7 +116,7 @@ def must_be_valid_state [ :created_at_numeric, 1, "created_at", :number ], # for sorting [ :described_at_numeric, 2, "described_at", :number ], # TODO: using :number for lack of :datetime support in Xapian values [ :request, 3, "request_collapse", :string ], - [ :request_title_collapse, 4, "request_title_collapse", :string ], + [ :request_title_collapse, 4, "request_title_collapse", :string ] ], terms: [ [ :calculated_state, 'S', "status" ], [ :requested_by, 'B', "requested_by" ], diff --git a/app/models/public_body.rb b/app/models/public_body.rb index fd97ebbf18..c1d862d2cf 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -56,7 +56,7 @@ def self.admin_title ['publication_scheme', '(i18n)'], ['disclosure_log', '(i18n)'], ['home_page', ''], - ['tag_string', '(tags separated by spaces)'], + ['tag_string', '(tags separated by spaces)'] ] end diff --git a/lib/tasks/cleanup.rake b/lib/tasks/cleanup.rake index 863bb70733..b62367d4fb 100644 --- a/lib/tasks/cleanup.rake +++ b/lib/tasks/cleanup.rake @@ -81,7 +81,7 @@ namespace :cleanup do request.public_body_id, request.public_body.name, request.public_body.request_email, - request.created_at.to_s, + request.created_at.to_s ] end end diff --git a/lib/world_foi_websites.rb b/lib/world_foi_websites.rb index 349bbf31a5..822d66de8f 100644 --- a/lib/world_foi_websites.rb +++ b/lib/world_foi_websites.rb @@ -140,7 +140,7 @@ def self.world_foi_websites { name: 'Derecho al Dato', country_name: 'Argentina', country_iso_code: 'AR', - url: 'https://derechoaldato.com.ar/' }, + url: 'https://derechoaldato.com.ar/' } ] world_foi_websites end diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb index d16cc5ad27..1960f63347 100644 --- a/spec/controllers/general_controller_spec.rb +++ b/spec/controllers/general_controller_spec.rb @@ -259,7 +259,7 @@ info_request_events(:useless_outgoing_message_event), info_request_events(:silly_outgoing_message_event), info_request_events(:useful_incoming_message_event), - info_request_events(:another_useful_incoming_message_event), + info_request_events(:another_useful_incoming_message_event) ]) expect(assigns[:xapian_users].results.map { |x| x[:model] }).to eq([users(:bob_smith_user)]) expect(assigns[:xapian_bodies].results).to eq([]) @@ -289,7 +289,7 @@ info_request_events(:useless_outgoing_message_event), info_request_events(:silly_outgoing_message_event), info_request_events(:useful_incoming_message_event), - info_request_events(:another_useful_incoming_message_event), + info_request_events(:another_useful_incoming_message_event) ]) expect(assigns[:xapian_users]).to eq(nil) expect(assigns[:xapian_bodies]).to eq(nil) diff --git a/spec/lib/typeahead_search_spec.rb b/spec/lib/typeahead_search_spec.rb index e68d35cb15..2c5f00eb80 100644 --- a/spec/lib/typeahead_search_spec.rb +++ b/spec/lib/typeahead_search_spec.rb @@ -133,7 +133,7 @@ def search_bodies(xapian_search) expect(search_info_requests(search)).to match_array([ info_requests(:fancy_dog_request), info_requests(:naughty_chicken_request), - info_requests(:another_boring_request), + info_requests(:another_boring_request) ]) end diff --git a/spec/models/incoming_message_spec.rb b/spec/models/incoming_message_spec.rb index 217ac3279d..cd5f967caf 100644 --- a/spec/models/incoming_message_spec.rb +++ b/spec/models/incoming_message_spec.rb @@ -899,7 +899,7 @@ def populate_raw_email(fixture) im.extract_attachments! expect(im.get_attachments_for_display.map(&:display_filename)).to eq([ - 'bah.txt', + 'bah.txt' ]) end @@ -946,7 +946,7 @@ def populate_raw_email(fixture) expect(attachments.map(&:display_filename)).to eq([ 'Same attachment twice.txt', 'hello.txt', - 'hello.txt', + 'hello.txt' ]) end @@ -985,7 +985,7 @@ def populate_raw_email(fixture) expect(im.get_attachments_for_display.map(&:display_filename)).to eq([ 'test.html', # picks HTML rather than text by default, as likely to render better - 'attach.txt', + 'attach.txt' ]) end end @@ -1011,7 +1011,7 @@ def populate_raw_email(fixture) expect(im.get_attachments_for_display.map(&:display_filename)).to eq([ 'FOI 09 02976i.doc', - 'FOI 09 02976iii.doc', + 'FOI 09 02976iii.doc' ]) end diff --git a/spec/models/mail_server_log_spec.rb b/spec/models/mail_server_log_spec.rb index 85e160f7f3..4a90d64790 100644 --- a/spec/models/mail_server_log_spec.rb +++ b/spec/models/mail_server_log_spec.rb @@ -215,7 +215,7 @@ "Oct 3 16:39:35 host postfix/qmgr[15615]: CB55836EE58C: from=, size=1695, nrcpt=1 (queue active)", "Oct 3 16:39:38 host postfix/smtp[7676]: CB55836EE58C: to=, relay=aspmx.l.google.com[74.125.25.27]:25, delay=2.5, delays=0.13/0.02/1.7/0.59, dsn=2.0.0, status=sent (250 2.0.0 OK 1349246383 j9si1676296paw.328)", "Oct 3 16:39:38 host postfix/smtp[1681]: 9634B16F7F7: to=, relay=none, delay=46, status=deferred (connect to 216.150.150.131[216.150.150.131]: No route to host)", - "Oct 3 16:39:38 host postfix/qmgr[15615]: CB55836EE58C: removed", + "Oct 3 16:39:38 host postfix/qmgr[15615]: CB55836EE58C: removed" ]} describe ".load_postfix_log_data" do diff --git a/spec/models/public_body_spec.rb b/spec/models/public_body_spec.rb index c18e12ec92..c273f81236 100644 --- a/spec/models/public_body_spec.rb +++ b/spec/models/public_body_spec.rb @@ -1397,7 +1397,7 @@ def set_default_attributes(public_body) expect(notes[0..2]).to eq([ "line 2: creating new authority 'North West Fake Authority' (locale: en):\n\t\{\"name\":\"North West Fake Authority\",\"request_email\":\"north_west_foi@localhost\",\"home_page\":\"http://northwest.org\"\}", "line 3: creating new authority 'Scottish Fake Authority' (locale: en):\n\t\{\"name\":\"Scottish Fake Authority\",\"request_email\":\"scottish_foi@localhost\",\"home_page\":\"http://scottish.org\",\"tag_string\":\"scottish\"\}", - "line 4: creating new authority 'Fake Authority of Northern Ireland' (locale: en):\n\t\{\"name\":\"Fake Authority of Northern Ireland\",\"request_email\":\"ni_foi@localhost\",\"tag_string\":\"fake aTag\"\}", + "line 4: creating new authority 'Fake Authority of Northern Ireland' (locale: en):\n\t\{\"name\":\"Fake Authority of Northern Ireland\",\"request_email\":\"ni_foi@localhost\",\"tag_string\":\"fake aTag\"\}" ]) expect(notes[3]).to match(/Notes: Some bodies are in database, but not in CSV file:\n( .+\n)*You may want to delete them manually.\n/) @@ -1723,7 +1723,7 @@ def set_default_attributes(public_body) "line 3: creating new authority 'Scottish Fake Authority' (locale: en):\n\t{\"name\":\"Scottish Fake Authority\",\"request_email\":\"scottish_foi@localhost\",\"home_page\":\"http://scottish.org\",\"tag_string\":\"scottish\"}", "line 3: creating new authority 'Scottish Fake Authority' (locale: es):\n\t{\"name\":\"Autoridad Escocesa\"}", "line 4: creating new authority 'Fake Authority of Northern Ireland' (locale: en):\n\t{\"name\":\"Fake Authority of Northern Ireland\",\"request_email\":\"ni_foi@localhost\",\"tag_string\":\"fake aTag\"}", - "line 4: creating new authority 'Fake Authority of Northern Ireland' (locale: es):\n\t{\"name\":\"Autoridad Irlandesa\"}", + "line 4: creating new authority 'Fake Authority of Northern Ireland' (locale: es):\n\t{\"name\":\"Autoridad Irlandesa\"}" ]) expect(notes[6]).to match(/Notes: Some bodies are in database, but not in CSV file:\n( .+\n)*You may want to delete them manually.\n/) @@ -1749,7 +1749,7 @@ def set_default_attributes(public_body) expect(notes[0..2]).to eq([ "line 2: creating new authority 'North West Fake Authority' (locale: en):\n\t{\"name\":\"North West Fake Authority\",\"request_email\":\"north_west_foi@localhost\",\"home_page\":\"http://northwest.org\"}", "line 3: creating new authority 'Scottish Fake Authority' (locale: en):\n\t{\"name\":\"Scottish Fake Authority\",\"request_email\":\"scottish_foi@localhost\",\"home_page\":\"http://scottish.org\",\"tag_string\":\"scottish\"}", - "line 4: creating new authority 'Fake Authority of Northern Ireland' (locale: en):\n\t{\"name\":\"Fake Authority of Northern Ireland\",\"request_email\":\"ni_foi@localhost\",\"tag_string\":\"fake aTag\"}", + "line 4: creating new authority 'Fake Authority of Northern Ireland' (locale: en):\n\t{\"name\":\"Fake Authority of Northern Ireland\",\"request_email\":\"ni_foi@localhost\",\"tag_string\":\"fake aTag\"}" ]) expect(notes[3]).to match(/Notes: Some bodies are in database, but not in CSV file:\n( .+\n)*You may want to delete them manually.\n/) @@ -1819,7 +1819,7 @@ def set_default_attributes(public_body) ['publication_scheme', '(i18n)'], ['disclosure_log', '(i18n)'], ['home_page', ''], - ['tag_string', '(tags separated by spaces)'], + ['tag_string', '(tags separated by spaces)'] ] expect(PublicBody.csv_import_fields).to eq(expected_fields) @@ -1829,7 +1829,7 @@ def set_default_attributes(public_body) old_csv_import_fields = PublicBody.csv_import_fields.clone expected_fields = [ ['name', '(i18n)Existing records cannot be renamed'], - ['short_name', '(i18n)'], + ['short_name', '(i18n)'] ] PublicBody.csv_import_fields = expected_fields @@ -1850,7 +1850,7 @@ def set_default_attributes(public_body) ['disclosure_log', '(i18n)'], ['home_page', ''], ['tag_string', '(tags separated by spaces)'], - ['a_new_field', ''], + ['a_new_field', ''] ] PublicBody.csv_import_fields << ['a_new_field', ''] @@ -1871,7 +1871,7 @@ def set_default_attributes(public_body) expect(notes.size).to eq(3) expect(notes[0..1]).to eq([ "line 2: creating new authority 'Test' (locale: en):\n\t{\"name\":\"Test\",\"request_email\":\"test@test.es\",\"home_page\":\"http://www.test.es/\",\"tag_string\":\"37\"}", - "line 2: creating new authority 'Test' (locale: es):\n\t{\"name\":\"Test\"}", + "line 2: creating new authority 'Test' (locale: es):\n\t{\"name\":\"Test\"}" ]) expect(notes[2]).to match(/Notes: Some bodies are in database, but not in CSV file:\n( .+\n)*You may want to delete them manually.\n/) From b42ed65c96fbee6f32cb44c951a12573ed17a18e Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 20 Feb 2023 10:44:07 +0000 Subject: [PATCH 220/289] Style: IfInsideElse RuboCop --- app/controllers/admin_controller.rb | 52 +++++++++---------- app/controllers/application_controller.rb | 8 ++- .../password_changes_controller.rb | 14 +++-- app/controllers/request_controller.rb | 12 ++--- app/controllers/user_controller.rb | 40 +++++++------- app/controllers/users/messages_controller.rb | 24 ++++----- app/controllers/users/sessions_controller.rb | 27 +++++----- app/helpers/info_request_helper.rb | 12 ++--- app/models/ability.rb | 4 +- app/models/incoming_message.rb | 6 +-- app/models/info_request.rb | 8 ++- .../info_request/response_rejection/bounce.rb | 12 ++--- lib/acts_as_xapian/acts_as_xapian.rb | 10 ++-- lib/alaveteli_external_command.rb | 8 ++- lib/mail_handler/backends/mail_backend.rb | 28 +++++----- lib/tasks/themes.rake | 4 +- 16 files changed, 119 insertions(+), 150 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 1672a3b709..ba1eeab5c4 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -41,35 +41,31 @@ def authenticate if AlaveteliConfiguration.skip_admin_auth session[:using_admin] = 1 nil - else - if session[:using_admin].nil? || session[:admin_name].nil? - if params[:emergency].nil? || AlaveteliConfiguration.disable_emergency_user - if !authenticated? - ask_to_login( - web: _('To log into the administrative interface'), - email: _('Then you can log into the administrative interface'), - email_subject: _('Log into the admin interface'), - user_name: 'a superuser' - ) - else - if !@user.nil? && @user.is_admin? - session[:using_admin] = 1 - session[:admin_name] = @user.url_name - else - session[:using_admin] = nil - session[:user_id] = nil - session[:admin_name] = nil - authenticate - end - end + elsif session[:using_admin].nil? || session[:admin_name].nil? + if params[:emergency].nil? || AlaveteliConfiguration.disable_emergency_user + if !authenticated? + ask_to_login( + web: _('To log into the administrative interface'), + email: _('Then you can log into the administrative interface'), + email_subject: _('Log into the admin interface'), + user_name: 'a superuser' + ) + elsif !@user.nil? && @user.is_admin? + session[:using_admin] = 1 + session[:admin_name] = @user.url_name else - authenticate_or_request_with_http_basic do |user_name, password| - if user_name == AlaveteliConfiguration.admin_username && password == AlaveteliConfiguration.admin_password - session[:using_admin] = 1 - session[:admin_name] = user_name - else - request_http_basic_authentication - end + session[:using_admin] = nil + session[:user_id] = nil + session[:admin_name] = nil + authenticate + end + else + authenticate_or_request_with_http_basic do |user_name, password| + if user_name == AlaveteliConfiguration.admin_username && password == AlaveteliConfiguration.admin_password + session[:using_admin] = 1 + session[:admin_name] = user_name + else + request_http_basic_authentication end end end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ddc80c855d..674952c1a2 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -318,12 +318,10 @@ def add_post_redirect_param_to_uri(uri) else uri += "&post_redirect=1" end + elsif uri.include?("#") + uri.sub!("#", "?post_redirect=1#") else - if uri.include?("#") - uri.sub!("#", "?post_redirect=1#") - else - uri += "?post_redirect=1" - end + uri += "?post_redirect=1" end uri end diff --git a/app/controllers/password_changes_controller.rb b/app/controllers/password_changes_controller.rb index 78a3882671..2aa2878148 100644 --- a/app/controllers/password_changes_controller.rb +++ b/app/controllers/password_changes_controller.rb @@ -94,17 +94,15 @@ def update redirect_to SafeRedirect.new(@pretoken_redirect.uri).path, notice: _('Your password has been changed.') end - else - if otp_enabled?(@password_change_user) - msg = _("Your password has been changed. " \ + elsif otp_enabled?(@password_change_user) + msg = _("Your password has been changed. " \ "You also have a new one time passcode which you'll " \ "need next time you want to change your password") redirect_to one_time_password_path, notice: msg - else - msg = _('Your password has been changed.') - redirect_to show_user_profile_path(@password_change_user.url_name), - notice: msg - end + else + msg = _('Your password has been changed.') + redirect_to show_user_profile_path(@password_change_user.url_name), + notice: msg end else render :edit diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index aaf7f12a8a..e4692be147 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -671,14 +671,12 @@ def render_new_compose if @info_request.public_body.is_requestable? render action: 'new' + elsif @info_request.public_body.not_requestable_reason == 'bad_contact' + render action: 'new_bad_contact' else - if @info_request.public_body.not_requestable_reason == 'bad_contact' - render action: 'new_bad_contact' - else - # if not requestable because defunct or not_apply, redirect to main page - # (which doesn't link to the /new/ URL) - redirect_to public_body_url(@info_request.public_body) - end + # if not requestable because defunct or not_apply, redirect to main page + # (which doesn't link to the /new/ URL) + redirect_to public_body_url(@info_request.public_body) end nil diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 04091e9d27..f64373a247 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -155,26 +155,26 @@ def signup else # New unconfirmed user - # Block signups from suspicious countries - # TODO: Add specs (see RequestController#create) - # TODO: Extract to UserSpamScorer? - if blocked_ip?(country_from_ip, @user_signup) - handle_blocked_ip(@user_signup) && return - end - - # Rate limit signups - ip_rate_limiter.record(user_ip) - - if ip_rate_limiter.limit?(user_ip) - handle_rate_limited_signup(user_ip, @user_signup.email) && return - end - - # Prevent signups from potential spammers - if spam_user?(@user_signup) - handle_spam_user(@user_signup) do - render action: 'sign' - end && return - end + # Block signups from suspicious countries + # TODO: Add specs (see RequestController#create) + # TODO: Extract to UserSpamScorer? + if blocked_ip?(country_from_ip, @user_signup) + handle_blocked_ip(@user_signup) && return + end + + # Rate limit signups + ip_rate_limiter.record(user_ip) + + if ip_rate_limiter.limit?(user_ip) + handle_rate_limited_signup(user_ip, @user_signup.email) && return + end + + # Prevent signups from potential spammers + if spam_user?(@user_signup) + handle_spam_user(@user_signup) do + render action: 'sign' + end && return + end @user_signup.email_confirmed = false @user_signup.save! diff --git a/app/controllers/users/messages_controller.rb b/app/controllers/users/messages_controller.rb index 4a6af1c9c0..93a66ffdfd 100644 --- a/app/controllers/users/messages_controller.rb +++ b/app/controllers/users/messages_controller.rb @@ -15,20 +15,18 @@ def contact if @recaptcha_required && !verify_recaptcha flash.now[:error] = _('There was an error with the reCAPTCHA. ' \ 'Please try again.') - else - if @contact.valid? - if spam_user_message?(params[:contact][:message], @user) - handle_spam_user_message(@user) && return - end - - send_message(@user, @recipient_user) - @user.user_messages.create - - flash[:notice] = _('Your message to {{recipient_user_name}} has ' \ - 'been sent!', - recipient_user_name: @recipient_user.name.html_safe) - redirect_to user_url(@recipient_user) + elsif @contact.valid? + if spam_user_message?(params[:contact][:message], @user) + handle_spam_user_message(@user) && return end + + send_message(@user, @recipient_user) + @user.user_messages.create + + flash[:notice] = _('Your message to {{recipient_user_name}} has ' \ + 'been sent!', + recipient_user_name: @recipient_user.name.html_safe) + redirect_to user_url(@recipient_user) end end diff --git a/app/controllers/users/sessions_controller.rb b/app/controllers/users/sessions_controller.rb index 1b8f0252c7..c5e1fe1e03 100644 --- a/app/controllers/users/sessions_controller.rb +++ b/app/controllers/users/sessions_controller.rb @@ -33,27 +33,24 @@ def create # Failed to authenticate clear_session_credentials render template: 'user/sign' - else + elsif @user_signin.email_confirmed # Successful login - if @user_signin.email_confirmed - + if spam_user?(@user_signin) # Prevent signins from potential spammers - if spam_user?(@user_signin) - handle_spam_user(@user_signin) do - render template: 'user/sign' - end && return - end + handle_spam_user(@user_signin) do + render template: 'user/sign' + end && return + end - sign_in(@user_signin, remember_me: params[:remember_me].present?) + sign_in(@user_signin, remember_me: params[:remember_me].present?) - if is_modal_dialog - render template: 'users/sessions/show' - else - do_post_redirect @post_redirect, @user_signin - end + if is_modal_dialog + render template: 'users/sessions/show' else - send_confirmation_mail @user_signin + do_post_redirect @post_redirect, @user_signin end + else + send_confirmation_mail @user_signin end rescue ActionController::ParameterMissing flash[:error] = _('Invalid form submission') diff --git a/app/helpers/info_request_helper.rb b/app/helpers/info_request_helper.rb index 1ef7a7cd9b..3954b2814b 100644 --- a/app/helpers/info_request_helper.rb +++ b/app/helpers/info_request_helper.rb @@ -42,14 +42,12 @@ def status_text_awaiting_description(info_request, opts = {}) if is_owning_user && !info_request.is_external? && !render_to_file status_text_awaiting_description_owner_please_answer( new_responses_count) + elsif old_unclassified + status_text_awaiting_description_old_unclassified( + new_responses_count) else - if old_unclassified - status_text_awaiting_description_old_unclassified( - new_responses_count) - else - status_text_awaiting_description_other(info_request, - new_responses_count) - end + status_text_awaiting_description_other(info_request, + new_responses_count) end end diff --git a/app/models/ability.rb b/app/models/ability.rb index 645fad5da5..03422dea5c 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -209,8 +209,8 @@ def initialize(user, project: nil, public_token: false) if feature_enabled? :alaveteli_pro can :read, :api_key if user && user.is_pro_admin? - else - can :read, :api_key if user && user.is_admin? + elsif user && user.is_admin? + can :read, :api_key end if feature_enabled? :projects diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index e5e6450ef4..f91eda86a3 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -522,10 +522,8 @@ def get_body_for_html_display(collapse_quoted_sections = true) end # and display link for quoted stuff text = text.gsub(/FOLDED_QUOTED_SECTION/, "\n\n" + ''+_("show quoted sections")+'' + "\n\n") - else - if folded_quoted_text.include?('FOLDED_QUOTED_SECTION') - text = text + "\n\n" + ''+_("hide quoted sections")+'' - end + elsif folded_quoted_text.include?('FOLDED_QUOTED_SECTION') + text = text + "\n\n" + ''+_("hide quoted sections")+'' end text.strip! diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 8f0c8ab8a0..6df03f08f9 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -858,12 +858,10 @@ def email_subject_followup(opts = {}) html = opts.fetch(:html, true) if incoming_message.nil? || !incoming_message.valid_to_reply_to? || !incoming_message.subject 'Re: ' + email_subject_request(html: html) + elsif incoming_message.subject.match(/^Re:/i) + incoming_message.subject else - if incoming_message.subject.match(/^Re:/i) - incoming_message.subject - else - 'Re: ' + incoming_message.subject - end + 'Re: ' + incoming_message.subject end end diff --git a/app/models/info_request/response_rejection/bounce.rb b/app/models/info_request/response_rejection/bounce.rb index 93b4651f23..0649d91452 100644 --- a/app/models/info_request/response_rejection/bounce.rb +++ b/app/models/info_request/response_rejection/bounce.rb @@ -8,14 +8,12 @@ def reject(_reason = nil) # to, or the mail is spoofing the request address, and we'll end up # in a loop if we bounce it. true + elsif info_request.is_external? + true else - if info_request.is_external? - true - else - RequestMailer. - stopped_responses(info_request, email, raw_email_data). - deliver_now - end + RequestMailer. + stopped_responses(info_request, email, raw_email_data). + deliver_now end end end diff --git a/lib/acts_as_xapian/acts_as_xapian.rb b/lib/acts_as_xapian/acts_as_xapian.rb index e40894b073..fd572e2444 100644 --- a/lib/acts_as_xapian/acts_as_xapian.rb +++ b/lib/acts_as_xapian/acts_as_xapian.rb @@ -987,13 +987,11 @@ def single_xapian_value(field, type = nil) end elsif type == :boolean value ? true : false - else + elsif value.kind_of?(Array) # Arrays are for terms which require multiple of them, e.g. tags - if value.is_a?(Array) - value.map(&:to_s) - else - value.to_s - end + value.map(&:to_s) + else + value.to_s end end diff --git a/lib/alaveteli_external_command.rb b/lib/alaveteli_external_command.rb index 67c13a9f39..c6f7e3e91e 100644 --- a/lib/alaveteli_external_command.rb +++ b/lib/alaveteli_external_command.rb @@ -62,13 +62,11 @@ def run(*args) $stderr.puts(%Q[External Command: Error from command "#{program_name} #{args.join(' ')}":]) $stderr.print(xc.err) nil + elsif opts.has_key? :append_to + opts[:append_to] << "\n\n" else - if opts.has_key? :append_to - opts[:append_to] << "\n\n" - else - xc.out - end + xc.out end end diff --git a/lib/mail_handler/backends/mail_backend.rb b/lib/mail_handler/backends/mail_backend.rb index 13c2115cc5..e5830afa07 100644 --- a/lib/mail_handler/backends/mail_backend.rb +++ b/lib/mail_handler/backends/mail_backend.rb @@ -260,13 +260,11 @@ def expand_and_normalize_parts(part, parent_mail) def count_parts(part, parent_mail) if part.multipart? part.parts.each { |p| count_parts(p, parent_mail) } + elsif part.rfc822_attachment + count_parts(part.rfc822_attachment, parent_mail) else - if part.rfc822_attachment - count_parts(part.rfc822_attachment, parent_mail) - else - parent_mail.count_parts_count += 1 - part.url_part_number = parent_mail.count_parts_count - end + parent_mail.count_parts_count += 1 + part.url_part_number = parent_mail.count_parts_count end parent_mail.count_first_uudecode_count = parent_mail.count_parts_count end @@ -321,17 +319,15 @@ def _get_attachment_leaves_recursive(part, within_rfc822_attachment, parent_mail parent_mail) end end - else + elsif part.rfc822_attachment # Add all the parts of a decoded attached message - if part.rfc822_attachment - leaves_found += _get_attachment_leaves_recursive(part.rfc822_attachment, - part.rfc822_attachment, - parent_mail) - else - # Store leaf - part.within_rfc822_attachment = within_rfc822_attachment - leaves_found += [part] - end + leaves_found += _get_attachment_leaves_recursive(part.rfc822_attachment, + part.rfc822_attachment, + parent_mail) + else + # Store leaf + part.within_rfc822_attachment = within_rfc822_attachment + leaves_found += [part] end leaves_found end diff --git a/lib/tasks/themes.rake b/lib/tasks/themes.rake index 3df338b827..572b1702da 100644 --- a/lib/tasks/themes.rake +++ b/lib/tasks/themes.rake @@ -80,8 +80,8 @@ namespace :themes do Git.checkout theme_directory, committish all_failed = false break - else - puts "Failed to find #{committish}; skipping..." if verbose + elsif verbose + puts "Failed to find #{committish}; skipping..." end end puts "Falling to using HEAD instead" if all_failed && verbose From d4cc0ee77e687576c6ab292a23129f239f1c62f6 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 20 Feb 2023 11:02:22 +0000 Subject: [PATCH 221/289] Style: PreferredHashMethods RuboCop --- app/helpers/admin_helper.rb | 2 +- app/models/mail_server_log.rb | 4 ++-- .../outgoing_message/template/incoming_message_followup.rb | 2 +- app/models/outgoing_message/template/initial_request.rb | 2 +- app/models/outgoing_message/template/internal_review.rb | 2 +- lib/alaveteli_external_command.rb | 2 +- lib/configuration.rb | 2 +- lib/xapian_queries.rb | 6 +++--- script/runner | 4 ++-- spec/models/statistics_spec.rb | 4 ++-- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb index b844f11cc8..b8fe71a8a3 100644 --- a/app/helpers/admin_helper.rb +++ b/app/helpers/admin_helper.rb @@ -50,7 +50,7 @@ def event_params_description(event) if can?(:admin, AlaveteliPro::Embargo) || !event.info_request.embargo diff = event.params_diff significant_event_params(event).each do |key| - if diff[:new].has_key? key + if diff[:new].key? key text += "Changed #{key} from '#{diff[:old][key]}' to '#{diff[:new][key]}'. " end end diff --git a/app/models/mail_server_log.rb b/app/models/mail_server_log.rb index a3266b1635..9cc35e3109 100644 --- a/app/models/mail_server_log.rb +++ b/app/models/mail_server_log.rb @@ -92,7 +92,7 @@ def self.load_postfix_log_data(f, done) sanitised_line = scrub(line) order += 1 queue_id = extract_postfix_queue_id_from_syslog_line(sanitised_line) - if emails.has_key?(queue_id) + if emails.key?(queue_id) create_mail_server_logs(emails[queue_id], sanitised_line, order, done) end end @@ -103,7 +103,7 @@ def self.scan_for_postfix_queue_ids(f) f.each do |line| emails = email_addresses_on_line(line) queue_id = extract_postfix_queue_id_from_syslog_line(line) - result[queue_id] = [] unless result.has_key?(queue_id) + result[queue_id] = [] unless result.key?(queue_id) result[queue_id] = (result[queue_id] + emails).uniq end result diff --git a/app/models/outgoing_message/template/incoming_message_followup.rb b/app/models/outgoing_message/template/incoming_message_followup.rb index 20f37b946e..7a66eac326 100644 --- a/app/models/outgoing_message/template/incoming_message_followup.rb +++ b/app/models/outgoing_message/template/incoming_message_followup.rb @@ -34,7 +34,7 @@ def template_string(replacements) def assert_required_keys(hash, *required_keys) required_keys.each do |required_key| - unless hash.has_key?(required_key) + unless hash.key?(required_key) raise ArgumentError, "Missing required key: #{required_key}" end end diff --git a/app/models/outgoing_message/template/initial_request.rb b/app/models/outgoing_message/template/initial_request.rb index eec008f877..fbc9d44ba4 100644 --- a/app/models/outgoing_message/template/initial_request.rb +++ b/app/models/outgoing_message/template/initial_request.rb @@ -49,7 +49,7 @@ def template_string(replacements) def assert_required_keys(hash, *required_keys) required_keys.each do |required_key| - unless hash.has_key?(required_key) + unless hash.key?(required_key) raise ArgumentError, "Missing required key: #{required_key}" end end diff --git a/app/models/outgoing_message/template/internal_review.rb b/app/models/outgoing_message/template/internal_review.rb index 83f4d11948..b0d9f140e5 100644 --- a/app/models/outgoing_message/template/internal_review.rb +++ b/app/models/outgoing_message/template/internal_review.rb @@ -56,7 +56,7 @@ def template_string(replacements) def assert_required_keys(hash, *required_keys) required_keys.each do |required_key| - unless hash.has_key?(required_key) + unless hash.key?(required_key) raise ArgumentError, "Missing required key: #{required_key}" end end diff --git a/lib/alaveteli_external_command.rb b/lib/alaveteli_external_command.rb index c6f7e3e91e..1dd1e1b9c1 100644 --- a/lib/alaveteli_external_command.rb +++ b/lib/alaveteli_external_command.rb @@ -62,7 +62,7 @@ def run(*args) $stderr.puts(%Q[External Command: Error from command "#{program_name} #{args.join(' ')}":]) $stderr.print(xc.err) nil - elsif opts.has_key? :append_to + elsif opts.key? :append_to opts[:append_to] << "\n\n" else diff --git a/lib/configuration.rb b/lib/configuration.rb index 84b57c13fb..14532ef8fc 100644 --- a/lib/configuration.rb +++ b/lib/configuration.rb @@ -144,7 +144,7 @@ def self.background_jobs def self.method_missing(name) key = name.to_s.upcase - if DEFAULTS.has_key?(key.to_sym) + if DEFAULTS.key?(key.to_sym) MySociety::Config.get(key, DEFAULTS[key.to_sym]) else super diff --git a/lib/xapian_queries.rb b/lib/xapian_queries.rb index 7c973bbc74..958df79191 100644 --- a/lib/xapian_queries.rb +++ b/lib/xapian_queries.rb @@ -59,13 +59,13 @@ def get_status_from_params(params) def get_date_range_from_params(params) query = "" - if params.has_key?(:request_date_after) && !params.has_key?(:request_date_before) + if params.key?(:request_date_after) && !params.key?(:request_date_before) params[:request_date_before] = Time.zone.now.strftime("%d/%m/%Y") query += " #{params[:request_date_after]}..#{params[:request_date_before]}" - elsif !params.has_key?(:request_date_after) && params.has_key?(:request_date_before) + elsif !params.key?(:request_date_after) && params.key?(:request_date_before) params[:request_date_after] = "01/01/2001" end - if params.has_key?(:request_date_after) + if params.key?(:request_date_after) query = " #{params[:request_date_after]}..#{params[:request_date_before]}" end query diff --git a/script/runner b/script/runner index bdbc1dbba4..1579046450 100755 --- a/script/runner +++ b/script/runner @@ -11,7 +11,7 @@ Dir.chdir(alaveteli_dir) do # If the environment variable LOGFILE is present, # redirect STDERR and STDOUT to that file. - if ENV.has_key? "LOGFILE" + if ENV.key? "LOGFILE" STDERR.reopen(STDOUT.reopen(ENV["LOGFILE"], "a")) STDOUT.sync=true puts "Daemon starting at #{Time.new}" @@ -26,7 +26,7 @@ Dir.chdir(alaveteli_dir) do # If the environment variable PIDFILE is present, # write the pid of the daemon process to that file. - if ENV.has_key? "PIDFILE" + if ENV.key? "PIDFILE" File.open(ENV["PIDFILE"], 'w') do |fh| fh.puts pid end diff --git a/spec/models/statistics_spec.rb b/spec/models/statistics_spec.rb index 8ef875dfe0..830d40ecd4 100644 --- a/spec/models/statistics_spec.rb +++ b/spec/models/statistics_spec.rb @@ -25,7 +25,7 @@ percentages=false, {} ) expect(to_draw['public_bodies'][0].class).to eq(Hash) - expect(to_draw['public_bodies'][0].has_key?('request_email')).to be false + expect(to_draw['public_bodies'][0].key?('request_email')).to be false end it "should generate the expected id" do @@ -76,7 +76,7 @@ y_values] # These should be all be arrays with one element per public body: per_pb_keys.each do |key| - if to_draw.has_key? key + if to_draw.key? key expect(to_draw[key].class).to eq(Array) expect(to_draw[key].length).to eq(3), "for key #{key}" end From 679e311b3fc5a867bd4f4dbcec49ad1e35c83a87 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 20 Feb 2023 11:16:52 +0000 Subject: [PATCH 222/289] Style: ZeroLengthPredicate RuboCop --- app/controllers/admin_public_body_controller.rb | 4 ++-- app/controllers/users/sessions_controller.rb | 2 +- app/mailers/request_mailer.rb | 2 +- app/mailers/track_mailer.rb | 4 ++-- app/models/info_request.rb | 4 ++-- app/models/public_body.rb | 4 ++-- app/models/raw_email.rb | 2 +- lib/mail_handler/backends/mail_backend.rb | 2 +- lib/tasks/import.rake | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/controllers/admin_public_body_controller.rb b/app/controllers/admin_public_body_controller.rb index 5e35c6225c..ff59aec23c 100644 --- a/app/controllers/admin_public_body_controller.rb +++ b/app/controllers/admin_public_body_controller.rb @@ -175,7 +175,7 @@ def import_csv admin_current_user, AlaveteliLocalization.available_locales) - if errors.size == 0 + if errors.empty? if dry_run_only notes.push("Dry run was successful, real run would do as above.") # Store the csv file for ease of performing the real run @@ -190,7 +190,7 @@ def import_csv admin_current_user, AlaveteliLocalization. available_locales) - raise "dry run mismatched real run" if errors.size != 0 + raise "dry run mismatched real run" if !errors.empty? notes.push("Import was successful.") end end diff --git a/app/controllers/users/sessions_controller.rb b/app/controllers/users/sessions_controller.rb index c5e1fe1e03..fa1cf15dd8 100644 --- a/app/controllers/users/sessions_controller.rb +++ b/app/controllers/users/sessions_controller.rb @@ -29,7 +29,7 @@ def create User.authenticate_from_form(user_signin_params, @post_redirect.reason_params[:user_name]) end - if @post_redirect.nil? || @user_signin.errors.size > 0 + if @post_redirect.nil? || !@user_signin.errors.empty? # Failed to authenticate clear_session_credentials render template: 'user/sign' diff --git a/app/mailers/request_mailer.rb b/app/mailers/request_mailer.rb index be8825ea84..a256c71e52 100644 --- a/app/mailers/request_mailer.rb +++ b/app/mailers/request_mailer.rb @@ -245,7 +245,7 @@ def receive(email, raw_email, source = :mailin) reply_info_requests = requests_matching_email(email) # Nothing found, so save in holding pen - if reply_info_requests.size == 0 + if reply_info_requests.empty? opts[:rejected_reason] = _("Could not identify the request from the email address") request = InfoRequest.holding_pen_request diff --git a/app/mailers/track_mailer.rb b/app/mailers/track_mailer.rb index 1641b74b9b..72dc5b891c 100644 --- a/app/mailers/track_mailer.rb +++ b/app/mailers/track_mailer.rb @@ -99,13 +99,13 @@ def self.alert_tracks alert_results.push(result) end # If there were more alerts for this track, then store them - if alert_results.size > 0 + if !alert_results.empty? email_about_things.push([track_thing, alert_results, xapian_object]) end end # If we have anything to send, then send everything for the user in one mail - if email_about_things.size > 0 + if !email_about_things.empty? # Send the email AlaveteliLocalization.with_locale(user.locale) do diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 6df03f08f9..2caf2e100b 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -1365,7 +1365,7 @@ def is_followupable?(incoming_message) end def postal_email - if who_can_followup_to.size == 0 + if who_can_followup_to.empty? public_body.request_email else who_can_followup_to[-1][1] @@ -1373,7 +1373,7 @@ def postal_email end def postal_email_name - if who_can_followup_to.size == 0 + if who_can_followup_to.empty? public_body.name else who_can_followup_to[-1][0] diff --git a/app/models/public_body.rb b/app/models/public_body.rb index c1d862d2cf..fd6dc3adcf 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -542,12 +542,12 @@ def self.import_csv_from_file(csv_filename, tag, tag_behaviour, dry_run, editor, # Give an error listing ones that are to be deleted deleted_ones = set_of_existing - set_of_importing - if deleted_ones.size > 0 + if !deleted_ones.empty? notes.push "Notes: Some " + tag + " bodies are in database, but not in CSV file:\n " + Array(deleted_ones).sort.join("\n ") + "\nYou may want to delete them manually.\n" end # Rollback if a dry run, or we had errors - raise ImportCSVDryRun if dry_run || (errors.size > 0) + raise ImportCSVDryRun if dry_run || (!errors.empty?) end rescue ImportCSVDryRun # Ignore diff --git a/app/models/raw_email.rb b/app/models/raw_email.rb index 8167f697a6..e428acb02c 100644 --- a/app/models/raw_email.rb +++ b/app/models/raw_email.rb @@ -64,7 +64,7 @@ def valid_to_reply_to? end def empty_from_field? - mail.from_addrs.nil? || mail.from_addrs.size == 0 + mail.from_addrs.nil? || mail.from_addrs.empty? end def mail diff --git a/lib/mail_handler/backends/mail_backend.rb b/lib/mail_handler/backends/mail_backend.rb index e5830afa07..8dc5e2336a 100644 --- a/lib/mail_handler/backends/mail_backend.rb +++ b/lib/mail_handler/backends/mail_backend.rb @@ -298,7 +298,7 @@ def get_attachment_leaves(mail) def _get_attachment_leaves_recursive(part, within_rfc822_attachment, parent_mail) leaves_found = [] if part.multipart? - if part.parts.size == 0 + if part.parts.empty? # This is typically caused by a missing final # MIME boundary, in which case the text of the # message (including the opening MIME diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake index 8b0531799d..24d94f4a68 100644 --- a/lib/tasks/import.rake +++ b/lib/tasks/import.rake @@ -65,7 +65,7 @@ namespace :import do STDERR.puts "(#{percent_complete}% complete)" end - if errors.length > 0 + if !errors.empty? STDERR.puts 'Import failed, with the following errors:' errors.each do |error| From d2c582e4012a3f0fcfa308fc8b5e3587159a8ccb Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 20 Feb 2023 14:18:44 +0000 Subject: [PATCH 223/289] Style: Lambda RuboCop --- app/controllers/track_controller.rb | 2 +- app/models/alaveteli_pro/embargo.rb | 2 +- app/models/comment.rb | 6 +++--- app/models/outgoing_message/snippet.rb | 2 +- app/models/user/authentication.rb | 2 +- lib/data_export.rb | 4 ++-- spec/lib/strip_empty_sessions_spec.rb | 2 +- spec/models/public_body_spec.rb | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb index 29c161db27..61dddb443a 100644 --- a/app/controllers/track_controller.rb +++ b/app/controllers/track_controller.rb @@ -176,7 +176,7 @@ def atom_feed_internal request.format = params[:format] || 'xml' respond_to do |format| format.json { render json: @xapian_object.results.map { |r| r[:model].json_for_api(true, - lambda do |t| + ->(t) do view_context.highlight_and_excerpt( t, @xapian_object.words_to_highlight( diff --git a/app/models/alaveteli_pro/embargo.rb b/app/models/alaveteli_pro/embargo.rb index 385b05d676..6e06e65715 100644 --- a/app/models/alaveteli_pro/embargo.rb +++ b/app/models/alaveteli_pro/embargo.rb @@ -25,7 +25,7 @@ class Embargo < ApplicationRecord validates_presence_of :info_request validates_presence_of :publish_at validates_inclusion_of :embargo_duration, - in: lambda { |e| e.allowed_durations }, + in: ->(e) { e.allowed_durations }, allow_nil: true after_initialize :set_default_duration, :set_publish_at_from_duration, diff --git a/app/models/comment.rb b/app/models/comment.rb index 4b4c540d1f..07b295d271 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -54,19 +54,19 @@ class Comment < ApplicationRecord validate :check_body_has_content, :check_body_uses_mixed_capitals - scope :visible, lambda { + scope :visible, -> { joins(:info_request). merge(InfoRequest.is_searchable.except(:select)). where(visible: true) } - scope :embargoed, lambda { + scope :embargoed, -> { joins(info_request: :embargo). where('embargoes.id IS NOT NULL'). references(:embargoes) } - scope :not_embargoed, lambda { + scope :not_embargoed, -> { joins(:info_request). select('comments.*'). joins('LEFT OUTER JOIN embargoes diff --git a/app/models/outgoing_message/snippet.rb b/app/models/outgoing_message/snippet.rb index 7b7bc68b83..51dabd3fbe 100644 --- a/app/models/outgoing_message/snippet.rb +++ b/app/models/outgoing_message/snippet.rb @@ -29,7 +29,7 @@ def self.admin_title end OutgoingMessage::Snippet::Translation.class_eval do - with_options if: lambda { |t| !t.default_locale? && t.required_attribute_submitted? } do |required| + with_options if: ->(t) { !t.default_locale? && t.required_attribute_submitted? } do |required| required.validates :name, :body, presence: true end diff --git a/app/models/user/authentication.rb b/app/models/user/authentication.rb index b58b543ecf..9554ba860d 100644 --- a/app/models/user/authentication.rb +++ b/app/models/user/authentication.rb @@ -8,7 +8,7 @@ module User::Authentication attr_reader :password attr_accessor :password_confirmation - scope :sha1, lambda { + scope :sha1, -> { where("users.salt IS NOT NULL AND users.hashed_password NOT LIKE '$2a$%'") } diff --git a/lib/data_export.rb b/lib/data_export.rb index 085fca6cab..71eee643ed 100644 --- a/lib/data_export.rb +++ b/lib/data_export.rb @@ -58,7 +58,7 @@ def self.detects_gender(name) end def self.gender_lambda - lambda { |x| detects_gender(x.name) } + ->(x) { detects_gender(x.name) } end # Remove all instances of user's name (if there is a user), otherwise @@ -78,7 +78,7 @@ def self.case_insensitive_user_censor(text, user) # Returns a lambda to pass to export function that censors x.property def self.name_censor_lambda(property) - lambda do |x| + ->(x) do if x.respond_to?(:info_request) case_insensitive_user_censor(x.send(property), x.info_request.user) else diff --git a/spec/lib/strip_empty_sessions_spec.rb b/spec/lib/strip_empty_sessions_spec.rb index 8cecdce874..2ad1273211 100644 --- a/spec/lib/strip_empty_sessions_spec.rb +++ b/spec/lib/strip_empty_sessions_spec.rb @@ -2,7 +2,7 @@ RSpec.describe StripEmptySessions do def make_response(session_data, response_headers) - app = lambda do |env| + app = ->(env) do env['rack.session'] = session_data return [200, response_headers, ['content']] end diff --git a/spec/models/public_body_spec.rb b/spec/models/public_body_spec.rb index c273f81236..6d708f06d2 100644 --- a/spec/models/public_body_spec.rb +++ b/spec/models/public_body_spec.rb @@ -1066,7 +1066,7 @@ expect(@public_body.get_tag_values('cheese')).to eq(['green']) expect(@public_body.get_tag_values('wondrous')).to eq([]) - lambda { + -> { expect(@public_body.get_tag_values('notthere')).to raise_error(PublicBody::TagNotFound) } end From 8d22f36263f28402775a0ab4cb91036818381250 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 24 Feb 2023 14:43:16 +0000 Subject: [PATCH 224/289] Style: RedundantBegin RuboCop --- .../admin_incoming_message_controller.rb | 18 ++-- .../alaveteli_pro/subscriptions_controller.rb | 84 +++++++++---------- app/controllers/application_controller.rb | 8 +- app/models/censor_rule.rb | 8 +- app/models/holiday_import.rb | 48 +++++------ app/models/info_request.rb | 10 +-- .../legislation/reference_collection.rb | 12 ++- app/models/mail_server_log.rb | 44 +++++----- .../lib/alaveteli_features.rb | 10 +-- lib/alaveteli_pro/metrics_report.rb | 22 +++-- lib/normalize_string.rb | 12 ++- lib/tasks/geoip.rake | 24 +++--- 12 files changed, 137 insertions(+), 163 deletions(-) diff --git a/app/controllers/admin_incoming_message_controller.rb b/app/controllers/admin_incoming_message_controller.rb index 01a02c0e52..e70d3f9990 100644 --- a/app/controllers/admin_incoming_message_controller.rb +++ b/app/controllers/admin_incoming_message_controller.rb @@ -54,16 +54,14 @@ def bulk_destroy errors = [] info_request = InfoRequest.find(params[:request_id]) @incoming_messages.each do |message| - begin - message.destroy - info_request.log_event( - 'destroy_incoming', - editor: admin_current_user, - deleted_incoming_message_id: message.id - ) - rescue - errors << message.id - end + message.destroy + info_request.log_event( + 'destroy_incoming', + editor: admin_current_user, + deleted_incoming_message_id: message.id + ) + rescue + errors << message.id end info_request.expire(preserve_database_cache: true) if errors.empty? diff --git a/app/controllers/alaveteli_pro/subscriptions_controller.rb b/app/controllers/alaveteli_pro/subscriptions_controller.rb index 234a9efc3e..927f527318 100644 --- a/app/controllers/alaveteli_pro/subscriptions_controller.rb +++ b/app/controllers/alaveteli_pro/subscriptions_controller.rb @@ -93,59 +93,57 @@ def create end def authorise - begin - @subscription = current_user.pro_account.subscriptions. - retrieve(params.require(:id)) - - if !@subscription - head :not_found - - elsif @subscription.require_authorisation? - respond_to do |format| - format.json do - render json: { - payment_intent: @subscription.payment_intent.client_secret, - callback_url: authorise_subscription_path(@subscription.id) - } - end + @subscription = current_user.pro_account.subscriptions. + retrieve(params.require(:id)) + + if !@subscription + head :not_found + + elsif @subscription.require_authorisation? + respond_to do |format| + format.json do + render json: { + payment_intent: @subscription.payment_intent.client_secret, + callback_url: authorise_subscription_path(@subscription.id) + } end + end - elsif @subscription.invoice_open? - flash[:error] = _('There was a problem authorising your payment. You ' \ - 'have not been charged. Please try again.') + elsif @subscription.invoice_open? + flash[:error] = _('There was a problem authorising your payment. You ' \ + 'have not been charged. Please try again.') - json_redirect_to plan_path( - remove_stripe_namespace(@subscription.plan.id) - ) + json_redirect_to plan_path( + remove_stripe_namespace(@subscription.plan.id) + ) - elsif @subscription.active? - current_user.add_role(:pro) + elsif @subscription.active? + current_user.add_role(:pro) - flash[:notice] = { - partial: 'alaveteli_pro/subscriptions/signup_message' - } - flash[:new_pro_user] = true + flash[:notice] = { + partial: 'alaveteli_pro/subscriptions/signup_message' + } + flash[:new_pro_user] = true - json_redirect_to alaveteli_pro_dashboard_path + json_redirect_to alaveteli_pro_dashboard_path - else - head :ok - end + else + head :ok + end - rescue Stripe::RateLimitError, - Stripe::InvalidRequestError, - Stripe::AuthenticationError, - Stripe::APIConnectionError, - Stripe::StripeError => e - if send_exception_notifications? - ExceptionNotifier.notify_exception(e, env: request.env) - end + rescue Stripe::RateLimitError, + Stripe::InvalidRequestError, + Stripe::AuthenticationError, + Stripe::APIConnectionError, + Stripe::StripeError => e + if send_exception_notifications? + ExceptionNotifier.notify_exception(e, env: request.env) + end - flash[:error] = _('There was a problem submitting your payment. You ' \ - 'have not been charged. Please try again later.') + flash[:error] = _('There was a problem submitting your payment. You ' \ + 'have not been charged. Please try again later.') - json_redirect_to plan_path('pro') - end + json_redirect_to plan_path('pro') end def destroy diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 674952c1a2..24f422e993 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -456,11 +456,9 @@ def country_from_ip end def user_ip - begin - request.remote_ip - rescue ActionDispatch::RemoteIp::IpSpoofAttackError - nil - end + request.remote_ip + rescue ActionDispatch::RemoteIp::IpSpoofAttackError + nil end # URL Encode the path parameter for use in render_exception diff --git a/app/models/censor_rule.rb b/app/models/censor_rule.rb index 0e42ce3ea5..a3704e9b6c 100644 --- a/app/models/censor_rule.rb +++ b/app/models/censor_rule.rb @@ -109,11 +109,9 @@ def single_char_regexp end def require_valid_regexp - begin - make_regexp('UTF-8') - rescue RegexpError => e - errors.add(:text, e.message) - end + make_regexp('UTF-8') + rescue RegexpError => e + errors.add(:text, e.message) end def to_replace(encoding) diff --git a/app/models/holiday_import.rb b/app/models/holiday_import.rb index f566427781..782c949d01 100644 --- a/app/models/holiday_import.rb +++ b/app/models/holiday_import.rb @@ -66,24 +66,22 @@ def all_holidays_valid end def populate_from_ical_feed - begin - cal_file = open(ical_feed_url) - cal_parser = Icalendar::Parser.new(cal_file) - cals = cal_parser.parse - cal = cals.first - unless cal - errors.add(:ical_feed_url, "Sorry, there's a problem with the format of that feed.") - return - end - cal.events.each { |cal_event| populate_from_ical_event(cal_event) } - rescue Errno::ENOENT, Exception => e - if e.message == 'Invalid line in calendar string!' - errors.add(:ical_feed_url, "Sorry, there's a problem with the format of that feed.") - elsif e.message =~ /^No such file or directory/ - errors.add(:ical_feed_url, "Sorry we couldn't find that feed.") - else - raise e - end + cal_file = open(ical_feed_url) + cal_parser = Icalendar::Parser.new(cal_file) + cals = cal_parser.parse + cal = cals.first + unless cal + errors.add(:ical_feed_url, "Sorry, there's a problem with the format of that feed.") + return + end + cal.events.each { |cal_event| populate_from_ical_event(cal_event) } + rescue Errno::ENOENT, Exception => e + if e.message == 'Invalid line in calendar string!' + errors.add(:ical_feed_url, "Sorry, there's a problem with the format of that feed.") + elsif e.message =~ /^No such file or directory/ + errors.add(:ical_feed_url, "Sorry we couldn't find that feed.") + else + raise e end end @@ -95,14 +93,12 @@ def populate_from_ical_event(cal_event) end def populate_from_suggestions - begin - holiday_info = Holidays.between(start_date, end_date, @country_code.to_sym, :observed) - holiday_info.each do |holiday_info_hash| - holidays << Holiday.new(description: holiday_info_hash[:name], - day: holiday_info_hash[:date]) - end - rescue Holidays::InvalidRegion - [] + holiday_info = Holidays.between(start_date, end_date, @country_code.to_sym, :observed) + holiday_info.each do |holiday_info_hash| + holidays << Holiday.new(description: holiday_info_hash[:name], + day: holiday_info_hash[:date]) end + rescue Holidays::InvalidRegion + [] end end diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 2caf2e100b..57e37d0c98 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -1852,12 +1852,10 @@ def index_of_last_described_event end def set_defaults - begin - self.described_state = 'waiting_response' if described_state.nil? - rescue ActiveModel::MissingAttributeError - # this should only happen on Model.exists? call. It can be safely ignored. - # See http://www.tatvartha.com/2011/03/activerecordmissingattributeerror-missing-attribute-a-bug-or-a-features/ - end + self.described_state = 'waiting_response' if described_state.nil? + rescue ActiveModel::MissingAttributeError + # this should only happen on Model.exists? call. It can be safely ignored. + # See http://www.tatvartha.com/2011/03/activerecordmissingattributeerror-missing-attribute-a-bug-or-a-features/ end def set_law_used diff --git a/app/models/legislation/reference_collection.rb b/app/models/legislation/reference_collection.rb index 32644c34c0..d1a1ab79ac 100644 --- a/app/models/legislation/reference_collection.rb +++ b/app/models/legislation/reference_collection.rb @@ -30,13 +30,11 @@ def match(text) type = capture[0] parse_matches(capture[1]).each do |reference| - begin - references << Legislation::Reference.new( - legislation: legislation, reference: "#{type} #{reference}" - ) - rescue Legislation::InvalidReferenceType - # noop - end + references << Legislation::Reference.new( + legislation: legislation, reference: "#{type} #{reference}" + ) + rescue Legislation::InvalidReferenceType + # noop end references diff --git a/app/models/mail_server_log.rb b/app/models/mail_server_log.rb index 9cc35e3109..f8854e6018 100644 --- a/app/models/mail_server_log.rb +++ b/app/models/mail_server_log.rb @@ -232,30 +232,28 @@ def line(opts = {}) end def delivery_status - begin - unless attributes['delivery_status'].present? - # attempt to parse the status from the log line and store if successful - set_delivery_status - end - - DeliveryStatusSerializer.load(read_attribute(:delivery_status)) - # TODO: This rescue can be removed when there are no more cached - # MTA-specific statuses - rescue ArgumentError - warn %q(MailServerLog#delivery_status rescuing from invalid delivery - status. Run bundle exec rake temp:cache_delivery_status to update - cached values. This error handling will be removed soon.). - squish unless Rails.env.test? - - # re-try setting the delivery status, forcing the write by avoiding the - # Rails 4.2 call to old_attribute_value hidden inside write_attribute as - # that will re-raise the 'Invalid delivery status' ArgumentError we're - # attempting to rescue - # https://apidock.com/rails/v4.2.7/ActiveRecord/AttributeMethods/Dirty/write_attribute - set_delivery_status(true) - save! - DeliveryStatusSerializer.load(read_attribute(:delivery_status)) + unless attributes['delivery_status'].present? + # attempt to parse the status from the log line and store if successful + set_delivery_status end + + DeliveryStatusSerializer.load(read_attribute(:delivery_status)) + # TODO: This rescue can be removed when there are no more cached + # MTA-specific statuses + rescue ArgumentError + warn %q(MailServerLog#delivery_status rescuing from invalid delivery + status. Run bundle exec rake temp:cache_delivery_status to update + cached values. This error handling will be removed soon.). + squish unless Rails.env.test? + + # re-try setting the delivery status, forcing the write by avoiding the + # Rails 4.2 call to old_attribute_value hidden inside write_attribute as + # that will re-raise the 'Invalid delivery status' ArgumentError we're + # attempting to rescue + # https://apidock.com/rails/v4.2.7/ActiveRecord/AttributeMethods/Dirty/write_attribute + set_delivery_status(true) + save! + DeliveryStatusSerializer.load(read_attribute(:delivery_status)) end private diff --git a/gems/alaveteli_features/lib/alaveteli_features.rb b/gems/alaveteli_features/lib/alaveteli_features.rb index 1f634aa94b..66860937bb 100644 --- a/gems/alaveteli_features/lib/alaveteli_features.rb +++ b/gems/alaveteli_features/lib/alaveteli_features.rb @@ -43,11 +43,9 @@ def self.backend=(backend) # We just want to know if our tables exist, but we can't do that without # risking an error def self.tables_exist? - begin - ActiveRecord::Base.establish_connection - ActiveRecord::Base.connection.data_source_exists?(:flipper_features) - rescue - false - end + ActiveRecord::Base.establish_connection + ActiveRecord::Base.connection.data_source_exists?(:flipper_features) + rescue + false end end diff --git a/lib/alaveteli_pro/metrics_report.rb b/lib/alaveteli_pro/metrics_report.rb index 40546dd5d5..77c755a6af 100644 --- a/lib/alaveteli_pro/metrics_report.rb +++ b/lib/alaveteli_pro/metrics_report.rb @@ -120,20 +120,18 @@ def new_stripe_users count = 0 sub_ids = [] stripe_plans.each do |plan_id| - begin - Stripe::Subscription.list( - 'created[gte]': report_start.to_i, - 'created[lte]': report_end.to_i, - plan: plan_id - ).auto_paging_each do |item| - if item.plan.id == plan_id - count += 1 - sub_ids << item.id - end + Stripe::Subscription.list( + 'created[gte]': report_start.to_i, + 'created[lte]': report_end.to_i, + plan: plan_id + ).auto_paging_each do |item| + if item.plan.id == plan_id + count += 1 + sub_ids << item.id end - rescue Stripe::InvalidRequestError - # tried to fetch a plan that's not set up end + rescue Stripe::InvalidRequestError + # tried to fetch a plan that's not set up end { new_and_returning_users: { count: count, subs: sub_ids } } end diff --git a/lib/normalize_string.rb b/lib/normalize_string.rb index 48530f0e4a..a1e42ddda7 100644 --- a/lib/normalize_string.rb +++ b/lib/normalize_string.rb @@ -76,13 +76,11 @@ def convert_string_to_utf8_or_binary(s, suggested_character_encoding=nil) end def convert_string_to_utf8(s, suggested_character_encoding=nil) - begin - result = normalize_string_to_utf8 s, suggested_character_encoding - StringConversionResult.new(result, false) - rescue EncodingNormalizationError - result = scrub(s) - StringConversionResult.new(result, true) - end + result = normalize_string_to_utf8 s, suggested_character_encoding + StringConversionResult.new(result, false) +rescue EncodingNormalizationError + result = scrub(s) + StringConversionResult.new(result, true) end def scrub(string) diff --git a/lib/tasks/geoip.rake b/lib/tasks/geoip.rake index 42fda379c8..dade426ee2 100644 --- a/lib/tasks/geoip.rake +++ b/lib/tasks/geoip.rake @@ -38,22 +38,20 @@ namespace :geoip do downloaded_location = File.join(tmp_dir, 'geodata.tar.gz') File.open(downloaded_location, "wb") do |saved_file| - begin - URI.open(link, "rb") do |read_file| - saved_file.write(read_file.read) - end - - rescue OpenURI::HTTPError => ex - log 'Error downloading MaxMind geoip data file' - log " #{ex.message}" + URI.open(link, "rb") do |read_file| + saved_file.write(read_file.read) + end - if ex.message == '401 Unauthorized' - log 'Please check the MAXMIND_LICENSE_KEY setting in ' \ - 'config/general.yml' - end + rescue OpenURI::HTTPError => ex + log 'Error downloading MaxMind geoip data file' + log " #{ex.message}" - exit + if ex.message == '401 Unauthorized' + log 'Please check the MAXMIND_LICENSE_KEY setting in ' \ + 'config/general.yml' end + + exit end `tar -xzf #{downloaded_location} -C #{tmp_dir}` From 1e145721478c29d24d99584fd7478a6af21e553a Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Mon, 27 Feb 2023 16:51:43 +0000 Subject: [PATCH 225/289] Disable NumericLiterals cop --- .ruby-style.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-style.yml b/.ruby-style.yml index 9277f8c0ac..83122370ba 100644 --- a/.ruby-style.yml +++ b/.ruby-style.yml @@ -1882,7 +1882,7 @@ Style/NumericLiteralPrefix: Enabled: true Style/NumericLiterals: - Enabled: true + Enabled: false Style/NumericPredicate: Enabled: false From 2980fb575aeffc767def739d41f0a7712ecbe9ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 05:00:31 +0000 Subject: [PATCH 226/289] Build(deps): Bump rails from 7.0.4.2 to 7.0.4.3 Bumps [rails](https://github.com/rails/rails) from 7.0.4.2 to 7.0.4.3. - [Release notes](https://github.com/rails/rails/releases) - [Commits](https://github.com/rails/rails/compare/v7.0.4.2...v7.0.4.3) --- updated-dependencies: - dependency-name: rails dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 114 +++++++++++++++++++++++++-------------------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6dd3671a86..5f1ace3395 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -45,47 +45,47 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (7.0.4.2) - actionpack (= 7.0.4.2) - activesupport (= 7.0.4.2) + actioncable (7.0.4.3) + actionpack (= 7.0.4.3) + activesupport (= 7.0.4.3) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4.2) - actionpack (= 7.0.4.2) - activejob (= 7.0.4.2) - activerecord (= 7.0.4.2) - activestorage (= 7.0.4.2) - activesupport (= 7.0.4.2) + actionmailbox (7.0.4.3) + actionpack (= 7.0.4.3) + activejob (= 7.0.4.3) + activerecord (= 7.0.4.3) + activestorage (= 7.0.4.3) + activesupport (= 7.0.4.3) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.4.2) - actionpack (= 7.0.4.2) - actionview (= 7.0.4.2) - activejob (= 7.0.4.2) - activesupport (= 7.0.4.2) + actionmailer (7.0.4.3) + actionpack (= 7.0.4.3) + actionview (= 7.0.4.3) + activejob (= 7.0.4.3) + activesupport (= 7.0.4.3) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.4.2) - actionview (= 7.0.4.2) - activesupport (= 7.0.4.2) + actionpack (7.0.4.3) + actionview (= 7.0.4.3) + activesupport (= 7.0.4.3) rack (~> 2.0, >= 2.2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4.2) - actionpack (= 7.0.4.2) - activerecord (= 7.0.4.2) - activestorage (= 7.0.4.2) - activesupport (= 7.0.4.2) + actiontext (7.0.4.3) + actionpack (= 7.0.4.3) + activerecord (= 7.0.4.3) + activestorage (= 7.0.4.3) + activesupport (= 7.0.4.3) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4.2) - activesupport (= 7.0.4.2) + actionview (7.0.4.3) + activesupport (= 7.0.4.3) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -93,22 +93,22 @@ GEM active_model_otp (2.3.1) activemodel rotp (~> 6.2.0) - activejob (7.0.4.2) - activesupport (= 7.0.4.2) + activejob (7.0.4.3) + activesupport (= 7.0.4.3) globalid (>= 0.3.6) - activemodel (7.0.4.2) - activesupport (= 7.0.4.2) - activerecord (7.0.4.2) - activemodel (= 7.0.4.2) - activesupport (= 7.0.4.2) - activestorage (7.0.4.2) - actionpack (= 7.0.4.2) - activejob (= 7.0.4.2) - activerecord (= 7.0.4.2) - activesupport (= 7.0.4.2) + activemodel (7.0.4.3) + activesupport (= 7.0.4.3) + activerecord (7.0.4.3) + activemodel (= 7.0.4.3) + activesupport (= 7.0.4.3) + activestorage (7.0.4.3) + actionpack (= 7.0.4.3) + activejob (= 7.0.4.3) + activerecord (= 7.0.4.3) + activesupport (= 7.0.4.3) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.4.2) + activesupport (7.0.4.3) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -310,7 +310,7 @@ GEM mini_portile2 (2.8.1) mini_racer (0.6.3) libv8-node (~> 16.10.0.0) - minitest (5.17.0) + minitest (5.18.0) money (6.16.0) i18n (>= 0.6.4, <= 2) multi_json (1.15.0) @@ -361,24 +361,24 @@ GEM public_suffix (5.0.1) racc (1.6.2) rack (2.2.6.2) - rack-test (2.0.2) + rack-test (2.1.0) rack (>= 1.3) rack-utf8_sanitizer (1.8.0) rack (>= 1.0, < 4.0) - rails (7.0.4.2) - actioncable (= 7.0.4.2) - actionmailbox (= 7.0.4.2) - actionmailer (= 7.0.4.2) - actionpack (= 7.0.4.2) - actiontext (= 7.0.4.2) - actionview (= 7.0.4.2) - activejob (= 7.0.4.2) - activemodel (= 7.0.4.2) - activerecord (= 7.0.4.2) - activestorage (= 7.0.4.2) - activesupport (= 7.0.4.2) + rails (7.0.4.3) + actioncable (= 7.0.4.3) + actionmailbox (= 7.0.4.3) + actionmailer (= 7.0.4.3) + actionpack (= 7.0.4.3) + actiontext (= 7.0.4.3) + actionview (= 7.0.4.3) + activejob (= 7.0.4.3) + activemodel (= 7.0.4.3) + activerecord (= 7.0.4.3) + activestorage (= 7.0.4.3) + activesupport (= 7.0.4.3) bundler (>= 1.15.0) - railties (= 7.0.4.2) + railties (= 7.0.4.3) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -391,9 +391,9 @@ GEM rails-i18n (7.0.5) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.0.4.2) - actionpack (= 7.0.4.2) - activesupport (= 7.0.4.2) + railties (7.0.4.3) + actionpack (= 7.0.4.3) + activesupport (= 7.0.4.3) method_source rake (>= 12.2) thor (~> 1.0) @@ -506,7 +506,7 @@ GEM rack (>= 1, < 3) thor (1.2.1) tilt (2.0.10) - timeout (0.3.1) + timeout (0.3.2) trailblazer-option (0.1.2) tzinfo (2.0.6) concurrent-ruby (~> 1.0) @@ -537,7 +537,7 @@ GEM rexml xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.6) + zeitwerk (2.6.7) zip_tricks (5.6.0) PLATFORMS From c9ee7036aa87c254a48d98e47ebebeeecf7b738d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 05:04:50 +0000 Subject: [PATCH 227/289] Build(deps-dev): Bump rubocop from 1.48.0 to 1.48.1 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.48.0 to 1.48.1. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.48.0...v1.48.1) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 657a313781..8f890af555 100644 --- a/Gemfile +++ b/Gemfile @@ -190,7 +190,7 @@ group :development do gem 'launchy', '< 2.6.0' gem 'listen', '>= 3.0.5', '< 3.8.1' gem 'web-console', '>= 3.3.0' - gem 'rubocop', '~> 1.48.0', require: false + gem 'rubocop', '~> 1.48.1', require: false gem 'rubocop-performance', require: false gem 'rubocop-rails', require: false end diff --git a/Gemfile.lock b/Gemfile.lock index 6dd3671a86..2e5ffaf562 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -349,7 +349,7 @@ GEM open4 (1.3.4) os (1.1.4) parallel (1.22.1) - parser (3.2.1.0) + parser (3.2.1.1) ast (~> 2.4.1) pg (1.4.5) prime (0.1.2) @@ -441,7 +441,7 @@ GEM rspec-mocks (~> 3.11) rspec-support (~> 3.11) rspec-support (3.11.1) - rubocop (1.48.0) + rubocop (1.48.1) json (~> 2.3) parallel (~> 1.10) parser (>= 3.2.0.0) @@ -610,7 +610,7 @@ DEPENDENCIES routing-filter (~> 0.7.0) rspec-activemodel-mocks (~> 1.1.0) rspec-rails (~> 6.0.0) - rubocop (~> 1.48.0) + rubocop (~> 1.48.1) rubocop-performance rubocop-rails ruby-msg (~> 1.5.0)! From f94e3393ac8f593752658cef5aeec90480887741 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Fri, 17 Mar 2023 17:06:01 +0000 Subject: [PATCH 228/289] Add check before removing old params_yaml column Check for content in InfoRequestEvent#params_yaml column. If a re-user skips 0.42.0.0 upgrade notes then they could lose data. Add a check to ensure we prevent this. --- ...9_remove_info_request_event_params_yaml.rb | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/db/migrate/20230127132719_remove_info_request_event_params_yaml.rb b/db/migrate/20230127132719_remove_info_request_event_params_yaml.rb index 8793b2115f..765b34aca2 100644 --- a/db/migrate/20230127132719_remove_info_request_event_params_yaml.rb +++ b/db/migrate/20230127132719_remove_info_request_event_params_yaml.rb @@ -1,5 +1,22 @@ class RemoveInfoRequestEventParamsYaml < ActiveRecord::Migration[7.0] - def change - remove_column :info_request_events, :params_yaml, :text + def up + if InfoRequestEvent.where(params: nil).any? + raise <<~TXT + We can't run the RemoveInfoRequestEventParamsYaml database migration. + + We have dectected InfoRequestEvent objects which haven't been migrated + to the new JSONB params column. + + Please deploy Alaveteli 0.42.0.0 and run the upgrade tasks: + https://github.com/mysociety/alaveteli/blob/0.42.0.0/doc/CHANGES.md#upgrade-notes + + TXT + end + + remove_column :info_request_events, :params_yaml + end + + def down + add_column :info_request_events, :params_yaml, :text end end From 031bdcdf8dedbc42587ef4fe6600369f52c0a767 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Fri, 17 Mar 2023 19:01:30 +0000 Subject: [PATCH 229/289] Add check before removing old notes column Check for content in PublicBody::Translation#notes column. If a re-user skips 0.42.0.0 upgrade notes then they could lose data. Add a check to ensure we prevent this. --- ...20220902112339_remove_public_body_notes.rb | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/db/migrate/20220902112339_remove_public_body_notes.rb b/db/migrate/20220902112339_remove_public_body_notes.rb index 90491f35c0..09d3f72b04 100644 --- a/db/migrate/20220902112339_remove_public_body_notes.rb +++ b/db/migrate/20220902112339_remove_public_body_notes.rb @@ -1,13 +1,22 @@ class RemovePublicBodyNotes < ActiveRecord::Migration[6.1] - def change - reversible do |dir| - dir.up do - remove_column :public_body_translations, :notes - end - - dir.down do - PublicBody.add_translation_fields! notes: :text - end + def up + if PublicBody::Translation.where.not(notes: nil).any? + raise <<~TXT + We can't run the RemovePublicBodyNotes database migration. + + We have dectected PublicBody::Translation objects which haven't been + migrated to the new Note model. + + Please deploy Alaveteli 0.42.0.0 and run the upgrade tasks: + https://github.com/mysociety/alaveteli/blob/0.42.0.0/doc/CHANGES.md#upgrade-notes + + TXT end + + remove_column :public_body_translations, :notes + end + + def down + PublicBody.add_translation_fields! notes: :text end end From 6566933b9166b09db9fae620e23303819092f15d Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 14 Mar 2023 12:04:36 +0000 Subject: [PATCH 230/289] Rename blog items to posts --- app/models/blog.rb | 2 +- app/views/general/blog.html.erb | 26 ++++++++++++------------ spec/models/blog_spec.rb | 8 ++++---- spec/views/general/blog.html.erb_spec.rb | 8 ++++---- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/app/models/blog.rb b/app/models/blog.rb index 66869228f9..90b68fced5 100644 --- a/app/models/blog.rb +++ b/app/models/blog.rb @@ -13,7 +13,7 @@ def self.enabled? AlaveteliConfiguration.blog_feed.present? end - def items + def posts return [] if content.empty? data = XmlSimple.xml_in(content) diff --git a/app/views/general/blog.html.erb b/app/views/general/blog.html.erb index 8c24cbdbea..e86cb25e02 100644 --- a/app/views/general/blog.html.erb +++ b/app/views/general/blog.html.erb @@ -4,18 +4,18 @@

    <%=@title %>

    - <% @blog.items.each do |item| %> + <% @blog.posts.each do |post| %>
    - <% date = Time.zone.parse(item['pubDate'][0]) %> + <% date = Time.zone.parse(post['pubDate'][0]) %>

    - - <%=h item['title'][0] %> + + <%=h post['title'][0] %>

    <% author = - item['creator'] ? item['creator']&.first : item['author']&.first %> + post['creator'] ? post['creator']&.first : post['author']&.first %> <% if author && date %>

    @@ -30,20 +30,20 @@ <% end %>

    - <% if item['encoded'] %> - <%= sanitize(raw item['encoded'][0]) %> - <% elsif item['description'] %> - <%= sanitize(raw item['description'][0]) %> + <% if post['encoded'] %> + <%= sanitize(raw post['encoded'][0]) %> + <% elsif post['description'] %> + <%= sanitize(raw post['description'][0]) %> <% end %>

    - <% if item['comments'] %> - <%= n_( + <% if post['comments'] %> + <%= n_( "{{number_of_comments}} comment", "{{number_of_comments}} comments", - item['comments'][1], - :number_of_comments=>item['comments'][1]) %> + post['comments'][1], + :number_of_comments=>post['comments'][1]) %> <% end %>

    diff --git a/spec/models/blog_spec.rb b/spec/models/blog_spec.rb index 176157ab0e..6e6e8c3a8b 100644 --- a/spec/models/blog_spec.rb +++ b/spec/models/blog_spec.rb @@ -22,9 +22,9 @@ end end - describe '#items' do + describe '#posts' do let(:blog) { described_class.new } - subject(:items) { blog.items } + subject(:posts) { blog.posts } context 'when feed is fetched successfully' do before do @@ -36,7 +36,7 @@ end it 'parses an item from an example feed' do - expect(items.count).to eq(1) + expect(posts.count).to eq(1) end end @@ -48,7 +48,7 @@ end it 'should fail silently if the blog is returning an error' do - expect(items.count).to eq(0) + expect(posts.count).to eq(0) end end end diff --git a/spec/views/general/blog.html.erb_spec.rb b/spec/views/general/blog.html.erb_spec.rb index 71dc0ee8ae..38664437c7 100644 --- a/spec/views/general/blog.html.erb_spec.rb +++ b/spec/views/general/blog.html.erb_spec.rb @@ -4,14 +4,14 @@ subject { rendered } before do - assign :blog, double(items: blog_items) + assign :blog, double(posts: blog_posts) assign :twitter_user, double.as_null_object assign :facebook_user, double.as_null_object render end context 'with a creator and date' do - let(:blog_items) do + let(:blog_posts) do [{ 'title' => 'foo', 'link' => 'https://www.example.com/foo', 'creator' => ['Bob'], @@ -22,7 +22,7 @@ end context 'with an author and date' do - let(:blog_items) do + let(:blog_posts) do [{ 'title' => 'foo', 'link' => 'https://www.example.com/foo', 'author' => ['Bob'], @@ -33,7 +33,7 @@ end context 'with a date and no author or creator' do - let(:blog_items) do + let(:blog_posts) do [{ 'title' => 'foo', 'link' => 'https://www.example.com/foo', 'pubDate' => ['Mon, 01 Apr 2013 19:26:08 +0000'] }] From bc8c0f591c4f7776a59f7004cdcc377ea0679740 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 14 Mar 2023 17:19:44 +0000 Subject: [PATCH 231/289] Blog posts model --- app/models/blog.rb | 4 ++ app/models/blog/post.rb | 16 ++++++++ .../20230314171033_create_blog_posts.rb | 11 ++++++ spec/factories/blog/posts.rb | 18 +++++++++ spec/models/blog/post_spec.rb | 37 +++++++++++++++++++ 5 files changed, 86 insertions(+) create mode 100644 app/models/blog/post.rb create mode 100644 db/migrate/20230314171033_create_blog_posts.rb create mode 100644 spec/factories/blog/posts.rb create mode 100644 spec/models/blog/post_spec.rb diff --git a/app/models/blog.rb b/app/models/blog.rb index 90b68fced5..492f1ef557 100644 --- a/app/models/blog.rb +++ b/app/models/blog.rb @@ -13,6 +13,10 @@ def self.enabled? AlaveteliConfiguration.blog_feed.present? end + def self.table_name_prefix + 'blog_' + end + def posts return [] if content.empty? diff --git a/app/models/blog/post.rb b/app/models/blog/post.rb new file mode 100644 index 0000000000..69ae0da44a --- /dev/null +++ b/app/models/blog/post.rb @@ -0,0 +1,16 @@ +# == Schema Information +# Schema version: 20230314171033 +# +# Table name: blog_posts +# +# id :bigint not null, primary key +# title :string +# url :string +# data :jsonb +# created_at :datetime not null +# updated_at :datetime not null +# +class Blog::Post < ApplicationRecord + validates_presence_of :title, :url + validates_uniqueness_of :url +end diff --git a/db/migrate/20230314171033_create_blog_posts.rb b/db/migrate/20230314171033_create_blog_posts.rb new file mode 100644 index 0000000000..32c6181fba --- /dev/null +++ b/db/migrate/20230314171033_create_blog_posts.rb @@ -0,0 +1,11 @@ +class CreateBlogPosts < ActiveRecord::Migration[7.0] + def change + create_table :blog_posts do |t| + t.string :title + t.string :url + t.jsonb :data + + t.timestamps + end + end +end diff --git a/spec/factories/blog/posts.rb b/spec/factories/blog/posts.rb new file mode 100644 index 0000000000..7e9ee15704 --- /dev/null +++ b/spec/factories/blog/posts.rb @@ -0,0 +1,18 @@ +# == Schema Information +# Schema version: 20230314171033 +# +# Table name: blog_posts +# +# id :bigint not null, primary key +# title :string +# url :string +# data :jsonb +# created_at :datetime not null +# updated_at :datetime not null +# +FactoryBot.define do + factory :blog_post, class: 'Blog::Post' do + sequence(:title) { |n| "My fancy blog post - part #{n}" } + sequence(:url) { |n| "http://example.com/blog_post_#{n}" } + end +end diff --git a/spec/models/blog/post_spec.rb b/spec/models/blog/post_spec.rb new file mode 100644 index 0000000000..efe539ff07 --- /dev/null +++ b/spec/models/blog/post_spec.rb @@ -0,0 +1,37 @@ +# == Schema Information +# Schema version: 20230314171033 +# +# Table name: blog_posts +# +# id :bigint not null, primary key +# title :string +# url :string +# data :jsonb +# created_at :datetime not null +# updated_at :datetime not null +# +require 'spec_helper' + +RSpec.describe Blog::Post, type: :model do + let(:post) { FactoryBot.build(:blog_post) } + + describe 'validations' do + specify { expect(post).to be_valid } + + it 'requires title' do + post.title = nil + expect(post).not_to be_valid + end + + it 'requires url' do + post.url = nil + expect(post).not_to be_valid + end + + it 'requires unique url' do + FactoryBot.create(:blog_post, url: 'http://example.com/blog_post_1') + post.url = 'http://example.com/blog_post_1' + expect(post).not_to be_valid + end + end +end From 1cd4fbe9dfda7ad1a397256a48a2807062d515fe Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 15 Mar 2023 07:21:34 +0000 Subject: [PATCH 232/289] Update blog rendering Render blog items from the database. --- app/views/general/blog.html.erb | 24 +++++++------- spec/views/general/blog.html.erb_spec.rb | 42 +++++++++++++++--------- 2 files changed, 39 insertions(+), 27 deletions(-) diff --git a/app/views/general/blog.html.erb b/app/views/general/blog.html.erb index e86cb25e02..00ecaeb6c9 100644 --- a/app/views/general/blog.html.erb +++ b/app/views/general/blog.html.erb @@ -6,16 +6,16 @@
    <% @blog.posts.each do |post| %>
    - <% date = Time.zone.parse(post['pubDate'][0]) %> + <% date = Time.zone.parse(post.data['pubDate'][0]) %>

    - - <%=h post['title'][0] %> + + <%=h post.title %>

    <% author = - post['creator'] ? post['creator']&.first : post['author']&.first %> + post.data['creator'] ? post.data['creator']&.first : post.data['author']&.first %> <% if author && date %>

    @@ -30,20 +30,20 @@ <% end %>

    - <% if post['encoded'] %> - <%= sanitize(raw post['encoded'][0]) %> - <% elsif post['description'] %> - <%= sanitize(raw post['description'][0]) %> + <% if post.data['encoded'] %> + <%= sanitize(raw post.data['encoded'][0]) %> + <% elsif post.data['description'] %> + <%= sanitize(raw post.data['description'][0]) %> <% end %>

    - <% if post['comments'] %> - <%= n_( + <% if post.data['comments'] %> + <%= n_( "{{number_of_comments}} comment", "{{number_of_comments}} comments", - post['comments'][1], - :number_of_comments=>post['comments'][1]) %> + post.data['comments'][1], + :number_of_comments=>post.data['comments'][1]) %> <% end %>

    diff --git a/spec/views/general/blog.html.erb_spec.rb b/spec/views/general/blog.html.erb_spec.rb index 38664437c7..48bfd9ff06 100644 --- a/spec/views/general/blog.html.erb_spec.rb +++ b/spec/views/general/blog.html.erb_spec.rb @@ -4,39 +4,51 @@ subject { rendered } before do - assign :blog, double(posts: blog_posts) + assign :blog, double(posts: [double(blog_post_attributes)]) assign :twitter_user, double.as_null_object assign :facebook_user, double.as_null_object render end context 'with a creator and date' do - let(:blog_posts) do - [{ 'title' => 'foo', - 'link' => 'https://www.example.com/foo', - 'creator' => ['Bob'], - 'pubDate' => ['Mon, 01 Apr 2013 19:26:08 +0000'] }] + let(:blog_post_attributes) do + { + title: 'foo', + url: 'https://www.example.com/foo', + data: { + 'creator' => ['Bob'], + 'pubDate' => ['Mon, 01 Apr 2013 19:26:08 +0000'] + } + } end it { is_expected.to match(/Posted on.*April 01, 2013.*by Bob/) } end context 'with an author and date' do - let(:blog_posts) do - [{ 'title' => 'foo', - 'link' => 'https://www.example.com/foo', - 'author' => ['Bob'], - 'pubDate' => ['Mon, 01 Apr 2013 19:26:08 +0000'] }] + let(:blog_post_attributes) do + { + title: 'foo', + url: 'https://www.example.com/foo', + data: { + 'author' => ['Bob'], + 'pubDate' => ['Mon, 01 Apr 2013 19:26:08 +0000'] + } + } end it { is_expected.to match(/Posted on.*April 01, 2013.*by Bob/) } end context 'with a date and no author or creator' do - let(:blog_posts) do - [{ 'title' => 'foo', - 'link' => 'https://www.example.com/foo', - 'pubDate' => ['Mon, 01 Apr 2013 19:26:08 +0000'] }] + let(:blog_post_attributes) do + { + title: 'foo', + url: 'https://www.example.com/foo', + data: { + 'pubDate' => ['Mon, 01 Apr 2013 19:26:08 +0000'] + } + } end it { is_expected.to match(/Posted on.*April 01, 2013/) } From dc6e860a3e338a6e5499a5fc3d3bf1a1cedaee2f Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 15 Mar 2023 08:16:34 +0000 Subject: [PATCH 233/289] Store Blog::Post in database --- app/models/blog.rb | 9 ++++++--- spec/models/blog_spec.rb | 30 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/app/models/blog.rb b/app/models/blog.rb index 492f1ef557..feb3b41ded 100644 --- a/app/models/blog.rb +++ b/app/models/blog.rb @@ -20,9 +20,12 @@ def self.table_name_prefix def posts return [] if content.empty? - data = XmlSimple.xml_in(content) - channel = data['channel'][0] - channel.fetch('item') { [] } + posts = XmlSimple.xml_in(content)['channel'][0].fetch('item', []).reverse + posts.map do |data| + Blog::Post.find_or_initialize_by(url: data['link'][0]).tap do |post| + post.update(title: data['title'][0], data: data) + end + end end def feeds diff --git a/spec/models/blog_spec.rb b/spec/models/blog_spec.rb index 6e6e8c3a8b..1a1627264b 100644 --- a/spec/models/blog_spec.rb +++ b/spec/models/blog_spec.rb @@ -38,6 +38,36 @@ it 'parses an item from an example feed' do expect(posts.count).to eq(1) end + + it 'returns Blog::Post objects' do + expect(posts).to all be_a(Blog::Post) + end + + it 'maps feed title to model title' do + expect(posts.first.title).to eq('Example Post') + end + + it 'maps feed link to model url' do + expect(posts.first.url).to eq('http://www.example.com/example-post') + end + + it 'maps feed to model data' do + expect(posts.first.data).to include( + 'category' => ['FOI'], + 'creator' => ['Example Blogger'], + 'comments' => ['http://www.example.com/example-post#comments', '2'], + 'pubDate' => ['Mon, 01 Apr 2013 19:26:08 +0000'] + ) + end + + it 'updates existing Blog::Post object when URL matches' do + existing = FactoryBot.create( + :blog_post, url: 'http://www.example.com/example-post' + ) + expect { posts }.to change { existing.reload.title }. + from('My fancy blog post - part 1'). + to('Example Post') + end end context 'when feed returns an error' do From a6f7773fdfdefd9cf543620e939254fb04eaf4b4 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 21 Mar 2023 17:36:38 +0000 Subject: [PATCH 234/289] Fix transient spec failure Add known initial `Blog::Post#title` value. This fixes some CI failures due to order the specs run. --- spec/models/blog_spec.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spec/models/blog_spec.rb b/spec/models/blog_spec.rb index 1a1627264b..6407fe21b6 100644 --- a/spec/models/blog_spec.rb +++ b/spec/models/blog_spec.rb @@ -62,10 +62,12 @@ it 'updates existing Blog::Post object when URL matches' do existing = FactoryBot.create( - :blog_post, url: 'http://www.example.com/example-post' + :blog_post, + title: 'My fancy blog post', + url: 'http://www.example.com/example-post' ) expect { posts }.to change { existing.reload.title }. - from('My fancy blog post - part 1'). + from('My fancy blog post'). to('Example Post') end end From 495150cbcc27b8e47d5a0384155c18899411d5e3 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 15 Mar 2023 10:49:15 +0000 Subject: [PATCH 235/289] Add blog post admin controller --- .../admin/blog_posts_controller.rb | 11 +++++ .../admin/blog_posts/_blog_post.html.erb | 24 +++++++++++ app/views/admin/blog_posts/index.html.erb | 21 ++++++++++ .../admin_general/_admin_navbar.html.erb | 1 + config/routes.rb | 6 +++ .../admin/blog_posts_controller_spec.rb | 41 +++++++++++++++++++ 6 files changed, 104 insertions(+) create mode 100644 app/controllers/admin/blog_posts_controller.rb create mode 100644 app/views/admin/blog_posts/_blog_post.html.erb create mode 100644 app/views/admin/blog_posts/index.html.erb create mode 100644 spec/controllers/admin/blog_posts_controller_spec.rb diff --git a/app/controllers/admin/blog_posts_controller.rb b/app/controllers/admin/blog_posts_controller.rb new file mode 100644 index 0000000000..e35a66bd09 --- /dev/null +++ b/app/controllers/admin/blog_posts_controller.rb @@ -0,0 +1,11 @@ +## +# Controller to manage tags for Blog::Post objects +# +class Admin::BlogPostsController < AdminController + def index + @blog_posts = Blog::Post.order(id: :desc).paginate( + page: params[:page], + per_page: 25 + ) + end +end diff --git a/app/views/admin/blog_posts/_blog_post.html.erb b/app/views/admin/blog_posts/_blog_post.html.erb new file mode 100644 index 0000000000..297cce69c5 --- /dev/null +++ b/app/views/admin/blog_posts/_blog_post.html.erb @@ -0,0 +1,24 @@ +
    +
    + + + <%= chevron_right %> + + <%= blog_post.title %> + +
    + +
    + <% blog_post.for_admin_column do |name, value| %> +
    + + <%= name.humanize %> + + + + <%= admin_value(value) %> + +
    + <% end %> +
    +
    diff --git a/app/views/admin/blog_posts/index.html.erb b/app/views/admin/blog_posts/index.html.erb new file mode 100644 index 0000000000..8623dee677 --- /dev/null +++ b/app/views/admin/blog_posts/index.html.erb @@ -0,0 +1,21 @@ +<% @title = 'Blog Posts' %> + +

    <%= @title %>

    + +<% if Blog.enabled? %> + <% if @blog_posts.size > 0 %> + <%= render partial: 'admin/blog_posts/blog_post', collection: @blog_posts %> + <% else %> +
    +

    None yet.

    +
    + <% end %> + + <%= will_paginate(@blog_posts) %> +<% else %> +
    +

    Blog Posts Disabled

    + To enable blog posts set BLOG_FEED to the URL of your external blog + feed in Alaveteli’s configuration. +
    +<% end %> diff --git a/app/views/admin_general/_admin_navbar.html.erb b/app/views/admin_general/_admin_navbar.html.erb index e93d8daa37..8838e892bd 100644 --- a/app/views/admin_general/_admin_navbar.html.erb +++ b/app/views/admin_general/_admin_navbar.html.erb @@ -53,6 +53,7 @@
    diff --git a/app/views/admin/blog_posts/_form.html.erb b/app/views/admin/blog_posts/_form.html.erb new file mode 100644 index 0000000000..4e761b21cc --- /dev/null +++ b/app/views/admin/blog_posts/_form.html.erb @@ -0,0 +1 @@ +<%= foi_error_messages_for :blog_post %> diff --git a/app/views/admin/blog_posts/_intro.html.erb b/app/views/admin/blog_posts/_intro.html.erb new file mode 100644 index 0000000000..ce4cd89294 --- /dev/null +++ b/app/views/admin/blog_posts/_intro.html.erb @@ -0,0 +1,3 @@ + diff --git a/app/views/admin/blog_posts/edit.html.erb b/app/views/admin/blog_posts/edit.html.erb new file mode 100644 index 0000000000..6c783a4fd1 --- /dev/null +++ b/app/views/admin/blog_posts/edit.html.erb @@ -0,0 +1,16 @@ +
    +
    + +
    +
    + +<%= render partial: 'intro', locals: { blog_post: @blog_post } %> + +<%= form_for [:admin, @blog_post], class: 'form form-horizontal' do |f| %> + <%= render partial: 'form', locals: { f: f } %> +
    + <%= submit_tag 'Save', class: 'btn btn-success' %> +
    +<% end %> diff --git a/config/routes.rb b/config/routes.rb index 2072b85895..88e9b7f29b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -497,7 +497,7 @@ def matches?(request) #### Admin::BlogPosts controller namespace :admin do - resources :blog_posts, only: [:index] + resources :blog_posts, only: [:index, :edit, :update] end #### diff --git a/spec/controllers/admin/blog_posts_controller_spec.rb b/spec/controllers/admin/blog_posts_controller_spec.rb index 693c1ce0dc..ff1c035575 100644 --- a/spec/controllers/admin/blog_posts_controller_spec.rb +++ b/spec/controllers/admin/blog_posts_controller_spec.rb @@ -38,4 +38,78 @@ with(page: '1', per_page: 25) end end + + describe 'GET edit' do + context 'blog post exists' do + let(:blog_post) { FactoryBot.create(:blog_post) } + + it 'renders the edit template' do + get :edit, params: { id: blog_post.id } + expect(response).to render_template('edit') + end + + it 'loads blog post by ID' do + get :edit, params: { id: blog_post.id } + expect(assigns[:blog_post]).to eq(blog_post) + end + + it 'responds successfully' do + get :edit, params: { id: blog_post.id } + expect(response).to be_successful + end + end + + context 'blog post does not exists' do + it 'returns a 404' do + expect { get :edit, params: { id: 1 } }.to raise_error( + ActiveRecord::RecordNotFound + ) + end + end + end + + describe 'PATCH #update' do + let(:blog_post) { FactoryBot.build(:blog_post, id: 1) } + + before do + allow(Blog::Post).to receive(:find).and_return(blog_post) + end + + context 'when a successful update' do + before do + allow(blog_post).to receive(:update).and_return(true) + end + + it 'assigns the blog post' do + patch :update, params: { id: blog_post.id } + expect(assigns[:blog_post]).to eq(blog_post) + end + + it 'sets a notice' do + patch :update, params: { id: blog_post.id } + expect(flash[:notice]).to eq('Blog Post successfully updated.') + end + + it 'redirects to the blog posts admin' do + patch :update, params: { id: blog_post.id } + expect(response).to redirect_to(admin_blog_posts_path) + end + end + + context 'on an unsuccessful update' do + before do + allow(blog_post).to receive(:update).and_return(false) + end + + it 'assigns the blog post' do + patch :update, params: { id: blog_post.id } + expect(assigns[:blog_post]).to eq(blog_post) + end + + it 'renders the form again' do + patch :update, params: { id: blog_post.id } + expect(response).to render_template(:edit) + end + end + end end From 17bcb57f1f6c5cc8b23849ac6c459c4ec3429f27 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 15 Mar 2023 17:11:28 +0000 Subject: [PATCH 237/289] Add blog post to both_links --- app/helpers/admin/link_helper.rb | 13 +++++++++++-- app/views/admin/blog_posts/_blog_post.html.erb | 2 +- app/views/admin/blog_posts/_intro.html.erb | 2 +- spec/helpers/admin/link_helper_spec.rb | 8 ++++++++ 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/app/helpers/admin/link_helper.rb b/app/helpers/admin/link_helper.rb index 02c8557ce2..5bbd39f6bd 100644 --- a/app/helpers/admin/link_helper.rb +++ b/app/helpers/admin/link_helper.rb @@ -1,8 +1,8 @@ # Helpers for rendering record links in the admin interface module Admin::LinkHelper def both_links(record) - method = "#{record.class.to_s.underscore}_both_links" - send(method, record) + type = record.class.to_s.underscore.parameterize(separator: '_') + send("#{type}_both_links", record) end private @@ -85,6 +85,15 @@ def comment_both_links(comment) title: admin_title) end + def blog_post_both_links(blog_post) + title = 'View blog post' + icon = eye + + link_to(icon, blog_post.url, title: title) + ' ' + + link_to(blog_post.title, edit_admin_blog_post_path(blog_post), + title: admin_title) + end + def admin_title 'View full details' end diff --git a/app/views/admin/blog_posts/_blog_post.html.erb b/app/views/admin/blog_posts/_blog_post.html.erb index e48f9388ba..7da3e22fde 100644 --- a/app/views/admin/blog_posts/_blog_post.html.erb +++ b/app/views/admin/blog_posts/_blog_post.html.erb @@ -4,7 +4,7 @@ <%= chevron_right %> - <%= link_to blog_post.title, edit_admin_blog_post_path(blog_post) %> + <%= both_links(blog_post) %>
    diff --git a/app/views/admin/blog_posts/_intro.html.erb b/app/views/admin/blog_posts/_intro.html.erb index ce4cd89294..da57bf5441 100644 --- a/app/views/admin/blog_posts/_intro.html.erb +++ b/app/views/admin/blog_posts/_intro.html.erb @@ -1,3 +1,3 @@ diff --git a/spec/helpers/admin/link_helper_spec.rb b/spec/helpers/admin/link_helper_spec.rb index 71fb1a423b..ed49c1fb53 100644 --- a/spec/helpers/admin/link_helper_spec.rb +++ b/spec/helpers/admin/link_helper_spec.rb @@ -88,5 +88,13 @@ it { is_expected.to include(comment_path(record)) } it { is_expected.to include(edit_admin_comment_path(record)) } end + + context 'with a Blog Post' do + let(:record) { FactoryBot.create(:blog_post) } + + it { is_expected.to include('icon-eye-open') } + it { is_expected.to include(record.url) } + it { is_expected.to include(edit_admin_blog_post_path(record)) } + end end end From 6c9020e06abdccb7132c1f554bfa993a409fe4c7 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 15 Mar 2023 17:05:13 +0000 Subject: [PATCH 238/289] Add taggable to blog posts --- app/controllers/admin/blog_posts_controller.rb | 4 +++- app/models/blog/post.rb | 6 ++++++ app/views/admin/blog_posts/_blog_post.html.erb | 4 ++++ app/views/admin/blog_posts/_form.html.erb | 8 ++++++++ app/views/admin/blog_posts/index.html.erb | 6 ++++++ app/views/admin/tags/_tagging.html.erb | 5 +++++ spec/controllers/admin/blog_posts_controller_spec.rb | 11 ++++++----- spec/models/blog/post_spec.rb | 3 +++ 8 files changed, 41 insertions(+), 6 deletions(-) diff --git a/app/controllers/admin/blog_posts_controller.rb b/app/controllers/admin/blog_posts_controller.rb index e87262ec38..87a8f1732a 100644 --- a/app/controllers/admin/blog_posts_controller.rb +++ b/app/controllers/admin/blog_posts_controller.rb @@ -30,6 +30,8 @@ def find_blog_post end def blog_post_params - {} + params.require(:blog_post).permit( + :tag_string + ) end end diff --git a/app/models/blog/post.rb b/app/models/blog/post.rb index 69ae0da44a..ff0e91abde 100644 --- a/app/models/blog/post.rb +++ b/app/models/blog/post.rb @@ -11,6 +11,12 @@ # updated_at :datetime not null # class Blog::Post < ApplicationRecord + include Taggable + + def self.admin_title + 'Blog Post' + end + validates_presence_of :title, :url validates_uniqueness_of :url end diff --git a/app/views/admin/blog_posts/_blog_post.html.erb b/app/views/admin/blog_posts/_blog_post.html.erb index 7da3e22fde..cc23d735cf 100644 --- a/app/views/admin/blog_posts/_blog_post.html.erb +++ b/app/views/admin/blog_posts/_blog_post.html.erb @@ -6,6 +6,10 @@ <%= both_links(blog_post) %> + +
    diff --git a/app/views/admin/blog_posts/_form.html.erb b/app/views/admin/blog_posts/_form.html.erb index 4e761b21cc..28ee89666a 100644 --- a/app/views/admin/blog_posts/_form.html.erb +++ b/app/views/admin/blog_posts/_form.html.erb @@ -1 +1,9 @@ <%= foi_error_messages_for :blog_post %> + +
    + <%= f.label :tag_string, 'Tags', class: 'control-label' %> + +
    + <%= f.text_field :tag_string, class: 'span4' %> +
    +
    diff --git a/app/views/admin/blog_posts/index.html.erb b/app/views/admin/blog_posts/index.html.erb index 8623dee677..0adf3d90bb 100644 --- a/app/views/admin/blog_posts/index.html.erb +++ b/app/views/admin/blog_posts/index.html.erb @@ -3,6 +3,12 @@

    <%= @title %>

    <% if Blog.enabled? %> +
    +
    + <%= link_to 'View tags', admin_tags_path(model_type: Blog::Post), class: 'btn' %> +
    +
    + <% if @blog_posts.size > 0 %> <%= render partial: 'admin/blog_posts/blog_post', collection: @blog_posts %> <% else %> diff --git a/app/views/admin/tags/_tagging.html.erb b/app/views/admin/tags/_tagging.html.erb index 3079577a5d..2db2fa89dd 100644 --- a/app/views/admin/tags/_tagging.html.erb +++ b/app/views/admin/tags/_tagging.html.erb @@ -19,6 +19,11 @@ note: tagging } %> +<% when Blog::Post %> + <%= render partial: 'admin/blog_posts/blog_post', locals: { + blog_post: tagging + } %> + <% else %>
    <%= tagging.to_json %>
    <% end %> diff --git a/spec/controllers/admin/blog_posts_controller_spec.rb b/spec/controllers/admin/blog_posts_controller_spec.rb index ff1c035575..d02aabd3f9 100644 --- a/spec/controllers/admin/blog_posts_controller_spec.rb +++ b/spec/controllers/admin/blog_posts_controller_spec.rb @@ -70,6 +70,7 @@ describe 'PATCH #update' do let(:blog_post) { FactoryBot.build(:blog_post, id: 1) } + let(:params) { { tag_string: 'foo' } } before do allow(Blog::Post).to receive(:find).and_return(blog_post) @@ -81,17 +82,17 @@ end it 'assigns the blog post' do - patch :update, params: { id: blog_post.id } + patch :update, params: { id: blog_post.id, blog_post: params } expect(assigns[:blog_post]).to eq(blog_post) end it 'sets a notice' do - patch :update, params: { id: blog_post.id } + patch :update, params: { id: blog_post.id, blog_post: params } expect(flash[:notice]).to eq('Blog Post successfully updated.') end it 'redirects to the blog posts admin' do - patch :update, params: { id: blog_post.id } + patch :update, params: { id: blog_post.id, blog_post: params } expect(response).to redirect_to(admin_blog_posts_path) end end @@ -102,12 +103,12 @@ end it 'assigns the blog post' do - patch :update, params: { id: blog_post.id } + patch :update, params: { id: blog_post.id, blog_post: params } expect(assigns[:blog_post]).to eq(blog_post) end it 'renders the form again' do - patch :update, params: { id: blog_post.id } + patch :update, params: { id: blog_post.id, blog_post: params } expect(response).to render_template(:edit) end end diff --git a/spec/models/blog/post_spec.rb b/spec/models/blog/post_spec.rb index efe539ff07..0f03a3db2b 100644 --- a/spec/models/blog/post_spec.rb +++ b/spec/models/blog/post_spec.rb @@ -11,8 +11,11 @@ # updated_at :datetime not null # require 'spec_helper' +require 'models/concerns/taggable' RSpec.describe Blog::Post, type: :model do + it_behaves_like 'concerns/taggable', :blog_post + let(:post) { FactoryBot.build(:blog_post) } describe 'validations' do From f6827e1e9ebb401a80782a53bad7bb5e566d4f05 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 23 Mar 2023 10:15:45 +0000 Subject: [PATCH 239/289] Fix blog post ordering The blog page should have the latest post at the top, this is the same order as the external feed. This was changed in #7642 to ensure the `Blog::Post#id` incremented correctly so posts could be sorted in SQL queries without extracting the published date. --- app/models/blog.rb | 2 +- spec/fixtures/files/blog_feed.atom | 17 +++++++++++++++++ spec/models/blog_spec.rb | 7 ++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/models/blog.rb b/app/models/blog.rb index feb3b41ded..6148ab0fc0 100644 --- a/app/models/blog.rb +++ b/app/models/blog.rb @@ -25,7 +25,7 @@ def posts Blog::Post.find_or_initialize_by(url: data['link'][0]).tap do |post| post.update(title: data['title'][0], data: data) end - end + end.reverse end def feeds diff --git a/spec/fixtures/files/blog_feed.atom b/spec/fixtures/files/blog_feed.atom index a831243b4c..ea47477e7b 100644 --- a/spec/fixtures/files/blog_feed.atom +++ b/spec/fixtures/files/blog_feed.atom @@ -33,6 +33,23 @@ ]]> http://www.example.com/feed/ 2 + + + + Other Post + http://www.example.com/other-post + http://www.example.com/other-post#comments + Mon, 01 Mar 2013 12:00:00 +0000 + Example Blogger + + + http://www.example.com/?id=332 + + A blog post +

    Another example post

    +]]>
    + http://www.example.com/feed/ + 0
    diff --git a/spec/models/blog_spec.rb b/spec/models/blog_spec.rb index 6407fe21b6..6df1fb241e 100644 --- a/spec/models/blog_spec.rb +++ b/spec/models/blog_spec.rb @@ -36,7 +36,7 @@ end it 'parses an item from an example feed' do - expect(posts.count).to eq(1) + expect(posts.count).to eq(2) end it 'returns Blog::Post objects' do @@ -70,6 +70,11 @@ from('My fancy blog post'). to('Example Post') end + + it 'returns BLog::Post in the same order as the feed' do + expect(posts.first.title).to eq('Example Post') + expect(posts.second.title).to eq('Other Post') + end end context 'when feed returns an error' do From 6ac2552c9d6854204bf2984dc8a697c06c35d44e Mon Sep 17 00:00:00 2001 From: Miroslav Date: Thu, 9 Mar 2023 23:16:07 +0100 Subject: [PATCH 240/289] Adding localisation to resent notice --- .../_resent_outgoing_correspondence.html.erb | 21 +++++++++++++------ .../_resent_outgoing_correspondence.text.erb | 19 ++++++++++++++++- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/app/views/request/_resent_outgoing_correspondence.html.erb b/app/views/request/_resent_outgoing_correspondence.html.erb index 00ccd5f5df..2410819f67 100644 --- a/app/views/request/_resent_outgoing_correspondence.html.erb +++ b/app/views/request/_resent_outgoing_correspondence.html.erb @@ -4,14 +4,23 @@

    - Sent - <% if outgoing_message.message_type == 'initial_request' %> - request - <% elsif outgoing_message.message_type == 'followup' %> - a follow up + <% case [outgoing_message.message_type, info_request_event.same_email_as_previous_send?] %> + <% in ['initial_request', true] %> + <%= _('Sent request to {{public_body_link}} again.', + public_body_link: public_body_link(@info_request.public_body)) %> + <% in ['initial_request', false] %> + <%= _('Sent request to {{public_body_link}} again, using a new contact ' \ + 'address.', + public_body_link: public_body_link(@info_request.public_body)) %> + <% in ['followup', true] %> + <%= _('Sent a follow up to {{public_body_link}} again.', + public_body_link: public_body_link(@info_request.public_body)) %> + <% in ['followup', false] %> + <%= _('Sent a follow up to {{public_body_link}} again, using a new ' \ + 'contact address.', + public_body_link: public_body_link(@info_request.public_body)) %> <% else %> <% raise "unknown message_type" %> <% end %> - to <%= public_body_link(@info_request.public_body) %> again<% if not info_request_event.same_email_as_previous_send? %>, using a new contact address<% end %>.

    diff --git a/app/views/request/_resent_outgoing_correspondence.text.erb b/app/views/request/_resent_outgoing_correspondence.text.erb index d39f8395b2..d226fab559 100644 --- a/app/views/request/_resent_outgoing_correspondence.text.erb +++ b/app/views/request/_resent_outgoing_correspondence.text.erb @@ -1,2 +1,19 @@ <%= _('Date:') %> <%= simple_date(info_request_event.created_at, :format => :text) %> -Sent <% if outgoing_message.message_type == 'initial_request' %> request <% elsif outgoing_message.message_type == 'followup' %> a follow up <% else %> <% raise "unknown message_type" %><% end %> to <%= public_body_link(@info_request.public_body) %> again<% if not info_request_event.same_email_as_previous_send? %>, using a new contact address<% end %>. +<% case [outgoing_message.message_type, info_request_event.same_email_as_previous_send?] %> +<% in ['initial_request', true] %> +<%= _('Sent request to {{public_body_name}} again.', + public_body_name: @info_request.public_body.name) %> +<% in ['initial_request', false] %> +<%= _('Sent request to {{public_body_name}} again, using a new contact ' \ + 'address.', + public_body_name: @info_request.public_body.name) %> +<% in ['followup', true] %> +<%= _('Sent a follow up to {{public_body_name}} again.', + public_body_name: @info_request.public_body.name) %> +<% in ['followup', false] %> +<%= _('Sent a follow up to {{public_body_name}} again, using a new contact ' \ + 'address.', + public_body_name: @info_request.public_body.name) %> +<% else %> +<% raise "unknown message_type" %> +<% end %> From 191de38dedbc814d2ab3d07234f6da3b222b492e Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Tue, 21 Mar 2023 09:10:32 +0000 Subject: [PATCH 241/289] Reduce prominence of defunct bodies in lists The small "Defunct" label at the bottom of the authority listing is easily missable. This adds all tags as CSS classes to hook off, and applies styling to the case where an authority is defunct to make it clearer that it's "gone". Not a "fix", but mitigates: * https://github.com/mysociety/alaveteli/issues/721 * https://github.com/mysociety/alaveteli/issues/7107 * https://github.com/mysociety/alaveteli/issues/7651 --- .../stylesheets/responsive/_lists_style.scss | 8 ++++++ app/helpers/taggable_helper.rb | 7 +++++ .../public_body/_body_listing_single.html.erb | 2 +- doc/CHANGES.md | 1 + spec/helpers/taggable_helper_spec.rb | 26 +++++++++++++++++++ 5 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 app/helpers/taggable_helper.rb create mode 100644 spec/helpers/taggable_helper_spec.rb diff --git a/app/assets/stylesheets/responsive/_lists_style.scss b/app/assets/stylesheets/responsive/_lists_style.scss index 0e59a74eb6..1ca93ae848 100644 --- a/app/assets/stylesheets/responsive/_lists_style.scss +++ b/app/assets/stylesheets/responsive/_lists_style.scss @@ -15,6 +15,14 @@ } } +.body_listing.tag--defunct { + color: grey; + + a { + color: grey; + } +} + .request_listing{ .bottomline { background-position:top left; diff --git a/app/helpers/taggable_helper.rb b/app/helpers/taggable_helper.rb new file mode 100644 index 0000000000..3ab8a75a63 --- /dev/null +++ b/app/helpers/taggable_helper.rb @@ -0,0 +1,7 @@ +# Helpers for Taggable records +module TaggableHelper + # Generate CSS classes for each tag of a given Taggable + def tags_css(taggable) + taggable.tags.map { |tag| "tag--#{tag.name}" }.join(' ') + end +end diff --git a/app/views/public_body/_body_listing_single.html.erb b/app/views/public_body/_body_listing_single.html.erb index 35208b9b81..48610a8931 100644 --- a/app/views/public_body/_body_listing_single.html.erb +++ b/app/views/public_body/_body_listing_single.html.erb @@ -6,7 +6,7 @@ request_link = false unless defined?(request_link) %> -
    +
    <%= link_to highlight_words(public_body.name, @highlight_words), public_body_path(public_body) %>
    diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 7ece89c3b3..3fc703c61b 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -2,6 +2,7 @@ ## Highlighted Features +* Reduce the visual prominence of defunct bodies in lists (Gareth Rees) * Add ability to paginate through requests in a batch (Gareth Rees) * Add list of batch requests to admin user page (Gareth Rees) * Add daily limit to user message creation (Gareth Rees) diff --git a/spec/helpers/taggable_helper_spec.rb b/spec/helpers/taggable_helper_spec.rb new file mode 100644 index 0000000000..bda56b93d0 --- /dev/null +++ b/spec/helpers/taggable_helper_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +RSpec.describe TaggableHelper do + include TaggableHelper + + describe '#tags_css' do + subject { tags_css(taggable) } + + let(:taggable) { FactoryBot.build(:public_body, tag_string: tag_string) } + + context 'when the taggable has tags' do + let(:tag_string) { 'foo bar_baz' } + it { is_expected.to eq('tag--foo tag--bar_baz') } + end + + context 'when the taggable has tags with values' do + let(:tag_string) { 'foo bar:baz' } + it { is_expected.to eq('tag--foo tag--bar') } + end + + context 'when the taggable has no tags' do + let(:tag_string) { '' } + it { is_expected.to be_empty } + end + end +end From ce5792848734591af598560f68a75ff00b68a5f4 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 21 Mar 2023 14:49:37 +0000 Subject: [PATCH 242/289] Move existing health checks to /health/checks Will allow us to add additional routes under /health for example metrics. --- app/controllers/health/checks_controller.rb | 19 +++++++++++++++++++ app/controllers/health_checks_controller.rb | 13 ------------- .../checks}/index.html.erb | 0 config/routes.rb | 5 ++++- .../checks_controller_spec.rb} | 6 +----- 5 files changed, 24 insertions(+), 19 deletions(-) create mode 100644 app/controllers/health/checks_controller.rb delete mode 100644 app/controllers/health_checks_controller.rb rename app/views/{health_checks => health/checks}/index.html.erb (100%) rename spec/controllers/{health_checks_controller_spec.rb => health/checks_controller_spec.rb} (92%) diff --git a/app/controllers/health/checks_controller.rb b/app/controllers/health/checks_controller.rb new file mode 100644 index 0000000000..9abe3254db --- /dev/null +++ b/app/controllers/health/checks_controller.rb @@ -0,0 +1,19 @@ +module Health + ## + # This controller is responsible for running health checks and returning + # either a 200 or 500 response for internal monitoring alerting + # + # See checks configured in config/initializers/health_checks.rb + # + class ChecksController < ApplicationController + def index + @health_checks = HealthChecks.all + + if HealthChecks.ok? + render action: :index, layout: false + else + render action: :index, layout: false , status: 500 + end + end + end +end diff --git a/app/controllers/health_checks_controller.rb b/app/controllers/health_checks_controller.rb deleted file mode 100644 index 8710825e50..0000000000 --- a/app/controllers/health_checks_controller.rb +++ /dev/null @@ -1,13 +0,0 @@ -class HealthChecksController < ApplicationController - - def index - @health_checks = HealthChecks.all - - if HealthChecks.ok? - render action: :index, layout: false - else - render action: :index, layout: false , status: 500 - end - end - -end diff --git a/app/views/health_checks/index.html.erb b/app/views/health/checks/index.html.erb similarity index 100% rename from app/views/health_checks/index.html.erb rename to app/views/health/checks/index.html.erb diff --git a/config/routes.rb b/config/routes.rb index 88e9b7f29b..28ea599017 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -215,7 +215,10 @@ def matches?(request) end #### - resources :health_checks, :only => [:index] + namespace :health do + resources :checks, :only => [:index] + end + get '/health_checks' => redirect('/health/checks') resources :request, :only => [] do resource :report, :only => [:new, :create] diff --git a/spec/controllers/health_checks_controller_spec.rb b/spec/controllers/health/checks_controller_spec.rb similarity index 92% rename from spec/controllers/health_checks_controller_spec.rb rename to spec/controllers/health/checks_controller_spec.rb index 96a2aca8e0..9568ea9f23 100644 --- a/spec/controllers/health_checks_controller_spec.rb +++ b/spec/controllers/health/checks_controller_spec.rb @@ -1,9 +1,7 @@ require 'spec_helper' -RSpec.describe HealthChecksController do - +RSpec.describe Health::ChecksController do describe 'GET index' do - it 'returns a 200 if all health checks pass' do allow(HealthChecks).to receive_messages(ok?: true) get :index @@ -20,7 +18,5 @@ get :index expect(response).to render_template(layout: false) end - end - end From f26c408a5b3fa708be802d6eb79b1b3f34efc1a9 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 21 Mar 2023 17:31:06 +0000 Subject: [PATCH 243/289] Add Sidekiq health metrics Prometheus endpoint Prints the main Sidekiq metrics in Prometheus format. --- app/controllers/health/metrics_controller.rb | 15 +++++++++++ app/views/health/metrics/index.text.erb | 27 +++++++++++++++++++ config/routes.rb | 1 + .../health/metrics_controller_spec.rb | 20 ++++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 app/controllers/health/metrics_controller.rb create mode 100644 app/views/health/metrics/index.text.erb create mode 100644 spec/controllers/health/metrics_controller_spec.rb diff --git a/app/controllers/health/metrics_controller.rb b/app/controllers/health/metrics_controller.rb new file mode 100644 index 0000000000..c19e5c6acc --- /dev/null +++ b/app/controllers/health/metrics_controller.rb @@ -0,0 +1,15 @@ +module Health + ## + # This controller is responsible for providing an overview of system metrics + # for internal monitoring checks + # + class MetricsController < ApplicationController + skip_before_action :html_response + + layout false + + def index + @sidekiq_stats = Sidekiq::Stats.new + end + end +end diff --git a/app/views/health/metrics/index.text.erb b/app/views/health/metrics/index.text.erb new file mode 100644 index 0000000000..c12d866a00 --- /dev/null +++ b/app/views/health/metrics/index.text.erb @@ -0,0 +1,27 @@ +# HELP sidekiq_processed_jobs The total number of processed jobs. +# TYPE sidekiq_processed_jobs gauge +sidekiq_processed_job <%= @sidekiq_stats.processed %> + +# HELP sidekiq_busy_workers The number of workers performing a job. +# TYPE sidekiq_busy_workers gauge +sidekiq_busy_workers <%= @sidekiq_stats.workers_size %> + +# HELP sidekiq_enqueued_jobs The number of enqueued jobs waiting to be processed. +# TYPE sidekiq_enqueued_jobs gauge +sidekiq_enqueued_jobs <%= @sidekiq_stats.enqueued %> + +# HELP sidekiq_retry_jobs The number of failed jobs scheduled for a retry. +# TYPE sidekiq_retry_jobs gauge +sidekiq_retry_jobs <%= @sidekiq_stats.retry_size %> + +# HELP sidekiq_scheduled_jobs The number of jobs scheduled for a future execution. +# TYPE sidekiq_scheduled_jobs gauge +sidekiq_scheduled_jobs <%= @sidekiq_stats.scheduled_size %> + +# HELP sidekiq_failed_jobs The total number of failed jobs; these will be retried automatically. +# TYPE sidekiq_failed_jobs gauge +sidekiq_failed_jobs <%= @sidekiq_stats.failed %> + +# HELP sidekiq_processed_jobs Number of jobs that need manual intervention to retry +# TYPE sidekiq_dead_jobs gauge +sidekiq_dead_jobs <%= @sidekiq_stats.dead_size %> diff --git a/config/routes.rb b/config/routes.rb index 28ea599017..5fac394134 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -217,6 +217,7 @@ def matches?(request) namespace :health do resources :checks, :only => [:index] + resources :metrics, :only => [:index], :defaults => { :format => 'txt' } end get '/health_checks' => redirect('/health/checks') diff --git a/spec/controllers/health/metrics_controller_spec.rb b/spec/controllers/health/metrics_controller_spec.rb new file mode 100644 index 0000000000..7496aa73f1 --- /dev/null +++ b/spec/controllers/health/metrics_controller_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +RSpec.describe Health::MetricsController do + describe 'GET index' do + it 'returns a 200' do + get :index, format: 'txt' + expect(response.status).to eq(200) + end + + it 'assigns sidekiq_stats' do + get :index, format: 'txt' + expect(assigns[:sidekiq_stats]).to_not be_nil + end + + it 'does not render a layout' do + get :index, format: 'txt' + expect(response).to render_template(layout: false) + end + end +end From 97dcbce83e303a7b0d2f84544455721e311cf51f Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 21 Mar 2023 17:45:15 +0000 Subject: [PATCH 244/289] Add Xapian health metric to Prometheus endpoint Fixes #6965 --- app/controllers/health/metrics_controller.rb | 1 + app/views/health/metrics/index.text.erb | 4 ++++ spec/controllers/health/metrics_controller_spec.rb | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/app/controllers/health/metrics_controller.rb b/app/controllers/health/metrics_controller.rb index c19e5c6acc..ab1a30d12e 100644 --- a/app/controllers/health/metrics_controller.rb +++ b/app/controllers/health/metrics_controller.rb @@ -10,6 +10,7 @@ class MetricsController < ApplicationController def index @sidekiq_stats = Sidekiq::Stats.new + @xapian_queued_jobs = ActsAsXapian::ActsAsXapianJob.count end end end diff --git a/app/views/health/metrics/index.text.erb b/app/views/health/metrics/index.text.erb index c12d866a00..06c39b039e 100644 --- a/app/views/health/metrics/index.text.erb +++ b/app/views/health/metrics/index.text.erb @@ -25,3 +25,7 @@ sidekiq_failed_jobs <%= @sidekiq_stats.failed %> # HELP sidekiq_processed_jobs Number of jobs that need manual intervention to retry # TYPE sidekiq_dead_jobs gauge sidekiq_dead_jobs <%= @sidekiq_stats.dead_size %> + +# HELP xapian_queued_jobs The number of jobs in the Xapian queue +# TYPE xapian_queued_jobs gauge +xapian_queued_jobs <%= @xapian_queued_jobs %> diff --git a/spec/controllers/health/metrics_controller_spec.rb b/spec/controllers/health/metrics_controller_spec.rb index 7496aa73f1..7e3d1e9a7f 100644 --- a/spec/controllers/health/metrics_controller_spec.rb +++ b/spec/controllers/health/metrics_controller_spec.rb @@ -12,6 +12,11 @@ expect(assigns[:sidekiq_stats]).to_not be_nil end + it 'assigns xapian_queued_jobs' do + get :index, format: 'txt' + expect(assigns[:xapian_queued_jobs]).to_not be_nil + end + it 'does not render a layout' do get :index, format: 'txt' expect(response).to render_template(layout: false) From 64e8a46e40df0ed7689bec95e367792abe004817 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 05:04:43 +0000 Subject: [PATCH 245/289] Build(deps): Bump aws-sdk-s3 from 1.119.1 to 1.119.2 Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.119.1 to 1.119.2. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-s3/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) --- updated-dependencies: - dependency-name: aws-sdk-s3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5272e320da..1b5b7d1b3c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -120,16 +120,16 @@ GEM rake (>= 10.4, < 14.0) ast (2.4.2) aws-eventstream (1.2.0) - aws-partitions (1.714.0) - aws-sdk-core (3.170.0) + aws-partitions (1.735.0) + aws-sdk-core (3.171.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.5) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.62.0) + aws-sdk-kms (1.63.0) aws-sdk-core (~> 3, >= 3.165.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.119.1) + aws-sdk-s3 (1.119.2) aws-sdk-core (~> 3, >= 3.165.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) From ecd7d040032a530f7596c91f0862d5c58b7761b8 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 16 Mar 2023 12:58:08 +0000 Subject: [PATCH 246/289] Add container around authority more info Needed for the styling and padding before adding more to the authority sidebar. --- app/views/public_body/show.html.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/public_body/show.html.erb b/app/views/public_body/show.html.erb index 8d025c0b89..616ad2e3ff 100644 --- a/app/views/public_body/show.html.erb +++ b/app/views/public_body/show.html.erb @@ -153,13 +153,13 @@ <% end %>
    - From f55041671c4200e4f43300069b76b5721de3e6a7 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 16 Mar 2023 11:48:20 +0000 Subject: [PATCH 247/289] Add case studies to authority and request pages Blog posts tagged as `case-study` and with a matching tag to the authority or request will be rendered in the sidebar. Fixes #6589 --- .../responsive/_sidebar_style.scss | 7 +++ app/helpers/blog_helper.rb | 12 +++++ .../info_requests/_sidebar.html.erb | 3 ++ app/views/blog_posts/_blog_post.html.erb | 3 ++ app/views/blog_posts/_blog_posts.html.erb | 11 ++++ app/views/public_body/show.html.erb | 1 + app/views/request/_sidebar.html.erb | 3 ++ spec/helpers/blog_helper_spec.rb | 53 +++++++++++++++++++ 8 files changed, 93 insertions(+) create mode 100644 app/helpers/blog_helper.rb create mode 100644 app/views/blog_posts/_blog_post.html.erb create mode 100644 app/views/blog_posts/_blog_posts.html.erb create mode 100644 spec/helpers/blog_helper_spec.rb diff --git a/app/assets/stylesheets/responsive/_sidebar_style.scss b/app/assets/stylesheets/responsive/_sidebar_style.scss index e550ee40de..094a85d0df 100644 --- a/app/assets/stylesheets/responsive/_sidebar_style.scss +++ b/app/assets/stylesheets/responsive/_sidebar_style.scss @@ -101,6 +101,13 @@ background-position: -128px 0; } +.sidebar__section.blog-posts { + .blog-posts-list { + list-style: none; + padding: 0; + } +} + .sidebar__section.citations { .citations-list { list-style: none; diff --git a/app/helpers/blog_helper.rb b/app/helpers/blog_helper.rb new file mode 100644 index 0000000000..38c6047b8f --- /dev/null +++ b/app/helpers/blog_helper.rb @@ -0,0 +1,12 @@ +## +# Helper methods for returning blog posts to be rendered +# +module BlogHelper + def blog_posts_for_taggable(taggable:, limit: 3) + return [] unless Blog.enabled? + + scope = Blog::Post.none + taggable.tags.each { |t| scope = scope.or(Blog::Post.with_tag(t.name)) } + scope.order(id: :desc).limit(limit) + end +end diff --git a/app/views/alaveteli_pro/info_requests/_sidebar.html.erb b/app/views/alaveteli_pro/info_requests/_sidebar.html.erb index c637afcf98..fb30815a32 100644 --- a/app/views/alaveteli_pro/info_requests/_sidebar.html.erb +++ b/app/views/alaveteli_pro/info_requests/_sidebar.html.erb @@ -21,6 +21,9 @@ <%= render partial: 'request/share_by_link', locals: { info_request: @info_request } %> + <%= render partial: 'blog_posts/blog_posts', + locals: { taggable: info_request } %> + <% unless state_transitions_empty?(@state_transitions) %>
    diff --git a/app/views/request/_sidebar.html.erb b/app/views/request/_sidebar.html.erb index 2fe6e81ced..58e87989b3 100644 --- a/app/views/request/_sidebar.html.erb +++ b/app/views/request/_sidebar.html.erb @@ -29,6 +29,9 @@ <%= render partial: 'request/citations', locals: { citations: citations, info_request: info_request } %> + <%= render partial: 'blog_posts/blog_posts', + locals: { taggable: info_request } %> + <% if similar_requests.any? %> <%= render partial: 'request/similar', locals: { info_request: info_request, diff --git a/spec/helpers/blog_helper_spec.rb b/spec/helpers/blog_helper_spec.rb new file mode 100644 index 0000000000..8263b18d74 --- /dev/null +++ b/spec/helpers/blog_helper_spec.rb @@ -0,0 +1,53 @@ +require 'spec_helper' + +RSpec.describe BlogHelper do + include BlogHelper + + describe '#blog_posts_for_taggable' do + let(:taggable) { FactoryBot.create(:public_body, tag_string: 'foo') } + + subject(:posts) { blog_posts_for_taggable(taggable: taggable) } + + context 'when blog disabled' do + before do + allow(Blog).to receive(:enabled?).and_return(false) + end + + let(:post) { FactoryBot.create(:blog_post, tag_string: 'foo') } + + it { is_expected.to eq([]) } + end + + context 'when blog enabled taggable' do + subject { blog_posts_for_taggable(taggable: taggable) } + + let(:post) { FactoryBot.create(:blog_post, tag_string: 'foo') } + let(:other_post) { FactoryBot.create(:blog_post, tag_string: 'bar') } + + it { is_expected.to include(post) } + it { is_expected.not_to include(other_post) } + end + + context 'without limit' do + before do + 4.times { FactoryBot.create(:blog_post, tag_string: 'foo') } + end + + it 'limits to 3 posts' do + expect(posts.count).to eq(3) + end + end + + context 'with limit' do + subject(:posts) { blog_posts_for_taggable(taggable: taggable, limit: 1) } + + before do + 2.times { FactoryBot.create(:blog_post, tag_string: 'foo') } + end + + it 'limits to specified number of posts' do + expect(posts.count).to eq(1) + end + end + end +end From d7bb2f7604c5a33fb8e931852aaea77514d33c38 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Mon, 20 Mar 2023 19:52:01 +0000 Subject: [PATCH 248/289] Add frontpage blog posts section --- app/helpers/blog_helper.rb | 4 ++++ app/models/blog/post.rb | 4 ++++ app/views/general/_frontpage_blog.html.erb | 14 +++++++++++++ app/views/general/frontpage.html.erb | 1 + spec/helpers/blog_helper_spec.rb | 20 ++++++++++++++++++ spec/models/blog/post_spec.rb | 24 ++++++++++++++++++++++ 6 files changed, 67 insertions(+) create mode 100644 app/views/general/_frontpage_blog.html.erb diff --git a/app/helpers/blog_helper.rb b/app/helpers/blog_helper.rb index 38c6047b8f..d504fac7f8 100644 --- a/app/helpers/blog_helper.rb +++ b/app/helpers/blog_helper.rb @@ -2,6 +2,10 @@ # Helper methods for returning blog posts to be rendered # module BlogHelper + def blog_posts_for_frontpage + Blog::Post.order(id: :desc).limit(4) + end + def blog_posts_for_taggable(taggable:, limit: 3) return [] unless Blog.enabled? diff --git a/app/models/blog/post.rb b/app/models/blog/post.rb index ff0e91abde..7651ef8e49 100644 --- a/app/models/blog/post.rb +++ b/app/models/blog/post.rb @@ -19,4 +19,8 @@ def self.admin_title validates_presence_of :title, :url validates_uniqueness_of :url + + def description + CGI.unescapeHTML(data['description'][0].to_s) + end end diff --git a/app/views/general/_frontpage_blog.html.erb b/app/views/general/_frontpage_blog.html.erb new file mode 100644 index 0000000000..6960bf5b7b --- /dev/null +++ b/app/views/general/_frontpage_blog.html.erb @@ -0,0 +1,14 @@ +<% if blog_posts_for_frontpage.any? %> +
    +

    <%= _('Latest news and campaigns') %>

    + + <% blog_posts_for_frontpage.each do |post| %> +
    +

    <%= link_to post.title, post.url %>

    +

    <%= post.description %>

    +
    + <% end %> + + <%= link_to _('See all →'), blog_path, class: 'button-secondary' %> +
    +<% end %> diff --git a/app/views/general/frontpage.html.erb b/app/views/general/frontpage.html.erb index 19c92e7cf5..1a73bed496 100644 --- a/app/views/general/frontpage.html.erb +++ b/app/views/general/frontpage.html.erb @@ -6,5 +6,6 @@ <%= render partial: 'frontpage_requests_list' %>
    + <%= render partial: 'frontpage_blog' if Blog.enabled? %> <%= render partial: 'frontpage_extra' %> <% end %> diff --git a/spec/helpers/blog_helper_spec.rb b/spec/helpers/blog_helper_spec.rb index 8263b18d74..771cdeda19 100644 --- a/spec/helpers/blog_helper_spec.rb +++ b/spec/helpers/blog_helper_spec.rb @@ -3,6 +3,26 @@ RSpec.describe BlogHelper do include BlogHelper + describe '#blog_posts_for_frontpage' do + subject(:posts) { blog_posts_for_frontpage } + + before do + 4.times { FactoryBot.create(:blog_post) } + end + + it { is_expected.to all be_a(Blog::Post) } + + it 'returns maximum 4 posts' do + FactoryBot.create(:blog_post) + expect(posts.count).to eq(4) + end + + it 'includes the latest post' do + latest = FactoryBot.create(:blog_post) + expect(posts).to include(latest) + end + end + describe '#blog_posts_for_taggable' do let(:taggable) { FactoryBot.create(:public_body, tag_string: 'foo') } diff --git a/spec/models/blog/post_spec.rb b/spec/models/blog/post_spec.rb index 0f03a3db2b..c3fa7abe0b 100644 --- a/spec/models/blog/post_spec.rb +++ b/spec/models/blog/post_spec.rb @@ -37,4 +37,28 @@ expect(post).not_to be_valid end end + + describe '#description' do + subject { post.description } + + let(:description) { 'Post description' } + + let(:post) do + FactoryBot.build( + :blog_post, data: { 'description' => [description, 'secondary'] } + ) + end + + it 'returns first description from data' do + is_expected.to eq('Post description') + end + + context 'when description contains escaped HTML entities' do + let(:description) { 'Foo & Bar' } + + it 'unescapes HTML entities' do + is_expected.to eq('Foo & Bar') + end + end + end end From 186034e87f8cad436b153714fe1988922606067a Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 14 Mar 2023 10:11:10 +0000 Subject: [PATCH 249/289] Bump xapian-full-alaveteli from 1.4.21.1 to 1.4.22.1 Fixes #7533 --- Gemfile | 2 +- Gemfile.lock | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index fa17b3c87e..7a87eb5a12 100644 --- a/Gemfile +++ b/Gemfile @@ -125,7 +125,7 @@ gem 'syslog_protocol', '~> 0.9.0' gem 'thin', '~> 1.8.1' gem 'vpim', '~> 13.11.11' gem 'will_paginate', '~> 3.3.1' -gem 'xapian-full-alaveteli', '~> 1.4.21.1' +gem 'xapian-full-alaveteli', '~> 1.4.22.1' gem 'xml-simple', '~> 1.1.9', require: 'xmlsimple' gem 'zip_tricks', '~> 5.6.0' diff --git a/Gemfile.lock b/Gemfile.lock index 1b5b7d1b3c..737a379004 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -532,7 +532,9 @@ GEM websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) will_paginate (3.3.1) - xapian-full-alaveteli (1.4.21.1) + xapian-full-alaveteli (1.4.22.1) + mini_portile2 (~> 2.8) + rake (~> 13.0) xml-simple (1.1.9) rexml xpath (3.2.0) @@ -634,6 +636,6 @@ DEPENDENCIES web-console (>= 3.3.0) webmock (~> 3.18.1) will_paginate (~> 3.3.1) - xapian-full-alaveteli (~> 1.4.21.1) + xapian-full-alaveteli (~> 1.4.22.1) xml-simple (~> 1.1.9) zip_tricks (~> 5.6.0) From 65d36e5e9dd7bf485034303fa37bdd444b165168 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 31 Mar 2023 15:26:26 +0100 Subject: [PATCH 250/289] Use number_with_delimiter for admin stats Makes some stats easier to read. Fixes https://github.com/mysociety/alaveteli/issues/7663. Also includes some minor code cleanup: * Quote style * ERB tag padding * Line spacing --- app/views/admin_general/stats.html.erb | 33 ++++++++++++++++++++------ 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/app/views/admin_general/stats.html.erb b/app/views/admin_general/stats.html.erb index 1ba4964897..7a05c48570 100644 --- a/app/views/admin_general/stats.html.erb +++ b/app/views/admin_general/stats.html.erb @@ -1,9 +1,24 @@ -<% @title = "Statistics" %> +<% @title = 'Statistics' %> +
    -

    <%=@public_body_count%> public authorities

    -

    <%=@info_request_count%> requests, <%=@outgoing_message_count%> outgoing messages, <%=@incoming_message_count%> incoming messages

    -

    <%=@user_count%> users, <%=@track_thing_count%> tracked things

    -

    <%=@comment_count%> annotations

    +

    + <%= number_with_delimiter(@public_body_count) %> public authorities +

    + +

    + <%= number_with_delimiter(@info_request_count) %> requests, + <%= number_with_delimiter(@outgoing_message_count) %> outgoing messages, + <%= number_with_delimiter(@incoming_message_count) %> incoming messages +

    + +

    + <%= number_with_delimiter(@user_count) %> users, + <%= number_with_delimiter(@track_thing_count) %> tracked things +

    + +

    + <%= number_with_delimiter(@comment_count) %> annotations +

    @@ -24,7 +39,9 @@ <% for state, count in @request_by_state %>
    - <%=count%> + + <%= number_with_delimiter(count) %> +
    <%=state%> @@ -51,7 +68,9 @@ <% for state, count in @tracks_by_type %>
    - <%=count%> + + <%= number_with_delimiter(count) %> +
    <%=state%> From b06a4b7cdfb1b946ea75e7a37571f0878c2b7f0b Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 7 Dec 2022 10:19:12 +0000 Subject: [PATCH 251/289] Tidy InfoRequestEvent acts_as_xapian configuration * Quote Style * Line Length * Array padding Also move `if` key to the end as it reads better to say "do all this config, _if_ the event is `indexed_by_search?`" --- app/models/info_request_event.rb | 57 ++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index 9fffd50cd7..576c22c482 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -110,28 +110,41 @@ def must_be_valid_state attr_accessor :no_xapian_reindex # Full text search indexing - acts_as_xapian texts: [ :search_text_main, :title ], - values: [ - [ :created_at, 0, "range_search", :date ], # for QueryParser range searches e.g. 01/01/2008..14/01/2008 - [ :created_at_numeric, 1, "created_at", :number ], # for sorting - [ :described_at_numeric, 2, "described_at", :number ], # TODO: using :number for lack of :datetime support in Xapian values - [ :request, 3, "request_collapse", :string ], - [ :request_title_collapse, 4, "request_title_collapse", :string ] - ], - terms: [ [ :calculated_state, 'S', "status" ], - [ :requested_by, 'B', "requested_by" ], - [ :requested_from, 'F', "requested_from" ], - [ :commented_by, 'C', "commented_by" ], - [ :request, 'R', "request" ], - [ :variety, 'V', "variety" ], - [ :latest_variety, 'K', "latest_variety" ], - [ :latest_status, 'L', "latest_status" ], - [ :waiting_classification, 'W', "waiting_classification" ], - [ :filetype, 'T', "filetype" ], - [ :tags, 'U', "tag" ], - [ :request_public_body_tags, 'X', "request_public_body_tag" ] ], - if: :indexed_by_search?, - eager_load: [ :outgoing_message, :comment, { info_request: [ :user, :public_body, :censor_rules ] } ] + acts_as_xapian \ + texts: [ + :search_text_main, + :title + ], + values: [ + # for QueryParser range searches e.g. 01/01/2008..14/01/2008: + [:created_at, 0, 'range_search', :date], + # for sorting: + [:created_at_numeric, 1, 'created_at', :number], + # TODO: using :number for lack of :datetime support in Xapian values: + [:described_at_numeric, 2, 'described_at', :number], + [:request, 3, 'request_collapse', :string], + [:request_title_collapse, 4, 'request_title_collapse', :string] + ], + terms: [ + [:calculated_state, 'S', 'status'], + [:requested_by, 'B', 'requested_by'], + [:requested_from, 'F', 'requested_from'], + [:commented_by, 'C', 'commented_by'], + [:request, 'R', 'request'], + [:variety, 'V', 'variety'], + [:latest_variety, 'K', 'latest_variety'], + [:latest_status, 'L', 'latest_status'], + [:waiting_classification, 'W', 'waiting_classification'], + [:filetype, 'T', 'filetype'], + [:tags, 'U', 'tag'], + [:request_public_body_tags, 'X', 'request_public_body_tag'] + ], + eager_load: [ + :outgoing_message, + :comment, + { info_request: [:user, :public_body, :censor_rules] } + ], + if: :indexed_by_search? def self.count_of_hides_by_week where(event_type: "hide").group("date(date_trunc('week', created_at))").count.sort From a98e90241838038f1cd993fe48c8e5abe8520490 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 7 Dec 2022 10:30:19 +0000 Subject: [PATCH 252/289] Privatise InfoRequestEvent methods With the exception of `get_clipped_response_efficiently` and `must_be_valid_state`, all the newly-private methods are only used as helpers for the `acts_as_xapian` configuration, so can be made private to reduce the public surface area of the object. `get_clipped_response_efficiently` is only called in `search_text_main`, which again is a helper for the `acts_as_xapian` configuration (though is also called elsewhere to render search result snippets). `must_be_valid_state` is only called via a `validate` call so there's no need for it to be public. `variety` is a slightly special case in that it's called on sibling events via `#latest_variety`, so it's made `protected` instead of `private`. I thought it worth preserving the specs to ensure we're populating the search index with correct data, though it does mean using `#send` to call the methods. I imagine we can improve this down the line. It seems more valuable to add clarity over internal vs external methods at this point. --- app/models/info_request_event.rb | 241 +++++------ spec/models/info_request_event_spec.rb | 528 +++++++++++++------------ 2 files changed, 394 insertions(+), 375 deletions(-) diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index 576c22c482..3226561ba7 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -101,12 +101,6 @@ class InfoRequestEvent < ApplicationRecord scope "#{event_type}_events", -> { where(event_type: event_type) } end - def must_be_valid_state - if described_state && !InfoRequest::State.all.include?(described_state) - errors.add(:described_state, "is not a valid state") - end - end - attr_accessor :no_xapian_reindex # Full text search indexing @@ -150,51 +144,11 @@ def self.count_of_hides_by_week where(event_type: "hide").group("date(date_trunc('week', created_at))").count.sort end - def requested_by - info_request.user_name_slug - end - - def requested_from - # acts_as_xapian will detect translated fields via Globalize and add all the - # available locales to the index. But 'requested_from' is not translated directly, - # although it relies on a translated field in PublicBody. Hence, we need to - # manually add all the localized values to the index (Xapian can handle a list - # of values in a term, btw) - info_request.public_body.translations.map(&:url_name) - end - - def commented_by - if event_type == 'comment' - comment.user.url_name - else - '' - end - end - + # TODO: Can possibly be made private def request info_request.url_title end - def latest_variety - sibling_events(reverse: true).each do |event| - return event.variety unless event.variety.blank? - end - end - - def latest_status - sibling_events(reverse: true).each do |event| - return event.calculated_state unless event.calculated_state.blank? - end - end - - def waiting_classification - info_request.awaiting_description == true ? "yes" : "no" - end - - def request_title_collapse - info_request.url_title(collapse: true) - end - def described_at # For responses, people might have RSS feeds on searches for type of # response (e.g. successful) in which case we want to date sort by @@ -203,16 +157,6 @@ def described_at last_described_at || created_at end - def described_at_numeric - # format it here as no datetime support in Xapian's value ranges - described_at.strftime("%Y%m%d%H%M%S") - end - - def created_at_numeric - # format it here as no datetime support in Xapian's value ranges - created_at.strftime("%Y%m%d%H%M%S") - end - def incoming_message_selective_columns(fields) message = IncomingMessage.select("#{ fields }, incoming_messages.info_request_id"). joins('INNER JOIN info_request_events ON incoming_messages.id = incoming_message_id'). @@ -223,26 +167,6 @@ def incoming_message_selective_columns(fields) message end - def get_clipped_response_efficiently - # TODO: this ugly code is an attempt to not always load all the - # columns for an incoming message, which can be *very* large - # (due to all the cached text). We care particularly in this - # case because it's called for every search result on a page - # (to show the search snippet). Actually, we should review if we - # need all this data to be cached in the database at all, and - # then we won't need this horrid workaround. - message = incoming_message_selective_columns("cached_attachment_text_clipped, cached_main_body_text_folded") - clipped_body = message.cached_main_body_text_folded - clipped_attachment = message.cached_attachment_text_clipped - if clipped_body.nil? || clipped_attachment.nil? - # we're going to have to load it anyway - text = incoming_message.get_text_for_indexing_clipped - else - text = clipped_body.gsub("FOLDED_QUOTED_SECTION", " ").strip + "\n\n" + clipped_attachment - end - text + "\n\n" - end - # clipped = true - means return shorter text. It is used for snippets fore # performance reasons. Xapian will take the full text. def search_text_main(clipped = false) @@ -263,6 +187,7 @@ def search_text_main(clipped = false) text end + # TODO: Can possibly be made private def title if event_type == 'sent' info_request.title @@ -271,42 +196,12 @@ def title end end - def filetype - if event_type == 'response' - unless incoming_message - raise "event type is 'response' but no incoming message for event id #{id}" - end - - incoming_message.get_present_file_extensions - else - '' - end - end - + # TODO: Can possibly be made private def tags # this returns an array of strings, each gets indexed as separate term by acts_as_xapian info_request.tag_array_for_search end - def request_public_body_tags - info_request.public_body.tag_array_for_search - end - - def indexed_by_search? - if %w[sent followup_sent response comment].include?(event_type) - return false unless info_request.indexed_by_search? - if event_type == 'response' && !incoming_message.indexed_by_search? - return false - end - if %w[sent followup_sent].include?(event_type) && !outgoing_message.indexed_by_search? - return false - end - return false if event_type == 'comment' && !comment.visible - return true - end - false - end - def variety event_type end @@ -457,13 +352,6 @@ def response? event_type == 'response' end - def only_editing_prominence_to_hide? - event_type == 'edit' && - params_diff[:new].keys == [:prominence] && - params_diff[:old][:prominence] == "normal" && - %w(hidden requester_only backpage).include?(params_diff[:new][:prominence]) - end - # This method updates the cached column of the InfoRequest that # stores the last created_at date of relevant events # when saving or destroying an InfoRequestEvent associated with the request @@ -522,6 +410,12 @@ def set_calculated_state!(state) end end + protected + + def variety + event_type + end + private def previous_events(opts = {}) @@ -586,4 +480,121 @@ def params_for_jsonb(params) memo end end + + def only_editing_prominence_to_hide? + event_type == 'edit' && + params_diff[:new].keys == [:prominence] && + params_diff[:old][:prominence] == "normal" && + %w(hidden requester_only backpage).include?(params_diff[:new][:prominence]) + end + + def get_clipped_response_efficiently + # TODO: this ugly code is an attempt to not always load all the + # columns for an incoming message, which can be *very* large + # (due to all the cached text). We care particularly in this + # case because it's called for every search result on a page + # (to show the search snippet). Actually, we should review if we + # need all this data to be cached in the database at all, and + # then we won't need this horrid workaround. + message = incoming_message_selective_columns("cached_attachment_text_clipped, cached_main_body_text_folded") + clipped_body = message.cached_main_body_text_folded + clipped_attachment = message.cached_attachment_text_clipped + if clipped_body.nil? || clipped_attachment.nil? + # we're going to have to load it anyway + text = incoming_message.get_text_for_indexing_clipped + else + text = clipped_body.gsub("FOLDED_QUOTED_SECTION", " ").strip + "\n\n" + clipped_attachment + end + text + "\n\n" + end + + def must_be_valid_state + if described_state && !InfoRequest::State.all.include?(described_state) + errors.add(:described_state, "is not a valid state") + end + end + + # INDEXING HELPERS + + def indexed_by_search? + if %w[sent followup_sent response comment].include?(event_type) + return false unless info_request.indexed_by_search? + if event_type == 'response' && !incoming_message.indexed_by_search? + return false + end + if %w[sent followup_sent].include?(event_type) && !outgoing_message.indexed_by_search? + return false + end + return false if event_type == 'comment' && !comment.visible + return true + end + false + end + + def requested_by + info_request.user_name_slug + end + + def requested_from + # acts_as_xapian will detect translated fields via Globalize and add all the + # available locales to the index. But 'requested_from' is not translated directly, + # although it relies on a translated field in PublicBody. Hence, we need to + # manually add all the localized values to the index (Xapian can handle a list + # of values in a term, btw) + info_request.public_body.translations.map(&:url_name) + end + + def commented_by + if event_type == 'comment' + comment.user.url_name + else + '' + end + end + + def request_title_collapse + info_request.url_title(collapse: true) + end + + def described_at_numeric + # format it here as no datetime support in Xapian's value ranges + described_at.strftime("%Y%m%d%H%M%S") + end + + def created_at_numeric + # format it here as no datetime support in Xapian's value ranges + created_at.strftime("%Y%m%d%H%M%S") + end + + def waiting_classification + info_request.awaiting_description == true ? "yes" : "no" + end + + def latest_variety + sibling_events(reverse: true).each do |event| + return event.variety unless event.variety.blank? + end + end + + def latest_status + sibling_events(reverse: true).each do |event| + return event.calculated_state unless event.calculated_state.blank? + end + end + + def filetype + if event_type == 'response' + unless incoming_message + raise "event type is 'response' but no incoming message for event id #{id}" + end + + incoming_message.get_present_file_extensions + else + '' + end + end + + def request_public_body_tags + info_request.public_body.tag_array_for_search + end end diff --git a/spec/models/info_request_event_spec.rb b/spec/models/info_request_event_spec.rb index aa91c48e32..94549ccacf 100644 --- a/spec/models/info_request_event_spec.rb +++ b/spec/models/info_request_event_spec.rb @@ -93,64 +93,6 @@ end end - describe 'when deciding if it is indexed by search' do - - it 'returns a falsey value for a comment that is not visible' do - comment = FactoryBot.create(:hidden_comment) - comment_event = FactoryBot.build(:comment_event, comment: comment) - expect(comment_event.indexed_by_search?).to be_falsey - end - - it 'returns a truthy value for a comment that is visible' do - comment = FactoryBot.create(:comment) - comment_event = FactoryBot.build(:comment_event, comment: comment) - expect(comment_event.indexed_by_search?).to be_truthy - end - - it 'returns a falsey value for an incoming message that is not indexed by search' do - incoming_message = FactoryBot.create(:incoming_message, :hidden) - response_event = FactoryBot.build(:response_event, - incoming_message: incoming_message) - expect(response_event.indexed_by_search?).to be_falsey - end - - it 'returns a truthy value for an incoming message that is indexed by search' do - incoming_message = FactoryBot.create(:incoming_message) - response_event = FactoryBot.build(:response_event, - incoming_message: incoming_message) - expect(response_event.indexed_by_search?).to be_truthy - end - - it 'returns a falsey value for an outgoing message that is not indexed by search' do - outgoing_message = FactoryBot.create(:hidden_followup) - followup_event = FactoryBot.build(:followup_sent_event, - outgoing_message: outgoing_message) - expect(followup_event.indexed_by_search?).to be_falsey - end - - it 'returns a truthy value for an outgoing message that is indexed by search' do - outgoing_message = FactoryBot.create(:new_information_followup) - followup_event = FactoryBot.build(:followup_sent_event, - outgoing_message: outgoing_message) - expect(followup_event.indexed_by_search?).to be_truthy - end - - it 'returns a falsey value for an overdue event' do - overdue_event = FactoryBot.build(:overdue_event) - expect(overdue_event.indexed_by_search?).to be_falsey - end - - it 'returns a falsey value for a very overdue event' do - very_overdue_event = FactoryBot.build(:very_overdue_event) - expect(very_overdue_event.indexed_by_search?).to be_falsey - end - - it 'returns a falsey value for an embargo expiry event' do - expire_embargo_event = FactoryBot.build(:expire_embargo_event) - expect(expire_embargo_event.indexed_by_search?).to be_falsey - end - end - describe '.count_of_hides_by_week' do it 'counts hide events by week' do FactoryBot.create(:hide_event, created_at: Time.utc(2016, 1, 24)) @@ -181,73 +123,6 @@ end end - describe '#requested_by' do - it "should return the slug of the associated request's user" do - ire = FactoryBot.create(:info_request_event) - expect(ire.requested_by).to eq(ire.info_request.user_name_slug) - end - end - - describe '#requested_from' do - it "should return an array of translated public body url_name values" do - ire = FactoryBot.create(:info_request_event) - public_body = ire.info_request.public_body - expect(ire.requested_from).to eq([public_body.url_name]) - end - end - - describe '#commented_by' do - context 'if it is a comment event' do - it "should return the commenter's url_name" do - user = FactoryBot.create(:user) - comment = FactoryBot.create(:comment, user: user) - ire = FactoryBot.create(:info_request_event, - event_type: 'comment', - comment: comment) - expect(ire.commented_by).to eq(user.url_name) - end - end - - context 'if it is not a comment event' do - it 'should return a blank string' do - ire = FactoryBot.create(:info_request_event) - expect(ire.commented_by).to eq('') - end - end - end - - describe '#variety' do - it 'should be an alias for event_type' do - ire = FactoryBot.create(:info_request_event) - expect(ire.variety).to eq(ire.event_type) - end - end - - describe '#latest_variety' do - it 'should return the variety for the most recent event of the related request' do - ire = FactoryBot.create(:info_request_event) - request = ire.info_request - new_event = FactoryBot.create(:info_request_event, - event_type: 'comment', - info_request: request) - request.reload - expect(ire.latest_variety).to eq('comment') - end - end - - describe '#latest_status' do - it 'should return the calculated_state of the most recent event of the related request' do - ire = FactoryBot.create(:info_request_event) - request = ire.info_request - new_event = FactoryBot.create(:info_request_event, - event_type: 'comment', - info_request: request) - new_event.set_calculated_state!('internal_review') - request.reload - expect(ire.latest_status).to eq('internal_review') - end - end - describe '#title' do context 'a sent event' do it 'should return the related info_request title' do @@ -268,38 +143,6 @@ end end - describe '#filetype' do - context 'a response event' do - let(:ire) { ire = FactoryBot.create(:response_event) } - - it 'should raise an error if there is not incoming_message' do - ire.incoming_message = nil - expect { ire.filetype }.to raise_error. - with_message(/event type is 'response' but no incoming message for event/) - end - - it 'should return a blank string if there are no attachments' do - info_request = ire.info_request - expect(ire.filetype).to eq('') - end - - it 'should return a space separated list of the attachment file types' do - info_request = ire.info_request - incoming = FactoryBot.create(:incoming_message_with_attachments, - info_request: info_request) - ire.incoming_message = incoming - expect(ire.filetype).to eq('pdf') - end - end - - context 'not a response event' do - it 'should return a blank string' do - ire = FactoryBot.create(:info_request_event, event_type: 'comment') - expect(ire.filetype).to eq('') - end - end - end - describe '#visible' do context 'is a comment' do it 'should return the visibility of the comment' do @@ -614,109 +457,6 @@ end end - describe "#only_editing_prominence_to_hide?" do - let(:unchanged_params) do - { editor: "henare", - old_title: "How much wood does a woodpecker peck?", - title: "How much wood does a woodpecker peck?", - old_described_state: "rejected", - described_state: "rejected", - old_awaiting_description: false, - awaiting_description: false, - old_allow_new_responses_from: "anybody", - allow_new_responses_from: "anybody", - old_handle_rejected_responses: "bounce", - handle_rejected_responses: "bounce", - old_tag_string: "", - tag_string: "", - old_comments_allowed: true, - comments_allowed: true } - end - - it "should be false if it's not an edit" do - ire = InfoRequestEvent.new(event_type: "resent") - - expect(ire.only_editing_prominence_to_hide?).to be false - end - - it "should be false if it's already a hide event" do - ire = InfoRequestEvent.new(event_type: "hide") - - expect(ire.only_editing_prominence_to_hide?).to be false - end - - it "should be false if editing multiple conditions" do - params = unchanged_params.merge({ old_prominence: "normal", - prominence: "backpage", - old_comments_allowed: true, - comments_allowed: false }) - - ire = InfoRequestEvent.new(event_type: "edit", params: params) - - expect(ire.only_editing_prominence_to_hide?).to be false - end - - context "when only editing prominence to hidden" do - let(:params) { unchanged_params.merge({old_prominence: "normal", prominence: "hidden"}) } - - it do - ire = InfoRequestEvent.new(event_type: "edit", params: params) - - expect(ire.only_editing_prominence_to_hide?).to be true - end - end - - context "when only editing prominence to requester_only" do - let(:params) { unchanged_params.merge({old_prominence: "normal", prominence: "requester_only"}) } - - it "should be true if only editing prominence to requester_only" do - ire = InfoRequestEvent.new(event_type: "edit", params: params) - - expect(ire.only_editing_prominence_to_hide?).to be true - end - end - - context "when only editing prominence to backpage" do - let(:params) { unchanged_params.merge({old_prominence: "normal", prominence: "backpage"}) } - - it "should be true if only editing prominence to backpage" do - ire = InfoRequestEvent.new(event_type: "edit", params: params) - - expect(ire.only_editing_prominence_to_hide?).to be true - end - end - - context "when the old prominence was hidden" do - let(:params) { unchanged_params.merge({old_prominence: "hidden", prominence: "requester_only"}) } - - it do - ire = InfoRequestEvent.new(event_type: "edit", params: params) - - expect(ire.only_editing_prominence_to_hide?).to be false - end - end - - context "when the old prominence was requester_only" do - let(:params) { unchanged_params.merge({old_prominence: "requester_only", prominence: "hidden"}) } - - it do - ire = InfoRequestEvent.new(event_type: "edit", params: params) - - expect(ire.only_editing_prominence_to_hide?).to be false - end - end - - context "when the old prominence was backpage" do - let(:params) { unchanged_params.merge({old_prominence: "backpage", prominence: "hidden"}) } - - it do - ire = InfoRequestEvent.new(event_type: "edit", params: params) - - expect(ire.only_editing_prominence_to_hide?).to be false - end - end - end - describe '#resets_due_dates?' do it 'returns true if the event is a sending of the request' do @@ -871,4 +611,272 @@ end + # Testing a private callback helper + describe "#only_editing_prominence_to_hide?" do + let(:unchanged_params) do + { editor: "henare", + old_title: "How much wood does a woodpecker peck?", + title: "How much wood does a woodpecker peck?", + old_described_state: "rejected", + described_state: "rejected", + old_awaiting_description: false, + awaiting_description: false, + old_allow_new_responses_from: "anybody", + allow_new_responses_from: "anybody", + old_handle_rejected_responses: "bounce", + handle_rejected_responses: "bounce", + old_tag_string: "", + tag_string: "", + old_comments_allowed: true, + comments_allowed: true } + end + + it "should be false if it's not an edit" do + ire = InfoRequestEvent.new(event_type: "resent") + + expect(ire.send(:only_editing_prominence_to_hide?)).to be false + end + + it "should be false if it's already a hide event" do + ire = InfoRequestEvent.new(event_type: "hide") + + expect(ire.send(:only_editing_prominence_to_hide?)).to be false + end + + it "should be false if editing multiple conditions" do + params = unchanged_params.merge({ old_prominence: "normal", + prominence: "backpage", + old_comments_allowed: true, + comments_allowed: false }) + + ire = InfoRequestEvent.new(event_type: "edit", params: params) + + expect(ire.send(:only_editing_prominence_to_hide?)).to be false + end + + context "when only editing prominence to hidden" do + let(:params) { unchanged_params.merge({old_prominence: "normal", prominence: "hidden"}) } + + it do + ire = InfoRequestEvent.new(event_type: "edit", params: params) + + expect(ire.send(:only_editing_prominence_to_hide?)).to be true + end + end + + context "when only editing prominence to requester_only" do + let(:params) { unchanged_params.merge({old_prominence: "normal", prominence: "requester_only"}) } + + it "should be true if only editing prominence to requester_only" do + ire = InfoRequestEvent.new(event_type: "edit", params: params) + + expect(ire.send(:only_editing_prominence_to_hide?)).to be true + end + end + + context "when only editing prominence to backpage" do + let(:params) { unchanged_params.merge({old_prominence: "normal", prominence: "backpage"}) } + + it "should be true if only editing prominence to backpage" do + ire = InfoRequestEvent.new(event_type: "edit", params: params) + + expect(ire.send(:only_editing_prominence_to_hide?)).to be true + end + end + + context "when the old prominence was hidden" do + let(:params) { unchanged_params.merge({old_prominence: "hidden", prominence: "requester_only"}) } + + it do + ire = InfoRequestEvent.new(event_type: "edit", params: params) + + expect(ire.send(:only_editing_prominence_to_hide?)).to be false + end + end + + context "when the old prominence was requester_only" do + let(:params) { unchanged_params.merge({old_prominence: "requester_only", prominence: "hidden"}) } + + it do + ire = InfoRequestEvent.new(event_type: "edit", params: params) + + expect(ire.send(:only_editing_prominence_to_hide?)).to be false + end + end + + context "when the old prominence was backpage" do + let(:params) { unchanged_params.merge({old_prominence: "backpage", prominence: "hidden"}) } + + it do + ire = InfoRequestEvent.new(event_type: "edit", params: params) + + expect(ire.send(:only_editing_prominence_to_hide?)).to be false + end + end + end + + + # INDEXING HELPERS + # + # Technically don't need to test because these are private, but we want to + # ensure we're populating the search index with the correct values so these + # currently call the method via `send`. + + describe 'when deciding if it is indexed by search' do + it 'returns a falsey value for a comment that is not visible' do + comment = FactoryBot.create(:hidden_comment) + comment_event = FactoryBot.build(:comment_event, comment: comment) + expect(comment_event.send(:indexed_by_search?)).to be_falsey + end + + it 'returns a truthy value for a comment that is visible' do + comment = FactoryBot.create(:comment) + comment_event = FactoryBot.build(:comment_event, comment: comment) + expect(comment_event.send(:indexed_by_search?)).to be_truthy + end + + it 'returns a falsey value for an incoming message that is not indexed by search' do + incoming_message = FactoryBot.create(:incoming_message, :hidden) + response_event = FactoryBot.build(:response_event, + incoming_message: incoming_message) + expect(response_event.send(:indexed_by_search?)).to be_falsey + end + + it 'returns a truthy value for an incoming message that is indexed by search' do + incoming_message = FactoryBot.create(:incoming_message) + response_event = FactoryBot.build(:response_event, + incoming_message: incoming_message) + expect(response_event.send(:indexed_by_search?)).to be_truthy + end + + it 'returns a falsey value for an outgoing message that is not indexed by search' do + outgoing_message = FactoryBot.create(:hidden_followup) + followup_event = FactoryBot.build(:followup_sent_event, + outgoing_message: outgoing_message) + expect(followup_event.send(:indexed_by_search?)).to be_falsey + end + + it 'returns a truthy value for an outgoing message that is indexed by search' do + outgoing_message = FactoryBot.create(:new_information_followup) + followup_event = FactoryBot.build(:followup_sent_event, + outgoing_message: outgoing_message) + expect(followup_event.send(:indexed_by_search?)).to be_truthy + end + + it 'returns a falsey value for an overdue event' do + overdue_event = FactoryBot.build(:overdue_event) + expect(overdue_event.send(:indexed_by_search?)).to be_falsey + end + + it 'returns a falsey value for a very overdue event' do + very_overdue_event = FactoryBot.build(:very_overdue_event) + expect(very_overdue_event.send(:indexed_by_search?)).to be_falsey + end + + it 'returns a falsey value for an embargo expiry event' do + expire_embargo_event = FactoryBot.build(:expire_embargo_event) + expect(expire_embargo_event.send(:indexed_by_search?)).to be_falsey + end + end + + describe '#requested_by' do + it "should return the slug of the associated request's user" do + ire = FactoryBot.create(:info_request_event) + expect(ire.send(:requested_by)).to eq(ire.info_request.user_name_slug) + end + end + + + describe '#requested_from' do + it "should return an array of translated public body url_name values" do + ire = FactoryBot.create(:info_request_event) + public_body = ire.info_request.public_body + expect(ire.send(:requested_from)).to eq([public_body.url_name]) + end + end + + describe '#commented_by' do + context 'if it is a comment event' do + it "should return the commenter's url_name" do + user = FactoryBot.create(:user) + comment = FactoryBot.create(:comment, user: user) + ire = FactoryBot.create(:info_request_event, + event_type: 'comment', + comment: comment) + expect(ire.send(:commented_by)).to eq(user.url_name) + end + end + + context 'if it is not a comment event' do + it 'should return a blank string' do + ire = FactoryBot.create(:info_request_event) + expect(ire.send(:commented_by)).to eq('') + end + end + end + + describe '#variety' do + it 'should be an alias for event_type' do + ire = FactoryBot.create(:info_request_event) + expect(ire.send(:variety)).to eq(ire.event_type) + end + end + + describe '#latest_variety' do + it 'should return the variety for the most recent event of the related request' do + ire = FactoryBot.create(:info_request_event) + request = ire.info_request + new_event = FactoryBot.create(:info_request_event, + event_type: 'comment', + info_request: request) + request.reload + expect(ire.send(:latest_variety)).to eq('comment') + end + end + + describe '#latest_status' do + it 'should return the calculated_state of the most recent event of the related request' do + ire = FactoryBot.create(:info_request_event) + request = ire.info_request + new_event = FactoryBot.create(:info_request_event, + event_type: 'comment', + info_request: request) + new_event.set_calculated_state!('internal_review') + request.reload + expect(ire.send(:latest_status)).to eq('internal_review') + end + end + + describe '#filetype' do + context 'a response event' do + let(:ire) { ire = FactoryBot.create(:response_event) } + + it 'should raise an error if there is not incoming_message' do + ire.incoming_message = nil + expect { ire.send(:filetype) }.to raise_error. + with_message(/event type is 'response' but no incoming message for event/) + end + + it 'should return a blank string if there are no attachments' do + info_request = ire.info_request + expect(ire.send(:filetype)).to eq('') + end + + it 'should return a space separated list of the attachment file types' do + info_request = ire.info_request + incoming = FactoryBot.create(:incoming_message_with_attachments, + info_request: info_request) + ire.incoming_message = incoming + expect(ire.send(:filetype)).to eq('pdf') + end + end + + context 'not a response event' do + it 'should return a blank string' do + ire = FactoryBot.create(:info_request_event, event_type: 'comment') + expect(ire.send(:filetype)).to eq('') + end + end + end + end From 0cd59efca67a13d188be43f7cb1f081a1ecad709 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 04:59:34 +0000 Subject: [PATCH 253/289] Build(deps): Bump aws-sdk-s3 from 1.119.2 to 1.120.0 Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.119.2 to 1.120.0. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-s3/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) --- updated-dependencies: - dependency-name: aws-sdk-s3 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 737a379004..4326e097ba 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -120,7 +120,7 @@ GEM rake (>= 10.4, < 14.0) ast (2.4.2) aws-eventstream (1.2.0) - aws-partitions (1.735.0) + aws-partitions (1.739.0) aws-sdk-core (3.171.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) @@ -129,7 +129,7 @@ GEM aws-sdk-kms (1.63.0) aws-sdk-core (~> 3, >= 3.165.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.119.2) + aws-sdk-s3 (1.120.0) aws-sdk-core (~> 3, >= 3.165.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) From 90f0c9025e668828dbfb17202ec15ebea2fa6389 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 05:03:25 +0000 Subject: [PATCH 254/289] Build(deps): Bump thin from 1.8.1 to 1.8.2 Bumps [thin](https://github.com/macournoyer/thin) from 1.8.1 to 1.8.2. - [Release notes](https://github.com/macournoyer/thin/releases) - [Changelog](https://github.com/macournoyer/thin/blob/master/CHANGELOG) - [Commits](https://github.com/macournoyer/thin/compare/v1.8.1...v1.8.2) --- updated-dependencies: - dependency-name: thin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 7a87eb5a12..de73285d40 100644 --- a/Gemfile +++ b/Gemfile @@ -122,7 +122,7 @@ gem 'strip_attributes', git: 'https://github.com/mysociety/strip_attributes.git' gem 'stripe', '~> 5.55.0' gem 'syck', '~> 1.4.1', require: false gem 'syslog_protocol', '~> 0.9.0' -gem 'thin', '~> 1.8.1' +gem 'thin', '~> 1.8.2' gem 'vpim', '~> 13.11.11' gem 'will_paginate', '~> 3.3.1' gem 'xapian-full-alaveteli', '~> 1.4.22.1' diff --git a/Gemfile.lock b/Gemfile.lock index 737a379004..7525b1b56c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -175,7 +175,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - daemons (1.4.0) + daemons (1.4.1) dalli (3.2.4) dante (0.2.0) date (3.3.3) @@ -500,7 +500,7 @@ GEM syck (1.4.1) syslog_protocol (0.9.2) text (1.3.1) - thin (1.8.1) + thin (1.8.2) daemons (~> 1.0, >= 1.0.9) eventmachine (~> 1.0, >= 1.0.4) rack (>= 1, < 3) @@ -628,7 +628,7 @@ DEPENDENCIES stripe-ruby-mock! syck (~> 1.4.1) syslog_protocol (~> 0.9.0) - thin (~> 1.8.1) + thin (~> 1.8.2) uglifier (~> 4.2.0) unicode (~> 0.4.4) unidecoder (~> 1.1.0) From a55e9c2523f242964678d4428e7910581263d233 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Mon, 3 Apr 2023 11:13:47 +0100 Subject: [PATCH 255/289] Update integration specs These specs are either outdated with our current implementation or just broken but the errors are hidden due to an issue upstream in Capybara. Depending on the block notation used Capybara will return different results: ``` # will fail expect(page).to have_selector("input") { false } # will pass expect(page).to have_selector("input") do false end ``` This has been fixed in Capybara v3.39.0 See: https://github.com/teamcapybara/capybara/issues/2616 --- spec/controllers/request_controller_spec.rb | 8 ++++---- .../request/_after_actions.html.erb_spec.rb | 17 +++++++---------- spec/views/request/show.html.erb_spec.rb | 8 ++++---- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index a7ffcfe862..d1fef1160e 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -1732,8 +1732,8 @@ def send_request sign_in users(:bob_smith_user) get :show, params: { url_title: 'why_do_you_have_such_a_fancy_dog' } expect(response.body).to have_css("div#comment-1 h2") do |s| - expect(s).to contain(/Silly.*left an annotation/m) - expect(s).not_to contain(/You.*left an annotation/m) + expect(s).to have_text(/Silly.*left an annotation/m) + expect(s).not_to have_text(/You.*left an annotation/m) end end @@ -1741,8 +1741,8 @@ def send_request sign_in users(:silly_name_user) get :show, params: { url_title: 'why_do_you_have_such_a_fancy_dog' } expect(response.body).to have_css("div#comment-1 h2") do |s| - expect(s).to contain(/Silly.*left an annotation/m) - expect(s).not_to contain(/You.*left an annotation/m) + expect(s).to have_text(/Silly.*left an annotation/m) + expect(s).not_to have_text(/You.*left an annotation/m) end end diff --git a/spec/views/request/_after_actions.html.erb_spec.rb b/spec/views/request/_after_actions.html.erb_spec.rb index c7d42fac5f..567a65c66e 100644 --- a/spec/views/request/_after_actions.html.erb_spec.rb +++ b/spec/views/request/_after_actions.html.erb_spec.rb @@ -18,7 +18,7 @@ end context 'if show_owner_update_status_action is true' do - before { locals.merge(show_owner_update_status_action: true) } + before { locals.merge!(show_owner_update_status_action: true) } it 'displays a link for the request owner to update the status of the request' do render partial: 'request/after_actions', locals: locals @@ -30,7 +30,7 @@ end context 'if show_owner_update_status_action is false' do - before { locals.merge(show_owner_update_status_action: false) } + before { locals.merge!(show_owner_update_status_action: false) } it 'does not display a link for the request owner to update the status of the request' do render partial: 'request/after_actions', locals: locals @@ -43,7 +43,7 @@ end context 'if show_other_user_update_status_action is true' do - before { locals.merge(show_other_user_update_status_action: true) } + before { locals.merge!(show_other_user_update_status_action: true) } it 'displays a link for anyone to update the status of the request' do render partial: 'request/after_actions', locals: locals @@ -55,7 +55,7 @@ end context 'if show_other_user_update_status_action is false' do - before { locals.merge(show_other_user_update_status_action: false) } + before { locals.merge!(show_other_user_update_status_action: false) } it 'does not display a link for anyone to update the status of the request' do render partial: 'request/after_actions', locals: locals @@ -90,8 +90,7 @@ render partial: 'request/after_actions', locals: locals expect(response.body).to have_css('ul.anyone_actions') do |div| - text = 'Add an annotation (to help the requester or others)' - expect(div).to have_css('a', text: text) + expect(div).to have_css('a', text: 'Add an annotation') end end end @@ -103,8 +102,7 @@ render partial: 'request/after_actions', locals: locals expect(response.body).to have_css('ul.anyone_actions') do |div| - text = 'Add an annotation (to help the requester or others)' - expect(div).not_to have_css('a', text: text) + expect(div).not_to have_css('a', text: 'Add an annotation') end end end @@ -114,8 +112,7 @@ render partial: 'request/after_actions', locals: locals expect(response.body).to have_css('ul.anyone_actions') do |div| - text = 'Add an annotation (to help the requester or others)' - expect(div).not_to have_css('a', text: text) + expect(div).not_to have_css('a', text: 'Add an annotation') end end end diff --git a/spec/views/request/show.html.erb_spec.rb b/spec/views/request/show.html.erb_spec.rb index 3c52f840e3..5e94b0cac0 100644 --- a/spec/views/request/show.html.erb_spec.rb +++ b/spec/views/request/show.html.erb_spec.rb @@ -277,7 +277,7 @@ def request_page assign :track_thing, TrackThing.create_track_for_request(request_with_attachment) render expect(rendered).to have_css(".attachment .attachment__name") do |s| - expect(s).to contain(/interesting.pdf/m) + expect(s).to have_text(/interesting.html/m) end end end @@ -285,8 +285,8 @@ def request_page context "when there is a censor rule" do it "should replace the attachment name" do request_with_attachment.censor_rules.create!( - text: "interesting.pdf", - replacement: "Mouse.pdf", + text: "interesting.html", + replacement: "Mouse.html", last_edit_editor: "unknown", last_edit_comment: "none") assign :info_request, request_with_attachment @@ -300,7 +300,7 @@ def request_page # Note that the censor rule applies to the original filename, # not the display_filename: expect(rendered).to have_css(".attachment .attachment__name") do |s| - expect(s).to contain(/Mouse.pdf/m) + expect(s).to have_text(/Mouse.html/m) end end end From f961164bae86d5090a855176fa63ccf7c8c0ba23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 05:05:13 +0000 Subject: [PATCH 256/289] Build(deps-dev): Bump capybara from 3.38.0 to 3.39.0 Bumps [capybara](https://github.com/teamcapybara/capybara) from 3.38.0 to 3.39.0. - [Release notes](https://github.com/teamcapybara/capybara/releases) - [Changelog](https://github.com/teamcapybara/capybara/blob/master/History.md) - [Commits](https://github.com/teamcapybara/capybara/compare/3.38.0...3.39.0) --- updated-dependencies: - dependency-name: capybara dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 7a87eb5a12..f344165362 100644 --- a/Gemfile +++ b/Gemfile @@ -167,7 +167,7 @@ group :test do gem 'webmock', '~> 3.18.1' gem 'simplecov', '~> 0.22.0' gem 'simplecov-lcov', '~> 0.7.0' - gem 'capybara', '~> 3.38.0' + gem 'capybara', '~> 3.39.0' gem 'stripe-ruby-mock', git: 'https://github.com/stripe-ruby-mock/stripe-ruby-mock', ref: '6ceea96' gem 'rails-controller-testing' diff --git a/Gemfile.lock b/Gemfile.lock index 737a379004..b7eefab34c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -113,7 +113,7 @@ GEM i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - addressable (2.8.1) + addressable (2.8.2) public_suffix (>= 2.0.2, < 6.0) annotate (3.2.0) activerecord (>= 3.2, < 8.0) @@ -159,7 +159,7 @@ GEM net-sftp (>= 2.0.0) net-ssh (>= 2.0.14) net-ssh-gateway (>= 1.1.0) - capybara (3.38.0) + capybara (3.39.0) addressable matrix mini_mime (>= 0.1.3) @@ -561,7 +561,7 @@ DEPENDENCIES bullet (~> 7.0.7) cancancan (~> 3.5.0) capistrano (~> 2.15.0, < 3.0.0) - capybara (~> 3.38.0) + capybara (~> 3.39.0) charlock_holmes (~> 0.7.7) dalli (~> 3.2.4) exception_notification (~> 4.5.0) From 373b1c7e90b950c5017777a4f2b4eb9413428703 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Mon, 3 Apr 2023 16:02:57 +0100 Subject: [PATCH 257/289] Remove "Introductory Pricing" phrase Started to cause some confusion for WhatDoTheyKnow users wondering if their plan will change price after a period of months. Makes less sense to include this in Alaveteli core now; we have a variety of installs running Pro, some quite new but some quite established. --- app/views/alaveteli_pro/plans/_pricing_tiers.html.erb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/views/alaveteli_pro/plans/_pricing_tiers.html.erb b/app/views/alaveteli_pro/plans/_pricing_tiers.html.erb index b0c5538c54..5f4c5b7452 100644 --- a/app/views/alaveteli_pro/plans/_pricing_tiers.html.erb +++ b/app/views/alaveteli_pro/plans/_pricing_tiers.html.erb @@ -22,10 +22,6 @@ no_cents_if_whole: true)) %> <% end %>

    - -

    - <%= _('Introductory Pricing') %> -

    From e43e1cbd716bb563d2970b2214e43acb4ba5ef12 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 5 Apr 2023 14:35:23 +0100 Subject: [PATCH 258/289] Fix admin timeline edit comment events When an comment is edited the admin timeline breaks. This is due to changes in how the event params are stored in #7173. We should now use `event.comment` which loads the correct `Comment` from the database without needing the manually load from the view. Fixes #7682 --- app/views/admin_general/_edit_comment.html.erb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/views/admin_general/_edit_comment.html.erb b/app/views/admin_general/_edit_comment.html.erb index 246e0bd7ae..a7a086980b 100644 --- a/app/views/admin_general/_edit_comment.html.erb +++ b/app/views/admin_general/_edit_comment.html.erb @@ -1,6 +1,5 @@ -<% comment = Comment.find(event.params[:comment_id].to_i) %> had annotation edited by administrator <%= event.params[:editor] %>. -<% if comment %> +<% if event.comment %> <%= event_params_description(event) %> <% else %> Missing annotation, internal error. From 6ccd2d06e1d1308425bb5fcb0a3a6b1506dbb076 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 05:01:55 +0000 Subject: [PATCH 259/289] Build(deps-dev): Bump rubocop-performance from 1.16.0 to 1.17.1 Bumps [rubocop-performance](https://github.com/rubocop/rubocop-performance) from 1.16.0 to 1.17.1. - [Release notes](https://github.com/rubocop/rubocop-performance/releases) - [Changelog](https://github.com/rubocop/rubocop-performance/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-performance/compare/v1.16.0...v1.17.1) --- updated-dependencies: - dependency-name: rubocop-performance dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9da69507a6..9910ffe691 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -349,7 +349,7 @@ GEM open4 (1.3.4) os (1.1.4) parallel (1.22.1) - parser (3.2.1.1) + parser (3.2.2.0) ast (~> 2.4.1) pg (1.4.6) prime (0.1.2) @@ -451,9 +451,9 @@ GEM rubocop-ast (>= 1.26.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.27.0) + rubocop-ast (1.28.0) parser (>= 3.2.1.0) - rubocop-performance (1.16.0) + rubocop-performance (1.17.1) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) rubocop-rails (2.18.0) From 0683c1d6469e1f2334e73f7d87decfadf316e0e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 05:03:30 +0000 Subject: [PATCH 260/289] Build(deps): Bump aws-sdk-s3 from 1.120.0 to 1.120.1 Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.120.0 to 1.120.1. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-s3/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) --- updated-dependencies: - dependency-name: aws-sdk-s3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9da69507a6..4484848961 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -120,7 +120,7 @@ GEM rake (>= 10.4, < 14.0) ast (2.4.2) aws-eventstream (1.2.0) - aws-partitions (1.739.0) + aws-partitions (1.743.0) aws-sdk-core (3.171.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) @@ -129,7 +129,7 @@ GEM aws-sdk-kms (1.63.0) aws-sdk-core (~> 3, >= 3.165.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.120.0) + aws-sdk-s3 (1.120.1) aws-sdk-core (~> 3, >= 3.165.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) From 4d98b9cfa70b0fce45bf119d552680a400d92224 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 05:00:20 +0000 Subject: [PATCH 261/289] Build(deps-dev): Bump rubocop-rails from 2.18.0 to 2.19.0 Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.18.0 to 2.19.0. - [Release notes](https://github.com/rubocop/rubocop-rails/releases) - [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.18.0...v2.19.0) --- updated-dependencies: - dependency-name: rubocop-rails dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .ruby-style.yml | 3 +++ Gemfile.lock | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.ruby-style.yml b/.ruby-style.yml index 83122370ba..66689f45e5 100644 --- a/.ruby-style.yml +++ b/.ruby-style.yml @@ -1366,6 +1366,9 @@ Rails/StripHeredoc: Rails/TableNameAssignment: Enabled: false +Rails/ThreeStateBooleanColumn: + Enabled: false + Rails/TimeZone: Enabled: false diff --git a/Gemfile.lock b/Gemfile.lock index 9da69507a6..86a9ef66fe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -349,7 +349,7 @@ GEM open4 (1.3.4) os (1.1.4) parallel (1.22.1) - parser (3.2.1.1) + parser (3.2.2.0) ast (~> 2.4.1) pg (1.4.6) prime (0.1.2) @@ -451,12 +451,12 @@ GEM rubocop-ast (>= 1.26.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.27.0) + rubocop-ast (1.28.0) parser (>= 3.2.1.0) rubocop-performance (1.16.0) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - rubocop-rails (2.18.0) + rubocop-rails (2.19.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) From 93c4711925038b63bb3ba076226089d2d7811ac1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 05:07:35 +0000 Subject: [PATCH 262/289] Build(deps-dev): Bump rubocop from 1.48.1 to 1.49.0 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.48.1 to 1.49.0. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.48.1...v1.49.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .ruby-style.yml | 6 ++++++ Gemfile | 2 +- Gemfile.lock | 10 +++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.ruby-style.yml b/.ruby-style.yml index 83122370ba..3887b0d21f 100644 --- a/.ruby-style.yml +++ b/.ruby-style.yml @@ -1555,6 +1555,9 @@ Style/ConstantVisibility: Style/Copyright: Enabled: false +Style/DataInheritance: + Enabled: false + Style/DateTime: Enabled: false @@ -1989,6 +1992,9 @@ Style/RedundantInitialize: Style/RedundantInterpolation: Enabled: true +Style/RedundantLineContinuation: + Enabled: false + Style/RedundantParentheses: Enabled: true diff --git a/Gemfile b/Gemfile index fab05415d5..8c2c00df93 100644 --- a/Gemfile +++ b/Gemfile @@ -190,7 +190,7 @@ group :development do gem 'launchy', '< 2.6.0' gem 'listen', '>= 3.0.5', '< 3.8.1' gem 'web-console', '>= 3.3.0' - gem 'rubocop', '~> 1.48.1', require: false + gem 'rubocop', '~> 1.49.0', require: false gem 'rubocop-performance', require: false gem 'rubocop-rails', require: false end diff --git a/Gemfile.lock b/Gemfile.lock index 9da69507a6..8cad290218 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -349,7 +349,7 @@ GEM open4 (1.3.4) os (1.1.4) parallel (1.22.1) - parser (3.2.1.1) + parser (3.2.2.0) ast (~> 2.4.1) pg (1.4.6) prime (0.1.2) @@ -441,17 +441,17 @@ GEM rspec-mocks (~> 3.11) rspec-support (~> 3.11) rspec-support (3.11.1) - rubocop (1.48.1) + rubocop (1.49.0) json (~> 2.3) parallel (~> 1.10) parser (>= 3.2.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.26.0, < 2.0) + rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.27.0) + rubocop-ast (1.28.0) parser (>= 3.2.1.0) rubocop-performance (1.16.0) rubocop (>= 1.7.0, < 2.0) @@ -612,7 +612,7 @@ DEPENDENCIES routing-filter (~> 0.7.0) rspec-activemodel-mocks (~> 1.1.0) rspec-rails (~> 6.0.0) - rubocop (~> 1.48.1) + rubocop (~> 1.49.0) rubocop-performance rubocop-rails ruby-msg (~> 1.5.0)! From a360f1e0c1debe72d31a9c3cb0f668ca42cb9d8c Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 11 Apr 2023 09:38:31 +0100 Subject: [PATCH 263/289] Remove duplicate method Looks like this was meant to be removed in #7452. --- app/models/info_request_event.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index 3226561ba7..3892b1a0a9 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -202,10 +202,6 @@ def tags info_request.tag_array_for_search end - def variety - event_type - end - def visible if event_type == 'comment' comment.visible From e8f7dcb20019edcab0da6c7dc8da9c9ea637dcb0 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Tue, 4 Apr 2023 15:42:39 +0100 Subject: [PATCH 264/289] feat: alter project download to include requests with no extractions --- app/models/project/export.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/project/export.rb b/app/models/project/export.rb index dcbfc50107..22cbed4cc4 100644 --- a/app/models/project/export.rb +++ b/app/models/project/export.rb @@ -14,7 +14,7 @@ def initialize(project) end def data - @data ||= project.info_requests.extracted.map do |info_request| + @data ||= project.info_requests.map do |info_request| Project::Export::InfoRequest.new(project, info_request).data end end From 9942e1cf480351fb03bcec2ac5e7a433d6ddafd8 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Wed, 5 Apr 2023 13:43:09 +0100 Subject: [PATCH 265/289] test: won't expect 'exported' call to info_requests --- spec/models/project/export_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/models/project/export_spec.rb b/spec/models/project/export_spec.rb index c458d8b18c..e693226024 100644 --- a/spec/models/project/export_spec.rb +++ b/spec/models/project/export_spec.rb @@ -11,11 +11,11 @@ let(:info_request_b) { instance_double('InfoRequest') } before do - allow(project).to receive_message_chain(:info_requests, :extracted). + allow(project).to receive_message_chain(:info_requests). and_return([info_request_a, info_request_b]) end - it 'individualy exports info requests' do + it 'individually exports info requests' do expect(Project::Export::InfoRequest).to receive(:new). with(project, info_request_a). and_return(double(data: { header: 'DATA A' })) From 997f2352f135deea60e703d3282478fd2d41eeb2 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Tue, 11 Apr 2023 12:28:49 +0100 Subject: [PATCH 266/289] Remove file_watcher from config In Rails 7, the file_watcher variable was removed from the config template (as well as the listen gem). This change is now reflected here, which makes development in a docker environment easier, because it means that the container doesn't need to be restarted for changes to files to reflect in the local website in the browser. --- Gemfile | 1 - Gemfile.lock | 8 -------- config/environments/development.rb | 4 ---- 3 files changed, 13 deletions(-) diff --git a/Gemfile b/Gemfile index 8c2c00df93..e8ac8a1651 100644 --- a/Gemfile +++ b/Gemfile @@ -188,7 +188,6 @@ group :development do gem 'net-ssh', '~> 7.1.0' gem 'net-ssh-gateway', '>= 1.1.0', '< 3.0.0' gem 'launchy', '< 2.6.0' - gem 'listen', '>= 3.0.5', '< 3.8.1' gem 'web-console', '>= 3.3.0' gem 'rubocop', '~> 1.49.0', require: false gem 'rubocop-performance', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 52a78f27e0..4c8eed37aa 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -202,7 +202,6 @@ GEM faraday_middleware (0.14.0) faraday (>= 0.7.4, < 1.0) fast_gettext (2.3.0) - ffi (1.15.5) fivemat (1.3.7) flipper (0.24.1) flipper-active_record (0.24.1) @@ -286,9 +285,6 @@ GEM libv8-node (16.10.0.0-arm64-darwin) libv8-node (16.10.0.0-x86_64-darwin) libv8-node (16.10.0.0-x86_64-linux) - listen (3.8.0) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) locale (2.1.3) loofah (2.19.1) crass (~> 1.0.2) @@ -400,9 +396,6 @@ GEM zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.0.6) - rb-fsevent (0.11.2) - rb-inotify (0.10.1) - ffi (~> 1.0) recaptcha (5.12.3) json redis (4.8.1) @@ -584,7 +577,6 @@ DEPENDENCIES jquery-ui-rails (~> 6.0.0) json (~> 2.6.2) launchy (< 2.6.0) - listen (>= 3.0.5, < 3.8.1) locale (~> 2.1.3) mahoro (~> 0.5) mail (~> 2.8.1) diff --git a/config/environments/development.rb b/config/environments/development.rb index 636e5e4909..a92d6846b3 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -64,10 +64,6 @@ # Annotate rendered view with file names. # config.action_view.annotate_rendered_view_with_filenames = true - # Use an evented file watcher to asynchronously detect changes in source code, - # routes, locales, etc. This feature depends on the listen gem. - config.file_watcher = ActiveSupport::EventedFileUpdateChecker - # Uncomment if you wish to allow Action Cable access from any origin. # config.action_cable.disable_request_forgery_protection = true From 4f087a17ac5eadca5a613707df533a7e4623565f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 06:35:46 +0000 Subject: [PATCH 267/289] Build(deps): Bump nokogiri from 1.14.2 to 1.14.3 Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.14.2 to 1.14.3. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.14.2...v1.14.3) --- updated-dependencies: - dependency-name: nokogiri dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 8c2c00df93..7d38c675e8 100644 --- a/Gemfile +++ b/Gemfile @@ -104,7 +104,7 @@ gem 'iso_country_codes', '~> 0.7.8' gem 'mail', '~> 2.8.1' gem 'maxmind-db', '~> 1.0.0' gem 'mahoro', '~> 0.5' -gem 'nokogiri', '~> 1.14.2' +gem 'nokogiri', '~> 1.14.3' gem 'open4', '~> 1.3.0' gem 'rack', '~> 2.2.6' gem 'rack-utf8_sanitizer', '~> 1.8.0' diff --git a/Gemfile.lock b/Gemfile.lock index 52a78f27e0..3a6b844fd9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -332,16 +332,16 @@ GEM net-ssh-gateway (2.0.0) net-ssh (>= 4.0.0) nio4r (2.5.8) - nokogiri (1.14.2) + nokogiri (1.14.3) mini_portile2 (~> 2.8.0) racc (~> 1.4) - nokogiri (1.14.2-aarch64-linux) + nokogiri (1.14.3-aarch64-linux) racc (~> 1.4) - nokogiri (1.14.2-arm64-darwin) + nokogiri (1.14.3-arm64-darwin) racc (~> 1.4) - nokogiri (1.14.2-x86_64-darwin) + nokogiri (1.14.3-x86_64-darwin) racc (~> 1.4) - nokogiri (1.14.2-x86_64-linux) + nokogiri (1.14.3-x86_64-linux) racc (~> 1.4) oink (0.10.1) activerecord @@ -596,7 +596,7 @@ DEPENDENCIES money (~> 6.16.0) net-ssh (~> 7.1.0) net-ssh-gateway (>= 1.1.0, < 3.0.0) - nokogiri (~> 1.14.2) + nokogiri (~> 1.14.3) oink (~> 0.10.1) open4 (~> 1.3.0) pg (~> 1.4.6) From 93d0ed0057d837739cbfea79e7e93fe6b239c690 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 31 Mar 2023 15:17:42 +0100 Subject: [PATCH 268/289] Add inline documentation for blog posts Add some basic documentation so that admins know they can match blog posts to related content via tags. --- app/views/admin/blog_posts/_about.html.erb | 21 +++++++++++++++++++++ app/views/admin/blog_posts/index.html.erb | 4 ++++ 2 files changed, 25 insertions(+) create mode 100644 app/views/admin/blog_posts/_about.html.erb diff --git a/app/views/admin/blog_posts/_about.html.erb b/app/views/admin/blog_posts/_about.html.erb new file mode 100644 index 0000000000..00e8965925 --- /dev/null +++ b/app/views/admin/blog_posts/_about.html.erb @@ -0,0 +1,21 @@ +
    +
    +
    +

    About Blog Posts

    + +

    + Alaveteli automatically imports posts from the configured + + BLOG_FEED to display around the site. +

    + +

    + By default blog posts are listed by recency. When they're presented + alongside <%= link_to 'taggable content', admin_tags_path %>, Alaveteli + attempts to render relevant posts through matching tags. For example, + blog posts tagged with "climate" would be matched with records + (requests, authorities, etc) also tagged "climate". +

    +
    +
    +
    diff --git a/app/views/admin/blog_posts/index.html.erb b/app/views/admin/blog_posts/index.html.erb index 0adf3d90bb..13507dc4e9 100644 --- a/app/views/admin/blog_posts/index.html.erb +++ b/app/views/admin/blog_posts/index.html.erb @@ -25,3 +25,7 @@ feed in Alaveteli’s configuration.
    <% end %> + +
    + +<%= render partial: 'about' %> From 45ced492a37b687dd741e891fe6a9bd86dd6c586 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Apr 2023 04:57:40 +0000 Subject: [PATCH 269/289] Build(deps): Bump recaptcha from 5.12.3 to 5.13.0 Bumps [recaptcha](https://github.com/ambethia/recaptcha) from 5.12.3 to 5.13.0. - [Release notes](https://github.com/ambethia/recaptcha/releases) - [Changelog](https://github.com/ambethia/recaptcha/blob/master/CHANGELOG.md) - [Commits](https://github.com/ambethia/recaptcha/compare/v5.12.3...v5.13.0) --- updated-dependencies: - dependency-name: recaptcha dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index e474f2de3a..6bd2ba6db2 100644 --- a/Gemfile +++ b/Gemfile @@ -108,7 +108,7 @@ gem 'nokogiri', '~> 1.14.3' gem 'open4', '~> 1.3.0' gem 'rack', '~> 2.2.6' gem 'rack-utf8_sanitizer', '~> 1.8.0' -gem 'recaptcha', '~> 5.12.3', require: 'recaptcha/rails' +gem 'recaptcha', '~> 5.13.0', require: 'recaptcha/rails' gem 'matrix', '~> 0.4.2' gem 'mini_magick', '~> 4.12.0' gem 'redis', '~> 4.8.1' diff --git a/Gemfile.lock b/Gemfile.lock index 0fd3ddda59..0393ea3267 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -396,7 +396,7 @@ GEM zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.0.6) - recaptcha (5.12.3) + recaptcha (5.13.0) json redis (4.8.1) regexp_parser (2.7.0) @@ -598,7 +598,7 @@ DEPENDENCIES rails (~> 7.0.4) rails-controller-testing rails-i18n (~> 7.0.5) - recaptcha (~> 5.12.3) + recaptcha (~> 5.13.0) redis (~> 4.8.1) rolify (~> 6.0.1) routing-filter (~> 0.7.0) From 0e8139451375658ea39012b886a00f2097490fae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Apr 2023 04:58:12 +0000 Subject: [PATCH 270/289] Build(deps-dev): Bump rubocop-rails from 2.19.0 to 2.19.1 Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.19.0 to 2.19.1. - [Release notes](https://github.com/rubocop/rubocop-rails/releases) - [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.19.0...v2.19.1) --- updated-dependencies: - dependency-name: rubocop-rails dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0fd3ddda59..2bc7c57cc4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -449,7 +449,7 @@ GEM rubocop-performance (1.17.1) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - rubocop-rails (2.19.0) + rubocop-rails (2.19.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) From c341f27a5f9de65986f634f4f3e9cd72aae01c24 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Apr 2023 04:59:41 +0000 Subject: [PATCH 271/289] Build(deps-dev): Bump rubocop from 1.49.0 to 1.50.1 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.49.0 to 1.50.1. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.49.0...v1.50.1) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .ruby-style.yml | 3 +++ Gemfile | 2 +- Gemfile.lock | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.ruby-style.yml b/.ruby-style.yml index 00485c270c..8c25fcf7c1 100644 --- a/.ruby-style.yml +++ b/.ruby-style.yml @@ -471,6 +471,9 @@ Lint/DuplicateHashKey: Lint/DuplicateMagicComment: Enabled: false +Lint/DuplicateMatchPattern: + Enabled: false + Lint/DuplicateMethods: Enabled: true diff --git a/Gemfile b/Gemfile index e474f2de3a..af69e2a034 100644 --- a/Gemfile +++ b/Gemfile @@ -189,7 +189,7 @@ group :development do gem 'net-ssh-gateway', '>= 1.1.0', '< 3.0.0' gem 'launchy', '< 2.6.0' gem 'web-console', '>= 3.3.0' - gem 'rubocop', '~> 1.49.0', require: false + gem 'rubocop', '~> 1.50.1', require: false gem 'rubocop-performance', require: false gem 'rubocop-rails', require: false end diff --git a/Gemfile.lock b/Gemfile.lock index 0fd3ddda59..1aad3abab1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -434,7 +434,7 @@ GEM rspec-mocks (~> 3.11) rspec-support (~> 3.11) rspec-support (3.11.1) - rubocop (1.49.0) + rubocop (1.50.1) json (~> 2.3) parallel (~> 1.10) parser (>= 3.2.0.0) @@ -604,7 +604,7 @@ DEPENDENCIES routing-filter (~> 0.7.0) rspec-activemodel-mocks (~> 1.1.0) rspec-rails (~> 6.0.0) - rubocop (~> 1.49.0) + rubocop (~> 1.50.1) rubocop-performance rubocop-rails ruby-msg (~> 1.5.0)! From 0747b1da6fbcca8d463efd4eed81e38aa29a8d5c Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Tue, 11 Apr 2023 12:07:07 +0100 Subject: [PATCH 272/289] feat: add censor rules JS and use previous comment feature in admin_censor_rule form This change introduces a new JavaScript file, censor-rules.js, to handle the functionality for the admin censor rules section. Specifically, it adds a "Use previous comment" feature to the form for editing censor rules. The change has been made by: Including the new censor-rules.js file in admin.js to make it available for use in the admin section of js files. Creating the censor-rules.js file, where a click event listener is added to the "Use previous comment" link. When the link is clicked, the event handler retrieves the last edit comment from the associated text area's data attribute and sets the text area's value to the comment at the last edit. Updating the _form.html.erb partial for the censor rule form. In the partial, a data attribute is added to the last_edit_comment text area to store the last_edit_comment value from the censor_rule object. The purpose of this change is to streamline the editing process for admin users. By providing a "Use previous comment" option, admins can easily reuse the last edit comment as the reason for the current update, saving time and effort when making similar or related changes to censor rules. --- app/assets/javascripts/admin.js | 1 + app/assets/javascripts/admin/censor-rules.js | 8 ++++++++ app/views/admin_censor_rule/_form.html.erb | 5 ++++- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 app/assets/javascripts/admin/censor-rules.js diff --git a/app/assets/javascripts/admin.js b/app/assets/javascripts/admin.js index f8e6a2fad4..b40ef6990a 100644 --- a/app/assets/javascripts/admin.js +++ b/app/assets/javascripts/admin.js @@ -9,5 +9,6 @@ //= require bootstrap-tooltip //= require admin/admin //= require admin/category-order +//= require admin/censor-rules //= require admin/holidays //= require jquery_ujs diff --git a/app/assets/javascripts/admin/censor-rules.js b/app/assets/javascripts/admin/censor-rules.js new file mode 100644 index 0000000000..d90a205f22 --- /dev/null +++ b/app/assets/javascripts/admin/censor-rules.js @@ -0,0 +1,8 @@ +$(function () { + $('#js-use-previous-comment').click(function (e) { + var textArea = $($(this).data('target')); + var lastEditComment = textArea.data('last-edit-comment'); + textArea.val(lastEditComment); + e.preventDefault(); + }) +}); diff --git a/app/views/admin_censor_rule/_form.html.erb b/app/views/admin_censor_rule/_form.html.erb index 603dfe4a8f..25314ecca0 100644 --- a/app/views/admin_censor_rule/_form.html.erb +++ b/app/views/admin_censor_rule/_form.html.erb @@ -56,7 +56,10 @@
    - <%= text_area 'censor_rule', 'last_edit_comment', :value => '', :rows => 2, :class => "span6" %> + <%= text_area 'censor_rule', 'last_edit_comment', :data => { last_edit_comment: @censor_rule.last_edit_comment }, :value => '', :rows => 2, :class => "span6" %> + <% if @censor_rule.last_edit_comment %> + Use previous comment + <% end %>
    put purpose of the rule, and why the change
    From b0ddc92b44423dbaa6deb79595a4e9c8ab464e43 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Apr 2023 15:22:54 +0000 Subject: [PATCH 273/289] Build(deps): Bump recaptcha from 5.13.0 to 5.13.1 Bumps [recaptcha](https://github.com/ambethia/recaptcha) from 5.13.0 to 5.13.1. - [Release notes](https://github.com/ambethia/recaptcha/releases) - [Changelog](https://github.com/ambethia/recaptcha/blob/master/CHANGELOG.md) - [Commits](https://github.com/ambethia/recaptcha/compare/v5.13.0...v5.13.1) --- updated-dependencies: - dependency-name: recaptcha dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 8b405bf569..e453f1704a 100644 --- a/Gemfile +++ b/Gemfile @@ -108,7 +108,7 @@ gem 'nokogiri', '~> 1.14.3' gem 'open4', '~> 1.3.0' gem 'rack', '~> 2.2.6' gem 'rack-utf8_sanitizer', '~> 1.8.0' -gem 'recaptcha', '~> 5.13.0', require: 'recaptcha/rails' +gem 'recaptcha', '~> 5.13.1', require: 'recaptcha/rails' gem 'matrix', '~> 0.4.2' gem 'mini_magick', '~> 4.12.0' gem 'redis', '~> 4.8.1' diff --git a/Gemfile.lock b/Gemfile.lock index 26ee1e61c9..6c146771fd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -396,7 +396,7 @@ GEM zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.0.6) - recaptcha (5.13.0) + recaptcha (5.13.1) json redis (4.8.1) regexp_parser (2.7.0) @@ -598,7 +598,7 @@ DEPENDENCIES rails (~> 7.0.4) rails-controller-testing rails-i18n (~> 7.0.5) - recaptcha (~> 5.13.0) + recaptcha (~> 5.13.1) redis (~> 4.8.1) rolify (~> 6.0.1) routing-filter (~> 0.7.0) From 3e683a2d29adc70d0f6471dc49068df60eb8b1b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Apr 2023 15:23:23 +0000 Subject: [PATCH 274/289] Build(deps-dev): Bump rubocop from 1.50.1 to 1.50.2 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.50.1 to 1.50.2. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.50.1...v1.50.2) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 8b405bf569..1cc515a3fd 100644 --- a/Gemfile +++ b/Gemfile @@ -189,7 +189,7 @@ group :development do gem 'net-ssh-gateway', '>= 1.1.0', '< 3.0.0' gem 'launchy', '< 2.6.0' gem 'web-console', '>= 3.3.0' - gem 'rubocop', '~> 1.50.1', require: false + gem 'rubocop', '~> 1.50.2', require: false gem 'rubocop-performance', require: false gem 'rubocop-rails', require: false end diff --git a/Gemfile.lock b/Gemfile.lock index 26ee1e61c9..a56ebd7759 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -344,7 +344,7 @@ GEM hodel_3000_compliant_logger open4 (1.3.4) os (1.1.4) - parallel (1.22.1) + parallel (1.23.0) parser (3.2.2.0) ast (~> 2.4.1) pg (1.4.6) @@ -399,7 +399,7 @@ GEM recaptcha (5.13.0) json redis (4.8.1) - regexp_parser (2.7.0) + regexp_parser (2.8.0) representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) @@ -434,7 +434,7 @@ GEM rspec-mocks (~> 3.11) rspec-support (~> 3.11) rspec-support (3.11.1) - rubocop (1.50.1) + rubocop (1.50.2) json (~> 2.3) parallel (~> 1.10) parser (>= 3.2.0.0) @@ -604,7 +604,7 @@ DEPENDENCIES routing-filter (~> 0.7.0) rspec-activemodel-mocks (~> 1.1.0) rspec-rails (~> 6.0.0) - rubocop (~> 1.50.1) + rubocop (~> 1.50.2) rubocop-performance rubocop-rails ruby-msg (~> 1.5.0)! From 0b8c46fbc9af46aa3659e94595f4ac94d8bedd73 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 20 Apr 2023 13:18:51 +0100 Subject: [PATCH 275/289] Remove merge conflict marker --- doc/CHANGES.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 6a2cf7782e..79fe0e53d7 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -1,4 +1,3 @@ -<<<<<<< HEAD # develop ## Highlighted Features From f7dae71984a79825e1ddf8dbefdbf3893d3f79d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Apr 2023 08:43:54 +0000 Subject: [PATCH 276/289] Build(deps): Bump aws-sdk-s3 from 1.120.1 to 1.121.0 Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.120.1 to 1.121.0. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-s3/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) --- updated-dependencies: - dependency-name: aws-sdk-s3 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 64c7d4113c..7da7bc0331 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -120,7 +120,7 @@ GEM rake (>= 10.4, < 14.0) ast (2.4.2) aws-eventstream (1.2.0) - aws-partitions (1.743.0) + aws-partitions (1.751.0) aws-sdk-core (3.171.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) @@ -129,7 +129,7 @@ GEM aws-sdk-kms (1.63.0) aws-sdk-core (~> 3, >= 3.165.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.120.1) + aws-sdk-s3 (1.121.0) aws-sdk-core (~> 3, >= 3.165.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) From d0ad2a5cdfb909bf640afdb116529c652b19ae24 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Apr 2023 08:44:52 +0000 Subject: [PATCH 277/289] Build(deps): Bump recaptcha from 5.13.1 to 5.14.0 Bumps [recaptcha](https://github.com/ambethia/recaptcha) from 5.13.1 to 5.14.0. - [Release notes](https://github.com/ambethia/recaptcha/releases) - [Changelog](https://github.com/ambethia/recaptcha/blob/master/CHANGELOG.md) - [Commits](https://github.com/ambethia/recaptcha/compare/v5.13.1...v5.14.0) --- updated-dependencies: - dependency-name: recaptcha dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 5d3bae9d97..4f7a46777b 100644 --- a/Gemfile +++ b/Gemfile @@ -108,7 +108,7 @@ gem 'nokogiri', '~> 1.14.3' gem 'open4', '~> 1.3.0' gem 'rack', '~> 2.2.6' gem 'rack-utf8_sanitizer', '~> 1.8.0' -gem 'recaptcha', '~> 5.13.1', require: 'recaptcha/rails' +gem 'recaptcha', '~> 5.14.0', require: 'recaptcha/rails' gem 'matrix', '~> 0.4.2' gem 'mini_magick', '~> 4.12.0' gem 'redis', '~> 4.8.1' diff --git a/Gemfile.lock b/Gemfile.lock index 64c7d4113c..1b040c730b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -396,8 +396,7 @@ GEM zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.0.6) - recaptcha (5.13.1) - json + recaptcha (5.14.0) redis (4.8.1) regexp_parser (2.8.0) representable (3.2.0) @@ -598,7 +597,7 @@ DEPENDENCIES rails (~> 7.0.4) rails-controller-testing rails-i18n (~> 7.0.5) - recaptcha (~> 5.13.1) + recaptcha (~> 5.14.0) redis (~> 4.8.1) rolify (~> 6.0.1) routing-filter (~> 0.7.0) From df2f56e032839b4896a1c4c370f1427e2f44b1fc Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 14 Apr 2023 16:37:43 +0100 Subject: [PATCH 278/289] style: Lint/IneffectiveAccessModifier RuboCop 2 changes, made manually --- app/models/mail_server_log.rb | 1 + app/models/public_body.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/models/mail_server_log.rb b/app/models/mail_server_log.rb index f8854e6018..2144d2aacf 100644 --- a/app/models/mail_server_log.rb +++ b/app/models/mail_server_log.rb @@ -295,6 +295,7 @@ def self.create_mail_server_logs(emails, line, order, done) end end end + private_class_method :create_mail_server_logs def line_decorator mta = AlaveteliConfiguration.mta_log_type.to_sym diff --git a/app/models/public_body.rb b/app/models/public_body.rb index fd6dc3adcf..8ec9dd5bcf 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -955,6 +955,7 @@ def self.get_public_body_list_translated_condition(table, has_first_letter=false result += " AND #{table}.locale = :locale" if locale result end + private_class_method :get_public_body_list_translated_condition def update_missing_email_tag if missing_email? && !defunct? From 348d80527a035b66207a2fedaa592bd06913d4b0 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 14 Apr 2023 17:06:23 +0100 Subject: [PATCH 279/289] style: Lint/ImplicitStringConcatenation RuboCop --- app/models/incoming_message.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index f91eda86a3..d15d8bb950 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -235,7 +235,7 @@ def self.remove_quoted_sections(text, replacement = "FOLDED_QUOTED_SECTION") # http://www.whatdotheyknow.com/request/71/response/108 # http://www.whatdotheyknow.com/request/police_powers_to_inform_car_insu # http://www.whatdotheyknow.com/request/secured_convictions_aided_by_cct - multiline_original_message = '(' + '''>>>.* \d\d/\d\d/\d\d\d\d\s+\d\d:\d\d(?::\d\d)?\s*>>>''' + ')' + multiline_original_message = '(>>>.* \d\d/\d\d/\d\d\d\d\s+\d\d:\d\d(?::\d\d)?\s*>>>)' text.gsub!(/^(#{multiline_original_message}\n.*)$/m, replacement) # On Thu, Nov 28, 2013 at 9:08 AM, A User @@ -278,12 +278,13 @@ def self.remove_quoted_sections(text, replacement = "FOLDED_QUOTED_SECTION") # http://www.whatdotheyknow.com/request/123/response/192 # http://www.whatdotheyknow.com/request/235/response/513 # http://www.whatdotheyknow.com/request/445/response/743 - original_message = - '(' + '''----* This is a copy of the message, including all the headers. ----*''' \ - '|' + '''----*\s*Original Message\s*----*''' \ - '|' + '''----*\s*Forwarded message.+----*''' \ - '|' + '''----*\s*Forwarded by.+----*''' \ - ')' + message_section_strings = [ + '----* This is a copy of the message, including all the headers. ----*', + '----*\s*Original Message\s*----*', + '----*\s*Forwarded message.+----*', + '----*\s*Forwarded by.+----*' + ] + original_message = "(#{message_section_strings.join('|')})" # Could have a ^ at start here, but see messed up formatting here: # http://www.whatdotheyknow.com/request/refuse_and_recycling_collection#incoming-842 text.gsub!(/(#{original_message}\n.*)$/mi, replacement) From 08ffda92e01d181f53c043783be4a6e4e92be597 Mon Sep 17 00:00:00 2001 From: Alexander Griffen Date: Fri, 21 Apr 2023 14:41:04 +0100 Subject: [PATCH 280/289] style: Lint/ShadowingOuterVariable RuboCop Manual changes made to variable names --- app/controllers/api_controller.rb | 12 ++++++------ app/models/info_request.rb | 4 ++-- app/models/outgoing_message.rb | 2 +- lib/alaveteli_text_masker.rb | 4 ++-- .../alaveteli_rate_limiter/ip_rate_limiter_spec.rb | 4 ++-- spec/mailers/alaveteli_pro/embargo_mailer_spec.rb | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index d5d9521d98..6dd05e2365 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -244,18 +244,18 @@ def body_request_events render template: "api/request_events", formats: [:atom], layout: false elsif feed_type == "json" @event_data = [] - @events.each do |event| + @events.each do |json_event| - request = event.info_request + request = json_event.info_request this_event = { request_id: request.id, - event_id: event.id, - created_at: event.created_at.iso8601, - event_type: event.event_type, + event_id: json_event.id, + created_at: json_event.created_at.iso8601, + event_type: json_event.event_type, request_url: request_url(request), request_email: request.incoming_email, title: request.title, - body: event.outgoing_message.body, + body: json_event.outgoing_message.body, user_name: request.user_name } this_event[:user_url] = user_url(request.user) if request.user diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 57e37d0c98..b64c356986 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -1475,12 +1475,12 @@ def applicable_censor_rules def apply_censor_rules_to_text(text) applicable_censor_rules. - reduce(text) { |text, rule| rule.apply_to_text(text) } + reduce(text) { |t, rule| rule.apply_to_text(t) } end def apply_censor_rules_to_binary(text) applicable_censor_rules. - reduce(text) { |text, rule| rule.apply_to_binary(text) } + reduce(text) { |t, rule| rule.apply_to_binary(t) } end def apply_masks(text, content_type) diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb index 1e97e8b8bf..434384deb4 100644 --- a/app/models/outgoing_message.rb +++ b/app/models/outgoing_message.rb @@ -191,7 +191,7 @@ def body(options = {}) info_request.try(:applicable_censor_rules) or [] end - censor_rules.reduce(text) { |text, rule| rule.apply_to_text(text) } + censor_rules.reduce(text) { |t, rule| rule.apply_to_text(t) } end def raw_body diff --git a/lib/alaveteli_text_masker.rb b/lib/alaveteli_text_masker.rb index b9496b4a3b..a0dd232daf 100644 --- a/lib/alaveteli_text_masker.rb +++ b/lib/alaveteli_text_masker.rb @@ -147,7 +147,7 @@ def apply_binary_masks(text, options = {}) # Replace censor items censor_rules = options[:censor_rules] || [] - text = censor_rules.reduce(text) { |text, rule| rule.apply_to_binary(text) } + text = censor_rules.reduce(text) { |t, rule| rule.apply_to_binary(t) } raise "internal error in apply_binary_masks" if text.bytesize != orig_size text @@ -173,7 +173,7 @@ def apply_text_masks(text, options = {}) memo.gsub(mask[:to_replace], mask[:replacement]) end - censor_rules.reduce(text) { |text, rule| rule.apply_to_text(text) } + censor_rules.reduce(text) { |t, rule| rule.apply_to_text(t) } end end diff --git a/spec/lib/alaveteli_rate_limiter/ip_rate_limiter_spec.rb b/spec/lib/alaveteli_rate_limiter/ip_rate_limiter_spec.rb index bd6f584f5f..0b00382fac 100644 --- a/spec/lib/alaveteli_rate_limiter/ip_rate_limiter_spec.rb +++ b/spec/lib/alaveteli_rate_limiter/ip_rate_limiter_spec.rb @@ -19,8 +19,8 @@ defaults = AlaveteliRateLimiter::IPRateLimiter::Defaults. new(whitelist: whitelist) - described_class.set_defaults do |defaults| - defaults.whitelist = whitelist + described_class.set_defaults do |d| + d.whitelist = whitelist end expect(described_class.defaults).to eq(defaults) diff --git a/spec/mailers/alaveteli_pro/embargo_mailer_spec.rb b/spec/mailers/alaveteli_pro/embargo_mailer_spec.rb index 74958b297e..c5de3f7499 100644 --- a/spec/mailers/alaveteli_pro/embargo_mailer_spec.rb +++ b/spec/mailers/alaveteli_pro/embargo_mailer_spec.rb @@ -103,7 +103,7 @@ AlaveteliPro::EmbargoMailer.alert_expiring mails = ActionMailer::Base.deliveries - mail = mails.detect { |mail| mail.to == [pro_user_3.email] } + mail = mails.detect { |m| m.to == [pro_user_3.email] } expect(mail).to be nil end end @@ -228,7 +228,7 @@ AlaveteliPro::EmbargoMailer.alert_expired mails = ActionMailer::Base.deliveries - mail = mails.detect { |mail| mail.to == [pro_user_3.email] } + mail = mails.detect { |m| m.to == [pro_user_3.email] } expect(mail).to be nil end end From e8c5ec0c5fbc0f6edac2ad6d1a66231cd323983e Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Fri, 21 Apr 2023 17:14:21 +0100 Subject: [PATCH 281/289] Update default Ruby check Allow the preferred version to be specified in `.ruby-verison` file rather then the example file. This will allow re-users to upgrade to a later version of Ruby without changing a core file and possibly causing Git warnings: `cannot pull with rebase: You have unstaged changes` --- script/site-specific-install.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/site-specific-install.sh b/script/site-specific-install.sh index db02316e16..6b399516d6 100755 --- a/script/site-specific-install.sh +++ b/script/site-specific-install.sh @@ -199,7 +199,11 @@ fi # Ensure we have required Ruby version from the current distribution package, if # not then install using rbenv -required_ruby="$(cat $REPOSITORY/.ruby-version.example)" +if [ -f $REPOSITORY/.ruby-version ]; then + required_ruby="$(cat $REPOSITORY/.ruby-version)" +else + required_ruby="$(cat $REPOSITORY/.ruby-version.example)" +fi current_ruby="$(ruby --version | awk 'match($0, /[0-9\.]+/) {print substr($0,RSTART,RLENGTH)}')" if [ "$(printf '%s\n' "$required_ruby" "$current_ruby" | sort -V | head -n1)" = "$required_ruby" ]; then echo "Current Ruby (${current_ruby}) is greater than or equal to required version (${required_ruby})" From 831f1b7fcd2ab3b8dc35c7cec289c8db0e497d53 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 18 Apr 2023 16:03:19 +0100 Subject: [PATCH 282/289] Remove cls attribute This attribute is unused and removing this will make future refactoring easier. --- app/helpers/link_to_helper.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb index d8f151f769..95c29772d3 100755 --- a/app/helpers/link_to_helper.rb +++ b/app/helpers/link_to_helper.rb @@ -18,8 +18,8 @@ def request_path(info_request, options = {}) request_url(info_request, options.merge(only_path: true)) end - def request_link(info_request, cls=nil) - link_to info_request.title, request_path(info_request), class: cls + def request_link(info_request) + link_to info_request.title, request_path(info_request) end def request_details_path(info_request) @@ -104,8 +104,8 @@ def public_body_link_short(public_body) link_to public_body.short_or_long_name, public_body_path(public_body) end - def public_body_link(public_body, cls=nil) - link_to public_body.name, public_body_path(public_body), class: cls + def public_body_link(public_body) + link_to public_body.name, public_body_path(public_body) end def public_body_link_absolute(public_body) # e.g. for in RSS @@ -121,11 +121,11 @@ def user_path(user, options = {}) user_url(user, options.merge(only_path: true)) end - def user_link(user, cls=nil) - link_to user.name, user_path(user), class: cls + def user_link(user) + link_to user.name, user_path(user) end - def user_link_for_request(request, cls=nil) + def user_link_for_request(request) if request.is_external? user_name = request.external_user_name || _("Anonymous user") if !request.external_url.nil? @@ -134,7 +134,7 @@ def user_link_for_request(request, cls=nil) user_name end else - link_to request.user.name, user_path(request.user), class: cls + link_to request.user.name, user_path(request.user) end end @@ -203,8 +203,8 @@ def user_or_you_capital_link(user) link_to user_or_you_capital(user), user_path(user) end - def user_admin_link(user, name="admin", cls=nil) - link_to name, admin_user_url(user), class: cls + def user_admin_link(user, name="admin") + link_to name, admin_user_url(user) end # Tracks. feed can be 'track' or 'feed' From 340ce527e5ea9320bea890266a1f7b280b709a09 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 18 Apr 2023 16:10:05 +0100 Subject: [PATCH 283/289] Remove absolute attribute Conform to the conventions set out in `link_to_helper.rb` by creating a `#external_user_link_absolute` method. --- app/helpers/link_to_helper.rb | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb index 95c29772d3..7e1d9d8061 100755 --- a/app/helpers/link_to_helper.rb +++ b/app/helpers/link_to_helper.rb @@ -154,22 +154,25 @@ def user_link(user) link_to user.name, user_path(user) end - def external_user_link(request, absolute, text) + def external_user_link(request, text) if request.external_user_name request.external_user_name else - if absolute - url = help_privacy_url(anchor: 'anonymous') - else - url = help_privacy_path(anchor: 'anonymous') - end - link_to(text, url) + link_to(text, help_privacy_path(anchor: 'anonymous')) + end + end + + def external_user_link_absolute(request, text) + if request.external_user_name + request.external_user_name + else + link_to(text, help_privacy_url(anchor: 'anonymous')) end end def request_user_link_absolute(request, anonymous_text=_("Anonymous user")) if request.is_external? - external_user_link(request, absolute=true, anonymous_text) + external_user_link_absolute(request, anonymous_text) else user_link_absolute(request.user) end @@ -177,7 +180,7 @@ def request_user_link_absolute(request, anonymous_text=_("Anonymous user")) def request_user_link(request, anonymous_text=_("Anonymous user")) if request.is_external? - external_user_link(request, absolute=false, anonymous_text) + external_user_link(request, anonymous_text) else user_link(request.user) end From 5e4e4c5014f7fe871cc389005faa0e849a951c9d Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 18 Apr 2023 17:32:10 +0100 Subject: [PATCH 284/289] Remove duplicate method Reorders the `#user_link_absolute` method too. --- app/helpers/link_to_helper.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb index 7e1d9d8061..a72e3e0734 100755 --- a/app/helpers/link_to_helper.rb +++ b/app/helpers/link_to_helper.rb @@ -121,6 +121,10 @@ def user_path(user, options = {}) user_url(user, options.merge(only_path: true)) end + def user_link_absolute(user) + link_to user.name, user_url(user) + end + def user_link(user) link_to user.name, user_path(user) end @@ -146,14 +150,6 @@ def user_admin_link_for_request(request, external_text=nil, internal_text=nil) end end - def user_link_absolute(user) - link_to user.name, user_url(user) - end - - def user_link(user) - link_to user.name, user_path(user) - end - def external_user_link(request, text) if request.external_user_name request.external_user_name From 25deb7a80046b04421d3f08ab47aa2ccfc6b9ac2 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 19 Apr 2023 09:20:41 +0100 Subject: [PATCH 285/289] Move default anonymous user text This allows the `#external_user_link` and `#external_user_link_absolute` methods to be called without the second argument. --- app/helpers/link_to_helper.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb index a72e3e0734..522e4c33a1 100755 --- a/app/helpers/link_to_helper.rb +++ b/app/helpers/link_to_helper.rb @@ -150,23 +150,25 @@ def user_admin_link_for_request(request, external_text=nil, internal_text=nil) end end - def external_user_link(request, text) + def external_user_link(request, text = nil) if request.external_user_name request.external_user_name else + text ||= _("Anonymous user") link_to(text, help_privacy_path(anchor: 'anonymous')) end end - def external_user_link_absolute(request, text) + def external_user_link_absolute(request, text = nil) if request.external_user_name request.external_user_name else + text ||= _("Anonymous user") link_to(text, help_privacy_url(anchor: 'anonymous')) end end - def request_user_link_absolute(request, anonymous_text=_("Anonymous user")) + def request_user_link_absolute(request, anonymous_text = nil) if request.is_external? external_user_link_absolute(request, anonymous_text) else @@ -174,7 +176,7 @@ def request_user_link_absolute(request, anonymous_text=_("Anonymous user")) end end - def request_user_link(request, anonymous_text=_("Anonymous user")) + def request_user_link(request, anonymous_text = nil) if request.is_external? external_user_link(request, anonymous_text) else From 52518784a4938b71e0f2dc427ef68fd3364326a8 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 20 Apr 2023 14:22:01 +0100 Subject: [PATCH 286/289] Update changelog --- doc/CHANGES.md | 89 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 88 insertions(+), 1 deletion(-) diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 79fe0e53d7..110f76542e 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -2,28 +2,115 @@ ## Highlighted Features +* Improve censor rules comment editing (Alexander Griffen) * Reduce the visual prominence of defunct bodies in lists (Gareth Rees) +* Improve application health metrics (Graeme Porteous) +* Add ability to display blog posts on request/authority page sidebars using + tags (Graeme Porteous) +* Adding localisation to resent notice (Miroslav Schlossberg, Graeme Porteous) * Add ability to paginate through requests in a batch (Gareth Rees) * Add list of batch requests to admin user page (Gareth Rees) * Add daily limit to user message creation (Gareth Rees) +* Add project leaderboards (Alexander Griffen) +* Add background job processing (Graeme Porteous) * Add rate limiting to comment creation (Gareth Rees) * Fix bug preventing ex-pro users follow up to still-private requests (Gareth Rees, Graeme Porteous) * Make it clearer that usernames are published (Gareth Rees) * Add spam term checking to user to user messages (Gareth Rees) +* Install script improvements (Graeme Porteous) +* Update passenger config (Graeme Porteous) +* Removed legacy event params (Graeme Porteous) +* Removed legacy notes (Graeme Porteous) +* Fix rendering of notes on request new (Graeme Porteous) * Add support for Ruby 3.2 (Graeme Porteous) * Add support for Ruby 3.1 (Graeme Porteous) * Upgrade to Rails 7 (Graeme Porteous) * Improve processing of large PDF attachments (Graeme Porteous) * Add support for Ruby 3.0 (Graeme Porteous) * Drop support for Ruby 2.7 (Graeme Porteous) +* Code linting (Alexander Griffen, Graeme Porteous) +* Dependencies upgrades (Alexander Griffen, Graeme Porteous) ## Upgrade Notes -* To upgrade the Ruby version in your development Docker container please run: +* _Required:_ This upgrade requires upgrading Ruby from 2.7 to 3.x. Alaveteli + can now run on all supported 3.x versions. We recommend upgrading to the 3.2. + See: https://github.com/mysociety/alaveteli/wiki/Migrating-an-existing-Alaveteli-site-from-Ruby-2.7-to-3.x + +* _Required:_ For the new background job processing feature you'll need Redis + Server, a popular open-source in-memory data store. And you'll need Sidekiq + an efficient background job processor for Ruby: + + 1. install Redis Server by running: + + sudo apt-get install redis-server + + 2. configure Sidekiq to run when your server starts by creating + `/etc/systemd/system/sidekiq.service` from `config/sidekiq.service.example`. + And running: + + systemctl enable sidekiq.service + systemctl daemon-reload + +* _Required:_ There are some database structure updates so remember to run: + + bin/rails db:migrate + +* _Optional:_ To upgrade the Ruby version in your development Docker container + please run: docker/reset +* _Note:_ This release will be the last to support anonymous "external requests" + created by the API. If you rely on the API to create or update requests then + please contact us as it is our current intention to make the API read-only for + the next release. + +* _Note:_ This release will be the last to officially support Ubuntu Focal + 20.04. With the next release we will recommend using Ubuntu Jammy 22.04 LTS. + Although using Focal might still work as it will still be within Ubuntu's + long term support window. Please bear this in mind for future upgrades. + +### Changed Templates + +app/views/admin/tags/_tagging.html.erb +app/views/admin/users/_sign_in_table.html.erb +app/views/admin_censor_rule/_form.html.erb +app/views/admin_censor_rule/_list.html.erb +app/views/admin_censor_rule/index.html.erb +app/views/admin_comment/edit.html.erb +app/views/admin_general/_admin_navbar.html.erb +app/views/admin_general/_edit_comment.html.erb +app/views/admin_general/stats.html.erb +app/views/admin_public_body/_public_body.html.erb +app/views/admin_public_body/show.html.erb +app/views/admin_request/show.html.erb +app/views/admin_user/edit.html.erb +app/views/admin_user/show.html.erb +app/views/alaveteli_pro/general/_nav_items.html.erb +app/views/alaveteli_pro/info_request_batches/_message_preview.html.erb +app/views/alaveteli_pro/info_requests/_batch.html.erb +app/views/alaveteli_pro/info_requests/_message_preview.html.erb +app/views/alaveteli_pro/info_requests/_select_authority_form.html.erb +app/views/alaveteli_pro/info_requests/_sidebar.html.erb +app/views/alaveteli_pro/info_requests/new.html.erb +app/views/alaveteli_pro/plans/_pricing_tiers.html.erb +app/views/comment/rate_limited.html.erb +app/views/general/_nav_items.html.erb +app/views/general/blog.html.erb +app/views/general/frontpage.html.erb +app/views/health/checks/index.html.erb +app/views/projects/projects/show.html.erb +app/views/public_body/_body_listing_single.html.erb +app/views/public_body/show.html.erb +app/views/request/_batch.html.erb +app/views/request/_resent_outgoing_correspondence.html.erb +app/views/request/_resent_outgoing_correspondence.text.erb +app/views/request/_sidebar.html.erb +app/views/request/new.html.erb +app/views/request/preview.html.erb + # 0.42.0.1 ## Highlighted Features From 5cd82f7d682e4fdc6a38342ccf33cc9cc8a0e6f3 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 20 Apr 2023 14:22:35 +0100 Subject: [PATCH 287/289] Remove temporary rake tasks These should've been run while upgrading to 0.41 or 0.42. --- lib/tasks/temp.rake | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/lib/tasks/temp.rake b/lib/tasks/temp.rake index 26510d6cc3..502952a811 100644 --- a/lib/tasks/temp.rake +++ b/lib/tasks/temp.rake @@ -1,22 +1,2 @@ namespace :temp do - desc 'Populate incoming message from email' - task populate_incoming_message_from_email: :environment do - scope = IncomingMessage.where(from_email: nil) - count = scope.count - - scope.includes(:raw_email).find_each.with_index do |message, index| - message.update_columns(from_email: message.raw_email.from_email || '') - - erase_line - print "Populated IncomingMessage#from_email #{index + 1}/#{count}" - end - - erase_line - puts "Populated IncomingMessage#from_email completed." - end - - def erase_line - # https://en.wikipedia.org/wiki/ANSI_escape_code#Escape_sequences - print "\e[1G\e[K" - end end From 7dc0d55382be1a8d44369b20c78c923449df377c Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 20 Apr 2023 14:38:38 +0100 Subject: [PATCH 288/289] Generate translations --- locale/af_ZA/app.po | 83 +++++++++++++++++++++++++++++++- locale/aln/app.po | 83 +++++++++++++++++++++++++++++++- locale/app.pot | 82 +++++++++++++++++++++++++++++++- locale/ar/app.po | 83 +++++++++++++++++++++++++++++++- locale/bg/app.po | 83 +++++++++++++++++++++++++++++++- locale/bs/app.po | 83 +++++++++++++++++++++++++++++++- locale/ca/app.po | 83 +++++++++++++++++++++++++++++++- locale/ckb/app.po | 83 +++++++++++++++++++++++++++++++- locale/cs/app.po | 85 ++++++++++++++++++++++++++++++++- locale/cy/app.po | 83 +++++++++++++++++++++++++++++++- locale/de/app.po | 83 +++++++++++++++++++++++++++++++- locale/el/app.po | 83 +++++++++++++++++++++++++++++++- locale/en/app.po | 82 +++++++++++++++++++++++++++++++- locale/en_HK/app.po | 83 +++++++++++++++++++++++++++++++- locale/en_IE/app.po | 83 +++++++++++++++++++++++++++++++- locale/en_RW/app.po | 82 +++++++++++++++++++++++++++++++- locale/en_UG/app.po | 83 +++++++++++++++++++++++++++++++- locale/en_US/app.po | 83 +++++++++++++++++++++++++++++++- locale/es/app.po | 83 +++++++++++++++++++++++++++++++- locale/es_AR/app.po | 83 +++++++++++++++++++++++++++++++- locale/es_NI/app.po | 83 +++++++++++++++++++++++++++++++- locale/es_PA/app.po | 83 +++++++++++++++++++++++++++++++- locale/es_PY/app.po | 83 +++++++++++++++++++++++++++++++- locale/eu/app.po | 83 +++++++++++++++++++++++++++++++- locale/fa/app.po | 83 +++++++++++++++++++++++++++++++- locale/fi/app.po | 83 +++++++++++++++++++++++++++++++- locale/fr/app.po | 83 +++++++++++++++++++++++++++++++- locale/fr_BE/app.po | 83 +++++++++++++++++++++++++++++++- locale/fr_CA/app.po | 83 +++++++++++++++++++++++++++++++- locale/fr_FR/app.po | 85 ++++++++++++++++++++++++++++++++- locale/ga_IE/app.po | 83 +++++++++++++++++++++++++++++++- locale/gl/app.po | 83 +++++++++++++++++++++++++++++++- locale/he_IL/app.po | 83 +++++++++++++++++++++++++++++++- locale/hr/app.po | 85 ++++++++++++++++++++++++++++++++- locale/hu_HU/app.po | 83 +++++++++++++++++++++++++++++++- locale/id/app.po | 83 +++++++++++++++++++++++++++++++- locale/is/app.po | 85 ++++++++++++++++++++++++++++++++- locale/is_IS/app.po | 83 +++++++++++++++++++++++++++++++- locale/it/app.po | 83 +++++++++++++++++++++++++++++++- locale/it_IT/app.po | 83 +++++++++++++++++++++++++++++++- locale/ka/app.po | 85 ++++++++++++++++++++++++++++++++- locale/mk/app.po | 83 +++++++++++++++++++++++++++++++- locale/mk_MK/app.po | 83 +++++++++++++++++++++++++++++++- locale/nb/app.po | 83 +++++++++++++++++++++++++++++++- locale/ne/app.po | 83 +++++++++++++++++++++++++++++++- locale/ne_NP/app.po | 83 +++++++++++++++++++++++++++++++- locale/nl/app.po | 83 +++++++++++++++++++++++++++++++- locale/nl_BE/app.po | 83 +++++++++++++++++++++++++++++++- locale/nn/app.po | 83 +++++++++++++++++++++++++++++++- locale/pap/app.po | 83 +++++++++++++++++++++++++++++++- locale/pl/app.po | 83 +++++++++++++++++++++++++++++++- locale/pt_BR/app.po | 83 +++++++++++++++++++++++++++++++- locale/pt_PT/app.po | 83 +++++++++++++++++++++++++++++++- locale/ro_RO/app.po | 83 +++++++++++++++++++++++++++++++- locale/rw/app.po | 83 +++++++++++++++++++++++++++++++- locale/se/app.po | 83 +++++++++++++++++++++++++++++++- locale/si/app.po | 83 +++++++++++++++++++++++++++++++- locale/sk/app.po | 83 +++++++++++++++++++++++++++++++- locale/sl/app.po | 86 +++++++++++++++++++++++++++++++++- locale/sq/app.po | 83 +++++++++++++++++++++++++++++++- locale/sr/app.po | 83 +++++++++++++++++++++++++++++++- locale/sr@latin/app.po | 83 +++++++++++++++++++++++++++++++- locale/sv/app.po | 83 +++++++++++++++++++++++++++++++- locale/sw_KE/app.po | 83 +++++++++++++++++++++++++++++++- locale/tr/app.po | 83 +++++++++++++++++++++++++++++++- locale/tr_TR/app.po | 83 +++++++++++++++++++++++++++++++- locale/uk/app.po | 83 +++++++++++++++++++++++++++++++- locale/vi/app.po | 83 +++++++++++++++++++++++++++++++- locale/yue/app.po | 83 +++++++++++++++++++++++++++++++- locale/zh_CN/app.po | 83 +++++++++++++++++++++++++++++++- locale/zh_HK/app.po | 83 +++++++++++++++++++++++++++++++- locale_alaveteli_pro/app.pot | 8 ++-- locale_alaveteli_pro/en/app.po | 8 ++-- 73 files changed, 5835 insertions(+), 84 deletions(-) diff --git a/locale/af_ZA/app.po b/locale/af_ZA/app.po index cb8077a351..67242268ee 100644 --- a/locale/af_ZA/app.po +++ b/locale/af_ZA/app.po @@ -31,13 +31,14 @@ # Translators: # Translators: # Translators: +# Translators: # FOI Monkey, 2022 # FOI Monkey, 2022 msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: FOI Monkey, 2022\n" "Language-Team: Afrikaans (South Africa) (http://app.transifex.com/mysociety/al" @@ -445,6 +446,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -607,6 +611,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -670,6 +677,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -934,6 +944,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -1003,6 +1016,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1530,6 +1546,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2204,6 +2223,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Onthou my op hierdie rekanaar" @@ -2390,6 +2412,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2426,6 +2451,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2491,6 +2540,9 @@ msgstr "Meld af" msgid "Sign up" msgstr "Registreer" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2545,6 +2597,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2962,9 +3017,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3185,6 +3246,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3311,9 +3375,15 @@ msgstr "Vandag" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3660,6 +3730,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "Ja" @@ -3789,6 +3862,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4409,6 +4485,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/aln/app.po b/locale/aln/app.po index 22f9f9519b..4d917401c6 100644 --- a/locale/aln/app.po +++ b/locale/aln/app.po @@ -31,13 +31,14 @@ # Translators: # Translators: # Translators: +# Translators: # Valon , 2011 # Valon , 2011 msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Valon , 2011\n" "Language-Team: Albanian Gheg (http://app.transifex.com/mysociety/alaveteli/lan" @@ -438,6 +439,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -600,6 +604,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -663,6 +670,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -927,6 +937,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -996,6 +1009,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1523,6 +1539,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2197,6 +2216,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2383,6 +2405,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2419,6 +2444,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2484,6 +2533,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2538,6 +2590,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2955,9 +3010,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3178,6 +3239,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3304,9 +3368,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3653,6 +3723,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3782,6 +3855,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4402,6 +4478,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/app.pot b/locale/app.pot index 4ba73e0c8c..d81fbc0cae 100644 --- a/locale/app.pot +++ b/locale/app.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-10-09 01:10+0200\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -406,6 +406,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -568,6 +571,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -631,6 +637,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -895,6 +904,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -964,6 +976,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1491,6 +1506,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2165,6 +2183,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2351,6 +2372,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2387,6 +2411,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2452,6 +2500,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2506,6 +2557,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2923,9 +2977,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3146,6 +3206,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3272,9 +3335,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3621,6 +3690,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3750,6 +3822,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4370,6 +4445,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/ar/app.po b/locale/ar/app.po index 002343139b..a6abe272a6 100644 --- a/locale/ar/app.po +++ b/locale/ar/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Aladdin El-Haraty , 2012 # Aladdin El-Haraty , 2012 # Aladdin El-Haraty , 2012 @@ -50,7 +51,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: , 2013\n" "Language-Team: Arabic (http://app.transifex.com/mysociety/alaveteli/language/a" @@ -489,6 +490,9 @@ msgstr "يمكن ان تستند كل الخيارات اسفله على your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1609,6 +1625,9 @@ msgstr "آخر مطلب وقع الإطلاع عليه: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2296,6 +2315,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2485,6 +2507,9 @@ msgstr "البحث عن مساهماتك" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "ابعث متابعة " @@ -2521,6 +2546,30 @@ msgstr "ابعث رسالة ل {{user_name}} فقط لمشاهدة كيفية ا msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2586,6 +2635,9 @@ msgstr "تسجيل الخروج" msgid "Sign up" msgstr "اشترك" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2646,6 +2698,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3073,9 +3128,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "عدد المطالب التي بامكانك تقديمها في اليوم الواحد محدود, لاننا لاننا لا تريد ان تكثر على السلطات العامة الطلبات الغير ملائمة. ان كان لديك سبب وجيه لتسألهم الترفيع في العدد المحدد للطلبات في حالتك, الرجاء الاتصال بنا." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3305,6 +3366,9 @@ msgstr "" "سرعة رد السلطات على الطلبات , عدد الطلبات\n" "التي تسوجب ردا بريديا و اكثر ." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3437,9 +3501,15 @@ msgstr "اليوم" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "طلبات كثيرة جدا" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3808,6 +3878,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "اكتب طلبك بلغة بسيطة ودقيقة." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3937,6 +4010,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "لقد بلغت السقف الأقصى للطلبات الجديدة. المستخدمون محددون عادة ب {{max_requests_per_user_per_day}} طلب في كل 24 ساعة. ستتمكن من القيام بطلب جديد خلال{{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4580,6 +4656,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/bg/app.po b/locale/bg/app.po index 9b057ee1f4..f4815f0a2f 100644 --- a/locale/bg/app.po +++ b/locale/bg/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Anton Stoychev , 2013 # Anton Stoychev , 2013 # Liz Conlan , 2018 @@ -41,7 +42,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: louisecrow , 2014\n" "Language-Team: Bulgarian (http://app.transifex.com/mysociety/alaveteli/languag" @@ -482,6 +483,9 @@ msgstr "Всички опции по-долу могат да се използ msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -650,6 +654,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "Размножено заявление, създадено от {{info_request_user}} на {{date}}." +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Започващи с" @@ -713,6 +720,9 @@ msgstr " Спиране на някои известия от {{site_name}}" msgid "Cancel, return to your profile page" msgstr "Отказ и връщане в страницата на профила Ви" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Промяна на имейла в {{site_name}}" @@ -979,6 +989,9 @@ msgstr "Готово >>" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Сваляне на zip файл с цялата кореспонденция" @@ -1052,6 +1065,9 @@ msgstr "История на събитията" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Това, което напишете на тази страница, включително Вашето име,\n" @@ -1621,6 +1637,9 @@ msgstr "Последно гледано заявление: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2310,6 +2329,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2499,6 +2521,9 @@ msgstr "Търсене в допринесеното от Вас" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Изпращане на пояснително съобщение" @@ -2535,6 +2560,30 @@ msgstr "Изпращане на съобщение до {{user_name}} само msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Изпратено до един орган от {{info_request_user}} на {{date}}." @@ -2600,6 +2649,9 @@ msgstr "Изход" msgid "Sign up" msgstr "Регистриране" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2660,6 +2712,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3093,9 +3148,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Има ограничение на броя заявления на ден, които може да направите, понеже не желаем публичните органи да бъдат бомбардирани с голям брой неуместни заявления. Ако считате, че имате основателна причина да поискате вдигане на лимита във Вашия случай, молим, уведомете ни." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Все още няма нищо за показване." @@ -3324,6 +3385,9 @@ msgstr "" "бързината, с която органите отговарят на заявления, броят на заявленията,\n" "които изискват отговор по пощата и много други." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3458,9 +3522,15 @@ msgstr "Днес" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Твърде много заявления" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3827,6 +3897,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "Напишете заявлението си ясно и конкретно." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3956,6 +4029,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Вие достигнахте лимита за нови заявления. Потребителите обикновено са ограничени до {{max_requests_per_user_per_day}} заявления на всеки 24 часа. Ще можете да отправите друго заявление в {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4605,6 +4681,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/bs/app.po b/locale/bs/app.po index b65c95fdcc..51a1e51423 100644 --- a/locale/bs/app.po +++ b/locale/bs/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Krule , 2011 # BORIS , 2011 # BORIS , 2011 @@ -44,7 +45,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: vedad , 2011\n" "Language-Team: Bosnian (http://app.transifex.com/mysociety/alaveteli/language/" @@ -472,6 +473,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -640,6 +644,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Počevši sa" @@ -703,6 +710,9 @@ msgstr "Poništi neka {{site_name}} upozorenja" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Promijeniti e-mail na {{site_name}}" @@ -969,6 +979,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Preuzmite svu korespondenciju u zip fajlu" @@ -1040,6 +1053,9 @@ msgstr "Prikaz prošlih događanja" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Sve što unesete na ovu stranicu, uključujući Vaše ime, \n" @@ -1602,6 +1618,9 @@ msgstr "Zadnji pregledani zahtjev: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2289,6 +2308,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2475,6 +2497,9 @@ msgstr "Pretražite Vaše doprinose" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2511,6 +2536,30 @@ msgstr "Pošalji poruku {{user_name}} samo da vidite kako radi" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2576,6 +2625,9 @@ msgstr "Odjavite se" msgid "Sign up" msgstr "Registrujte se" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2636,6 +2688,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3069,9 +3124,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3294,6 +3355,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3426,9 +3490,15 @@ msgstr "Danas" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3795,6 +3865,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "Pišite Vaš zahtjev jednostavnim, preciznim jezikom." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3924,6 +3997,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4554,6 +4630,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/ca/app.po b/locale/ca/app.po index b2a9c0961f..2e2e32aa8c 100644 --- a/locale/ca/app.po +++ b/locale/ca/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # David Cabo , 2012,2014 # ecapfri , 2012 # ecapfri , 2012 @@ -43,7 +44,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: mmtarres , 2012\n" "Language-Team: Catalan (http://app.transifex.com/mysociety/alaveteli/language/" @@ -487,6 +488,9 @@ msgstr "All the options below can use variety or latest msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -655,6 +659,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Començant per" @@ -718,6 +725,9 @@ msgstr "Cancelar alertas de {{site_name}}" msgid "Cancel, return to your profile page" msgstr "Cancelar, volver a mi perfil" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Cambiar correo en {{site_name}}" @@ -986,6 +996,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Descarregar un fitxer ZIP amb tota la correspondència" @@ -1055,6 +1068,9 @@ msgstr "Historial de eventos" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Tot el que escriguis en aquesta pàgina, incloent el teu nom, \n" @@ -1621,6 +1637,9 @@ msgstr "Última solicitud vista: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2309,6 +2328,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2498,6 +2520,9 @@ msgstr "Busca tus aportaciones" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Enviar una resposta" @@ -2534,6 +2559,30 @@ msgstr "Envia un missatge a {{user_name}} sólo para ver cómo funciona" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2599,6 +2648,9 @@ msgstr "Tancar sessió" msgid "Sign up" msgstr "Registra't" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2659,6 +2711,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3091,9 +3146,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Hay un límite en el número de solicitudes que puedes hacer en un día, porque no queremos que los organismos públicos reciban un número exagerado de solicitudes mal formuladas. Si necesitas que el límite no se aplique en tu caso, por favor contacta con nosotros." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3322,6 +3383,9 @@ msgstr "" "estadísticas sobre por ejemplo la velocidad de respuesta de los organismos o\n" "el número de solicitudes que piden usar correo ordinario." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3454,9 +3518,15 @@ msgstr "Hoy" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3819,6 +3889,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "Escriu la teva sol·licitud en un llenguatge senzill i clar." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3948,6 +4021,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Has alcanzado el límite de solicitudes en un día, que es de {{max_requests_per_user_per_day}} solicitudes en un plazo de 24 horas. Podrás enviar una nueva solicitud en {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4591,6 +4667,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/ckb/app.po b/locale/ckb/app.po index cb76b51a19..80dab25c12 100644 --- a/locale/ckb/app.po +++ b/locale/ckb/app.po @@ -31,11 +31,12 @@ # Translators: # Translators: # Translators: +# Translators: msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Graeme Porteous \n" "Language-Team: Central Kurdish (http://app.transifex.com/mysociety/alaveteli/l" @@ -436,6 +437,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -598,6 +602,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -661,6 +668,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -925,6 +935,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -994,6 +1007,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1521,6 +1537,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2195,6 +2214,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2381,6 +2403,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2417,6 +2442,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2482,6 +2531,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2536,6 +2588,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2953,9 +3008,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3176,6 +3237,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3302,9 +3366,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3651,6 +3721,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3780,6 +3853,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4400,6 +4476,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/cs/app.po b/locale/cs/app.po index b565aa0768..3a3db62edf 100644 --- a/locale/cs/app.po +++ b/locale/cs/app.po @@ -31,6 +31,8 @@ # Translators: # Translators: # Translators: +# Translators: +# Appukonrad , 2012 # Appukonrad , 2012 # Graeme Porteous , 2021 # Hana Hunt , 2016-2018,2020-2021 @@ -41,6 +43,7 @@ # janakneschke , 2013 # janakneschke , 2012-2013 # janakneschke , 2013 +# Jiří Podhorecký, 2021 # Appukonrad , 2012,2015-2017 # Jiří Podhorecký, 2021-2022 # josefpospisil , 2012 @@ -57,7 +60,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Jiří Podhorecký, 2021\n" "Language-Team: Czech (http://app.transifex.com/mysociety/alaveteli/language/cs" @@ -492,6 +495,9 @@ msgstr "Všechny níže uvedené možnosti variety or l msgid "All time" msgstr "Vždy" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "Nejlepší hráči" @@ -656,6 +662,9 @@ msgstr "Odstraněno s těchto stránek" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "Dávka vytvořena {{info_request_user}} dne {{date}}." +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Začínající na" @@ -719,6 +728,9 @@ msgstr "Zrušte tato upozornění stránek {{site_name}}" msgid "Cancel, return to your profile page" msgstr "Zrušit, návrat zpět do stránky s profilem" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Změnit e-mail na stránkách {{site_name}}" @@ -993,6 +1005,9 @@ msgstr "Hotovo >>" msgid "Download Data" msgstr "Stažená data" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Stáhnout zazipovaný soubor celé korespondence" @@ -1064,6 +1079,9 @@ msgstr "Historie případu" msgid "Every citizen has the right to access information held by public authorities." msgstr "Každý občan má právo na přístup k informacím veřejných institucí" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "Veškeré informace, které vložíte na tuto stránku, včetně vašeho jména, budou trvale uveřejněny na tomto webu." @@ -1614,6 +1632,9 @@ msgstr "Naposled prohlížený dotaz: {{request_url}}" msgid "Latest" msgstr "Nejnovější" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Zjistěte více →" @@ -2299,6 +2320,9 @@ msgstr "Nařízení" msgid "Rejected" msgstr "Zamítnuto" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Zapamatovat mé údaje (zašrktněte, pokud chcete být déle přihlášeni; nezaškrtávejte, pokud jste na veřejně přístupném počítači)." @@ -2488,6 +2512,9 @@ msgstr "Prohledávat vlastní příspěvky" msgid "Section" msgstr "Sekce" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Odpovědět" @@ -2524,6 +2551,30 @@ msgstr "Vznést dotaz na uživatele {{user_name}}. Tímto způsobem si můžete msgid "Sending..." msgstr "Odesílá se..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Odešlete {{authority_count}} instituci od {{info_request_user}} dne {{date}}." @@ -2591,6 +2642,9 @@ msgstr "Odhlásit" msgid "Sign up" msgstr "Registrovat" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2650,6 +2704,9 @@ msgstr "Omlouváme se, teď nelze přídávat nové komentáře. Prosím zkuste msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "Omlouváme se, teď nelze poslat vaši žádost. Prosím zkuste to později. " @@ -3079,9 +3136,15 @@ msgstr "Tuto stránku používá více než jedna osoba s tímt msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Počet dotazů za jeden den je limitován. Nechceme, aby byly instituce bombardovány velkým množstvím nerelevantních dotazů. Pokud máte dobrý důvod, proč by měl být váš limit navýšen, prosímekontaktujte nás." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Zatím tu nic není" @@ -3310,6 +3373,9 @@ msgstr "Sekce se statistickými informacemi o institucích je v současnosti v t msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "Tato tabulka ukazuje technické detaily související s tímto dotazem vzneseným na stránkách {{site_name}}. Tento přehled lze použít k analýze rychlosti, s jakou instituce odpovídají na dotazy, počtu dotazů, které byly zodpovězeny poštou atd. " +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "Tomuto uživateli byl zablokován přístup na stránky {{site_name}} " @@ -3442,9 +3508,15 @@ msgstr "Dnes" msgid "Too many annotations" msgstr "Příliš mnoho poznámek" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Příliš mnoho dotazů" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Nejlepší hráči" @@ -3813,6 +3885,9 @@ msgstr "" "Svůj dotaz formulujte v jasných bodech. \n" "Pokud žádáte o více nesouvisejících informací, rozdělte je do více dotazů. " +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "Ano" @@ -3948,6 +4023,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Dosáhli jste početního limitu stanoveného pro nové dotazy. Uživatelé mohou podat {{max_requests_per_user_per_day}} dotazů během 24 hodin. Nový dotaz můžete podat za {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "Opustili jste tento projekt" @@ -4621,6 +4699,11 @@ msgstr[1] "{{number_of_comments}} připomínky" msgstr[2] "{{number_of_comments}} připomínek" msgstr[3] "{{number_of_comments}} připomínek" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} dotaz" diff --git a/locale/cy/app.po b/locale/cy/app.po index 7b712754b9..29dade8740 100644 --- a/locale/cy/app.po +++ b/locale/cy/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Cymrodor , 2014,2017 # Cymrodor , 2014 # skenaja , 2011-2012 @@ -54,7 +55,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: PerryX , 2013\n" "Language-Team: Welsh (http://app.transifex.com/mysociety/alaveteli/language/cy" @@ -463,6 +464,9 @@ msgstr "Gall yr holl opsiynau isod defnyddio variety neu >" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Lawrlwytho ffeil zip o bob gohebiaeth" @@ -1021,6 +1034,9 @@ msgstr "Hanes y digwyddiad" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "Dangosir popeth yr ydych yn rhoi i mewn ar y dudalen hon, gan gynnwys eich enw, yn gyhoeddus ar y wefan hon am byth (pam?)." @@ -1556,6 +1572,9 @@ msgstr "Y cais diwethaf edrychwyd arno: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Dysgu mwy →" @@ -2230,6 +2249,9 @@ msgstr "" msgid "Rejected" msgstr "Gwrthodwyd" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2416,6 +2438,9 @@ msgstr "Chwilio eich cyfraniadau" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Anfon neges ddilynol" @@ -2452,6 +2477,30 @@ msgstr "Anfon neges i {{user_name}} dim ond i weld sut mae'n gweithio" msgid "Sending..." msgstr "Yn anfon..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Anfonwyd at un awdurdod gan {{info_request_user}} ar {{date}}." @@ -2519,6 +2568,9 @@ msgstr "Allgofnodwch" msgid "Sign up" msgstr "Cofrestrwch" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2573,6 +2625,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2990,9 +3045,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Mae cyfyngiad ar y nifer o geisiadau y gallwch eu gwneud mewn diwrnod, oherwydd nid ydym am i awdurdodau cyhoeddus gael eu peledu gyda nifer fawr o geisiadau amhriodol. Os ydych yn teimlo bod gennych reswm da dros ofyn i'r terfyn gael ei godi yn eich achos chi, cysylltwch â ni." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Does dim i'w ddangos eto." @@ -3215,6 +3276,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "Mae'r tabl hwn yn dangos manylion technegol y digwyddiadau mewnol a ddigwyddodd i'r cais hwn ar {{site_name}}. Gallai hwn gael ei ddefnyddio i gynhyrchu gwybodaeth am ba mor gyflym y mae awdurdodau yn ymateb i geisiadau, nifer y ceisiadau sy'n gofyn am ymateb drwy'r post a llawer mwy." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3341,9 +3405,15 @@ msgstr "Heddiw" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Gormod o geisiadau" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3690,6 +3760,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "Ysgrifennwch eich cais mewn iaith syml, gryno." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3819,6 +3892,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Rydych chi wedi cyrraedd y terfyn cyfradd ar geisiadau newydd. Fel arfer cyfyngir defnyddwyr i {{max_requests_per_user_per_day}} cais mewn unrhyw gyfnod treigl 24-awr. Byddwch yn gallu gwneud cais arall ymhen {{ can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4455,6 +4531,11 @@ msgstr[1] "{{number_of_comments}} sylw" msgstr[2] "{{number_of_comments}} sylw" msgstr[3] "{{number_of_comments}} sylw" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} cais" diff --git a/locale/de/app.po b/locale/de/app.po index a4bcf5fdc6..d0bf72b7c5 100644 --- a/locale/de/app.po +++ b/locale/de/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # andreas.pavlou , 2016 # andreas.pavlou , 2016 # arne , 2015-2016 @@ -48,7 +49,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: stefanw , 2011\n" "Language-Team: German (http://app.transifex.com/mysociety/alaveteli/language/d" @@ -478,6 +479,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -644,6 +648,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Mit Anfangsbuchstabe" @@ -707,6 +714,9 @@ msgstr "Einige Benachrichtigungen für {{site_name}} abbestellen" msgid "Cancel, return to your profile page" msgstr "Abbrechen, zurück zur Profilseite" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Email ändern auf {{site_name}}" @@ -973,6 +983,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Laden Sie eine Zip-Datei des gesamten Schriftverkehrs herunter." @@ -1044,6 +1057,9 @@ msgstr "Verlaufsübersicht" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Jegliche auf dieser Seite eingegebene Information, inklusive Ihrem Namen, ⏎ wird\n" @@ -1581,6 +1597,9 @@ msgstr "Zuletzt angesehene Anfrage: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Mehr erfahren" @@ -2258,6 +2277,9 @@ msgstr "" msgid "Rejected" msgstr "Abgelehnt" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Login speichern (Sie bleiben eingeloggt. Nutzen Sie diese Funktion nicht an öffentlichen Computern) " @@ -2447,6 +2469,9 @@ msgstr "Suchen Sie Ihre Beiträge" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Nachfrage senden" @@ -2483,6 +2508,30 @@ msgstr "Nachricht senden an {{user_name}} um zu sehen wie es funktioniert" msgid "Sending..." msgstr "Senden..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2548,6 +2597,9 @@ msgstr "Ausloggen" msgid "Sign up" msgstr "Benutzerkonto erstellen" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2604,6 +2656,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3021,9 +3076,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3246,6 +3307,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3374,9 +3438,15 @@ msgstr "Heute" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Zu viele Anfragen" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3726,6 +3796,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "Formulieren Sie Ihre Anfrage in schlicht und präzise ." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3855,6 +3928,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4484,6 +4560,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/el/app.po b/locale/el/app.po index 008d14dcba..81dd461146 100644 --- a/locale/el/app.po +++ b/locale/el/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Andreas Nedelkos , 2017 # Graeme Porteous , 2021 # Maria Nathanail , 2021 @@ -42,7 +43,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: ΜΑΡΙΑ ΝΑΘΑΝΑΗΛ , 2021\n" "Language-Team: Greek (http://app.transifex.com/mysociety/alaveteli/language/el" @@ -453,6 +454,9 @@ msgstr "Όλες οι επιλογές παρακάτω μπορούν να χρ msgid "All time" msgstr "Όλων των εποχών" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "Καλύτεροι παίκτες όλων των εποχών" @@ -615,6 +619,9 @@ msgstr "Έχει εκδιωχτεί από αυτό το site" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "Παρτίδα που δημιουργήθηκε από {{info_request_user}} στις {{date}}." +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Ξεκινώντας με" @@ -678,6 +685,9 @@ msgstr "Ακυρώστε κάποιες ειδοποιήσεις από το {{s msgid "Cancel, return to your profile page" msgstr "Ακυρώστε, επιστρέψτε στη σελίδα του προφίλ σας" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Αλλάξτε email στο {{site_name}}" @@ -942,6 +952,9 @@ msgstr "Ολοκληρώθηκε >>" msgid "Download Data" msgstr "Κατεβάστε δεδομένα" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Κατεβάστε ένα αρχείο zip με όλη την αλληλογραφία" @@ -1011,6 +1024,9 @@ msgstr "Ιστορικό συμβάντων" msgid "Every citizen has the right to access information held by public authorities." msgstr "Κάθε πολίτης έχει το δικαίωμα να αποκτήσει πληροφορίες από δημόσιους οργανισμούς." +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "Οτιδήποτε εισάγετε σε αυτή την σελίδα, συμπεριλαμβανομένου του ονόματός σας, θα εμφανίζετε δημόσια σε αυτή την ιστοσελίδα για πάντα" @@ -1543,6 +1559,9 @@ msgstr "Τελευταία αίτηση που είδατε: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Μάθετε περισσότερα →" @@ -2217,6 +2236,9 @@ msgstr "" msgid "Rejected" msgstr "Έχει απορριφθεί" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Να με θυμάσαι (σας κρατά συνδεδεμένο για μεγαλύτερο χρονικό διάστημα, μην το χρησιμοποιείτε σε δημόσιο υπολογιστή)" @@ -2403,6 +2425,9 @@ msgstr "Αναζητήστε τις συνεισφορές σας" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Στείλτε ένα followup" @@ -2439,6 +2464,30 @@ msgstr "Αποστολή μηνύματος στον {{user_name}} για να msgid "Sending..." msgstr "Αποστολή..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Εστάλη στις αρχές από {{info_request_user}} στις {{date}}." @@ -2504,6 +2553,9 @@ msgstr "Αποσύνδεση" msgid "Sign up" msgstr "Δημιουργία λογαριασμού" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2558,6 +2610,9 @@ msgstr "Λυπούμαστε, αυτή τη στιγμή είναι αδύνατ msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "Λυπούμαστε, αυτή τη στιγμή δεν είναι δυνατόν να σταλεί το αίτημά σας. Παρακαλούμε δοκιμάστε ξανά αργότερα. " @@ -2975,9 +3030,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Υπάρχει ένα όριο στον αριθμό αιτημάτων που μπορείτε να κάνετε σε μια μέρα, γιατί δεν θέλουμε οι δημόσιες αρχές να βομβαρδίζονται με μεγάλο αριθμό ανάρμοστων αιτημάτων. Αν πιστεύετε ότι έχετε καλό λόγο να ζητήσετε αύξηση του ορίου στην περίπτωσή σας, παρακαλούμε επικοινωνήστε ." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Δεν υπάρχει τίποτα για να εμφανιστεί ακόμα." @@ -3198,6 +3259,9 @@ msgstr "Αυτό το τμήμα σχετικά με τις στατιστικέ msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "Αυτός ο πίνακας δείχνει τις τεχνικές λεπτομέρειες των εσωτερικών διεργασιών που συνέβησαν με αυτό το αίτημα στο {{site_name}}. Αυτό θα μπορούσε να παρέχει πληροφορίες σχετικά με την ταχύτητα με την οποία οι αρχές ανταποκρίνονται στα αιτήματα, τον αριθμό των αιτήσεων που απαιτούν ταχυδρομική απάντηση και πολλά άλλα." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "Ο χρήστης αυτός έχει τεθεί σε αναστολή από το {{site_name}}" @@ -3324,9 +3388,15 @@ msgstr "Σήμερα" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Πάρα πολλά αιτήματα" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Κορυφαίοι πρόσφατοι παίκτες" @@ -3673,6 +3743,9 @@ msgstr "Γράψτε ένα απαντητικό μήνυμα για το Αίτ msgid "Write your request in simple, precise language." msgstr "Γράψτε ένα αίτημα σε απλή, συγκεκριμένη γλώσσα ." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "Ναι" @@ -3802,6 +3875,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Φτάσατε το όριο νέων αιτημάτων. Οι χρήστες/-ριες συνήθως περιορίζονται σε {{max_requests_per_user_per_day}} αιτήματα σε κάθε 24ωρο. Θα μπορείτε να καταθέσετε νέο αίτημα σε {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "Εγκαταλείψατε το σχέδιο " @@ -4422,6 +4498,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "{{number_of_comments}} σχόλιο" msgstr[1] "{{number_of_comments}} σχόλια" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} αίτηση" diff --git a/locale/en/app.po b/locale/en/app.po index 90b54a8b0c..5b9dccfa54 100644 --- a/locale/en/app.po +++ b/locale/en/app.po @@ -35,7 +35,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Graeme Porteous \n" "Language-Team: English (http://www.transifex.com/mysociety/alaveteli/language/" @@ -446,6 +446,9 @@ msgstr "All the options below can use variety or latest msgid "All time" msgstr "All time" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "All time best players" @@ -608,6 +611,9 @@ msgstr "Banned from this site" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "Batch created by {{info_request_user}} on {{date}}." +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Beginning with" @@ -671,6 +677,9 @@ msgstr "Cancel some {{site_name}} alerts" msgid "Cancel, return to your profile page" msgstr "Cancel, return to your profile page" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Change email on {{site_name}}" @@ -935,6 +944,9 @@ msgstr "Done >>" msgid "Download Data" msgstr "Download Data" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Download a zip file of all correspondence" @@ -1004,6 +1016,9 @@ msgstr "Event history" msgid "Every citizen has the right to access information held by public authorities." msgstr "Every citizen has the right to access information held by public authorities." +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" @@ -1531,6 +1546,9 @@ msgstr "Last request viewed: {{request_url}}" msgid "Latest" msgstr "Latest" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Learn more →" @@ -2205,6 +2223,9 @@ msgstr "Regulation" msgid "Rejected" msgstr "Rejected" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Remember me (keeps you signed in longer; do not use on a public computer)" @@ -2391,6 +2412,9 @@ msgstr "Search your contributions" msgid "Section" msgstr "Section" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Send a followup" @@ -2427,6 +2451,30 @@ msgstr "Send message to {{user_name}} just to see how it works" msgid "Sending..." msgstr "Sending..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Sent to one authority by {{info_request_user}} on {{date}}." @@ -2492,6 +2540,9 @@ msgstr "Sign out" msgid "Sign up" msgstr "Sign up" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." @@ -2546,6 +2597,9 @@ msgstr "Sorry, we're currently unable to add your annotation. Please try again l msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "Sorry, we're currently unable to create your account. Please try again later." +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "Sorry, we're currently unable to send your request. Please try again later." @@ -2963,9 +3017,15 @@ msgstr "There is more than one person who uses this site and ha msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "There is nothing to display yet." @@ -3186,6 +3246,9 @@ msgstr "This section on public body statistics is currently experimental, so the msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "This user has been suspended from {{site_name}} " @@ -3312,9 +3375,15 @@ msgstr "Today" msgid "Too many annotations" msgstr "Too many annotations" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Too many requests" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Top recent players" @@ -3661,6 +3730,9 @@ msgstr "Write your FOI follow up message to {{authority_name}}" msgid "Write your request in simple, precise language." msgstr "Write your request in simple, precise language." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "Yes" @@ -3790,6 +3862,9 @@ msgstr "You have hit the rate limit on annotations. Users are ordinarily limited msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "You have left the project." @@ -4410,6 +4485,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "{{number_of_comments}} comment" msgstr[1] "{{number_of_comments}} comments" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} request" diff --git a/locale/en_HK/app.po b/locale/en_HK/app.po index 2f652f8e81..5cab7d3019 100644 --- a/locale/en_HK/app.po +++ b/locale/en_HK/app.po @@ -31,11 +31,12 @@ # Translators: # Translators: # Translators: +# Translators: msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Graeme Porteous \n" "Language-Team: English (Hong Kong) (http://app.transifex.com/mysociety/alavete" @@ -436,6 +437,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -598,6 +602,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -661,6 +668,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -925,6 +935,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -994,6 +1007,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1521,6 +1537,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2195,6 +2214,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2381,6 +2403,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2417,6 +2442,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2482,6 +2531,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2536,6 +2588,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2953,9 +3008,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3176,6 +3237,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3302,9 +3366,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3651,6 +3721,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3780,6 +3853,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4400,6 +4476,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/en_IE/app.po b/locale/en_IE/app.po index f193229767..b3e2d59be4 100644 --- a/locale/en_IE/app.po +++ b/locale/en_IE/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # John Cross , 2012 # handelaar , 2011 # John Cross , 2012 @@ -40,7 +41,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: John Cross , 2012\n" "Language-Team: English (Ireland) (http://app.transifex.com/mysociety/alaveteli" @@ -441,6 +442,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -603,6 +607,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -666,6 +673,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -930,6 +940,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -999,6 +1012,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1526,6 +1542,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2200,6 +2219,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2386,6 +2408,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2422,6 +2447,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2487,6 +2536,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2541,6 +2593,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2958,9 +3013,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3181,6 +3242,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3307,9 +3371,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3656,6 +3726,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3785,6 +3858,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4405,6 +4481,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/en_RW/app.po b/locale/en_RW/app.po index 06a689aad5..338c5f2fc7 100644 --- a/locale/en_RW/app.po +++ b/locale/en_RW/app.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2018-12-21 12:21+0000\n" "Last-Translator: Liz Conlan \n" "Language-Team: LANGUAGE \n" @@ -418,6 +418,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -580,6 +583,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -643,6 +649,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -907,6 +916,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -976,6 +988,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1512,6 +1527,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2186,6 +2204,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2375,6 +2396,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2411,6 +2435,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2476,6 +2524,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2530,6 +2581,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2952,9 +3006,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "There is a limit on the number of requests you can make in a day, because we don’t want public agencies to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3179,6 +3239,9 @@ msgstr "" "the speed with which agencies respond to requests, the number of requests\n" "which require a postal response and much more." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3305,9 +3368,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3654,6 +3723,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3783,6 +3855,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4403,6 +4478,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/en_UG/app.po b/locale/en_UG/app.po index f7b4d2ee3c..40439d7377 100644 --- a/locale/en_UG/app.po +++ b/locale/en_UG/app.po @@ -31,12 +31,13 @@ # Translators: # Translators: # Translators: +# Translators: # Liz Conlan , 2018 msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Liz Conlan , 2018\n" "Language-Team: English (Uganda) (http://app.transifex.com/mysociety/alaveteli/" @@ -448,6 +449,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -610,6 +614,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -673,6 +680,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -937,6 +947,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -1006,6 +1019,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1542,6 +1558,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2216,6 +2235,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2405,6 +2427,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2441,6 +2466,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2506,6 +2555,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2560,6 +2612,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2982,9 +3037,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "There is a limit on the number of requests you can make in a day, because we don’t want public agencies to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3209,6 +3270,9 @@ msgstr "" "the speed with which agencies respond to requests, the number of requests\n" "which require a postal response and much more." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3335,9 +3399,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3684,6 +3754,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3813,6 +3886,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4433,6 +4509,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/en_US/app.po b/locale/en_US/app.po index f87cc98e5d..0cb3b8f217 100644 --- a/locale/en_US/app.po +++ b/locale/en_US/app.po @@ -31,11 +31,12 @@ # Translators: # Translators: # Translators: +# Translators: msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Graeme Porteous \n" "Language-Team: English (United States) (http://app.transifex.com/mysociety/ala" @@ -436,6 +437,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -598,6 +602,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -661,6 +668,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -925,6 +935,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -994,6 +1007,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1521,6 +1537,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2195,6 +2214,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2381,6 +2403,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2417,6 +2442,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2482,6 +2531,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2536,6 +2588,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2953,9 +3008,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3176,6 +3237,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3302,9 +3366,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3651,6 +3721,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3780,6 +3853,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4400,6 +4476,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/es/app.po b/locale/es/app.po index c989e1d80c..ef126ae689 100644 --- a/locale/es/app.po +++ b/locale/es/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Anatoli Pena , 2017 # Anatoli Pena , 2017 # Anatoli Pena , 2017 @@ -61,7 +62,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: vickyanderica , 2011\n" "Language-Team: Spanish (http://app.transifex.com/mysociety/alaveteli/language/" @@ -505,6 +506,9 @@ msgstr "All the options below can use variety or latest msgid "All time" msgstr "Todo el tiempo" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "Los mejores jugadores de todos los tiempos. " @@ -673,6 +677,9 @@ msgstr "Vedado el ingreso al sitio" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "Lote creado por {{info_request_user}} el {{date}}." +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Comenzando por" @@ -736,6 +743,9 @@ msgstr "Cancelar alertas de {{site_name}}" msgid "Cancel, return to your profile page" msgstr "Cancelar, volver a mi perfil" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Cambiar correo en {{site_name}}" @@ -1004,6 +1014,9 @@ msgstr "Hecho >>" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Descarga un fichero ZIP con toda la correspondencia" @@ -1075,6 +1088,9 @@ msgstr "Historial de eventos" msgid "Every citizen has the right to access information held by public authorities." msgstr "Todos los ciudadanos tienen el derecho a acceder a la información que tiene los organismos y autoridades públicas." +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Todo lo que escribas en esta página, incluyendo tu nombre, \n" @@ -1649,6 +1665,9 @@ msgstr "Última solicitud vista: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Conoce más →" @@ -2337,6 +2356,9 @@ msgstr "" msgid "Rejected" msgstr "Rechazada" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" "Recuérdame (mantiene la sesión abierta;\n" @@ -2528,6 +2550,9 @@ msgstr "Busca tus aportaciones" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Mandar una respuesta" @@ -2564,6 +2589,30 @@ msgstr "Enviar un mensaje a {{user_name}} sólo para ver cómo funciona" msgid "Sending..." msgstr "Enviando..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Enviada a un organismo por {{info_request_user}} el {{date}}." @@ -2630,6 +2679,9 @@ msgstr "Cerrar sesión" msgid "Sign up" msgstr "Registrarse" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2690,6 +2742,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3123,9 +3178,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Hay un límite en el número de solicitudes que puedes hacer en un día, porque no queremos que los organismos públicos reciban un número exagerado de solicitudes mal formuladas. Si necesitas que el límite no se aplique en tu caso, por favor contacta con nosotros." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "No hay nada que mostrar aún." @@ -3355,6 +3416,9 @@ msgstr "" "estadísticas sobre por ejemplo la velocidad de respuesta de los organismos o\n" "el número de solicitudes que piden usar correo ordinario." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3487,9 +3551,15 @@ msgstr "Hoy" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Demasiados pedidos" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Los mejores jugadores recientes" @@ -3856,6 +3926,9 @@ msgstr "Escribe tu mensaje de seguimiento a {{authority_name}}" msgid "Write your request in simple, precise language." msgstr "Escribe tu solicitud en un lenguaje sencillo y claro." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3985,6 +4058,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Has alcanzado el límite de solicitudes en un día, que es de {{max_requests_per_user_per_day}} solicitudes en un plazo de 24 horas. Podrás enviar una nueva solicitud en {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4639,6 +4715,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} solicitudes." diff --git a/locale/es_AR/app.po b/locale/es_AR/app.po index b6f7a1ebd4..f967a24479 100644 --- a/locale/es_AR/app.po +++ b/locale/es_AR/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Anatoli Pena , 2017 # andreas.pavlou , 2015,2017 # Fabrizio Scrollini , 2012 @@ -50,7 +51,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Victor Diaz , 2014\n" "Language-Team: Spanish (Argentina) (http://app.transifex.com/mysociety/alavete" @@ -494,6 +495,9 @@ msgstr "All the options below can use variety or latest msgid "All time" msgstr "Todo el tiempo" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "Los mejores jugadores de todos los tiempos. " @@ -662,6 +666,9 @@ msgstr "Vedado el ingreso al sitio" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "Lote creado por {{info_request_user}} el {{date}}." +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Comenzando por" @@ -725,6 +732,9 @@ msgstr "Cancelar alertas de {{site_name}}" msgid "Cancel, return to your profile page" msgstr "Cancelar, volver a mi perfil" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Cambiar correo en {{site_name}}" @@ -993,6 +1003,9 @@ msgstr "Hecho >>" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Descarga un fichero ZIP con toda la correspondencia" @@ -1064,6 +1077,9 @@ msgstr "Historial de eventos" msgid "Every citizen has the right to access information held by public authorities." msgstr "Todos los ciudadanos tienen el derecho a acceder a la información que tiene los organismos y autoridades públicas." +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Todo lo que escribas en esta página, incluyendo tu nombre, \n" @@ -1638,6 +1654,9 @@ msgstr "Última solicitud vista: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Conoce más →" @@ -2326,6 +2345,9 @@ msgstr "" msgid "Rejected" msgstr "Rechazada" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" "Recuérdame (mantiene la sesión abierta;\n" @@ -2517,6 +2539,9 @@ msgstr "Busca tus aportaciones" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Mandar una respuesta" @@ -2553,6 +2578,30 @@ msgstr "Enviar un mensaje a {{user_name}} sólo para ver cómo funciona" msgid "Sending..." msgstr "Enviando..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Enviada a un organismo por {{info_request_user}} el {{date}}." @@ -2619,6 +2668,9 @@ msgstr "Cerrar sesión" msgid "Sign up" msgstr "Registrarse" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2679,6 +2731,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3112,9 +3167,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Hay un límite en el número de solicitudes que puedes hacer en un día, porque no queremos que los organismos públicos reciban un número exagerado de solicitudes mal formuladas. Si necesitas que el límite no se aplique en tu caso, por favor contacta con nosotros." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "No hay nada que mostrar aún." @@ -3344,6 +3405,9 @@ msgstr "" "estadísticas sobre por ejemplo la velocidad de respuesta de los organismos o\n" "el número de solicitudes que piden usar correo ordinario." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3476,9 +3540,15 @@ msgstr "Hoy" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Demasiados pedidos" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Los mejores jugadores recientes" @@ -3845,6 +3915,9 @@ msgstr "Escribe tu mensaje de seguimiento a {{authority_name}}" msgid "Write your request in simple, precise language." msgstr "Escribe tu solicitud en un lenguaje sencillo y claro." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3974,6 +4047,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Has alcanzado el límite de solicitudes en un día, que es de {{max_requests_per_user_per_day}} solicitudes en un plazo de 24 horas. Podrás enviar una nueva solicitud en {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4628,6 +4704,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} solicitudes." diff --git a/locale/es_NI/app.po b/locale/es_NI/app.po index 7f2acbcbed..a71ad38c83 100644 --- a/locale/es_NI/app.po +++ b/locale/es_NI/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Fabrizio Scrollini , 2012 # Fabrizio Scrollini , 2012 # Gaba , 2012,2014 @@ -51,7 +52,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Victor Diaz , 2014\n" "Language-Team: Spanish (Nicaragua) (http://app.transifex.com/mysociety/alavete" @@ -497,6 +498,9 @@ msgstr "Todas las opciones a continuación pueden usar variedad msgid "All time" msgstr "Todo el tiempo" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "Todo el tiempo los mejores jugadores" @@ -665,6 +669,9 @@ msgstr "Expulso de este sitio" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "Bloque creado por {{info_request_user}} en {{date}}." +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Comenzando por" @@ -728,6 +735,9 @@ msgstr "Cancelar alertas de {{site_name}}" msgid "Cancel, return to your profile page" msgstr "Cancelar, volver a mi perfil" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Cambiar correo en {{site_name}}" @@ -994,6 +1004,9 @@ msgstr "Hecho >>" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Descarga un fichero ZIP con toda la correspondencia" @@ -1065,6 +1078,9 @@ msgstr "Historial de eventos" msgid "Every citizen has the right to access information held by public authorities." msgstr "Todos los ciudadanos tienen derecho a acceder a la información pública en poder de las entidades públicas." +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "Todo lo que escribas en esta página, incluyendo tu nombre, estará disponible públicamente en está web (¿por qué?)." @@ -1638,6 +1654,9 @@ msgstr "Última solicitud vista: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2326,6 +2345,9 @@ msgstr "" msgid "Rejected" msgstr "Rechazado" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" "Recuérdame (mantiene la sesión abierta;\n" @@ -2517,6 +2539,9 @@ msgstr "Busca tus aportaciones" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Mandar una respuesta" @@ -2553,6 +2578,30 @@ msgstr "Enviar un mensaje a {{user_name}} sólo para ver cómo funciona" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Enviado por {{authority_count}} la autoridad {{info_request_user}} el {{date}}." @@ -2619,6 +2668,9 @@ msgstr "Cerrar sesión" msgid "Sign up" msgstr "Iniciar cesión " +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2679,6 +2731,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3112,9 +3167,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Hay un límite en el número de solicitudes que puedes hacer en un día, porque no queremos que los Entidades públicas reciban un número exagerado de solicitudes mal formuladas. Si necesitas que el límite no se aplique en tu caso, por favor contacta con nosotros." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "No hay nada que mostrar aún." @@ -3344,6 +3405,9 @@ msgstr "" "estadísticas sobre por ejemplo la velocidad de respuesta de las entidades o\n" "el número de solicitudes que piden usar correo ordinario." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3476,9 +3540,15 @@ msgstr "Hoy" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Demasiados pedidos" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3845,6 +3915,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "Escribe tu solicitud en un lenguaje sencillo y claro." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3974,6 +4047,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Has alcanzado el límite de solicitudes en un día, que es de {{max_requests_per_user_per_day}} solicitudes en un plazo de 24 horas. Podrás enviar una nueva solicitud en {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4624,6 +4700,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/es_PA/app.po b/locale/es_PA/app.po index 99324ec474..13497ddef8 100644 --- a/locale/es_PA/app.po +++ b/locale/es_PA/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Aida Martinez , 2016 # Fabrizio Scrollini , 2012 # Fabrizio Scrollini , 2012 @@ -52,7 +53,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Victor Diaz , 2014\n" "Language-Team: Spanish (Panama) (http://app.transifex.com/mysociety/alaveteli/" @@ -498,6 +499,9 @@ msgstr "Todas las opciones a continuación pueden usar variedad msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "Mejores jugadores de todos los tiempos" @@ -667,6 +671,9 @@ msgstr "Bloqueado de este sitio Web" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "Bloque creado por {{info_request_user}} en {{date}}." +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Comenzando por" @@ -730,6 +737,9 @@ msgstr "Cancelar alertas de {{site_name}}" msgid "Cancel, return to your profile page" msgstr "Cancelar, volver a mi perfil" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Cambiar dirección de correo en {{site_name}}" @@ -996,6 +1006,9 @@ msgstr "Listo >>" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Descarge un documento ZIP con toda la correspondencia" @@ -1067,6 +1080,9 @@ msgstr "Historial de eventos" msgid "Every citizen has the right to access information held by public authorities." msgstr "Todo ciudadano tiene el derecho de acceder a la información en poder de las instituciones públicas. " +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Todo lo que escriba en esta página, incluyendo su nombre,\n" @@ -1639,6 +1655,9 @@ msgstr "Última solicitud vista: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Aprenda más →" @@ -2325,6 +2344,9 @@ msgstr "" msgid "Rejected" msgstr "Rechazado" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Recuérdame (mantiene la sesión abierta; no lo use en un ordenador público)" @@ -2514,6 +2536,9 @@ msgstr "Busque sus aportaciones" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Enviar un seguimiento a la respuesta" @@ -2550,6 +2575,30 @@ msgstr "Enviar un mensaje a {{user_name}} sólo para ver cómo funciona" msgid "Sending..." msgstr "Enviando..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Enviado a una institución pública {{info_request_user}} el {{date}}" @@ -2616,6 +2665,9 @@ msgstr "Cerrar sesión" msgid "Sign up" msgstr "Registrarse" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2676,6 +2728,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3105,9 +3160,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Hay un límite en el número de solicitudes que puede realizar en un día, porque no queremos que las instituciones públicas reciban un número exagerado de solicitudes mal formuladas. Si necesita que el límite no se aplique en su caso, por favor contáctenos." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "No hay nada que mostrar aún." @@ -3336,6 +3397,9 @@ msgstr "" " con la solicitud en {{site_name}}. Estos datos pueden ser utilizados para generar estadísticas sobre\n" " por ejemplo la velocidad de respuesta de las instituciones." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3468,9 +3532,15 @@ msgstr "Hoy" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Demasiadas solicitudes" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Los mejores jugadores más recientes" @@ -3834,6 +3904,9 @@ msgstr "Para enviar un mensaje de seguimiento sobre acces a la información a {{ msgid "Write your request in simple, precise language." msgstr "Escriba su solicitud en un lenguaje sencillo y claro." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3963,6 +4036,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Ha alcanzado el límite de solicitudes en un día, que es de {{max_requests_per_user_per_day}} solicitudes en un plazo de 24 horas. Podrá enviar una nueva solicitud en {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4613,6 +4689,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} solicitud" diff --git a/locale/es_PY/app.po b/locale/es_PY/app.po index ce3b7b2337..86c7d2b405 100644 --- a/locale/es_PY/app.po +++ b/locale/es_PY/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Fabrizio Scrollini , 2012 # Fabrizio Scrollini , 2012 # Gaba , 2012,2014 @@ -51,7 +52,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Victor Diaz , 2014\n" "Language-Team: Spanish (Paraguay) (http://app.transifex.com/mysociety/alavetel" @@ -497,6 +498,9 @@ msgstr "Todas las opciones a continuación pueden usar variedad msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -665,6 +669,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "Bloque creado por {{info_request_user}} en {{date}}." +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Comenzando por" @@ -728,6 +735,9 @@ msgstr "Cancelar alertas de {{site_name}}" msgid "Cancel, return to your profile page" msgstr "Cancelar, volver a mi perfil" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Cambiar correo en {{site_name}}" @@ -994,6 +1004,9 @@ msgstr "Hecho >>" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Descarga un fichero ZIP con toda la correspondencia" @@ -1065,6 +1078,9 @@ msgstr "Historial de eventos" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "Todo lo que escribas en esta página, incluyendo tu nombre, estará disponible públicamente en está web (¿por qué?)." @@ -1632,6 +1648,9 @@ msgstr "Última solicitud vista: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2320,6 +2339,9 @@ msgstr "" msgid "Rejected" msgstr "Rechazado" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" "Recuérdame (mantiene la sesión abierta;\n" @@ -2511,6 +2533,9 @@ msgstr "Busca tus aportaciones" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Mandar una respuesta" @@ -2547,6 +2572,30 @@ msgstr "Enviar un mensaje a {{user_name}} sólo para ver cómo funciona" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Enviado por {{authority_count}} la autoridad {{info_request_user}} el {{date}}." @@ -2613,6 +2662,9 @@ msgstr "Cerrar sesión" msgid "Sign up" msgstr "Iniciar sesión " +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2673,6 +2725,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3106,9 +3161,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Hay un límite en el número de solicitudes que puedes hacer en un día, porque no queremos que las entidades públicas reciban un número exagerado de solicitudes mal formuladas. Si necesitas que el límite no se aplique en tu caso, por favor contacta con nosotros." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "No hay nada que mostrar aún." @@ -3338,6 +3399,9 @@ msgstr "" "estadísticas sobre por ejemplo la velocidad de respuesta de las entidades o\n" "el número de solicitudes que piden usar correo ordinario." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3470,9 +3534,15 @@ msgstr "Hoy" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Demasiados pedidos" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3839,6 +3909,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "Escribe tu solicitud en un lenguaje sencillo y claro." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3968,6 +4041,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Has alcanzado el límite de solicitudes en un día, que es de {{max_requests_per_user_per_day}} solicitudes en un plazo de 24 horas. Podrás enviar una nueva solicitud en {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4618,6 +4694,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/eu/app.po b/locale/eu/app.po index ae61887ae9..0a15baf4f3 100644 --- a/locale/eu/app.po +++ b/locale/eu/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # David Cabo , 2012 # sroberto , 2012 # Liz Conlan , 2018 @@ -41,7 +42,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: sroberto , 2012\n" "Language-Team: Basque (http://app.transifex.com/mysociety/alaveteli/language/e" @@ -464,6 +465,9 @@ msgstr "Beheko aukera guztiek erabil dezakete variety edo your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Orrialde honetan idatziko duzun guztia, zure izena barne, \n" @@ -1562,6 +1578,9 @@ msgstr "Ikusi den azken eskabidea: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2238,6 +2257,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2427,6 +2449,9 @@ msgstr "Bilatu zure ekarpenak" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Bidali erantzuna" @@ -2463,6 +2488,30 @@ msgstr "Bidali _____-ri mezua {{user_name}} nola funtzionatzen duen ikustearren" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2528,6 +2577,9 @@ msgstr "Itxi saioa" msgid "Sign up" msgstr "Erregistratu" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2584,6 +2636,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3009,9 +3064,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Badago egunean egin ditzakezun eskabide kopuru mugatua, ez dugulako nahi erakunde publikoek gaizki idatzitako eskabide gehiegizkoak jaso ditzaten. Zure kasuan muga hau aplika ez dadin behar izanez gero, mesedez jar zaitez gurekin harremanetan." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3234,6 +3295,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "Ondoko taulak {{site_name}} eskabidearekin zerikusia duten barne gertaeren datu teknikoak erakusten ditu. Datu hauek erabil daitezke estatistikak sortzeko, esaterako erakundeen erantzun abiadura edo posta arrunta erabiltzeko eskatzen duten eskabide kopurua." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3362,9 +3426,15 @@ msgstr "Gaur" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3714,6 +3784,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "Idatz ezazu zure eskabidea hizkera erraz eta argi batez." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3843,6 +3916,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Egun bateko eskabide kopurua gainditu duzu, hau da 24 ordutan H{{max_requests_per_user_per_day}} eskabide egin daitezke. Eskabide berria egin ahal izango duzu {{can_make_another_request}}-ean." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4473,6 +4549,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/fa/app.po b/locale/fa/app.po index a8c27f13ee..bbf398ad60 100644 --- a/locale/fa/app.po +++ b/locale/fa/app.po @@ -31,11 +31,12 @@ # Translators: # Translators: # Translators: +# Translators: msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Graeme Porteous \n" "Language-Team: Persian (http://app.transifex.com/mysociety/alaveteli/language/" @@ -436,6 +437,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -598,6 +602,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -661,6 +668,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -925,6 +935,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -994,6 +1007,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1521,6 +1537,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2195,6 +2214,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2381,6 +2403,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2417,6 +2442,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2482,6 +2531,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2536,6 +2588,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2953,9 +3008,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3176,6 +3237,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3302,9 +3366,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3651,6 +3721,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3780,6 +3853,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4400,6 +4476,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/fi/app.po b/locale/fi/app.po index d04526a938..f70057ba8f 100644 --- a/locale/fi/app.po +++ b/locale/fi/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # apoikola , 2013 # apoikola , 2013 # Juha-Matti Santala , 2013 @@ -39,7 +40,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Juha-Matti Santala , 2013\n" "Language-Team: Finnish (http://app.transifex.com/mysociety/alaveteli/language/" @@ -440,6 +441,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -602,6 +606,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -665,6 +672,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -929,6 +939,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -998,6 +1011,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1525,6 +1541,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2199,6 +2218,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2385,6 +2407,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2421,6 +2446,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2486,6 +2535,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2540,6 +2592,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2957,9 +3012,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3180,6 +3241,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3306,9 +3370,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3655,6 +3725,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3784,6 +3857,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4404,6 +4480,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/fr/app.po b/locale/fr/app.po index da943cd317..07ffad097b 100644 --- a/locale/fr/app.po +++ b/locale/fr/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # 0c5d54599df8b711a7a254a114ba48aa, 2011 # Adrien Chauvet, 2013 # Adrien Chauvet, 2013 @@ -76,7 +77,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: vickyanderica , 2011\n" "Language-Team: French (http://app.transifex.com/mysociety/alaveteli/language/f" @@ -521,6 +522,9 @@ msgstr "Toutes les options ci-dessous peuvent utiliser Etat ou msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "Palmarès des meilleurs acteurs" @@ -685,6 +689,9 @@ msgstr "Banni de ce site" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "Groupe creé par {{info_request_user}} le {{date}}" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Commence par" @@ -748,6 +755,9 @@ msgstr "Annuler les alertes {{site_name}} " msgid "Cancel, return to your profile page" msgstr "Annuler, retourner à votre page de profil" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Changer le courriel sur {{site_name}}" @@ -1016,6 +1026,9 @@ msgstr "Fait >>" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Télécharger un fichier zip de toute la correspondance" @@ -1089,6 +1102,9 @@ msgstr "Historique des événements" msgid "Every citizen has the right to access information held by public authorities." msgstr "Chaque citoyen a la droit d'accédez aux informations détenues par les autorités publiques." +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Tout ce que vous indiquez dans cette page, y compris votre nom ,\n" @@ -1654,6 +1670,9 @@ msgstr "Dernière demande consultée : {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "En savoir plus →" @@ -2333,6 +2352,9 @@ msgstr "" msgid "Rejected" msgstr "Rejeté" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Souvenez-vous de moi (vous permet de rester connecté longtemps; ne pas utiliser sur un ordinateur publique)" @@ -2522,6 +2544,9 @@ msgstr "Chercher vos contributions" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Envoyer un suivi" @@ -2558,6 +2583,30 @@ msgstr "Envoyer un message à {{user_name}} juste pour voir comment ça marche" msgid "Sending..." msgstr "Envoi..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Envoyé à {{info_request_user}} ce {{date}}." @@ -2624,6 +2673,9 @@ msgstr "Se déconnecter" msgid "Sign up" msgstr "Créer un compte" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2681,6 +2733,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3106,9 +3161,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Il y a une limite sur le nombre de demandes que vous pouvez faire en une journée, parce que nous ne voulons pas que les autorités publiques soient bombardées avec un grand nombre de demandes inappropriées. Si vous sentez que vous avez une bonne raison de demander que la limite soit levée pour vous, veuillez nous contacter." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Il n'y a rien à afficher encore." @@ -3336,6 +3397,9 @@ msgstr "" " la vitesse avec laquelle les autorités répondent aux demandes, le nombre de demandes \n" " qui nécessitent une réponse postale et bien plus encore." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3468,9 +3532,15 @@ msgstr "Aujourd'hui" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Trop de demandes " +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Palmarès des acteurs récents" @@ -3836,6 +3906,9 @@ msgstr "Ecrivez votre message de suivi à {{authority_name}}" msgid "Write your request in simple, precise language." msgstr "Formulez votre demande en langage simple et precis ." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3965,6 +4038,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Vous avez atteint la limite du nombre des nouvelles demandes. Les utilisateurs sont normalement limités à {max_requests_per_user_per_day}} demandes par jour . Vous serez en mesure de faire une autre demande dans {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4620,6 +4696,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} demandes" diff --git a/locale/fr_BE/app.po b/locale/fr_BE/app.po index d5b4ceb616..365a4ae055 100644 --- a/locale/fr_BE/app.po +++ b/locale/fr_BE/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # 0c5d54599df8b711a7a254a114ba48aa, 2011 # Adrien Chauvet, 2013 # Adrien Chauvet, 2013 @@ -61,7 +62,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: vickyanderica , 2011\n" "Language-Team: French (Belgium) (http://app.transifex.com/mysociety/alaveteli/" @@ -485,6 +486,9 @@ msgstr "Toutes les options ci-dessous peuvent utiliser variety msgid "All time" msgstr "Tout le temps" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "Palmarès des meilleurs acteurs" @@ -647,6 +651,9 @@ msgstr "Banni de ce site" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "Groupe créé par {{info_request_user}} le {{date}}" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Commence par" @@ -710,6 +717,9 @@ msgstr "Annuler certaines alertes de {{site_name}} " msgid "Cancel, return to your profile page" msgstr "Annuler et retourner à votre page de profil" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Changer l'email utilisé sur {{site_name}}" @@ -974,6 +984,9 @@ msgstr "C'est fait" msgid "Download Data" msgstr "Télécharger les données" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Télécharger un fichier zip de toute la correspondance" @@ -1043,6 +1056,9 @@ msgstr "Historique des événements" msgid "Every citizen has the right to access information held by public authorities." msgstr "Chaque citoyen a le droit d'accéder aux informations détenues par les autorités publiques." +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "Tout ce que vous indiquez dans cette page, y compris votre nom, sera public sur ce site (pourquoi?)." @@ -1579,6 +1595,9 @@ msgstr "Dernière demande consultée : {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "En savoir plus →" @@ -2254,6 +2273,9 @@ msgstr "" msgid "Rejected" msgstr "Rejeté" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Souvenez-vous de moi (vous permet de rester connecté, ne pas utiliser sur un ordinateur public)" @@ -2440,6 +2462,9 @@ msgstr "Rechercher vos contributions" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Envoyer un message de suivi" @@ -2476,6 +2501,30 @@ msgstr "Envoyer un message à {{user_name}} juste pour voir comment cela fonctio msgid "Sending..." msgstr "Envoi..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Envoyé à une autorité par {{info_request_user}} le {{date}}." @@ -2542,6 +2591,9 @@ msgstr "Se déconnecter" msgid "Sign up" msgstr "S'inscrire" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2598,6 +2650,9 @@ msgstr "Désolé, nous sommes actuellement dans l'impossibilité d'ajouter votre msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "Désolé, nous sommes actuellement dans l'impossibilité d'envoyer votre demande. Merci d'essayer ultérieurement." @@ -3015,9 +3070,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Il y a une limite concernant le nombre de demandes que vous pouvez effectuer en une journée, parce que nous ne voulons pas que les autorités publiques soient bombardées avec un grand nombre de demandes inappropriées. Si vous estimez que vous avez une bonne raison de demander que la limite soit augmentée pour vous, veuillez nous contacter." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "A ce stade, il n'y a rien à afficher." @@ -3240,6 +3301,9 @@ msgstr "Cette section sur les statistiques de l'organisme public est actuellemen msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "Ce tableau présente les détails techniques des événements internes concernant cette demande faite via {{site_name}}. Ces données pourraient être utilisées pour générer des informations sur la vitesse avec laquelle les autorités répondent aux demandes, le nombre de demandes qui nécessitent une réponse postale et bien plus encore." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "Cet utilisateur a été suspendu de {{site_name}}" @@ -3366,9 +3430,15 @@ msgstr "Aujourd'hui" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Trop de demandes " +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Palmarès des acteurs récents" @@ -3720,6 +3790,9 @@ msgstr "Ecrivez votre message de suivi à {{authority_name}}" msgid "Write your request in simple, precise language." msgstr "Formulez votre demande en langage simple et précis." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "Oui" @@ -3852,6 +3925,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Vous avez atteint la limite maximale de nouvelles demandes. Les utilisateurs sont limités à {{max_requests_per_user_per_day}} demandes par période de 24h. Vous pourrez faire une autre demande dans {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "Vous avez quitté le projet." @@ -4489,6 +4565,11 @@ msgstr[0] "{{number_of_comments}} commentaire" msgstr[1] "{{number_of_comments}} commentaires" msgstr[2] "{{number_of_comments}} commentaires" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} demande" diff --git a/locale/fr_CA/app.po b/locale/fr_CA/app.po index ed71d06e54..164d5717a7 100644 --- a/locale/fr_CA/app.po +++ b/locale/fr_CA/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # 0c5d54599df8b711a7a254a114ba48aa, 2011 # andreas.pavlou , 2013 # 0c5d54599df8b711a7a254a114ba48aa, 2011 @@ -53,7 +54,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: vickyanderica , 2011\n" "Language-Team: French (Canada) (http://app.transifex.com/mysociety/alaveteli/l" @@ -496,6 +497,9 @@ msgstr "Toutes les options ci-dessous peuvent utiliser variety msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -660,6 +664,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Commence avec" @@ -723,6 +730,9 @@ msgstr "Annuler certaines alertes de {{site_name}}" msgid "Cancel, return to your profile page" msgstr "Annuler, retourner à votre page de profil" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Changer le courriel sur {{site_name}}" @@ -991,6 +1001,9 @@ msgstr "Fait >>" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Télécharger un fichier zip de toute la correspondance" @@ -1064,6 +1077,9 @@ msgstr "Historique des événements" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Tout ce que vous indiquez sur cette page, y compris votre nom ,\n" @@ -1626,6 +1642,9 @@ msgstr "Dernière demande consultée : {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2305,6 +2324,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2494,6 +2516,9 @@ msgstr "Chercher dans vos demandes" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Envoyer un message de suivi" @@ -2530,6 +2555,30 @@ msgstr "Envoyer un message à {{user_name}} Juste pour voir comment cela fonctio msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2595,6 +2644,9 @@ msgstr "Se déconnecter" msgid "Sign up" msgstr "Créer un compte" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2653,6 +2705,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3080,9 +3135,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Il y a un nombre limite de demandes pouvant être formulées par jour (nous voulons éviter que les organismes soient bombardés de demandes inappropriées). Si vous croyez que vous devriez être exempté de cette limite, veuillez nous contacter." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3308,6 +3369,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "Ce tableau détaille les événements techniques liés à cette demande. Cette information peut vous aider à retracer la suite des événements et, par exemple, à voir avec précision quand ont été échangés les différents messages." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3442,9 +3506,15 @@ msgstr "Aujourd'hui" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Trop de demandes " +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3806,6 +3876,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "Formulez votre demande en langage simple et précis ." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3935,6 +4008,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Vous avez atteint la limite de nouvelles demandes permises. Les utilisateurs sont normalement limités à {max_requests_per_user_per_day}} demandes par jour. Vous serez en mesure de faire une autre demande dans {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4590,6 +4666,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/fr_FR/app.po b/locale/fr_FR/app.po index 5053bde03a..2ccdbc9158 100644 --- a/locale/fr_FR/app.po +++ b/locale/fr_FR/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # 0c5d54599df8b711a7a254a114ba48aa, 2011 # a270031086f2a0d3514bc0cb507b48f6, 2019 # Adrien Chauvet, 2013 @@ -62,9 +63,9 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" -"Last-Translator: Laurent S, 2019-2023\n" +"Last-Translator: vickyanderica , 2011\n" "Language-Team: French (France) (http://app.transifex.com/mysociety/alaveteli/l" "anguage/fr_FR/)\n" "MIME-Version: 1.0\n" @@ -486,6 +487,9 @@ msgstr "Toutes les options ci-dessous peuvent utiliser variety msgid "All time" msgstr "Tout le temps" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "Palmarès des meilleurs acteurs" @@ -648,6 +652,9 @@ msgstr "Banni de ce site" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "Groupe créé par {{info_request_user}} le {{date}}" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Commence par" @@ -711,6 +718,9 @@ msgstr "Annuler certaines alertes de {{site_name}} " msgid "Cancel, return to your profile page" msgstr "Annuler et retourner à votre page de profil" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Changer l'email utilisé sur {{site_name}}" @@ -1015,6 +1025,9 @@ msgstr "C'est fait" msgid "Download Data" msgstr "Télécharger la donnée" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Télécharger un fichier zip de toute la correspondance" @@ -1084,6 +1097,9 @@ msgstr "Historique des événements" msgid "Every citizen has the right to access information held by public authorities." msgstr "Ma Dada est un site associatif qui vous aide à faire des demandes d’accès aux documents administratifs communicables." +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "Tout ce que vous indiquez dans cette page, y compris votre nom, sera public sur ce site (pourquoi?)." @@ -1618,6 +1634,9 @@ msgstr "Dernière demande consultée : {{request_url}}" msgid "Latest" msgstr "Dernier" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "En savoir plus →" @@ -2299,6 +2318,9 @@ msgstr "Regulation" msgid "Rejected" msgstr "Rejetée" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Souvenez-vous de moi (vous permet de rester connecté, ne pas utiliser sur un ordinateur public)" @@ -2485,6 +2507,9 @@ msgstr "Rechercher vos contributions" msgid "Section" msgstr "Section" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Envoyer un message" @@ -2521,6 +2546,30 @@ msgstr "Envoyer un message à {{user_name}} juste pour voir comment cela fonctio msgid "Sending..." msgstr "Envoi..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Envoyé à une autorité par {{info_request_user}} le {{date}}." @@ -2587,6 +2636,9 @@ msgstr "Se déconnecter" msgid "Sign up" msgstr "S'inscrire" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2643,6 +2695,9 @@ msgstr "Désolé, nous sommes actuellement dans l'impossibilité d'ajouter votre msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "Désolé, nous sommes actuellement dans l'impossibilité d'envoyer votre demande. Merci d'essayer ultérieurement." @@ -3064,9 +3119,15 @@ msgstr "Il y a plus d'une personne qui utilise ce site et ce no msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Il y a une limite concernant le nombre de demandes que vous pouvez effectuer en une journée, parce que nous ne voulons pas que les autorités publiques soient bombardées avec un grand nombre de demandes inappropriées. Si vous estimez que vous avez une bonne raison de demander que la limite soit augmentée pour vous, veuillez nous contacter." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "A ce stade, il n'y a rien à afficher." @@ -3289,6 +3350,9 @@ msgstr "Cette section sur les statistiques de l'organisme public est actuellemen msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "Ce tableau présente les détails techniques des événements internes concernant cette demande faite via {{site_name}}. Ces données pourraient être utilisées pour générer des informations sur la vitesse avec laquelle les autorités répondent aux demandes, le nombre de demandes qui nécessitent une réponse postale et bien plus encore." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "Cet utilisateur a été suspendu de {{site_name}} " @@ -3415,9 +3479,15 @@ msgstr "Aujourd'hui" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Trop de demandes " +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Palmarès des acteurs récents" @@ -3769,6 +3839,9 @@ msgstr "Ecrivez votre message de suivi à {{authority_name}}" msgid "Write your request in simple, precise language." msgstr "Formulez votre demande en langage simple et précis." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "Oui" @@ -3901,6 +3974,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Vous avez atteint la limite maximale de nouvelles demandes. Les utilisateurs sont limités à {{max_requests_per_user_per_day}} demandes par période de 24h. Vous pourrez faire une autre demande dans {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "Vous avez quitté ce projet" @@ -4538,6 +4614,11 @@ msgstr[0] "{{number_of_comments}} commentaire" msgstr[1] "{{number_of_comments}} commentaires" msgstr[2] "{{number_of_comments}} commentaires" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} demande" diff --git a/locale/ga_IE/app.po b/locale/ga_IE/app.po index 7e177cdb11..ac16fa8c09 100644 --- a/locale/ga_IE/app.po +++ b/locale/ga_IE/app.po @@ -31,12 +31,13 @@ # Translators: # Translators: # Translators: +# Translators: # Niall Ó Tuathail , 2015 msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Niall Ó Tuathail , 2015\n" "Language-Team: Irish (Ireland) (http://app.transifex.com/mysociety/alaveteli/l" @@ -438,6 +439,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -600,6 +604,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Ag tosú le" @@ -663,6 +670,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -927,6 +937,9 @@ msgstr "Críochnaithe >>" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -996,6 +1009,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1523,6 +1539,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2197,6 +2216,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2383,6 +2405,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2419,6 +2444,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2484,6 +2533,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2538,6 +2590,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2955,9 +3010,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3178,6 +3239,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3304,9 +3368,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3653,6 +3723,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3782,6 +3855,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4402,6 +4478,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/gl/app.po b/locale/gl/app.po index 26f465908a..1f5e391c3b 100644 --- a/locale/gl/app.po +++ b/locale/gl/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # David Cabo , 2012 # Liz Conlan , 2018 # louisecrow , 2014 @@ -39,7 +40,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: louisecrow , 2014\n" "Language-Team: Galician (http://app.transifex.com/mysociety/alaveteli/language" @@ -483,6 +484,9 @@ msgstr "All the options below can use variety or latest msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -651,6 +655,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Comenzando por" @@ -714,6 +721,9 @@ msgstr "Cancelar alertas de {{site_name}}" msgid "Cancel, return to your profile page" msgstr "Cancelar, volver a mi perfil" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Cambiar correo en {{site_name}}" @@ -982,6 +992,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Descargar un fichero ZIP con toda la correspondencia" @@ -1053,6 +1066,9 @@ msgstr "Historial de eventos" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Todo lo que escribas en esta página, incluyendo tu nombre, \n" @@ -1621,6 +1637,9 @@ msgstr "Última solicitud vista: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2309,6 +2328,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2498,6 +2520,9 @@ msgstr "Busca tus aportaciones" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Mandar una respuesta" @@ -2534,6 +2559,30 @@ msgstr "Enviar un mensaje a {{user_name}} sólo para ver cómo funciona" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2599,6 +2648,9 @@ msgstr "Cerrar sesión" msgid "Sign up" msgstr "Registrarse" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2659,6 +2711,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3092,9 +3147,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Hay un límite en el número de solicitudes que puedes hacer en un día, porque no queremos que los organismos públicos reciban un número exagerado de solicitudes mal formuladas. Si necesitas que el límite no se aplique en tu caso, por favor contacta con nosotros." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3323,6 +3384,9 @@ msgstr "" "estadísticas sobre por ejemplo la velocidad de respuesta de los organismos o\n" "el número de solicitudes que piden usar correo ordinario." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3457,9 +3521,15 @@ msgstr "Hoy" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3824,6 +3894,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "Escribe tu solicitud en un lenguaje sencillo y claro." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3953,6 +4026,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Has alcanzado el límite de solicitudes en un día, que es de {{max_requests_per_user_per_day}} solicitudes en un plazo de 24 horas. Podrás enviar una nueva solicitud en {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4596,6 +4672,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/he_IL/app.po b/locale/he_IL/app.po index a1e6eb9c90..78eb9c3ee7 100644 --- a/locale/he_IL/app.po +++ b/locale/he_IL/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Liz Conlan , 2018 # louisecrow , 2014 # louisecrow , 2014 @@ -53,7 +54,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Z.D , 2013\n" "Language-Team: Hebrew (Israel) (http://app.transifex.com/mysociety/alaveteli/l" @@ -495,6 +496,9 @@ msgstr "כל האפשרויות למטה יכולות לעשות שימושyour name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "כל מה שתזינו בדף הזה, כולל השם שלכם, יוצג פתוח לציבור באתר הזה לתמיד(למה?)." @@ -1617,6 +1633,9 @@ msgstr "בקשה אחרונה שנצפתה: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2304,6 +2323,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "זכור אותי (משאיר אתכם מחוברים לזמן רב יותר; אל תסמנו על מחשב ציבורי)" @@ -2492,6 +2514,9 @@ msgstr "חפש בין התוספות שלך" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "לשלוח הודעת המשך" @@ -2528,6 +2553,30 @@ msgstr "שלחו הודעה {{user_name}} רק כדי לראות איך זה ע msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2593,6 +2642,9 @@ msgstr "התנתק" msgid "Sign up" msgstr "הרשמה" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2653,6 +2705,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3083,9 +3138,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "מספר הבקשות שניתן להגיש ביום מוגבל, כי אנו לא רוצים להציף את הרשויות הציבוריות בבקשות שווא. אם אתם רוצים להגדיל את המספר המותר, צרו קשר." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3316,6 +3377,9 @@ msgstr "" " המהירות בה רשויות מגיבות לבקשות, מספר הבקשות\n" " שדרשו שליחת דואר ודברים רבים נוספים." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3446,9 +3510,15 @@ msgstr "היום" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "יותר מדי בקשות" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3809,6 +3879,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "כתבו את בקשתכם בשפה פשוטה ומדויקת." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3938,6 +4011,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "עברתם את המכסה היומית המותרת להגשת בקשות מידע. לרוב מוגבלים המשתמשים ל- {{max_requests_per_user_per_day}} בקשות ביממה. תוכלו להגיש בקשה נוספת בעוד {{can_make_another_request}} שעות." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4601,6 +4677,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/hr/app.po b/locale/hr/app.po index 9fb40978da..491726bcfb 100644 --- a/locale/hr/app.po +++ b/locale/hr/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # ae792aa766bbca91f3f4821acaa19518_a48216f <924a924c26027fc002ca6fada3386ff5_247255>, 2015 # Bojan Opacak , 2013 # Bojan Opacak , 2013 @@ -63,9 +64,9 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" -"Last-Translator: Miroslav Schlossberg, 2021-2023\n" +"Last-Translator: Žana Počuča , 2015,2021\n" "Language-Team: Croatian (http://app.transifex.com/mysociety/alaveteli/language" "/hr/)\n" "MIME-Version: 1.0\n" @@ -475,6 +476,9 @@ msgstr "Sve opcije ispod mogu koristiti variety ili lat msgid "All time" msgstr "Sveukupno" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "Svo vrijeme najbolji igrači" @@ -637,6 +641,9 @@ msgstr "Zabranjen pristup na ovoj stranici" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "Seriju je napravio/la {{info_request_user}} dana {{date}}." +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Počevši sa" @@ -700,6 +707,9 @@ msgstr "Poništite neka upozorenja na {{site_name}}" msgid "Cancel, return to your profile page" msgstr "Odustanite, vratite se na stranicu svojeg profila" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Promijenite elektroničku poštu na {{site_name}}" @@ -964,6 +974,9 @@ msgstr "Završeno >>" msgid "Download Data" msgstr "Preuzmi podatke" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Preuzmite svu korespondenciju u zip datoteci" @@ -1033,6 +1046,9 @@ msgstr "Prikaz prošlih događanja" msgid "Every citizen has the right to access information held by public authorities." msgstr "Svaki građanin ima pravo na pristup informacijama koje posjeduju tijela javne vlasti." +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "Sve što unesete na ovu stranicu, uključujući vaše ime, bit će javno prikazano na ovoj internetskoj stranici zauvijek" @@ -1564,6 +1580,9 @@ msgstr "Zadnje pregledani zahtjev: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Saznajte više →" @@ -2239,6 +2258,9 @@ msgstr "" msgid "Rejected" msgstr "Odbijen" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Zapamti me (ostajete dulje prijavljeni; ne koristite na javnim računalima)" @@ -2425,6 +2447,9 @@ msgstr "Pretražite Vaše doprinose" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Pošaljite dodatnu poruku" @@ -2461,6 +2486,30 @@ msgstr "Pošaljite poruku {{user_name}} samo da vidite kako radi" msgid "Sending..." msgstr "Slanje..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Poslano jednoj ustanovi od {{info_request_user}} dana {{date}}." @@ -2527,6 +2576,9 @@ msgstr "Odjavite se" msgid "Sign up" msgstr "Registrirajte se" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2581,6 +2633,9 @@ msgstr "Nažalost, trenutno ne možemo dodati vašu bilješku. Molimo pokušajte msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "Nažalost, trenutno ne možemo poslati Vaš zahtjev. Molimo pokušajte ponovo kasnije." @@ -2998,9 +3053,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Postoji ograničenje broja zahtjeva koje možete dnevno izraditi. Ne želimo da tijela javne vlasti budu zatrpane velikim brojem neprikladnih zahtjeva. Ukoliko mislite da, u Vašem slučaju, imate dobar razlog zatražiti veći broj zahtjeva, molimo javite nam se." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Još nema ničega za prikazati." @@ -3223,6 +3284,9 @@ msgstr "Ovaj je odjeljak o statistici tijela javne vlasti trenutno eksperimental msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "Ova tablica prikazuje tehničke detalje internih događaja vezanih uz ovaj zahtjev na {{site_name}}. To se može iskoristiti za dobivanje informacija o brzini kojom tijela javne vlasti odgovaraju na zahtjeve, o broju zahtjeva koji žele odgovoriti poštom i mnogo drugih stvari." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "Ovaj korisnik je suspendiran na {{site_name}} " @@ -3349,9 +3413,15 @@ msgstr "Danas" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Previše zahtjeva" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Najnoviji vrhunski igrači" @@ -3700,6 +3770,9 @@ msgstr "Napišite svoju dodatnu poruku za pravo na pristup informacijama za {{au msgid "Write your request in simple, precise language." msgstr "Pišite Vaš zahtjev jednostavnim, preciznim jezikom." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "Da" @@ -3832,6 +3905,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Dosegli ste limit novih zahtjeva. Korisnici su ograničeni na {{max_requests_per_user_per_day}} zahtjeva u periodu od 24 sata. Novi zatjev bit će moguć za {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "Napustili ste projekt." @@ -4469,6 +4545,11 @@ msgstr[0] "{{number_of_comments}} komentara" msgstr[1] "{{number_of_comments}} komentara" msgstr[2] "{{number_of_comments}} komentara" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} zahtjeva" diff --git a/locale/hu_HU/app.po b/locale/hu_HU/app.po index 238f19f518..a19b3e0b7c 100644 --- a/locale/hu_HU/app.po +++ b/locale/hu_HU/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # alaveteli_hu , 2012 # alaveteli_hu , 2012 # Dohány Tamás, 2021-2022 @@ -48,7 +49,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: iamdtms, 2021-2022\n" "Language-Team: Hungarian (Hungary) (http://app.transifex.com/mysociety/alavete" @@ -484,6 +485,9 @@ msgstr "Az alábbi beállítások mindegyike használhatja a változatzip formátumban" @@ -1052,6 +1065,9 @@ msgstr "Eseménytörténet" msgid "Every citizen has the right to access information held by public authorities." msgstr "Minden állampolgárnak joga van hozzáférni a hatóságok birtokában lévő információkhoz." +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Az ön neve, valamint minden, amit itt beír,\n" @@ -1624,6 +1640,9 @@ msgstr "Legutóbb megtekintett igénylés: {{request_url}}" msgid "Latest" msgstr "Legújabb" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "További információ →" @@ -2313,6 +2332,9 @@ msgstr "Szabályozás" msgid "Rejected" msgstr "Elutasítva" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Emlékezzen rám (továbbra is bejelentkezve marad; ne használja nyilvános számítógépen)" @@ -2502,6 +2524,9 @@ msgstr "Keresés az adatigényléseimben" msgid "Section" msgstr "Szakasz" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Emlékeztető üzenet küldése - Rákérdezhet az adatgazdánál, hogy hogy áll az igénylése." @@ -2538,6 +2563,30 @@ msgstr "Üzenet küldése a következőnek: {{user_name}} Csak hogy megnézzük, msgid "Sending..." msgstr "Küldés..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Elküldte {{authority_count}} hatóságnak, {{info_request_user}}, {{date}}." @@ -2603,6 +2652,9 @@ msgstr "Kijelentkezés" msgid "Sign up" msgstr "Regisztráció" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2663,6 +2715,9 @@ msgstr "Sajnáljuk, jelenleg nem tudjuk hozzáadni a kommentjét. Kérlek, prób msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "Sajnáljuk, jelenleg nem tudjuk elküldeni kérését. Kérlek, próbáld újra később." @@ -3096,9 +3151,15 @@ msgstr "Egynél több személy használja ezt az oldalt és ren msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Ennek a korlátozásnak az az oka hogy nem szeretnénk ha nagy mennyiségű inadekvát adatigényléssel árasztaná el az adatgazdákat valaki. Ha úgy érzi hogy nyomós oka van ennél több adatigénylést kezdeményezni rövid időn belül, kérjük, lépjen kapcsolatba velünk." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Még nincs mit megjeleníteni." @@ -3327,6 +3388,9 @@ msgstr "" "a közintézmények milyen gyorsan válaszolnak, mennyi igénylés esetén\n" "van szükség postai válaszra stb.. " +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "Ezt a felhasználót felfüggesztettük a {{site_name}} webhelyen" @@ -3459,9 +3523,15 @@ msgstr "Ma " msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Túl sok igénylés" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Legújabb játékosok" @@ -3826,6 +3896,9 @@ msgstr "Írja meg az FOI nyomon követési üzenetét a következőnek: {{author msgid "Write your request in simple, precise language." msgstr "Igénylését egyszerűen és pontosan fogalmazza meg!" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "Igen" @@ -3957,6 +4030,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Felhasználóink 24 órán belül legfeljebb {{max_requests_per_user_per_day}} új adatigénylést kezdeményezhetnek. Ön elérte ezt a számot, ezért a következő adatigénylését legkorábban kb. {{can_make_another_request}} óra múlva küldheti el." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "Kilépett a projektből." @@ -4602,6 +4678,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "{{number_of_comments}} megjegyzés" msgstr[1] "{{number_of_comments}} megjegyzés" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} igénylés" diff --git a/locale/id/app.po b/locale/id/app.po index a2c719120f..781aa31525 100644 --- a/locale/id/app.po +++ b/locale/id/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Agung Riyadi , 2013 # Agung Riyadi , 2012-2013 # agustriwanto , 2012 @@ -47,7 +48,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Agung Riyadi , 2012-2013\n" "Language-Team: Indonesian (http://app.transifex.com/mysociety/alaveteli/langua" @@ -492,6 +493,9 @@ msgstr "Semua pilihan di bawah dapat menggunakanjenis atauyour name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Semua yang Anda masukkan di halaman ini, termasuknama Anda, \n" @@ -1634,6 +1650,9 @@ msgstr "Permintaan terakhir yang dilihat: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2321,6 +2340,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2510,6 +2532,9 @@ msgstr "Cari kontribusi Anda" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Kirim tindak lanjut" @@ -2546,6 +2571,30 @@ msgstr "Kirim pesan kepada {{user_name}} hanya untuk melihat cara kerjanya" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2611,6 +2660,9 @@ msgstr "Keluar" msgid "Sign up" msgstr "Daftar" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2671,6 +2723,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3104,9 +3159,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Ada batas jumlah permintaan yang dapat Anda buat dalam sehari, karena kami tidak mau otoritas publik dibombardir dengan sejumlah besar permintaan yang tidak sesuai. Jika Anda merasa Anda memiliki alasan yang bagus untuk meminta batasan ini dicabut dalam kasus Anda, silakan berhubungan." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3334,6 +3395,9 @@ msgstr "" "kecepatan otoritas dalam merespon permintaan, jumlah permintaan\n" "yang membutuhkan respon pos dan banyak lagi." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3468,9 +3532,15 @@ msgstr "Hari ini" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Terlalu banyak permintaan" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3837,6 +3907,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "Tulis permintaan Anda dalam bahasa yang sederhana, tepat." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3966,6 +4039,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Anda telah mencapai batas kecepatan permintaan baru. Pengguna biasanya dibatasi sampai {{max_requests_per_user_per_day}} permintaan dalam jangka waktu 24 jam berjalan. Anda akan dapat membuat permintaan lain dalam {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4612,6 +4688,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/is/app.po b/locale/is/app.po index 864538bfa2..18857701cc 100644 --- a/locale/is/app.po +++ b/locale/is/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Finnur Magnusson , 2015 # Liz Conlan , 2018 # Ölvir Gíslason , 2016 @@ -39,9 +40,9 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" -"Last-Translator: Páll Hilmarsson , 2020-2021,2023\n" +"Last-Translator: Ölvir Gíslason , 2016\n" "Language-Team: Icelandic (http://app.transifex.com/mysociety/alaveteli/languag" "e/is/)\n" "MIME-Version: 1.0\n" @@ -472,6 +473,9 @@ msgstr "Með öllum neðangreindum valkostum má nota variety o msgid "All time" msgstr "Allra tíma" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "Þau allra afkastamestu" @@ -640,6 +644,9 @@ msgstr "Í banni á þessum vef" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "Hópbeiðni búin til af {{info_request_user}} þann {{date}}." +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Byrjar á" @@ -703,6 +710,9 @@ msgstr "Hætta við einhverjar {{site_name}} viðvaranir" msgid "Cancel, return to your profile page" msgstr "Hætta við, fara aftur á þína síðu" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Breyta netfangi á {{site_name}}" @@ -967,6 +977,9 @@ msgstr "Lokið >>" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Sækja zip-skrá með öllum samskiptum" @@ -1038,6 +1051,9 @@ msgstr "Færsluferill" msgid "Every citizen has the right to access information held by public authorities." msgstr "Allir borgarar hafa rétt á að fá aðgang að upplýsingum sem stjórnvöld búa yfir." +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Allt sem þú setur á þetta vefsvæði, þar á meðal nafnið þitt,\n" @@ -1582,6 +1598,9 @@ msgstr "Síðasta beiðni sem var skoðuð: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Meiri upplýsingar →" @@ -2258,6 +2277,9 @@ msgstr "" msgid "Rejected" msgstr "Hafnað" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Muna mig (þú verður lengur innskráð/ur; ekki haka við þetta á tæki sem fleiri en þú nota)" @@ -2447,6 +2469,9 @@ msgstr "Leitaðu í þínum innleggjum" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Senda svar/viðbót" @@ -2483,6 +2508,30 @@ msgstr "Senda skilaboð til {{user_name}} til að prófa hvernig það virkar" msgid "Sending..." msgstr "Sendi..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Sent til eins stjórnvalds af {{info_request_user}} þann {{date}}" @@ -2548,6 +2597,9 @@ msgstr "Útskrá" msgid "Sign up" msgstr "Nýskrá" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2606,6 +2658,9 @@ msgstr "Því miður getum við ekki bætt við athugasemd þinni núna. Reyndu msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "Því miður getum við ekki send beiðnina þína núna. Reyndu aftur síðar." @@ -3031,9 +3086,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Fjöldi þeirra beiðna sem hægt er að leggja fram á einum degi er takmarkaður því við viljum forðast að stjórnvöld fái mikinn fjölda óviðeigandi beiðna. Hafðu samband ef þér finnst ástæða til að aflétta takmörkuninni í þínu tilfelli." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Ekkert til að sýna enn." @@ -3254,6 +3315,9 @@ msgstr "Hlutinn um tölfræði stjórnvalda er á tilraunastigi svo það eru ý msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "Þessi tafla sýnir tæknilegar upplýsingar um feril beiðnarinnar á {{site_name}}. Þetta má til dæmis nota til að fá fram upplýsingar um það hversu hratt stjórnvöld bregðast við beiðnum og fjölda þeirra beiðna sem þarf að svara bréflega, svo fátt eitt sé nefnt." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3382,9 +3446,15 @@ msgstr "Í dag" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Of margar beiðnir" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Afkastamest upp á síðkastið" @@ -3736,6 +3806,9 @@ msgstr "Skrifa ítrekunarskilaboð vegna upplýsingabeiðni til {{authority_name msgid "Write your request in simple, precise language." msgstr "Skrifaðu beiðnina þín með einföldu, markvissu máli" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3865,6 +3938,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Þú hefur náð hámarksfjölda nýrra beiðna. Takmarkið fyrir notendur er yfirleitt {{max_requests_per_user_per_day}} beiðnir á hverjum sólarhring. Þú getur lagt fram nýja beiðni eftir {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4491,6 +4567,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} beiðni" diff --git a/locale/is_IS/app.po b/locale/is_IS/app.po index 8a2d89dd61..30ee627fbd 100644 --- a/locale/is_IS/app.po +++ b/locale/is_IS/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Finnur Magnusson , 2015 # Liz Conlan , 2018 # Ölvir Gíslason , 2016 @@ -39,7 +40,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Ölvir Gíslason , 2016\n" "Language-Team: Icelandic (Iceland) (http://app.transifex.com/mysociety/alavete" @@ -472,6 +473,9 @@ msgstr "Með öllum neðangreindum valkostum má nota variety o msgid "All time" msgstr "Allra tíma" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "Þau allra afkastamestu" @@ -640,6 +644,9 @@ msgstr "Í banni á þessum vef" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "Hópbeiðni búin til af {{info_request_user}} þann {{date}}." +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Byrjar á" @@ -703,6 +710,9 @@ msgstr "Hætta við einhverjar {{site_name}} viðvaranir" msgid "Cancel, return to your profile page" msgstr "Hætta við, fara aftur á þína síðu" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Breyta netfangi á {{site_name}}" @@ -967,6 +977,9 @@ msgstr "Lokið >>" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Sækja zip-skrá með öllum samskiptum" @@ -1038,6 +1051,9 @@ msgstr "Færsluferill" msgid "Every citizen has the right to access information held by public authorities." msgstr "Allir borgarar hafa rétt á að fá aðgang að upplýsingum sem stjórnvöld búa yfir." +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Allt sem þú setur á þetta vefsvæði, þar á meðal nafnið þitt,\n" @@ -1582,6 +1598,9 @@ msgstr "Síðasta beiðni sem var skoðuð: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Meiri upplýsingar →" @@ -2258,6 +2277,9 @@ msgstr "" msgid "Rejected" msgstr "Hafnað" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Muna mig (þú verður lengur innskráð/ur; ekki haka við þetta á tæki sem fleiri en þú nota)" @@ -2447,6 +2469,9 @@ msgstr "Leitaðu í þínum innleggjum" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Senda svar/viðbót" @@ -2483,6 +2508,30 @@ msgstr "Senda skilaboð til {{user_name}} til að prófa hvernig það virkar" msgid "Sending..." msgstr "Sendi..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Sent til eins stjórnvalds af {{info_request_user}} þann {{date}}" @@ -2548,6 +2597,9 @@ msgstr "Útskrá" msgid "Sign up" msgstr "Nýskrá" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2606,6 +2658,9 @@ msgstr "Því miður getum við ekki bætt við athugasemd þinni núna. Reyndu msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "Því miður getum við ekki send beiðnina þína núna. Reyndu aftur síðar." @@ -3031,9 +3086,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Fjöldi þeirra beiðna sem hægt er að leggja fram á einum degi er takmarkaður því við viljum forðast að stjórnvöld fái mikinn fjölda óviðeigandi beiðna. Hafðu samband ef þér finnst ástæða til að aflétta takmörkuninni í þínu tilfelli." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Ekkert til að sýna enn." @@ -3254,6 +3315,9 @@ msgstr "Hlutinn um tölfræði stjórnvalda er á tilraunastigi svo það eru ý msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "Þessi tafla sýnir tæknilegar upplýsingar um feril beiðnarinnar á {{site_name}}. Þetta má til dæmis nota til að fá fram upplýsingar um það hversu hratt stjórnvöld bregðast við beiðnum og fjölda þeirra beiðna sem þarf að svara bréflega, svo fátt eitt sé nefnt." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3382,9 +3446,15 @@ msgstr "Í dag" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Of margar beiðnir" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Afkastamest upp á síðkastið" @@ -3736,6 +3806,9 @@ msgstr "Skrifa ítrekunarskilaboð vegna upplýsingabeiðni til {{authority_name msgid "Write your request in simple, precise language." msgstr "Skrifaðu beiðnina þín með einföldu, markvissu máli" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3865,6 +3938,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Þú hefur náð hámarksfjölda nýrra beiðna. Takmarkið fyrir notendur er yfirleitt {{max_requests_per_user_per_day}} beiðnir á hverjum sólarhring. Þú getur lagt fram nýja beiðni eftir {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4491,6 +4567,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} beiðni" diff --git a/locale/it/app.po b/locale/it/app.po index a6ae357a4c..e2ae50b431 100644 --- a/locale/it/app.po +++ b/locale/it/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Antonella , 2014-2015 # Claudio Cesarano , 2015-2016 # Giancarlo , 2015 @@ -43,7 +44,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Marco Giustini , 2013\n" "Language-Team: Italian (http://app.transifex.com/mysociety/alaveteli/language/" @@ -468,6 +469,9 @@ msgstr "Tutte le opzioni qui sotto possono usare la variety o < msgid "All time" msgstr "Globale" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "I migliori" @@ -630,6 +634,9 @@ msgstr "Bannato da questo sito" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "Gruppo di richieste creato da {{info_request_user}} il {{date}}." +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "quelle che iniziano per " @@ -693,6 +700,9 @@ msgstr "Cancella alcuni avvisi di {{site_name}} " msgid "Cancel, return to your profile page" msgstr "Cancella e torna al tuo profilo" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Cambia l'indirizzo email su {{site_name}}" @@ -957,6 +967,9 @@ msgstr "Fatto >>" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Scarica un file .zip di tutta la corrispondenza" @@ -1026,6 +1039,9 @@ msgstr "Cronologia" msgid "Every citizen has the right to access information held by public authorities." msgstr "Ogni cittadino ha diritto di accedere alle informazioni possedute dalle pubbliche amministrazioni." +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "Tutto ciò che scrivi in questa pagina, incluso il tuo nome sarà pubblicato su questo sito e sarà visibile (perché?)." @@ -1570,6 +1586,9 @@ msgstr "Ultima richiesta visualizzata: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Scopri di più →" @@ -2247,6 +2266,9 @@ msgstr "" msgid "Rejected" msgstr "Rifiutata" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Ricordami (mantiene l'accesso più a lungo: non usare questa funzione su un computer pubblico)" @@ -2436,6 +2458,9 @@ msgstr "Cerca i tuoi contributi" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Invia un messaggio di risposta" @@ -2472,6 +2497,30 @@ msgstr "Invia un messaggio a {{user_name}} per vedere come funziona" msgid "Sending..." msgstr "Invio in corso..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Spedito da {{info_request_user}} il {{date}}." @@ -2538,6 +2587,9 @@ msgstr "Esci" msgid "Sign up" msgstr "Registrati" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2594,6 +2646,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3013,9 +3068,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Abbiamo impostato un limite al numero di richieste quotidiane che puoi fare, perché non vogliamo che le amministrazioni siano bombardate con un numero eccessivo di richieste, magari non appropriate. Se pensi che nel tuo caso serva un'eccezione scrivici." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Non c'è ancora niente da mostrare." @@ -3239,6 +3300,9 @@ msgstr "Questa sezione sulle statistiche che riguardano le pubbliche amministraz msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "Questa tabella mostra dettagli tecnici relativi alla risposta alla richiesta spedita attraverso {{site_name}}. Può essere usata per ricavare informazioni sulla rapidità di risposta delle amministrazioni, il numero di richieste che richiedono risposta per posta ecc." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3365,9 +3429,15 @@ msgstr "Oggi" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Troppe richieste" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Gli utenti più attivi di recente" @@ -3716,6 +3786,9 @@ msgstr "Rispondi a \"{{authority_name}}\"" msgid "Write your request in simple, precise language." msgstr "Devi scrivere la tua richiesta in un linguaggio semplice e preciso." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3845,6 +3918,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Hai raggiunto il limite di nuove richieste. Gli utenti possono inviare non più di {{max_requests_per_user_per_day}} richieste in un periodo di 24 ore. Potrai inviare una nuova richiesta tra {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4485,6 +4561,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} richiesta" diff --git a/locale/it_IT/app.po b/locale/it_IT/app.po index 58ad0ca11b..0d8fb0db6c 100644 --- a/locale/it_IT/app.po +++ b/locale/it_IT/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Giancarlo , 2015 # guido romeo , 2015 # 1bb8f5eb4bc72723d4109decfd20c765, 2017-2018 @@ -39,7 +40,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Marco Giustini , 2013\n" "Language-Team: Italian (Italy) (http://app.transifex.com/mysociety/alaveteli/l" @@ -464,6 +465,9 @@ msgstr "Tutte le opzioni qui sotto possono usare la variety o < msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "I migliori" @@ -626,6 +630,9 @@ msgstr "Bannato da questo sito" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "Gruppo di richieste creato da {{info_request_user}} il {{date}}." +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "quelle che iniziano per " @@ -689,6 +696,9 @@ msgstr "Cancella alcuni avvisi di {{site_name}} " msgid "Cancel, return to your profile page" msgstr "Cancella e torna al tuo profilo" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Cambia l'indirizzo email su {{site_name}}" @@ -953,6 +963,9 @@ msgstr "Fatto >>" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Scarica un file .zip di tutta la corrispondenza" @@ -1022,6 +1035,9 @@ msgstr "Cronologia" msgid "Every citizen has the right to access information held by public authorities." msgstr "Ogni cittadino ha diritto di accedere alle informazioni possedute dalle pubbliche amministrazioni." +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "Tutto ciò che scrivi in questa pagina, incluso il tuo nome sarà pubblicato su questo sito e sarà visibile (perché?)." @@ -1566,6 +1582,9 @@ msgstr "Ultima richiesta visualizzata: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Scopri di più →" @@ -2243,6 +2262,9 @@ msgstr "" msgid "Rejected" msgstr "Rifiutata" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Ricordami (mantiene l'accesso più a lungo: non usare questa funzione su un computer pubblico)" @@ -2432,6 +2454,9 @@ msgstr "Cerca i tuoi contributi" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Invia un messaggio di risposta" @@ -2468,6 +2493,30 @@ msgstr "Invia un messaggio a {{user_name}} per vedere come funziona" msgid "Sending..." msgstr "Invio in corso..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Spedito da {{info_request_user}} il {{date}}." @@ -2534,6 +2583,9 @@ msgstr "Esci" msgid "Sign up" msgstr "Registrati" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2590,6 +2642,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3009,9 +3064,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Abbiamo impostato un limite al numero di richieste quotidiane che puoi fare, perché non vogliamo che le amministrazioni siano bombardate con un numero eccessivo di richieste, magari non appropriate. Se pensi che nel tuo caso serva un'eccezione scrivici." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Non c'è ancora niente da mostrare." @@ -3235,6 +3296,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "Questa tabella mostra dettagli tecnici relativi alla risposta alla richiesta spedita attraverso {{site_name}}. Può essere usata per ricavare informazioni sulla rapidità di risposta delle amministrazioni, il numero di richieste che richiedono risposta per posta ecc." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3361,9 +3425,15 @@ msgstr "Oggi" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Troppe richieste" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Gli utenti più attivi di recente" @@ -3712,6 +3782,9 @@ msgstr "Rispondi a \"{{authority_name}}\"" msgid "Write your request in simple, precise language." msgstr "Devi scrivere la tua richiesta in un linguaggio semplice e preciso." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3841,6 +3914,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Hai raggiunto il limite di nuove richieste. Gli utenti possono inviare non più di {{max_requests_per_user_per_day}} richieste in un periodo di 24 ore. Potrai inviare una nuova richiesta tra {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4478,6 +4554,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} richiesta" diff --git a/locale/ka/app.po b/locale/ka/app.po index 03ce58957a..4a8cf7ee20 100644 --- a/locale/ka/app.po +++ b/locale/ka/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Jubo Beridzishvili, 2021-2023 # Lela Merabishvili, 2021 # Lela Merabishvili, 2021-2022 @@ -41,9 +42,9 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" -"Last-Translator: Jubo Beridzishvili, 2021-2023\n" +"Last-Translator: Natalie Hiirulainen , 2021,2023\n" "Language-Team: Georgian (http://app.transifex.com/mysociety/alaveteli/language" "/ka/)\n" "MIME-Version: 1.0\n" @@ -449,6 +450,9 @@ msgstr "ქვემოთ მოცემულ ყველა ვარია msgid "All time" msgstr "ყველა დროის" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "ყველა დროის საუკეთესო მოთამაშეები" @@ -611,6 +615,9 @@ msgstr "დაბლოკილია ვებგვერდიდან" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "შექმნილია მომხმარებლის მიერ {{info_request_user}} თარიღით {{date}}." +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "რომლებიც იწყება" @@ -674,6 +681,9 @@ msgstr "ვებგვერდის {{site_name}} ზოგიერთი msgid "Cancel, return to your profile page" msgstr "გააუქმე, ან დაბრუნდი შენი პროფილის გვერდზე" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "შეცვალე ელ-ფოსტა ვებგვერდისთვის {{site_name}}" @@ -944,6 +954,9 @@ msgstr "დასრულება >>" msgid "Download Data" msgstr "მონაცემების გადმოწერა" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "მიმოწერის ისტორიის ZIP ფორმატით გადმოწერა" @@ -1013,6 +1026,9 @@ msgstr "მოქმედებების ისტორია" msgid "Every citizen has the right to access information held by public authorities." msgstr "ყველა მოქალაქეს აქვს უფლება გამოითხოვოს ინფორმაცია, რომელსაც საჯარო დაწესებულებები ფლობენ. " +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "ამ გვერდზე მითითებული ყველა ინფორმაცია, მათ შორის შენი სახელი, პორტალზე საჯაროდ, განუსაზღვრელი ვადით განთავსდება" @@ -1540,6 +1556,9 @@ msgstr "ბოლოს ნანახი მოთხოვნა: {{request_u msgid "Latest" msgstr "უკანასკნელი" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "გაიგე მეტი →" @@ -2222,6 +2241,9 @@ msgstr "რეგულაცია" msgid "Rejected" msgstr "უარყოფილია" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "დამახსოვრება (არ გამოიყენო საჯარო კომპიუტერზე)" @@ -2408,6 +2430,9 @@ msgstr "ძებნა" msgid "Section" msgstr "სექცია" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "პასუხის გაგზავნა" @@ -2444,6 +2469,30 @@ msgstr "წერილის გაგზავნა მომხმარე msgid "Sending..." msgstr "იგზავნება..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "გაუგზავნე {{authority_count}} საჯარო დაწესებულებას {{info_request_user}}-ის მიერ, თარიღით {{date}}." @@ -2509,6 +2558,9 @@ msgstr "გამოსვლა" msgid "Sign up" msgstr "რეგისტრაცია" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2563,6 +2615,9 @@ msgstr "ბოდიში, ამ ეტაპზე შენს ანოტ msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "ბოდიში, შენი მოთხოვნის გაგზავნა ვერ მოხერხდა. მოგვიანებით კიდევ სცადე." @@ -2980,9 +3035,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "ლიმიტის დაწესებით ვცდილობთ, რომ საჯარო დაწესებულებები დიდი ოდენობით შეუსაბამო განცხადებების მიღებისგან დავაზღვიოთ. თუ ფიქრობ, რომ ლეგიტიმური მიზეზი გაქვს ლიმიტის გასაზრდელად, დაგვიკავშირდი." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "საჩვენებელი არაფერია" @@ -3203,6 +3264,9 @@ msgstr "საჯარო უწყების სტატისტიკა msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "მოცემული ცხრილი აღნიშნავს მოთხოვნის ირგვლივ განხორციელებული მოქმედებების ისტორიას პორტალზე {{site_name}}. ცხრილის გამოყენება შეიძლება იმის გასარკვევად, თუ რა სისწრაფით პასუხობდნენ საჯარო დაწესებულებები მოთხოვნებს, რამდენი განაცხადი მოითხოვდა პასუხს საფოსტო მომსახურებით და ა.შ." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "მომხმარებელი დაბლოკილია საიტიდან {{site_name}} " @@ -3329,9 +3393,15 @@ msgstr "დღეს" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "უპს. განცხადებების დღიური ლიმიტი ამოიწურა" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "ბოლო დროის საუკეთესო მოთამაშეები" @@ -3678,6 +3748,9 @@ msgstr "გაუგზავნე საპასუხო წერილი msgid "Write your request in simple, precise language." msgstr " მოკლე და მკაფიო მესიჯებით მიმართვა საჯარო დაწესებულებებს გაუმარტივებს უკეთ აღიქვან შენი მოთხოვნილი ინფორმაციის შინაარსი, რაც ნიშნავს, რომ პასუხს უფრო მალე დაგიბრუნებენ." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "დიახ" @@ -3807,6 +3880,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "სამწუხაროდ, 24 საათის მანძილზე არაუმეტეს {{max_requests_per_user_per_day}} განცხადების გაგზავნა შეგიძლია." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "შენ ეს პროექტი დატოვე" @@ -4427,6 +4503,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "{{number_of_comments}} კომენტარი" msgstr[1] "{{number_of_comments}} კომენტარი" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} მოთხოვნა" diff --git a/locale/mk/app.po b/locale/mk/app.po index 6287167b20..af438011fd 100644 --- a/locale/mk/app.po +++ b/locale/mk/app.po @@ -31,11 +31,12 @@ # Translators: # Translators: # Translators: +# Translators: msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Graeme Porteous \n" "Language-Team: Macedonian (http://app.transifex.com/mysociety/alaveteli/langua" @@ -436,6 +437,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -598,6 +602,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -661,6 +668,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -925,6 +935,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -994,6 +1007,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1521,6 +1537,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2195,6 +2214,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2381,6 +2403,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2417,6 +2442,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2482,6 +2531,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2536,6 +2588,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2953,9 +3008,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3176,6 +3237,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3302,9 +3366,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3651,6 +3721,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3780,6 +3853,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4400,6 +4476,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/mk_MK/app.po b/locale/mk_MK/app.po index a24fedbc3a..ef80f5e8b0 100644 --- a/locale/mk_MK/app.po +++ b/locale/mk_MK/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Liz Conlan , 2018 # louisecrow , 2014 # louisecrow , 2014 @@ -38,7 +39,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: louisecrow , 2014\n" "Language-Team: Macedonian (Macedonia) (http://app.transifex.com/mysociety/alav" @@ -485,6 +486,9 @@ msgstr "Сите опции подолу може да користат msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -653,6 +657,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Започнувајќи со" @@ -716,6 +723,9 @@ msgstr "Откажете некои предупредувања за {{site_nam msgid "Cancel, return to your profile page" msgstr "Откажете и вратете се до страницата на вашиот профил" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Промени е-пошта на {{site_name}}" @@ -990,6 +1000,9 @@ msgstr "Готово >>" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Преземете zip датотека од целата кореспонденција" @@ -1063,6 +1076,9 @@ msgstr "Историја на настани" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Се што ќе внесете на оваа страница, вклучувајќи го и вашето име,\n" @@ -1636,6 +1652,9 @@ msgstr "Последно видено барање: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2325,6 +2344,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2514,6 +2536,9 @@ msgstr "Пребарајте ги вашите придонеси" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Испратете реакција" @@ -2550,6 +2575,30 @@ msgstr "Испратете порака до {{user_name}} само да вид msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2615,6 +2664,9 @@ msgstr "Одјавете се" msgid "Sign up" msgstr "Регистрирајте се" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2675,6 +2727,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3108,9 +3163,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Постои ограничување за бројот на барања кои може да ги направите во еден ден, бидејќи не сакаме имателите да бидат „бомбардирани“ со голем број на барања. Доколку сметате дека имате јака причина зошто ова ограничување не треба да важи за вас, ве молиме стапете во контакт." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3339,6 +3400,9 @@ msgstr "" "брзината со која имателите одговараат на барањата, бројот на барањата\n" "кои изнудуваат одговор преку пошта и др.." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3473,9 +3537,15 @@ msgstr "Денес" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Премногу барања" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3842,6 +3912,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "Напишете го вашето барање со едноставен, прецизен речник." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3971,6 +4044,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Го исполнивте ограничувањето за нови барања. Корисниците обично се ограничени на {{max_requests_per_user_per_day}} барања во период од 24 часа. Ќе може да направите ново барање за {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4620,6 +4696,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/nb/app.po b/locale/nb/app.po index 8104f28fc7..ff4df81ce5 100644 --- a/locale/nb/app.po +++ b/locale/nb/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # 2b81488fecf64b01474cdd73adee6da4_f428fa4 <168fddc5dd8708c6cc0c28446af80acb_220254>, 2017 # andreli , 2013 # Hans-Petter Fjeld , 2014 @@ -56,7 +57,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: pere , 2013,2015\n" "Language-Team: Norwegian Bokmål (http://app.transifex.com/mysociety/alaveteli/" @@ -503,6 +504,9 @@ msgstr "Alle alternativene nedenfor kan bruke variety eller your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Alt som du skriver inn på denne tjenesten, inkludert navnet ditt,\n" @@ -1628,6 +1644,9 @@ msgstr "Siste henvendelse du så på: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Lær mer →" @@ -2315,6 +2334,9 @@ msgstr "" msgid "Rejected" msgstr "Avvist" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Husk meg (lar deg være logget inn lengre, ikke bruk dette på en offentlig datamaskin)" @@ -2504,6 +2526,9 @@ msgstr "Søk i dine bidrag" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Send en oppfølgning" @@ -2540,6 +2565,30 @@ msgstr "Send melding til {{user_name}} bare for å se hvordan det fungerer" msgid "Sending..." msgstr "Sender..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Sendt til en myndighet av {{info_request_user}} den {{date}}." @@ -2605,6 +2654,9 @@ msgstr "Logg ut" msgid "Sign up" msgstr "Lag konto" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2665,6 +2717,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3096,9 +3151,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Det er en grense på antall henvendelser du kan lage på én dag, fordi vi ikke ønsker at offentlige myndigheter skal bli oversvømt med et stort antall upassende henvendelser. Dersom du synes du har en god grunn til at grensen skal økes i ditt tilfelle, vennligst ta kontakt." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Det er ingenting å vise enda." @@ -3323,6 +3384,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "Denne tabellen viser de tekniske detaljene til interne hendelser som skjedde med denne henvendelsen på {{site_name}}. Dette kan brukes til å generere informasjon om hvor raskt ulike etater svarer på henvendelser, antall henvendelser som krever papirpostsvar og mye mer." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3455,9 +3519,15 @@ msgstr "Idag" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "For mange henvendelser" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3822,6 +3892,9 @@ msgstr "Skriv din oppfølgningsmelding til {{authority_name}}" msgid "Write your request in simple, precise language." msgstr "Skriv henvendelsen i enkelt, nøyaktig språk." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3951,6 +4024,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Du har truffet grensen for antall nye henvendelser. Brukere er ordinært begrenset til {{max_requests_per_user_per_day}} henvendelser i en 24-timers periode. Du kan gjøre en ny henvendelse {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4591,6 +4667,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} henvendelse" diff --git a/locale/ne/app.po b/locale/ne/app.po index 4d17a80681..22fb6423c1 100644 --- a/locale/ne/app.po +++ b/locale/ne/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Amit Shrestha , 2017 # Anjesh Ojha , 2017 # arjun gautam , 2016 @@ -65,7 +66,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Yudeep Rajbhandari , 2017\n" "Language-Team: Nepali (http://app.transifex.com/mysociety/alaveteli/language/n" @@ -495,6 +496,9 @@ msgstr "तल रहेका सबै विकल्प varietyyour name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "तपाईँ ले यो पेजमा लेख्नु भएको हरेक कुराहरू,तपाईँको सहितनामसहित,\n" @@ -1619,6 +1635,9 @@ msgstr "अन्तिम पटक हेरिएको: {{request_url}} " msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "थप जान्नुहोस् →" @@ -2295,6 +2314,9 @@ msgstr "" msgid "Rejected" msgstr "फर्काइयो" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "मलाई सम्झनुहोस् (लामो समयसम्म प्रवेश गराइराख्छ;सार्वजनिक कम्प्युटरमा प्रयोग नगर्नुहोस्)" @@ -2484,6 +2506,9 @@ msgstr "तपाईंको योगदान खोज" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "फलोअप पठाउनुहोस्" @@ -2520,6 +2545,30 @@ msgstr "कसरी काम गर्छ भनेर हेर्नका msgid "Sending..." msgstr "पठाउँदै..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "{{date}} मा {{info_request_user}} द्वारा एउटा निकायलाई पठाइएको | " @@ -2585,6 +2634,9 @@ msgstr "साइन आउट गर्नुहोस्" msgid "Sign up" msgstr "साइन अप गर्नुहोस्" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2645,6 +2697,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3064,9 +3119,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "एक दिनमा कति सन्देश पठाउने भन्ने सीमाना छ, किन भने सार्वजनिक निकायहरू हाम्रो साइटबाट प्राप्त हुने अनुरोधहरूबाट ग्रसित नहुन्। यदि तपाईँको यस सीमालाई हटाइनु पर्छ भन्ने तपाईँसँग कुनै कारण छ भने थाह दिनुहोस्।" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "हालसम्म देखाउनको लागी केहि छैन |" @@ -3295,6 +3356,9 @@ msgstr "" "र कसलाई कति वटा अनुरोधहरू छन् भन्ने पनि\n" "कतिलाई हुलाकद्वारा जवाफ दिनु पर्छ इत्यादि। " +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3425,9 +3489,15 @@ msgstr "आज" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "धेरै अनुरोधहरू" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "हालका शीर्ष प्रयोगकर्ताहरू" @@ -3779,6 +3849,9 @@ msgstr "{{authority_name}}मा तपाईंले FOI सन्देश msgid "Write your request in simple, precise language." msgstr "सटीक, सरल भाषामा आफ्नो अनुरोध लेख्नुहोस्" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3908,6 +3981,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "तपाईंले नयाँ अनुरोधमा दर सीमा भेटाउनु भ​एको छ​। प्रयोगकर्ताहरु सामान्यतया २४-घण्टाको अवधिमा {{max_requests_per_user_per_day}} अनुरोधमा सिमित छन्। तपाईं {{can_make_another_request}}मा अर्को अनुरोध गर्न सक्षम हुनुहुनेछ।" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4547,6 +4623,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} अनुरोध" diff --git a/locale/ne_NP/app.po b/locale/ne_NP/app.po index f2a8bc361e..656593c3bb 100644 --- a/locale/ne_NP/app.po +++ b/locale/ne_NP/app.po @@ -31,11 +31,12 @@ # Translators: # Translators: # Translators: +# Translators: msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Graeme Porteous \n" "Language-Team: Nepali (Nepal) (http://app.transifex.com/mysociety/alaveteli/la" @@ -436,6 +437,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -598,6 +602,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -661,6 +668,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -925,6 +935,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -994,6 +1007,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1521,6 +1537,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2195,6 +2214,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2381,6 +2403,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2417,6 +2442,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2482,6 +2531,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2536,6 +2588,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2953,9 +3008,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3176,6 +3237,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3302,9 +3366,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3651,6 +3721,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3780,6 +3853,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4400,6 +4476,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/nl/app.po b/locale/nl/app.po index 191bc48492..03c0e7af95 100644 --- a/locale/nl/app.po +++ b/locale/nl/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Edwin Bosveld , 2013,2016 # Gareth Rees , 2020 # Graeme Porteous , 2019,2021 @@ -43,7 +44,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Luis Villegas, 2022\n" "Language-Team: Dutch (http://app.transifex.com/mysociety/alaveteli/language/nl" @@ -480,6 +481,9 @@ msgstr "Alle opties hieronder kunnen voor de dubbele punt varietyyour name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Alles wat je op deze pagina invult, ook je naam, \n" @@ -1609,6 +1625,9 @@ msgstr "Laatst bekeken verzoek: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Meer weten →" @@ -2289,6 +2308,9 @@ msgstr "" msgid "Rejected" msgstr "Geweigerd" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Aangemeld blijven (gebruik dit niet op een openbare computer)" @@ -2475,6 +2497,9 @@ msgstr "Doorzoek je bijdragen" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Stuur een follow-up bericht" @@ -2511,6 +2536,30 @@ msgstr "Verstuur een bericht aan {{user_name}} om te zien hoe het werkt" msgid "Sending..." msgstr "Wordt verzonden..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Verzonden naar een overheidsinstantie door {{info_request_user}} on {{date}}." @@ -2576,6 +2625,9 @@ msgstr "Log uit" msgid "Sign up" msgstr "Schrijf je in" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2630,6 +2682,9 @@ msgstr "Tot onze spijt kunnen wij je opmerking niet plaatsen. Probeer het later msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "Tot onze spijt kunnen wij je Woo-verzoek niet verzenden. Probeer het later alsjeblieft opnieuw." @@ -3051,9 +3106,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Er is een limiet aan het aantal verzoeken dat je per dag kunt versturen, omdat we niet willen dat de overheidsinstanties gebombardeerd worden met grote aantallen ongepaste verzoeken. Als je van mening bent dat je een goede reden hebt dat de limiet voor jou moet worden opgehoogd, gelieve ons te contacteren." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Er is voorlopig nog niets te tonen." @@ -3280,6 +3341,9 @@ msgstr "" "Deze tabel toont de technische details van de interne gebeurtenissen m.b.t. dit verzoek op {{site_name}}. Deze gegevens zouden gebruikt kunnen worden om informatie te verzamelen over de \n" " snelheid waarmee overheidsinstanties besluiten op verzoeken, het aantal verzoeken die per post beantwoord moeten worden, enzovoort." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "Deze gebruiker wordt tijdelijk geweerd van {{site_name}} " @@ -3425,9 +3489,15 @@ msgstr "Vandaag" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Te veel verzoeken" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Recente topspelers" @@ -3783,6 +3853,9 @@ msgstr "Formuleer een follow-up bericht over je Woo-verzoek aan {{authority_name msgid "Write your request in simple, precise language." msgstr "Formuleer je verzoek eenvoudig en nauwkeurig." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3912,6 +3985,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Je hebt het maximaal toegestane aantal verzoeken verstuurd. Het aantal verzoeken is beperkt tot {{max_requests_per_user_per_day}} per 24u. Je kunt weer een nieuw verzoek doen op {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4534,6 +4610,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "{{number_of_comments}} commentaar" msgstr[1] "{{number_of_comments}} opmerkingen" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} vraag" diff --git a/locale/nl_BE/app.po b/locale/nl_BE/app.po index c3465f8bdc..56c9bf2a88 100644 --- a/locale/nl_BE/app.po +++ b/locale/nl_BE/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Christophe Van Gheluwe , 2017 # claude transparencia , 2017-2018,2021 # Edwin Bosveld , 2013,2016 @@ -43,7 +44,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: louisecrow , 2017\n" "Language-Team: Dutch (Belgium) (http://app.transifex.com/mysociety/alaveteli/l" @@ -478,6 +479,9 @@ msgstr "Alle opties hieronder kunnen voor de dubbele punt varietyyour name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Alles wat u op deze pagina invult, ook uw naam, \n" @@ -1610,6 +1626,9 @@ msgstr "Laatst bekeken aanvraag: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Meer weten →" @@ -2290,6 +2309,9 @@ msgstr "" msgid "Rejected" msgstr "Geweigerd" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Aangemeld blijven (gebruik dit niet op een openbare computer)" @@ -2479,6 +2501,9 @@ msgstr "Zoek uw bijdragen" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Verzend een opvolgbericht" @@ -2515,6 +2540,30 @@ msgstr "Zend het bericht aan {{user_name}}, enkel om te zien hoe het werkt" msgid "Sending..." msgstr "Wordt verzonden..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Verzonden naar een overheidsinstantie door {{info_request_user}} on {{date}}." @@ -2580,6 +2629,9 @@ msgstr "Deconnecteer" msgid "Sign up" msgstr "Schrijf u in" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2638,6 +2690,9 @@ msgstr "Tot onze spijt kunnen wij uw commentaar thans niet toevoegen. Probeer a. msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "Tot onze spijt kunnen wij uw aanvraag nu niet verzenden. Probeer a.u.b. later opnieuw." @@ -3065,9 +3120,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Er staat een limiet op het aantal aanvragen dat u per dag kunt uitvoeren, omdat we niet willen dat de overheidsinstellingen gebombardeerd worden met een ongepast aantal aanvragen. Als u meent dat u een goede reden heeft om deze limiet voor u te verhogen, gelieve dan ons te contacteren." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Er is voorlopig nog niets te tonen." @@ -3294,6 +3355,9 @@ msgstr "" "Deze tabel toont de technische details van de interne gebeurtenissen m.b.t. deze aanvraag uitgevoerd via {{site_name}}. Deze gegevens zouden kunnen gebruikt worden om informatie op te stellen aangaande de \n" " snelheid waarmee de overheidsinstellingen antwoorden, het aantal aanvragen die een antwoord per post vereisen en veel meer." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3426,9 +3490,15 @@ msgstr "Vandaag" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Te veel aanvragen" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "De meest recente spelers" @@ -3786,6 +3856,9 @@ msgstr "Formuleer uw WOB follow-up bericht aan {{authority_name}}" msgid "Write your request in simple, precise language." msgstr "Formuleer uw vraag eenvoudig en nauwkeurig." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3915,6 +3988,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "U heeft de limiet voor nieuwe aanvragen bereikt. De gebruikers zijn beperkt tot {{max_requests_per_user_per_day}} aanvragen per 24u. U kan een nieuwe aanvraag doen op {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4543,6 +4619,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "{{number_of_comments}} commentaar" msgstr[1] "{{number_of_comments}} commentaren" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} vraag" diff --git a/locale/nn/app.po b/locale/nn/app.po index eeb2210c11..8533c5c868 100644 --- a/locale/nn/app.po +++ b/locale/nn/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # andreli , 2013 # Hans-Petter Fjeld , 2014 # b99f4c81950a40007b4adaea695ecb99_1c02644 , 2015 @@ -55,7 +56,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: velmont , 2015\n" "Language-Team: Norwegian Nynorsk (http://app.transifex.com/mysociety/alaveteli" @@ -500,6 +501,9 @@ msgstr "Alle alternativa nedanfor kan bruka variety eller your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Alt som du skriv inn på denne tenesta, inkluderte namnet ditt,\n" @@ -1627,6 +1643,9 @@ msgstr "Siste førespurnad du såg på: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Lær meir →" @@ -2314,6 +2333,9 @@ msgstr "" msgid "Rejected" msgstr "Avvist" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Hugs meg (lèt deg loggast inn lengre, ikkje bruk dette på ei offentleg datamaskin)" @@ -2503,6 +2525,9 @@ msgstr "Søk i bidraga dine" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Send ei oppfølging" @@ -2539,6 +2564,30 @@ msgstr "Send melding til {{user_name}} berre for å sjå korleis det fungerer" msgid "Sending..." msgstr "Sender..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Sendt til ei styresmakt av {{info_request_user}} den {{date}}." @@ -2604,6 +2653,9 @@ msgstr "Logg ut" msgid "Sign up" msgstr "Lag konto" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2664,6 +2716,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3095,9 +3150,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Det er ei grense på mengd førespurnader du kan laga på éin dag, fordi vi ikkje ynskjer at offentlege styresmakter skal oversymjast med ei stort mengd upassande førespurnader. Dersom du synest du har ein god grunn til at grensa skal aukast i tilfellet ditt, ver venleg og ta kontakt." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Det er ikkje noko å visa endå." @@ -3322,6 +3383,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "Denne tabellen viser dei tekniske detaljane til interne hendingar som skjedde med denne førespurnaden på {{site_name}}. Dette kan brukast til å generera informasjon om der raskt ulike etatar svarar på førespurnader, mengd førespurnader som krev papirpostsvar og mykje meir." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3455,9 +3519,15 @@ msgstr "Idag" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "For mange førespurnader" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3818,6 +3888,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "Skriv førespurnaden i enkelt, nøyaktig språk." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3947,6 +4020,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Du har treft grensa for mengd nye førespurnader. Brukarar er ordinært avgrensa til {{max_requests_per_user_per_day}} førespurnader i perioden til-ein 24 timar. Du kan gjera ein ny førespurnad {{can_maka_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4587,6 +4663,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/pap/app.po b/locale/pap/app.po index 1830a6c612..85a6e940f4 100644 --- a/locale/pap/app.po +++ b/locale/pap/app.po @@ -31,13 +31,14 @@ # Translators: # Translators: # Translators: +# Translators: # Luis Villegas, 2022 # Luis Villegas, 2022 msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Luis Villegas, 2022\n" "Language-Team: Papiamento (http://app.transifex.com/mysociety/alaveteli/langua" @@ -448,6 +449,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -610,6 +614,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -673,6 +680,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -937,6 +947,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -1006,6 +1019,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1533,6 +1549,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2207,6 +2226,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2393,6 +2415,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2429,6 +2454,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2494,6 +2543,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2548,6 +2600,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2965,9 +3020,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3188,6 +3249,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3314,9 +3378,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3663,6 +3733,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3792,6 +3865,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4412,6 +4488,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/pl/app.po b/locale/pl/app.po index 45c60625fb..98d1a5e342 100644 --- a/locale/pl/app.po +++ b/locale/pl/app.po @@ -31,13 +31,14 @@ # Translators: # Translators: # Translators: +# Translators: # Ewa Modrzejewska , 2013 # Ewa Modrzejewska , 2013 msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Ewa Modrzejewska , 2013\n" "Language-Team: Polish (http://app.transifex.com/mysociety/alaveteli/language/p" @@ -440,6 +441,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -602,6 +606,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -665,6 +672,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -929,6 +939,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -998,6 +1011,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1525,6 +1541,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2199,6 +2218,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2385,6 +2407,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2421,6 +2446,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2486,6 +2535,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2540,6 +2592,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2957,9 +3012,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3180,6 +3241,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3306,9 +3370,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3655,6 +3725,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3784,6 +3857,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4404,6 +4480,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/pt_BR/app.po b/locale/pt_BR/app.po index 90356dcb4b..41eb8567e5 100644 --- a/locale/pt_BR/app.po +++ b/locale/pt_BR/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # elaste <3laste2000@gmail.com>, 2012 # serramassuda , 2012 # Bruno , 2012 @@ -76,7 +77,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Vítor Márcio Paiva de Sousa Baptista , 2013\n" @@ -504,6 +505,9 @@ msgstr "Todas as opções abaixo podem usar variedade ou your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "Tudo o que você publicar nesta página, incluindo seu nome, será exibido publicamente neste site para sempre ( por quê? )." @@ -1600,6 +1616,9 @@ msgstr "Último pedido visualizado: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2274,6 +2293,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2460,6 +2482,9 @@ msgstr "Buscar suas contribuições" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Enviar um mensagem de acompanhamento" @@ -2496,6 +2521,30 @@ msgstr "Enviar mensagem para {{user_name}} veja como isso funciona" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2561,6 +2610,9 @@ msgstr "Sair" msgid "Sign up" msgstr "Cadastrar" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2615,6 +2667,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3037,9 +3092,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Há um limite de pedidos de informação que você pode fazer em um dia, porque não queremos que as autoridades públicas sejam bombardeadas por um número grande de pedidos inapropriados. Se você considera ter uma boa razão para seu limite ser ampliado, por favor nos contate." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3265,6 +3326,9 @@ msgstr "" "Esta tabela mostra detalhes técnicos dos eventos internos que\n" "aconteceram para esta requisição no {{site_name}}. Isto pode ser usado para gerar informação sobre a velocidade com a qual autoridades respondem às requisições, o número de requisições que requerem uma resposta por correio e muito mais." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3393,9 +3457,15 @@ msgstr "Hoje" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Excessivas requisições" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3742,6 +3812,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "Escreva seu pedido de forma simples." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3871,6 +3944,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Você atingiu o raro limite de pedidos novos. Usuários estão normalmente limitados a {{max_requests_per_user_per_day}} pedidos em um período de 24 horas. Você poderá fazer outro pedido em {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4513,6 +4589,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/pt_PT/app.po b/locale/pt_PT/app.po index 14e72b4f63..90948c9941 100644 --- a/locale/pt_PT/app.po +++ b/locale/pt_PT/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Bruno , 2012 # Carlos Vieira , 2011 # danielabsilva , 2011 @@ -60,7 +61,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Vítor Márcio Paiva de Sousa Baptista , 2013\n" @@ -488,6 +489,9 @@ msgstr "Todas as opções abaixo podem usar variedade ou your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "Tudo o que você publicar nesta página, incluindo seu nome, será exibido publicamente neste site para sempre ( por quê? )." @@ -1588,6 +1604,9 @@ msgstr "Último pedido visualizado: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2262,6 +2281,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Lembre-se de mim (mantém-te autenticado por mais tempo; não utilizar num computador público)" @@ -2451,6 +2473,9 @@ msgstr "Buscar suas contribuições" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Enviar um mensagem de acompanhamento" @@ -2487,6 +2512,30 @@ msgstr "Enviar mensagem para {{user_name}} veja como isso funciona" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Enviado a uma entidade por {{info_request_user}} em{{date}}." @@ -2553,6 +2602,9 @@ msgstr "Sair" msgid "Sign up" msgstr "Cadastrar" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2607,6 +2659,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3029,9 +3084,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Há um limite de pedidos de informação que você pode fazer em um dia, porque não queremos que as autoridades públicas sejam bombardeadas por um número grande de pedidos inapropriados. Se você considera ter uma boa razão para seu limite ser ampliado, por favor contacte-nos." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Ainda não existe informação para divulgar." @@ -3259,6 +3320,9 @@ msgstr "" "a velocidade com a qual as entidades respondem aos pedidos, o número de pedidos\n" " que requerem uma resposta por correio e muito mais." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3387,9 +3451,15 @@ msgstr "Hoje" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Excessivas requisições" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3738,6 +3808,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "Escreva seu pedido de forma simples." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3867,6 +3940,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Você atingiu o raro limite de pedidos novos. Usuários estão normalmente limitados a {{max_requests_per_user_per_day}} pedidos em um período de 24 horas. Você poderá fazer outro pedido em {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4511,6 +4587,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/ro_RO/app.po b/locale/ro_RO/app.po index 643680e54e..2334cb923d 100644 --- a/locale/ro_RO/app.po +++ b/locale/ro_RO/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Andra Ciuraru , 2016 # Andrei Cristian Petcu , 2012-2013 # Andrei Cristian Petcu , 2012-2013 @@ -60,7 +61,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Vitalie Zama , 2016\n" "Language-Team: Romanian (Romania) (http://app.transifex.com/mysociety/alavetel" @@ -501,6 +502,9 @@ msgstr "Toate opţiunile de mai jos pot utiliza varietatea sa msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "Cei mai buni jucători" @@ -667,6 +671,9 @@ msgstr "Blocat pe acest site" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "Grup de solicitări create de {{info_request_user}} la data de {{date}}." +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Începând cu" @@ -730,6 +737,9 @@ msgstr "Anulaţi niste alerte {{site_name}} " msgid "Cancel, return to your profile page" msgstr "Anulează şi revino la pagina ta de profil" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Modificaţi emailul pe {{site_name}}" @@ -998,6 +1008,9 @@ msgstr "Făcut >>" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Descărcaţi un fisier .zip cu toată corespondenţa" @@ -1071,6 +1084,9 @@ msgstr "Istoric evenimente" msgid "Every citizen has the right to access information held by public authorities." msgstr "Fiecare cetățean are dreptul să acceseze informațiile deținute de instituțiile publice." +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Tot ce introduci pe această pagină, inclusiv numele tău, \n" @@ -1649,6 +1665,9 @@ msgstr "Ultima cerere vizionată {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Învață mai multe →" @@ -2338,6 +2357,9 @@ msgstr "" msgid "Rejected" msgstr "Respins" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Ține-mă minte (te menține autentificate o perioadă mai lungă; nu folosi pe un computer public)" @@ -2527,6 +2549,9 @@ msgstr "Caută contribuţia ta" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Trimiteţi o urmărire" @@ -2563,6 +2588,30 @@ msgstr "Trimite un mesaj către {{user_name}} doar să vedeţi cum funcţioneaz msgid "Sending..." msgstr "Se trimite..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Trimis către o instituție publică de utilizatorul {{info_request_user}} la data {{date}}." @@ -2629,6 +2678,9 @@ msgstr "Ieşire din cont" msgid "Sign up" msgstr "Înscriere " +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2688,6 +2740,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3115,9 +3170,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Există o limită a numărului de cereri pe care le puteţi face într-o zi, deoarece nu dorim ca autorităţile publice să fie bombardate cu un mare număr de cereri inadecvate. Dacă consideraţi că aveţi un motiv întemeiat pentru a cere mărirea acestei limite, vă rugăm contactaţi." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Încă nu este nimic de afișat." @@ -3347,6 +3408,9 @@ msgstr "" "viteza cu care autorităţile răspund la solicitări, la numărul de solicitări\n" "care au nevoie de un răspuns scris şi multe altele." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3479,9 +3543,15 @@ msgstr "Azi" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Prea multe cereri" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Topul utilizatorilor." @@ -3850,6 +3920,9 @@ msgstr "Scrie un mesaj ulterior instituției {{authority_name}}" msgid "Write your request in simple, precise language." msgstr "Formulează solicitarea ta într-un limbaj precis, simplu." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3979,6 +4052,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Aţi atins limita maximă pentru cereri. Utilizatorii sunt de obicei limitaţi la {{max_requests_per_user_per_day}} cereri într-un interval de 24 de ore. Veţi putea face o nouă cerere în {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4634,6 +4710,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/rw/app.po b/locale/rw/app.po index 70c142f126..7cc01ea7bc 100644 --- a/locale/rw/app.po +++ b/locale/rw/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Clarisse Umutesi Mwitegereze , 2014-2015 # Gareth Rees , 2015 # Graeme Porteous , 2020 @@ -44,7 +45,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Stephen Abbott Pugh , 2015\n" "Language-Team: Kinyarwanda (http://app.transifex.com/mysociety/alaveteli/langu" @@ -491,6 +492,9 @@ msgstr "Amahitamo yose akurikira ashobora gukoreshwaho impindukayour name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Ibintu byose ushyira kuri uru rubuga, harimo amazina yawe,\n" @@ -1638,6 +1654,9 @@ msgstr "Ikibazo giheruka kurebwa: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Menya byinshi →" @@ -2327,6 +2346,9 @@ msgstr "" msgid "Rejected" msgstr "Cyanzwe" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Munyibuke (ituma ukomeza kuba ku murongo igihe kirekire; ntuyikoreshe kuri mudasobwa rusange)" @@ -2516,6 +2538,9 @@ msgstr "Shaka inyunganizi zawe" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Ohereza ubutumwa bwo gurikirana" @@ -2552,6 +2577,30 @@ msgstr "Oherereza ubutumwa {{user_name}} kureba gusa uko ikora " msgid "Sending..." msgstr "Inyandiko irikugenda…" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Byohererejwe umuyobozi na {{info_request_user}} kuwa {{date}}." @@ -2617,6 +2666,9 @@ msgstr "Sohoka" msgid "Sign up" msgstr "Funguza" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2677,6 +2729,9 @@ msgstr "Mutwihanganire ntidushoboye kongeraho ubusobanuro.Muze kongere mu gihe k msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "Mwihangane,ntabow dushoboye kohereza ikibazo cyanyu.Muze kongera mu gihe kiri imbere." @@ -3110,9 +3165,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Hari umubare ntarengwa w'ibibazo ushobora kubaza ku munsi, kuberako tutifuza ko abayobozi babazwa ibibazo byinshi bidakwiye. Niba wumva ifite impamvu ifatika yatuma usaba guhabwa umubare w'ibibazo birenze, ushobora kutwandikira." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Nta kintu cyo kugaragaza kiraboneka." @@ -3341,6 +3402,9 @@ msgstr "" "gihe abayobozi bafata mu gusubiza ibibazo, umubare w'ibibazo\n" "bisubizwa hakoreshejwe iposita n'ibindi byinshi." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3475,9 +3539,15 @@ msgstr "Uyu munsi" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Ibibazo byinshi cyane" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Abakinyi bitwaye neze mu buryo buhambaye" @@ -3844,6 +3914,9 @@ msgstr "Andika ubutumwa bukurikirana ibyo wasabye kuri {{authority_name}}" msgid "Write your request in simple, precise language." msgstr "Andika ikibazo cyawe mu magambo yoroshye kandi urasa ku ntego." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3973,6 +4046,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Wagejeje umubare w'ibibazo ntarengwa. Abakoresha uru rubuga basanzwe bemerewe ibibazo {{max_requests_per_user_per_day}} mu gihe cy'amasaha 24. Ushobora kubaza ikindi kibazo mu {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4623,6 +4699,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} ibyasabwe" diff --git a/locale/se/app.po b/locale/se/app.po index 5f6a049876..b2d1782b0a 100644 --- a/locale/se/app.po +++ b/locale/se/app.po @@ -31,11 +31,12 @@ # Translators: # Translators: # Translators: +# Translators: msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Graeme Porteous \n" "Language-Team: Northern Sami (http://app.transifex.com/mysociety/alaveteli/lan" @@ -436,6 +437,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -598,6 +602,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -661,6 +668,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -925,6 +935,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -994,6 +1007,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1521,6 +1537,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2195,6 +2214,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2381,6 +2403,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2417,6 +2442,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2482,6 +2531,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2536,6 +2588,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2953,9 +3008,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3176,6 +3237,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3302,9 +3366,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3651,6 +3721,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3780,6 +3853,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4400,6 +4476,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/si/app.po b/locale/si/app.po index 4666056385..76022a6555 100644 --- a/locale/si/app.po +++ b/locale/si/app.po @@ -31,11 +31,12 @@ # Translators: # Translators: # Translators: +# Translators: msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Graeme Porteous \n" "Language-Team: Sinhala (http://app.transifex.com/mysociety/alaveteli/language/" @@ -436,6 +437,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -598,6 +602,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -661,6 +668,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -925,6 +935,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -994,6 +1007,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1521,6 +1537,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2195,6 +2214,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2381,6 +2403,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2417,6 +2442,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2482,6 +2531,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2536,6 +2588,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2953,9 +3008,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3176,6 +3237,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3302,9 +3366,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3651,6 +3721,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3780,6 +3853,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4400,6 +4476,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/sk/app.po b/locale/sk/app.po index 6ba0834140..8faccf37e7 100644 --- a/locale/sk/app.po +++ b/locale/sk/app.po @@ -31,11 +31,12 @@ # Translators: # Translators: # Translators: +# Translators: msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Graeme Porteous \n" "Language-Team: Slovak (http://app.transifex.com/mysociety/alaveteli/language/s" @@ -437,6 +438,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -599,6 +603,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -662,6 +669,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -926,6 +936,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -995,6 +1008,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1522,6 +1538,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2196,6 +2215,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2382,6 +2404,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2418,6 +2443,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2483,6 +2532,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2537,6 +2589,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2954,9 +3009,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3177,6 +3238,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3303,9 +3367,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3652,6 +3722,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3781,6 +3854,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4401,6 +4477,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/sl/app.po b/locale/sl/app.po index c732b21090..3fea9a9725 100644 --- a/locale/sl/app.po +++ b/locale/sl/app.po @@ -31,9 +31,11 @@ # Translators: # Translators: # Translators: +# Translators: # Ana Šemerl Harmel, 2022 # Ana Šemerl Harmel, 2022 # Jernej Trebežnik, 2023 +# Jernej Trebežnik, 2023 # Liz Conlan , 2018 # louisecrow , 2014 # louisecrow , 2014 @@ -47,9 +49,9 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" -"Last-Translator: Jernej Trebežnik, 2023\n" +"Last-Translator: zejn , 2013\n" "Language-Team: Slovenian (http://app.transifex.com/mysociety/alaveteli/languag" "e/sl/)\n" "MIME-Version: 1.0\n" @@ -473,6 +475,9 @@ msgstr "Pri vseh izbirah spodaj lahko uporabite variety ali your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "Vse kar vpisujete na tej strani, vključno z vašim imenom, bo za vedno javno objavljeno na tej strani (zakaj?)." @@ -1599,6 +1616,9 @@ msgstr "Zadnji pregledani zahtevek: {{request_url}}" msgid "Latest" msgstr "Najnovejše" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Več informacij →" @@ -2285,6 +2305,9 @@ msgstr "Predpisi" msgid "Rejected" msgstr "Zavrnjeno" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Zapomni si me ( dlje časa boste ostali prijavljeni; ne uporabljajte v javno dostopnem računalniku)" @@ -2474,6 +2497,9 @@ msgstr "Iščite po vaših prispevkih" msgid "Section" msgstr "Oddelek" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Pošljite odziv" @@ -2510,6 +2536,30 @@ msgstr "Pošlji sporočilo {{user_name}}, da vidite kako deluje" msgid "Sending..." msgstr "Pošiljanje..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Poslal na en organ {{info_request_user}} v {{date}}." @@ -2577,6 +2627,9 @@ msgstr "Odjava" msgid "Sign up" msgstr "Nov račun" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "Prijave iz Tor so blokirane zaradi obsežne zlorabe. Prosimo, stopite v stik z nami, če je to za vas težava." @@ -2637,6 +2690,9 @@ msgstr "Oprostite, trenutno ne moremo dodati vašega zaznamka. Prosimo poskusite msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "Oprostite, trenutno ne moremo ustvariti vašega uporabniškega računa. Prosimo poskusite ponovno kasneje." +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "Oprostite, vaše zahteve trenutno ne moremo poslati. Prosimo poskusite ponovno kasneje." @@ -3059,9 +3115,15 @@ msgstr "Obstaja več kot ena oseba ki uporablja to stran in i msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Število pripisov, ki jih lahko naredite v enem dnevu je omejeno, ker ne želimo, da bi bilo spletno mesto bombardirano z velikim številom neprimernih pripisov. Če menite, da imate upravičen razlog za dvig te omejitve nas kontaktirajte " +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Obstaja omejitev na število dnevnih zahtevkov, ki jih lahko naredite, ker ne želimo javnih organov zasuti z veliko količino zahtevkov z neprimernimi zahtevami. Če se vam zdi, da imate upravičen razlog za dvig omejitve, nas kontaktirajte." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Ni ničesar za prikazati." @@ -3286,6 +3348,9 @@ msgstr "Ta stran s statistikami o javnih organih je trenutno v preizkusni fazi, msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "Ta tabela prikazuje tehnične podrobnosti internih dogodkov, ki so se dogajali na tem zahtevku na {{site_name}}. To lahko uporabite, da zgenerirate informacije o odzivnosti oz. hitrosti, s katero organi odgovarjajo na zahteve, število zahtev ki zahtevajo poštno pošiljanje in še mnogo več." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "Uporabnik je bil izključen iz {{site_name}} " @@ -3414,9 +3479,15 @@ msgstr "Danes" msgid "Too many annotations" msgstr "Preveč opomb" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Preveč zahtevkov" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Najboljši nedavni prosilci" @@ -3769,6 +3840,9 @@ msgstr "Napišite nadaljnje sporočilo za dostop do informacij javnega značaja msgid "Write your request in simple, precise language." msgstr "Zapišite vaš zahtevek v enostavnem in nedvoumnem jeziku." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "Da" @@ -3907,6 +3981,9 @@ msgstr "Dosegli ste limit komentarjev. Uporabniki so ponavadi omejeni na {{comme msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Prišli ste do omejitve števila novih zahtevkov. Uporabniki so običajno omejeni na {{max_requests_per_user_per_day}} na 24 urno obdobje. Nov zahtevek boste lahko naredili v {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "Zapustili ste projekt." @@ -4563,6 +4640,11 @@ msgstr[1] "{{number_of_comments}} komentarjev" msgstr[2] "{{number_of_comments}} komentarjev" msgstr[3] "{{number_of_comments}} komentarjev" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} zahteva" diff --git a/locale/sq/app.po b/locale/sq/app.po index aac84b18dd..28b028c912 100644 --- a/locale/sq/app.po +++ b/locale/sq/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # arianit , 2022 # arianit , 2012 # arianit , 2012,2022 @@ -50,7 +51,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Valon , 2011\n" "Language-Team: Albanian (http://app.transifex.com/mysociety/alaveteli/language" @@ -482,6 +483,9 @@ msgstr "Te gjitha opsionet si me poshte mund te perdorin varietyyour name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Çdo gjë që ke shkruar në këtë faqe, përfshi edhe emrin tënd, \n" @@ -1584,6 +1600,9 @@ msgstr "Kerkesa e fundit e pare: {{request_url}}" msgid "Latest" msgstr "Më të fundit" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Meso me teper →" @@ -2265,6 +2284,9 @@ msgstr "Rregullorja" msgid "Rejected" msgstr "Refuzuar" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Më kutjo mua (të mban signed in më gjatë; mos e përdorni në kompjutera publik)" @@ -2454,6 +2476,9 @@ msgstr "Kërko kontributet e tua" msgid "Section" msgstr "Seksioni" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Dërgo mesazh vijues" @@ -2490,6 +2515,30 @@ msgstr "Dërgo mesazh tek {{user_name}} vetëm për të parë se si funksionon" msgid "Sending..." msgstr "Duke derguar..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Derguar tek nje institucion nga {{info_request_user}} me {{date}}." @@ -2555,6 +2604,9 @@ msgstr "Ç'kyçu" msgid "Sign up" msgstr "Regjistrohu" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "Regjistrimet nga Tor janë bllokuar për shkak të keqpërdorimit të gjerë. Ju lutemi na kontaktoni nëse ky është një problem për ju." @@ -2611,6 +2663,9 @@ msgstr "Na vjen keq që për momentin nuk mund të shtojmë shënimin. Provoni p msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "Na vjen keq, për momentin nuk jemi të gjendje të krijojmë llogarinë tuaj. Provo më vonë." +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "Na vjen keq, për momentin nuk mund të dërgojmë kërkesën. Provo prap më vonë." @@ -3036,9 +3091,15 @@ msgstr "Ka më shumë se një person që përdor këtë faqe dhe ka këtë emër msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Ekziston një kufi në numrin e shënimeve që mund të bëni brenda një dite, sepse ne nuk duam që faqja të bombardohet me një numër të madh shënimesh të papërshtatshme. Nëse mendoni se keni një arsye të mirë për të kërkuar heqjen e kufirit në rastin tuaj, ju lutemi na kontaktoni." +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Ka nje kufi lidhur me numrin e kerkesave qe mund te dergoni ne nje dite, sepse nuk duam qe institucionet publike te bombardohen me nje numer te madh kerkesash te papershtatshme. Nese ju mnedoni se keni asye te forta per te kerkuar anullimin e kufirit per rastin tuaj, ju lutem na kontaktoni." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Nuk ka ende asgje per t'u shfaqur" @@ -3264,6 +3325,9 @@ msgstr "" "shpejtësisë me të cilën institucionet i përgjigjen kërkesave, numrit të kërkesave\n" "që kërkojne përgjigje postale dhe gjëra të tjera." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "Ky përdorues është pezulluar nga {{site_name}} " @@ -3392,9 +3456,15 @@ msgstr "Sot" msgid "Too many annotations" msgstr "Shumë shënime" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Shumë kërkesa" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Top lojtarë e rishtëm" @@ -3747,6 +3817,9 @@ msgstr "Shkruaj mesazhin tënd pasues QDP te {{authority_name}}" msgid "Write your request in simple, precise language." msgstr "Shkruaje kërkesën tënde me gjuhë të thjeshtë, dhe të saktë." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "Po" @@ -3878,6 +3951,9 @@ msgstr "Keni arritur kufirin e tarifës për shënimet. Përdoruesit zakonisht k msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Keni mberritur ne kufirin e kerkesave te reja. Perdoruesit zakonisht jane te kufizuar ne dergimin e {{max_requests_per_user_per_day}} kerkesave per nje periudhe 24 oreshe. Ju do keni mundesi te beni nje kerkese tjeter ne{{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "Keni lënë projektin." @@ -4514,6 +4590,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "{{number_of_comments}} koment" msgstr[1] "{{number_of_comments}} komente" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} kërkesë" diff --git a/locale/sr/app.po b/locale/sr/app.po index a9290ce0e9..4e5df020e8 100644 --- a/locale/sr/app.po +++ b/locale/sr/app.po @@ -31,11 +31,12 @@ # Translators: # Translators: # Translators: +# Translators: msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Graeme Porteous \n" "Language-Team: Serbian (http://app.transifex.com/mysociety/alaveteli/language/" @@ -437,6 +438,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -599,6 +603,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -662,6 +669,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -926,6 +936,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -995,6 +1008,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1522,6 +1538,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2196,6 +2215,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2382,6 +2404,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2418,6 +2443,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2483,6 +2532,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2537,6 +2589,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2954,9 +3009,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3177,6 +3238,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3303,9 +3367,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3652,6 +3722,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3781,6 +3854,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4401,6 +4477,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/sr@latin/app.po b/locale/sr@latin/app.po index 8d542df7df..d595f5cf1c 100644 --- a/locale/sr@latin/app.po +++ b/locale/sr@latin/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Aleksandar Krstić , 2015 # Goran Rakic , 2013 # Goran Vučković , 2013 @@ -47,7 +48,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Goran Vučković , 2013\n" "Language-Team: Serbian (Latin) (http://app.transifex.com/mysociety/alaveteli/l" @@ -495,6 +496,9 @@ msgstr "Sve opcije ispod mogu da koriste variety ili la msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -663,6 +667,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Počevši sa" @@ -726,6 +733,9 @@ msgstr "Otkaži neka {{site_name}} upozorenja" msgid "Cancel, return to your profile page" msgstr "Otkaži i vrati se na stranicu sa profilom korisnika" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Promenite e-mail adresu na {{site_name}}" @@ -994,6 +1004,9 @@ msgstr "Urađeno >>" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Preuzmite svu korespondenciju u zip fajlu" @@ -1067,6 +1080,9 @@ msgstr "Istorija promena" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Sve što unesete na ovu stranicu, uključujući i Vaše ime, \n" @@ -1640,6 +1656,9 @@ msgstr "Poslednji pregledani zahtev: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2329,6 +2348,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2518,6 +2540,9 @@ msgstr "Tražite Vaše doprinose" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Pošaljite reakciju" @@ -2554,6 +2579,30 @@ msgstr "Pošalji poruku za {{user_name}} samo da vidite kako radi" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2619,6 +2668,9 @@ msgstr "Odjavite se" msgid "Sign up" msgstr "Registrujte se" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2679,6 +2731,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3113,9 +3168,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Postoji ograničenje broja zahteva koje možete podneti u jednom danu, pošto želimo da izbegnemo da javne ustanove budu bombardovane velikim brojem neprikladnih zahteva. Ako mislite da u Vašem slučaju ovo ograničenje treba ukloniti, molimo da nam se javite." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3345,6 +3406,9 @@ msgstr "" "brzine kojom ustanove odgovaraju na zahteve, broja zahteva\n" "koji zahtevaju poštanski odgovor - i mnogo drugih namena." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3477,9 +3541,15 @@ msgstr "Danas" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Previše zahteva" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3847,6 +3917,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "Pišite Vaš zahtev jednostavnim, preciznim jezikom." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3976,6 +4049,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Dostigli ste limit broja unetih zahteva dnevno. Uobičajeni limit za korisnike sistema je {{max_requests_per_user_per_day}} podnetih zahteva u periodu od 24h. Novi zahtev ćete moći podneti {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4628,6 +4704,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/sv/app.po b/locale/sv/app.po index bfa2b190fd..397d901fca 100644 --- a/locale/sv/app.po +++ b/locale/sv/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # 03992e16f8df6e39b9d1cc0ff635887e, 2016 # Elenor Weijmar, 2018 # Elenor Weijmar, 2018-2022 @@ -54,7 +55,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Mattias Axell , 2015,2019-2022\n" "Language-Team: Swedish (http://app.transifex.com/mysociety/alaveteli/language/" @@ -474,6 +475,9 @@ msgstr "Alla alternativen nedan kan använda variety eller your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "Allt som du anger på denna sida, inklusive ditt namn, kommer att visas offentligt på denna hemsida för evigt" @@ -1563,6 +1579,9 @@ msgstr "Senast visade begäran: {{request_url}}" msgid "Latest" msgstr "Senaste" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Lär dig mer →" @@ -2240,6 +2259,9 @@ msgstr "Reglering" msgid "Rejected" msgstr "Nekad" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Kom ihåg mig (håller dig inloggad längre; använd inte i en publik dator i offentlig miljö)" @@ -2426,6 +2448,9 @@ msgstr "Sök dina bidrag" msgid "Section" msgstr "Sektion" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Skicka en uppföljning" @@ -2462,6 +2487,30 @@ msgstr "Skicka meddelande till {{user_name}} bara för att se hur det fungerar" msgid "Sending..." msgstr "Skickar..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "Skickat till en myndighet av {{info_request_user}} den {{date}}." @@ -2527,6 +2576,9 @@ msgstr "Logga ut" msgid "Sign up" msgstr "Registrera dig" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "Registreringar från Tor har blockerats på grund av extensiva missbruk. Vänligen kontakta oss anonymt om detta är ett problem för dig." @@ -2581,6 +2633,9 @@ msgstr "Ursäkta, vi kan för närvarande inte lägga till din anteckning. Vänl msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "Förlåt, vi kan för närvarande inte skapa ditt konto. Vänligen försök igen senare." +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "Ursäkta, vi kan för närvarande inte skicka din begäran. Vänligen försök igen senare." @@ -2998,9 +3053,15 @@ msgstr "Det finns fler än en person som använder denna sida o msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Det finns en gräns för antalet kommentarer du kan göra på en dag. Om du känner att du har en bra anledning att begära att gränsen hävs i ditt fall, vänligen hör av dig." +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Det finns en gräns för antalet förfrågningar som du kan göra på en dag. Detta eftersom myndigheterna inte ska överbelastas med för stort antal förfrågningar. Om du har en bra anledning att få begränsningen borttagen i ditt fall, vänligen ta kontakt med oss." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Det finns inget att visa än." @@ -3221,6 +3282,9 @@ msgstr "Denna sida för statistik om förfrågningar och myndigheter på Handlin msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "Denna tabell visar de tekniska detaljerna av de interna händelser som hänt denna begäran på {{site_name}}. Detta kan användas för att generera information om den hastighet myndigheter har för att svara på förfrågningar, antalet förfrågningar som kräver ett postsvar och mycket mer." +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "Denna användare har blivit avstängd från {{site_name}} " @@ -3347,9 +3411,15 @@ msgstr "Idag" msgid "Too many annotations" msgstr "För många kommentarer" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "För många förfrågningar" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "Nyligen hjälpsamma användare" @@ -3696,6 +3766,9 @@ msgstr "Skriv ditt uppföljningssvar angående begäran om allmän handling till msgid "Write your request in simple, precise language." msgstr "Skriv din begäran i enkelt, tydligt språk." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "Ja" @@ -3825,6 +3898,9 @@ msgstr "Du har nått gränsen för anteckningar/kommentarer. Användare är vanl msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Du har nått gränsen för att göra nya förfrågningar. Användare är vanligtvis begränsade till {{max_requests_per_user_per_day}} förfrågningar under en 24-timmarsperiod. Du kommer att kunna göra förfrågningar igen om {{can_make_another_request}}." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "Du har lämnat projektet." @@ -4455,6 +4531,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "{{number_of_comments}} kommentar" msgstr[1] "{{number_of_comments}} kommentarer" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} begäran" diff --git a/locale/sw_KE/app.po b/locale/sw_KE/app.po index 61d4551c1c..317750236b 100644 --- a/locale/sw_KE/app.po +++ b/locale/sw_KE/app.po @@ -31,11 +31,12 @@ # Translators: # Translators: # Translators: +# Translators: msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Graeme Porteous \n" "Language-Team: Swahili (Kenya) (http://app.transifex.com/mysociety/alaveteli/l" @@ -436,6 +437,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -598,6 +602,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -661,6 +668,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -925,6 +935,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -994,6 +1007,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1521,6 +1537,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2195,6 +2214,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2381,6 +2403,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2417,6 +2442,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2482,6 +2531,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2536,6 +2588,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2953,9 +3008,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3176,6 +3237,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3302,9 +3366,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3651,6 +3721,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3780,6 +3853,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4400,6 +4476,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/tr/app.po b/locale/tr/app.po index 5ad6032425..c400b1651d 100644 --- a/locale/tr/app.po +++ b/locale/tr/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Baran Ozgul , 2012 # Baran Ozgul , 2012 # Baran Ozgul , 2012 @@ -45,7 +46,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Senol Kaya , 2018\n" "Language-Team: Turkish (http://app.transifex.com/mysociety/alaveteli/language/" @@ -477,6 +478,9 @@ msgstr "Aşağıdaki tüm seçenekler iki nokta üst üste işaretinden önce your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "Bu sayfada adınız dahil girdiğiniz her türlü bilgi sonsuza kadar bu web sitesindehalka açık şekilde görünür olacaktır. " @@ -1585,6 +1601,9 @@ msgstr "Görüntülenen en son başvuru: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "Daha fazla bilgi →" @@ -2261,6 +2280,9 @@ msgstr "" msgid "Rejected" msgstr "Reddedildi" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Beni hatırla (siteye giriş yaptıktan sonra, daha uzun süre kalmanızı sağlar. Halka açık bir bilgisayarda kullanmayın)" @@ -2452,6 +2474,9 @@ msgstr "Kendi katkılarınızı arayın" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Bir takip iletisi gönderin" @@ -2488,6 +2513,30 @@ msgstr "Şu adrese mesaj gönder {{user_name}} nasıl çalıştığını bir gö msgid "Sending..." msgstr "Gönderiliyor..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "{{info_request_user}} tarafından {{date}} tarihinde {{authority_count}} kuruluşa gönderildi" @@ -2553,6 +2602,9 @@ msgstr "Hesabınızdan çıkış yapın" msgid "Sign up" msgstr "Hesap oluşturun" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2611,6 +2663,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3032,9 +3087,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Bir gün içinde yapabileceğiniz bilgi edinme başvurusu sınırlıdır çünkü kamu kurum ve kuruluşlarının çok sayıda gönderilmiş uygunsuz başvuruyla bir mesaj bombardmanına maruz kalmasını istemiyoruz. Eğer sizin durumunuzda bu sınırın kaldırılması için iyi bir neden olduğunu düşünüyorsanız lütfen bizimle iletişime geçin." +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "Henüz gösterilecek bir şey yok. " @@ -3260,6 +3321,9 @@ msgstr "" " {{site_name}} sitesinde bu başvuruyla ilgili site içinde gerçekleşmiş adımların teknik detaylarını görebilirsiniz. Bu tablo, kamu kuruluşlarının başvurulara cevap verme hızı\n" ", postayla cevap verilmesi gereken başvuru sayısı ve birçok başka konuda bilgi üretmek için kullanılabilir. " +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3396,9 +3460,15 @@ msgstr "Bugün" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Çok fazla sayıda başvuru" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3755,6 +3825,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "Başvurunuzu sade, net bir dille yazın." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3884,6 +3957,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Yeni başvurulara uygulanan sınıra eriştiniz. Kullancılar normal koşullarda 24 saatlik bir süre zarfında en çok {{max_requests_per_user_per_day}} başvuru yapabilir. {{can_make_another_request}} sonra yeni bir başvuru yapabilirsiniz. " +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4522,6 +4598,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/tr_TR/app.po b/locale/tr_TR/app.po index a7d2b4bdb6..766f786bca 100644 --- a/locale/tr_TR/app.po +++ b/locale/tr_TR/app.po @@ -31,12 +31,13 @@ # Translators: # Translators: # Translators: +# Translators: # Senol Kaya , 2018 msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Senol Kaya , 2018\n" "Language-Team: Turkish (Turkey) (http://app.transifex.com/mysociety/alaveteli/" @@ -469,6 +470,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -631,6 +635,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -694,6 +701,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -958,6 +968,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -1027,6 +1040,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1554,6 +1570,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2228,6 +2247,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2414,6 +2436,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2450,6 +2475,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2515,6 +2564,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2569,6 +2621,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2986,9 +3041,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3209,6 +3270,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3335,9 +3399,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3684,6 +3754,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3813,6 +3886,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4433,6 +4509,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/uk/app.po b/locale/uk/app.po index b1ad59a63e..893b2120a8 100644 --- a/locale/uk/app.po +++ b/locale/uk/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Ferents , 2013 # Ferents , 2013 # Gareth Rees , 2017 @@ -46,7 +47,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Natalie Hiirulainen , 2012,2014,2016-2019" ",2021\n" @@ -480,6 +481,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -644,6 +648,9 @@ msgstr "Забанено" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "Група запитів створена користувачем {{info_request_user}} {{date}}" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "Ті, що починаються з" @@ -707,6 +714,9 @@ msgstr "Скасувати деякі повідомлення сайту" msgid "Cancel, return to your profile page" msgstr "Скасувати, повернутися на сторінку профілю" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "Змінити електронну адресу на сайті" @@ -975,6 +985,9 @@ msgstr "Зроблено " msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "Завантажити zip-архів усієї переписки" @@ -1048,6 +1061,9 @@ msgstr "Історія" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" "Усе, що ви введете на цій сторінці (включно з вашим іменем), \n" @@ -1614,6 +1630,9 @@ msgstr "Останній переглянутий запит: {{request_url}}" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2297,6 +2316,9 @@ msgstr "" msgid "Rejected" msgstr "Відхилено" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "Запам’ятати мене" @@ -2485,6 +2507,9 @@ msgstr "Пошук у вашій активності на сайті" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "Надішліть додатковий запит" @@ -2521,6 +2546,30 @@ msgstr "Надіслати повідомлення до {{user_name}} прос msgid "Sending..." msgstr "Надислаю..." +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2586,6 +2635,9 @@ msgstr "Вийти" msgid "Sign up" msgstr "Зареєструватися" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2640,6 +2692,9 @@ msgstr "Вибачте, зараз ми не можемо додати ваш к msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -3059,9 +3114,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "Ми встановили обмеження на кількість запитів, які можна відправитипротягом одного дня. Ви можете попросити про зняття цього обмеження, написавши нам. Ваше прохання має бути обґрунтованим" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3290,6 +3351,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3418,9 +3482,15 @@ msgstr "Сьогодні" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "Забагато запитів" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3781,6 +3851,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "Використовуйте в запиті просту, зрозумілу мову." +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3910,6 +3983,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "Ви перевищили кількість дозволених запитів. Користувачі не можуть надсилати більш ніж{{max_requests_per_user_per_day}} запитів протягом 24 годин." +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4567,6 +4643,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}} запит" diff --git a/locale/vi/app.po b/locale/vi/app.po index 32b0c17bc0..04d91a44e1 100644 --- a/locale/vi/app.po +++ b/locale/vi/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # Anh Phan , 2013 # Anh Phan , 2013 # Anh Phan , 2013 @@ -40,7 +41,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Anh Phan , 2013\n" "Language-Team: Vietnamese (http://app.transifex.com/mysociety/alaveteli/langua" @@ -441,6 +442,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -603,6 +607,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -666,6 +673,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -930,6 +940,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -999,6 +1012,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1526,6 +1542,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2200,6 +2219,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2386,6 +2408,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2422,6 +2447,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2487,6 +2536,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2541,6 +2593,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2958,9 +3013,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3181,6 +3242,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3309,9 +3373,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3658,6 +3728,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3787,6 +3860,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4407,6 +4483,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/yue/app.po b/locale/yue/app.po index a60183730b..d4105ee8b3 100644 --- a/locale/yue/app.po +++ b/locale/yue/app.po @@ -31,11 +31,12 @@ # Translators: # Translators: # Translators: +# Translators: msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Graeme Porteous \n" "Language-Team: Cantonese (http://app.transifex.com/mysociety/alaveteli/languag" @@ -436,6 +437,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -598,6 +602,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -661,6 +668,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -925,6 +935,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -994,6 +1007,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1521,6 +1537,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2195,6 +2214,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2381,6 +2403,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2417,6 +2442,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2482,6 +2531,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2536,6 +2588,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2953,9 +3008,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3176,6 +3237,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3302,9 +3366,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3651,6 +3721,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3780,6 +3853,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4400,6 +4476,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/zh_CN/app.po b/locale/zh_CN/app.po index f037af0802..32eb98a0d5 100644 --- a/locale/zh_CN/app.po +++ b/locale/zh_CN/app.po @@ -31,11 +31,12 @@ # Translators: # Translators: # Translators: +# Translators: msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Graeme Porteous \n" "Language-Team: Chinese (China) (http://app.transifex.com/mysociety/alaveteli/l" @@ -436,6 +437,9 @@ msgstr "" msgid "All time" msgstr "" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "" @@ -598,6 +602,9 @@ msgstr "" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "" @@ -661,6 +668,9 @@ msgstr "" msgid "Cancel, return to your profile page" msgstr "" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "" @@ -925,6 +935,9 @@ msgstr "" msgid "Download Data" msgstr "" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "" @@ -994,6 +1007,9 @@ msgstr "" msgid "Every citizen has the right to access information held by public authorities." msgstr "" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "" @@ -1521,6 +1537,9 @@ msgstr "" msgid "Latest" msgstr "" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "" @@ -2195,6 +2214,9 @@ msgstr "" msgid "Rejected" msgstr "" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "" @@ -2381,6 +2403,9 @@ msgstr "" msgid "Section" msgstr "" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "" @@ -2417,6 +2442,30 @@ msgstr "" msgid "Sending..." msgstr "" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "" @@ -2482,6 +2531,9 @@ msgstr "" msgid "Sign up" msgstr "" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2536,6 +2588,9 @@ msgstr "" msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "" @@ -2953,9 +3008,15 @@ msgstr "" msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "" @@ -3176,6 +3237,9 @@ msgstr "" msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "" @@ -3302,9 +3366,15 @@ msgstr "" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "" @@ -3651,6 +3721,9 @@ msgstr "" msgid "Write your request in simple, precise language." msgstr "" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "" @@ -3780,6 +3853,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "" @@ -4400,6 +4476,11 @@ msgid_plural "{{number_of_comments}} comments" msgstr[0] "" msgstr[1] "" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "" diff --git a/locale/zh_HK/app.po b/locale/zh_HK/app.po index 1385349dfc..ba7161085d 100644 --- a/locale/zh_HK/app.po +++ b/locale/zh_HK/app.po @@ -31,6 +31,7 @@ # Translators: # Translators: # Translators: +# Translators: # beckymak , 2015 # caxekis , 2013 # caxekis , 2013 @@ -51,7 +52,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2011-03-09 17:48+0000\n" "Last-Translator: Yan Hin So , 2020\n" "Language-Team: Chinese (Hong Kong) (http://app.transifex.com/mysociety/alavete" @@ -459,6 +460,9 @@ msgstr "以下所有選項可在冒號前用varietyl msgid "All time" msgstr "歷來" +msgid "All time best contributors" +msgstr "" + msgid "All time best players" msgstr "歷來最佳玩家" @@ -621,6 +625,9 @@ msgstr "禁止進入本網站" msgid "Batch created by {{info_request_user}} on {{date}}." msgstr "{{info_request_user}}於{{date}}建立本批量要求。" +msgid "Before you start" +msgstr "" + msgid "Beginning with" msgstr "開始" @@ -684,6 +691,9 @@ msgstr "取消{{site_name}}的一些提示" msgid "Cancel, return to your profile page" msgstr "取消並返回個人簡介" +msgid "Cannot send messages" +msgstr "" + msgid "Change email on {{site_name}}" msgstr "更換在{{site_name}}使用的電郵地址" @@ -948,6 +958,9 @@ msgstr "完成 >>" msgid "Download Data" msgstr "下載資料" +msgid "Download Leaderboard Data" +msgstr "" + msgid "Download a zip file of all correspondence" msgstr "下載含全部回覆的壓縮檔案" @@ -1017,6 +1030,9 @@ msgstr "過往活動" msgid "Every citizen has the right to access information held by public authorities." msgstr "每一位公民都有權向公共機構索取資料。" +msgid "Everything that you enter on this page, including your name ({{user_name}}), will be displayed publicly on this website forever" +msgstr "" + msgid "Everything that you enter on this page, including your name, will be displayed publicly on this website forever" msgstr "你在本頁輸入的所有資料(包括你的姓名),將會在本站永久公開顯示。" @@ -1540,6 +1556,9 @@ msgstr "最後已讀要求:{{request_url}}" msgid "Latest" msgstr "最新" +msgid "Latest news and campaigns" +msgstr "" + msgid "Learn more →" msgstr "了解更多 →" @@ -2213,6 +2232,9 @@ msgstr "規例" msgid "Rejected" msgstr "拒絕提供資料" +msgid "Related blog posts" +msgstr "" + msgid "Remember me (keeps you signed in longer; do not use on a public computer)" msgstr "記住我(延長保留你的登入狀態;不要在公共電腦上使用此功能)" @@ -2399,6 +2421,9 @@ msgstr "搜尋你提供的資料" msgid "Section" msgstr "部份" +msgid "See all →" +msgstr "" + msgid "Send a followup" msgstr "跟進要求" @@ -2435,6 +2460,30 @@ msgstr "向{{user_name}}發出訊息,以體驗通訊系統" msgid "Sending..." msgstr "傳送中……" +msgid "Sent a follow up to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_link}} again." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent a follow up to {{public_body_name}} again." +msgstr "" + +msgid "Sent request to {{public_body_link}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_link}} again." +msgstr "" + +msgid "Sent request to {{public_body_name}} again, using a new contact address." +msgstr "" + +msgid "Sent request to {{public_body_name}} again." +msgstr "" + msgid "Sent to one authority by {{info_request_user}} on {{date}}." msgid_plural "Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}." msgstr[0] "{{info_request_user}}於{{date}}發至{{authority_count}}個公共機構。" @@ -2499,6 +2548,9 @@ msgstr "登出" msgid "Sign up" msgstr "登記" +msgid "Signing your request" +msgstr "" + msgid "Signups from Tor have been blocked due to extensive misuse. Please contact us if this is a problem for you." msgstr "" @@ -2553,6 +2605,9 @@ msgstr "抱歉,我們現時無法加入你的備註,請稍後再作備註。 msgid "Sorry, we're currently unable to create your account. Please try again later." msgstr "" +msgid "Sorry, we're currently unable to send your message. Please try again later." +msgstr "" + msgid "Sorry, we're currently unable to send your request. Please try again later." msgstr "抱歉,我們現時無法寄出你的要求,請稍後再寄。" @@ -2970,9 +3025,15 @@ msgstr "有多過一個人利用此網站及擁有此名稱。 msgid "There is a limit on the number of annotations you can make in a day because we don’t want the site to be bombarded with large numbers of inappropriate annotations. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "" +msgid "There is a limit on the number of messages you can send in a day because we don’t want users to be bombarded with large numbers of inappropriate messages. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." +msgstr "" + msgid "There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please get in touch." msgstr "因為我們不希望公共機構收到過量不恰當的要求,所以你每天能夠提出的要求設有上限。如果你認為有足夠理由要求撤銷上限, 請聯絡我們。" +msgid "There is also a limit on the speed at which you are able to create annotations. Please try again later if you have not hit your daily limit." +msgstr "" + msgid "There is nothing to display yet." msgstr "暫未有內容顯示。" @@ -3191,6 +3252,9 @@ msgstr "目前仍在試驗這個在公共機構統計的部份,請用家謹記 msgid "This table shows the technical details of the internal events that happened to this request on {{site_name}}. This could be used to generate information about the speed with which authorities respond to requests, the number of requests which require a postal response and much more." msgstr "此列表顯示了些內部事件的技術細節,那些事件都曾出現於載列在{{site_name}}的本項要求。這些細節或用以了解公共機構的回應速度、需以郵寄方式回覆要求的數目等。" +msgid "This user does not accept user to user messages." +msgstr "" + msgid "This user has been suspended from {{site_name}} " msgstr "此用戶已被{{site_name}}封鎖。" @@ -3317,9 +3381,15 @@ msgstr "今天" msgid "Too many annotations" msgstr "" +msgid "Too many messages" +msgstr "" + msgid "Too many requests" msgstr "過多要求" +msgid "Top recent contributors" +msgstr "" + msgid "Top recent players" msgstr "近期的頂級玩家" @@ -3664,6 +3734,9 @@ msgstr "撰寫索取資料要求,並傳予{{authority_name}}" msgid "Write your request in simple, precise language." msgstr "請以顯淺易明的文字撰寫要求。" +msgid "Writing your request" +msgstr "" + msgid "Yes" msgstr "是" @@ -3790,6 +3863,9 @@ msgstr "" msgid "You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}." msgstr "你已達到發出新要求的上限。一般用戶只可在連續24小時內提出最多{{max_requests_per_user_per_day}}個請求。你可於{{can_make_another_request}}再提出請求。" +msgid "You have hit the rate limit on user messages. Users are ordinarily limited to {{message_limit}} messages per day." +msgstr "" + msgid "You have left the project." msgstr "你已離開項目。" @@ -4393,6 +4469,11 @@ msgid "{{number_of_comments}} comment" msgid_plural "{{number_of_comments}} comments" msgstr[0] "{{number_of_comments}}則評論" +msgid "{{number_of_contributions}} contribution" +msgid_plural "{{number_of_contributions}} contributions" +msgstr[0] "" +msgstr[1] "" + msgid "{{number_of_requests}} request" msgid_plural "{{number_of_requests}} requests" msgstr[0] "{{number_of_requests}}項要求" diff --git a/locale_alaveteli_pro/app.pot b/locale_alaveteli_pro/app.pot index 7aa3aec457..ed8ad754b4 100644 --- a/locale_alaveteli_pro/app.pot +++ b/locale_alaveteli_pro/app.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2017-01-20 17:40+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -436,6 +436,9 @@ msgstr "" msgid "Friendly support" msgstr "" +msgid "From" +msgstr "" + msgid "From this screen you can get a helpful overview of your requests, and use quick actions to keep them up to date. Why not start your first one now?" msgstr "" @@ -499,9 +502,6 @@ msgstr "" msgid "Important info about requests to this authority" msgstr "" -msgid "Introductory Pricing" -msgstr "" - msgid "Investigating asbestos use in schools" msgstr "" diff --git a/locale_alaveteli_pro/en/app.po b/locale_alaveteli_pro/en/app.po index b4e7bd1f09..d386eec5e9 100644 --- a/locale_alaveteli_pro/en/app.po +++ b/locale_alaveteli_pro/en/app.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: alaveteli\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 13:14+0000\n" +"POT-Creation-Date: 2023-04-20 14:26+0100\n" "PO-Revision-Date: 2017-01-20 17:40+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -436,6 +436,9 @@ msgstr "For journalists, academics and power users" msgid "Friendly support" msgstr "Friendly support" +msgid "From" +msgstr "" + msgid "From this screen you can get a helpful overview of your requests, and use quick actions to keep them up to date. Why not start your first one now?" msgstr "From this screen you can get a helpful overview of your requests, and use quick actions to keep them up to date. Why not start your first one now?" @@ -499,9 +502,6 @@ msgstr "Image credits:" msgid "Important info about requests to this authority" msgstr "Important info about requests to this authority" -msgid "Introductory Pricing" -msgstr "Introductory Pricing" - msgid "Investigating asbestos use in schools" msgstr "Investigating asbestos use in schools" From a9fd74b67734861c078582df2a2bedd64085c91d Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Fri, 28 Apr 2023 11:41:22 +0100 Subject: [PATCH 289/289] Bump Alaveteli to 0.43.0.0 --- config/initializers/alaveteli.rb | 2 +- doc/CHANGES.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/initializers/alaveteli.rb b/config/initializers/alaveteli.rb index 11dab0a91c..c2e41bd542 100644 --- a/config/initializers/alaveteli.rb +++ b/config/initializers/alaveteli.rb @@ -10,7 +10,7 @@ load "util.rb" # Application version -ALAVETELI_VERSION = '0.42.0.1' +ALAVETELI_VERSION = '0.43.0.0' # Add new inflection rules using the following format # (all these examples are active by default): diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 110f76542e..7e6d47193f 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -1,4 +1,4 @@ -# develop +# 0.43.0.0 ## Highlighted Features