Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename registration_opened? to registration_open? #9709

Merged
merged 15 commits into from
Aug 7, 2024
Merged
8 changes: 8 additions & 0 deletions app/models/competition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,14 @@ def registration_status
end
end

def has_any_registrations?
if uses_new_registration_service?
self.microservice_registrations.any?
else
self.registrations.any?
end
end

def registration_range_specified?
registration_open.present? && registration_close.present?
end
Expand Down
5 changes: 3 additions & 2 deletions app/views/competitions/_nav.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,16 @@
icon: "lightbulb",
}
end
unless @competition.results_posted?
if @competition.announced? && !@competition.results_posted?
if @competition.use_wca_registration?
nav_items << {
text: t('.menu.register'),
path: competition_register_path(@competition),
icon: "sign in alt"
}
end
if @competition.registrations.any?

if [email protected]_not_yet_opened? && @competition.has_any_registrations?
dunkOnIT marked this conversation as resolved.
Show resolved Hide resolved
event_icons = @competition.events.map do |event|
{ text: event.id, path: competition_psych_sheet_event_path(@competition, event.id), cubing_icon: event.id, title: event.name }
end unless @competition.uses_new_registration_service?
Expand Down