diff --git a/app.py b/app.py index 450c10b..5b4cd5b 100644 --- a/app.py +++ b/app.py @@ -77,6 +77,7 @@ def register(): @app.route('/logout/') def logout(): session.pop("team_id") + flash("You've successfully logged out.") return redirect(url_for('root')) # Debugging things diff --git a/templates/dashboard.html b/templates/dashboard.html index 75fd324..406b9c0 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -12,7 +12,7 @@ text-align: right; } form { - margin-top: 20px; + margin-top: 30px; margin-bottom: 25px; } .bigger { @@ -32,35 +32,45 @@ {% block content %}

{{ team.name }}

+
+
+
+
+ Login information +

Your team key is {{ team.key }}. Share this with your teammates, + and keep it in a safe place. You need your team key in order to log in. + If you lose it, an organizer can send it to your team email, which is shown below.

+
+
+
+

Team information

-

Your team key is {{ team.key }}. Share this with your teammates, -and keep it in a safe place. You need it to log in. If you lose it, an organizer -can send it to your team email, which is shown below.

+

Your score is currently {{ team_score }}. Go solve more challenges!

Your team email is {{ team.email }}, and you are affiliated with {{ team.affiliation }}.

Your team is currently marked {{ "eligible" if team.eligible else "ineligible" }}.

Edit information

-

{{ config.eligibility }}

-

If you do not meet these requirements, you are still welcome to play, but you -will not be eligible for prizes. By checking the "Eligibility Certification" -checkbox below, you are certifying that you meet the prize eligibility -requirement. We may request appropriate documentation to verify your eligibility -status before sending you prizes.

- +
- +
- +
+

{{ config.eligibility }}

+

If you do not meet these requirements, you are still welcome to play, but you + will not be eligible for prizes. By checking the "Eligibility Certification" + checkbox below, you are certifying that you meet the prize eligibility + requirement. We may request appropriate documentation to verify your eligibility + status before sending you prizes.

@@ -72,38 +82,46 @@ status before sending you prizes.

Score calculation

{% if team_solves.count() %}
Solved problems
- - - - - - {% for solve in team_solves %} - - - - - - {% endfor %} - -
NameCategoryTimeValue
{{ solve.challenge.name }}{{ solve.challenge.category }}{{ solve.time }}{{ solve.challenge.points }}
+
+
+ + + + + + {% for solve in team_solves %} + + + + + + {% endfor %} + +
NameCategoryTimeValue
{{ solve.challenge.name }}{{ solve.challenge.category }}{{ solve.time }}{{ solve.challenge.points }}
+
+
{% else %}

No problems have been solved.

{% endif %} {% if team_adjustments.count() %}
Score adjustments
- - - - - - {% for adj in team_adjustments %} - - - - - {% endfor %} - -
ReasonValue
{{ adj.reason }}{{ adj.value }}
+
+
+ + + + + + {% for adj in team_adjustments %} + + + + + {% endfor %} + +
ReasonValue
{{ adj.reason }}{{ adj.value }}
+
+
{% else %}

No score adjustments have been made.

{% endif %} diff --git a/templates/register.html b/templates/register.html index cbc33be..fd3e5da 100644 --- a/templates/register.html +++ b/templates/register.html @@ -1,30 +1,29 @@ {% extends "base.html" %} {% block content %}

Register a Team

-

Important information about {{ config.ctf_name }}

-

{{ config.eligibility }}

-

If you do not meet these requirements, you are still welcome to play, but you -will not be eligible for prizes. By checking the "Eligibility Certification" -checkbox below, you are certifying that you meet the prize eligibility -requirement. We may request appropriate documentation to verify your eligibility -status before sending you prizes.

After registering, you will be directed to your team's dashboard. This will -contain a "team key", which is used to log in. Please store your team -key in a safe place, and share it with your team members.

-

Registration form

+contain a "team key", which is used to log in.

+

Please store your team key in a safe place, and share it with your +team members.

- +
- +
- +
+

{{ config.eligibility }}

+

If you do not meet these requirements, you are still welcome to play, but you + will not be eligible for prizes. By checking the "Eligibility Certification" + checkbox below, you are certifying that you meet the prize eligibility + requirement. We may request appropriate documentation to verify your eligibility + status before sending you prizes.

diff --git a/templates/scoreboard.html b/templates/scoreboard.html index 5568a2b..52e49d9 100644 --- a/templates/scoreboard.html +++ b/templates/scoreboard.html @@ -42,8 +42,8 @@ RankTeamAffiliationScore - {% for eligible, team, affiliation, score in data %} - {{ rank }}{{ team }}{{ affiliation }}{{ score }} + {% for eligible, teamid, team, affiliation, score in data %} + {{ rank }}{{ team }}{{ affiliation }}{{ score }} {% endfor %} diff --git a/utils.py b/utils.py index 265aa6a..6cdbba0 100644 --- a/utils.py +++ b/utils.py @@ -46,7 +46,7 @@ def calculate_scores(): scores[solve.team_id] += solve.challenge.points for adjustment in adjustments: scores[adjustment.team_id] += adjustment.value - return [(team_mapping[i[0]].eligible, team_mapping[i[0]].name, team_mapping[i[0]].affiliation, i[1]) for idx, i in enumerate(sorted(scores.items(), key=lambda k: (-k[1], most_recent_solve[k[0]])))] + return [(team_mapping[i[0]].eligible, i[0], team_mapping[i[0]].name, team_mapping[i[0]].affiliation, i[1]) for idx, i in enumerate(sorted(scores.items(), key=lambda k: (-k[1], most_recent_solve[k[0]])))] def get_complex(key): i = g.redis.get(key)