Skip to content

Commit

Permalink
Worlds updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
timreyn committed Nov 15, 2024
1 parent c59a8b4 commit c579859
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 16 deletions.
11 changes: 7 additions & 4 deletions app/handlers/nationals.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,14 @@ def nac2024projector(eventId):
return '', 404


@nac_bp.route('/person_states')
@worlds_bp.route('/person_states')
def person_states():
with client.context():
me = auth.user()
if not me:
return redirect('/login')
wca_host = os.environ.get('WCA_HOST')
data = requests.get(wca_host + '/api/v0/competitions/NAC2024/wcif/public')
data = requests.get(wca_host + '/api/v0/competitions/WC2025/wcif/public')
if data.status_code != 200:
abort(data.status_code)
competition = data.json()
Expand All @@ -267,7 +267,9 @@ def person_states():
abort(403)
return
regions = list(Region.query().iter())
person_keys = [ndb.Key(User, str(person['wcaUserId'])) for person in competition['persons']]
person_keys = [ndb.Key(User, str(person['wcaUserId'])) for person in competition['persons']
if person['registration'] is not None and
person['registration']['status'] == 'accepted']
users = ndb.get_multi(person_keys)
state_to_region = {state.key.id(): state.region.id() for state in State.query().iter()}
times = {}
Expand Down Expand Up @@ -431,7 +433,8 @@ def worlds2025qualification():
all_maybe_events=all_maybe_events,
earliest_phase=earliest_phase,
open_times=open_times,
close_times=close_times)
close_times=close_times,
prs=prs)

@worlds_bp.route('/schedule')
def worlds2025schedule():
Expand Down
10 changes: 6 additions & 4 deletions app/lib/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,17 @@ def FormatMultiBlindOld(time, verbose, trim_zeros, short_units):
return '%d/%d %s' % (solved, attempted,
FormatStandard(time_in_seconds * 100, trim_zeros))

def FormatMultiBlind(time, verbose, trim_zeros, short_units):
def FormatMultiBlind(time, verbose, trim_zeros, short_units, multi_blind_points):
missed = time % 100
res = time // 100
time_in_seconds = res % 100000
delta = 99 - res // 100000
solved = missed + delta
attempted = solved + missed

if verbose:
if multi_blind_points:
return str(delta) + ' pts'
elif verbose:
return '%d out of %d cubes in %s' % (
solved, attempted,
FormatStandard(time_in_seconds * 100, trim_zeros))
Expand All @@ -73,7 +75,7 @@ def FormatFewestMoves(time, is_average, verbose, short_units):
return result

def FormatTime(time, event_key, is_average, verbose=False,
trim_zeros=False, short_units=False):
trim_zeros=False, short_units=False, multi_blind_points=False):
if time == -1:
return 'DNF'
elif time == -2:
Expand All @@ -84,7 +86,7 @@ def FormatTime(time, event_key, is_average, verbose=False,
if time > 1000000000:
return FormatMultiBlindOld(time, verbose, trim_zeros, short_units)
else:
return FormatMultiBlind(time, verbose, trim_zeros, short_units)
return FormatMultiBlind(time, verbose, trim_zeros, short_units, multi_blind_points)
elif verbose:
return FormatVerbose(time, trim_zeros, short_units)
else:
Expand Down
4 changes: 4 additions & 0 deletions app/templates/nationals/2025/contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
No, you must have at least one result that meets the qualifying times in order to register for Rubik's WCA World Championship 2025.
{% endcall %}

{% call faq.faq_item("I am trying to register for the competition, but I can't select any events.", "cantregister") %}
There are qualifying times in all events which must be set in other WCA competitions before you can register for Rubik's WCA World Championship 2025. Please see <a href="/worlds/qualification">this page</a> for full details.
{% endcall %}

{% call faq.faq_item("Can I get a special accommodation?", "accommodation") %}
<p>Please fill out <a href="https://forms.gle/2TvUqoG7NFw1yVrg6">this form</a> if you need an accommodation, for example if you’re unable to compete for part of the competition due to a religious observance, or if you have a physical or medical condition that impacts your ability to compete on-stage.</p>
<p>The deadline to request accommodations is May 28, unless there are exceptional circumstances.</p>
Expand Down
5 changes: 4 additions & 1 deletion app/templates/nationals/2025/qualification.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h3>Qualification Times</h3>
</p>
{% elif earliest_phase %}
<p>
Based on your WCA results, the earliest you will be able to register is <b>Phase {{ earliest_phase }}</b>, which opens <b><span class="ts" data-ts="{{ open_times[earliest_phase - 1].timestamp() }}" data-divider=" "></span></b>.
Based on your WCA results, the earliest you will be able to register is <b>Phase {{ earliest_phase }}</b>, which opens <b><span class="ts" data-ts="{{ open_times[earliest_phase - 1].timestamp() }}" data-divider=" "></span></b>. Please note that, after you set times in a WCA competition, it can take a few days for this page to update.
</p>
{% else %}
<p>
Expand All @@ -53,6 +53,9 @@ <h3>Qualification Times</h3>
{% if 'bf' in event.key.id() %}
(single)
{% endif %}
{% if event.key.id() in prs %}
&ndash; {{ c.formatters.FormatTime(prs[event.key.id()], event.key, 'bf' not in event.key.id(), short_units=True, multi_blind_points=True) }}
{% endif %}
</td>
{% for quals in qualifications %}
{% set qual = quals[event.key.id()] %}
Expand Down
16 changes: 9 additions & 7 deletions app/templates/nationals/2025/schedule.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ <h3>Rubik's WCA World Championship 2025 Schedule</h3>
The tentative schedule is available at the <a href="https://www.worldcubeassociation.org/competitions/WC2025#competition-schedule">WCA website</a>. We will adjust the exact starting time of each event based on the number of registered competitors, however we will not change the scheduled days of any events.
</p>
<p>
Events will generally take place over two days, with the first round on Day 1, and the Semi-Finals and Finals on Day 2. The end of each day of the competition promises excitement: Rubik's Nations Cup on Thursday, and can't-miss Final Rounds on Friday, Saturday, and Sunday.
</p>
<p>
On the evening of <b>Friday, July 4</b>, competitors will be able to enjoy the July 4th fireworks over Lake Union.
Competitors must check in before their first event. Check-in will be open starting at <strong>8:00 AM</strong> on Thursday, Friday, and Saturday. You do not need to check in on Thursday if you do not have any events on Thursday.
</p>
<p>
In addition to the competition, we are planning events throughout the week leading up to the competition. This will likely include a warm-up competition in the Seattle area the weekend before (<b>Saturday, June 28 and Sunday, June 29</b>). We'll have more information about that here!
We reserve the right to change the number of competitors advancing to the semi-finals in each event, as well as 3x3 Round 2, depending on the number of competitors registered. In addition, we may add a semi-final to both 6x6 and 7x7. We are planning to make any changes of this nature no later than March 1, 2025.
</p>
<p>
Competitors must check in before their first event. Check-in will be open starting at <strong>8:00 AM</strong> on Thursday, Friday, and Saturday. You do not need to check in on Thursday if you do not have any events on Thursday.
Besides the compettiion, we'll have plenty of other excitement throughout the week:
</p>
<p>
We reserve the right to change the number of competitors advancing to the semi-finals in each event, as well as 3x3 Round 2, depending on the number of competitors registered. In addition, we may add a semi-final to both 6x6 and 7x7. We are planning to make any changes of this nature no later than March 1, 2025.
<b>Saturday, June 28 - Sunday, June 29</b>: (tentative) We're hoping there will be a warm-up competition in the Seattle area, more information to follow!<br/>
<b>Wednesday, July 2</b>: <i>Cubing at the Ball Game</i>: we've reserved a block of tickets for the Seattle Mariners vs. Kansas City Royals baseball game! The seats are great (right behind home plate in the upper deck) and only $20 each, and the stadium is easily accessible from the venue. We only have a limited number of seats available, so make sure to book soon at <a href="https://ticketor.com/cubingusa">Ticketor</a>. Non-competitors are welcome to book seats as well!<br/>
<b>Thursday, July 3</b>: To finish up the first night of the competition, we'll have our opening ceremony, including the traditional Flag Parade, followed by the always-exciting Rubik's Nations Cup.<br/>
<b>Friday, July 4</b>: After the competition, you'll be able to enjoy the July 4th fireworks over Lake Union.</br>
<b>Saturday, July 5</b>: WCA Staff Members will be invited to attend the WCA's annual meeting.<br/>
<b>Sunday, July 6</b>: We'll be finishing up the competition with our closing ceremony, awards, and (of course) crowning the new WCA World Champion!
</p>
{% endblock %}

0 comments on commit c579859

Please sign in to comment.