diff --git a/app/controllers/manage/questionnaires_controller.rb b/app/controllers/manage/questionnaires_controller.rb index f10c75129..70873a9b8 100644 --- a/app/controllers/manage/questionnaires_controller.rb +++ b/app/controllers/manage/questionnaires_controller.rb @@ -1,7 +1,6 @@ class Manage::QuestionnairesController < Manage::ApplicationController include QuestionnairesControllable - before_action :ensure_registration_is_open, only: [:new, :create] before_action :set_questionnaire, only: [:show, :edit, :update, :destroy, :check_in, :convert_to_admin, :update_acc_status, :message_events] respond_to :html, :json @@ -170,11 +169,4 @@ def convert_boarded_bus_param(values, questionnaire = nil) def set_questionnaire @questionnaire = ::Questionnaire.find(params[:id]) end - - def ensure_registration_is_open - if HackathonConfig['disable_account_registration'] - flash[:alert] = "Registration has closed" - redirect_to root_path - end - end end diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index aa1766d7b..011211046 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -4,12 +4,7 @@ class Users::RegistrationsController < Devise::RegistrationsController # GET /resource/sign_up def new - if HackathonConfig['disable_account_registration'] - flash[:alert] = "Registration has closed" - redirect_to root_path - else - super - end + super end # POST /resource diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index 3faa5fc93..e0e19883e 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -4,11 +4,11 @@ Register for %span.emphasized= HackathonConfig['name'] - - if !HackathonConfig['registration_is_open'] || HackathonConfig['disclaimer_message'].present? + - if !HackathonConfig['accepting_questionnaires'] || HackathonConfig['disclaimer_message'].present? #disclaimer - - if !HackathonConfig['registration_is_open'] + - if !HackathonConfig['accepting_questionnaires'] .center - %strong Registration is now closed. Thanks to everyone who applied! + %strong We are no longer accepting applications. Thanks to everyone who applied! %br - if HackathonConfig['disclaimer_message'].present? = markdown(HackathonConfig['disclaimer_message']) diff --git a/app/views/questionnaires/show.html.haml b/app/views/questionnaires/show.html.haml index 057f4472f..3719d0d9e 100644 --- a/app/views/questionnaires/show.html.haml +++ b/app/views/questionnaires/show.html.haml @@ -27,7 +27,7 @@ %p.center = btn_link_to "RSVP NOW »".html_safe, rsvp_path - if !@questionnaire.can_rsvp? && @questionnaire.acc_status != "denied" - - if HackathonConfig['registration_is_open'] + - if HackathonConfig['accepting_questionnaires'] - if HackathonConfig['thanks_for_applying_message'].present? = markdown(HackathonConfig['thanks_for_applying_message']) - else diff --git a/config/app.yml b/config/app.yml index 1ddd64947..69c47d4fe 100644 --- a/config/app.yml +++ b/config/app.yml @@ -2,11 +2,10 @@ defaults: &defaults # Logic config - registration_is_open: true + accepting_questionnaires: true last_day_to_apply: "<%= Date.new(2000, 1, 1).to_s %>" event_start_date: "<%= Date.new(2000, 1, 1).to_s %>" auto_late_waitlist: false - disable_account_registration: false # Content config name: HackFoo diff --git a/config/locales/en.yml b/config/locales/en.yml index 9a13eb5b5..b883e9c5e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -55,11 +55,10 @@ en: school: is_home: The "home" school is separated from all other schools on dashboard metrics. hackathon_config: - registration_is_open: Specify that registration is open. This does not block registration; it only changes messaging around it. + accepting_questionnaires: Specify that questionnaires are being accepted. This does not block applying; it only changes messaging around it. last_day_to_apply: 'Last date to apply to your hackathon (format: YYYY-MM-DD)' event_start_date: 'Start date of your hackathon (format: YYYY-MM-DD)' auto_late_waitlist: Automatically set application status to "late waitlist" for new applications - disable_account_registration: Prevent applicants from applying name: Your hackathon's name logo_asset: Optional logo asset (should be a full https:// URL to a .jpg, .png, or .svg file)