Skip to content

Commit 1a31861

Browse files
authored
refactor(config): Adjusts registration verbiage to always allow user registration (#232)
1 parent accd02e commit 1a31861

File tree

6 files changed

+7
-22
lines changed

6 files changed

+7
-22
lines changed

app/controllers/manage/questionnaires_controller.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
class Manage::QuestionnairesController < Manage::ApplicationController
22
include QuestionnairesControllable
33

4-
before_action :ensure_registration_is_open, only: [:new, :create]
54
before_action :set_questionnaire, only: [:show, :edit, :update, :destroy, :check_in, :convert_to_admin, :update_acc_status, :message_events]
65

76
respond_to :html, :json
@@ -170,11 +169,4 @@ def convert_boarded_bus_param(values, questionnaire = nil)
170169
def set_questionnaire
171170
@questionnaire = ::Questionnaire.find(params[:id])
172171
end
173-
174-
def ensure_registration_is_open
175-
if HackathonConfig['disable_account_registration']
176-
flash[:alert] = "Registration has closed"
177-
redirect_to root_path
178-
end
179-
end
180172
end

app/controllers/users/registrations_controller.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@ class Users::RegistrationsController < Devise::RegistrationsController
44

55
# GET /resource/sign_up
66
def new
7-
if HackathonConfig['disable_account_registration']
8-
flash[:alert] = "Registration has closed"
9-
redirect_to root_path
10-
else
11-
super
12-
end
7+
super
138
end
149

1510
# POST /resource

app/views/devise/registrations/new.html.haml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
Register for
55
%span.emphasized= HackathonConfig['name']
66

7-
- if !HackathonConfig['registration_is_open'] || HackathonConfig['disclaimer_message'].present?
7+
- if !HackathonConfig['accepting_questionnaires'] || HackathonConfig['disclaimer_message'].present?
88
#disclaimer
9-
- if !HackathonConfig['registration_is_open']
9+
- if !HackathonConfig['accepting_questionnaires']
1010
.center
11-
%strong Registration is now closed. Thanks to everyone who applied!
11+
%strong We are no longer accepting applications. Thanks to everyone who applied!
1212
%br
1313
- if HackathonConfig['disclaimer_message'].present?
1414
= markdown(HackathonConfig['disclaimer_message'])

app/views/questionnaires/show.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
%p.center
2828
= btn_link_to "RSVP NOW &raquo;".html_safe, rsvp_path
2929
- if [email protected]_rsvp? && @questionnaire.acc_status != "denied"
30-
- if HackathonConfig['registration_is_open']
30+
- if HackathonConfig['accepting_questionnaires']
3131
- if HackathonConfig['thanks_for_applying_message'].present?
3232
= markdown(HackathonConfig['thanks_for_applying_message'])
3333
- else

config/app.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
defaults: &defaults
33

44
# Logic config
5-
registration_is_open: true
5+
accepting_questionnaires: true
66
last_day_to_apply: "<%= Date.new(2000, 1, 1).to_s %>"
77
event_start_date: "<%= Date.new(2000, 1, 1).to_s %>"
88
auto_late_waitlist: false
9-
disable_account_registration: false
109

1110
# Content config
1211
name: HackFoo

config/locales/en.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,10 @@ en:
5555
school:
5656
is_home: The "home" school is separated from all other schools on dashboard metrics.
5757
hackathon_config:
58-
registration_is_open: Specify that registration is open. This does <strong>not</strong> block registration; it only changes messaging around it.
58+
accepting_questionnaires: Specify that questionnaires are being accepted. This does <strong>not</strong> block applying; it only changes messaging around it.
5959
last_day_to_apply: 'Last date to apply to your hackathon (format: YYYY-MM-DD)'
6060
event_start_date: 'Start date of your hackathon (format: YYYY-MM-DD)'
6161
auto_late_waitlist: Automatically set application status to "late waitlist" for new applications
62-
disable_account_registration: Prevent applicants from applying
6362

6463
name: Your hackathon's name
6564
logo_asset: Optional logo asset (should be a full https:// URL to a .jpg, .png, or .svg file)

0 commit comments

Comments
 (0)