From c094db90d7e770bd334b4e5472793a9584bedde3 Mon Sep 17 00:00:00 2001
From: Jambrose777
diff --git a/WcaOnRails/app/views/competitions_mailer/notify_wcat_of_confirmed_competition.html.erb b/WcaOnRails/app/views/competitions_mailer/notify_wcat_of_confirmed_competition.html.erb
index 9c71e82a3e1..2889ecb7806 100644
--- a/WcaOnRails/app/views/competitions_mailer/notify_wcat_of_confirmed_competition.html.erb
+++ b/WcaOnRails/app/views/competitions_mailer/notify_wcat_of_confirmed_competition.html.erb
@@ -68,6 +68,10 @@
<% if @competition.qualification_results? %>
The <%= "Delegate".pluralize(@competition.delegates.count) %> requested the adoption of qualification results because "<%= @competition.qualification_results_reason %>".
<% end %>
+
+ <% if @competition.event_restrictions? %>
+ The <%= "Delegate".pluralize(@competition.delegates.count) %> requested the adoption of event restrictions because "<%= @competition.event_restrictions_reason %>".
+ <% end %>
diff --git a/WcaOnRails/config/locales/en.yml b/WcaOnRails/config/locales/en.yml index 87e0b786633..0fb46a7f97d 100644 --- a/WcaOnRails/config/locales/en.yml +++ b/WcaOnRails/config/locales/en.yml @@ -299,6 +299,8 @@ en: early_puzzle_submission_reason: "Reason and details for submitting puzzles early" qualification_results: "I would like to use qualification results to limit who can compete in certain events" qualification_results_reason: "Reason and details for qualification results" + event_restrictions: "I would like to restrict competitors from registering for specific combinations of events" + event_restrictions_reason: "Reason and details for event restrictions" #context: a registration to a competition registration: guests: "Guests" @@ -499,6 +501,8 @@ en: early_puzzle_submission_reason: "Please elaborate here why you would like to require competitors to submit puzzles early. Please fill this out in English!" qualification_results: "" qualification_results_reason: "Please elaborate here why you would like to use qualification times. Please fill this out in English!" + event_restrictions: "" + event_restrictions_reason: "Please elaborate here why you would like to restrict certain event combinations. Please fill this out in English!" website_contact: inquiry: "" competition_id: "" diff --git a/WcaOnRails/db/migrate/20190816004605_add_event_restriction_columns_to_competitions.rb b/WcaOnRails/db/migrate/20190816004605_add_event_restriction_columns_to_competitions.rb new file mode 100644 index 00000000000..a8e929a5eec --- /dev/null +++ b/WcaOnRails/db/migrate/20190816004605_add_event_restriction_columns_to_competitions.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +class AddEventRestrictionColumnsToCompetitions < ActiveRecord::Migration[5.2] + def change + add_column :Competitions, :event_restrictions, :boolean, null: true, default: nil + add_column :Competitions, :event_restrictions_reason, :text, null: true, default: nil + end +end diff --git a/WcaOnRails/db/structure.sql b/WcaOnRails/db/structure.sql index a3518488659..86f24f3297d 100644 --- a/WcaOnRails/db/structure.sql +++ b/WcaOnRails/db/structure.sql @@ -67,6 +67,8 @@ CREATE TABLE `Competitions` ( `name_reason` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `external_registration_page` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `confirmed_at` datetime DEFAULT NULL, + `event_restrictions` tinyint(1) DEFAULT NULL, + `event_restrictions_reason` text COLLATE utf8mb4_unicode_ci, PRIMARY KEY (`id`), KEY `year_month_day` (`year`,`month`,`day`), KEY `index_Competitions_on_countryId` (`countryId`), @@ -1573,4 +1575,5 @@ INSERT INTO `schema_migrations` (version) VALUES ('20190716065618'), ('20190728084145'), ('20190814232833'), -('20190816001639'); +('20190816001639'), +('20190816004605'); diff --git a/WcaOnRails/lib/database_dumper.rb b/WcaOnRails/lib/database_dumper.rb index 9a0d7fa7bdf..775cdd74f7b 100644 --- a/WcaOnRails/lib/database_dumper.rb +++ b/WcaOnRails/lib/database_dumper.rb @@ -80,6 +80,8 @@ def self.actions_to_column_sanitizers(columns_by_action) early_puzzle_submission_reason qualification_results qualification_results_reason + event_restrictions + event_restrictions_reason ), db_default: %w( connected_stripe_account_id