mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-18 14:34:21 +01:00
Make team profile pages use the shared errors component (#1589)
* Fix team pages to use the core errors alert component * Closes #1585
This commit is contained in:
@@ -154,6 +154,9 @@ def new():
|
||||
@authed_only
|
||||
@require_team_mode
|
||||
def private():
|
||||
infos = get_infos()
|
||||
errors = get_errors()
|
||||
|
||||
user = get_current_user()
|
||||
if not user.team_id:
|
||||
return render_template("teams/team_enrollment.html")
|
||||
@@ -167,6 +170,9 @@ def private():
|
||||
place = team.place
|
||||
score = team.score
|
||||
|
||||
if config.is_scoreboard_frozen():
|
||||
infos.append("Scoreboard has been frozen")
|
||||
|
||||
return render_template(
|
||||
"teams/private.html",
|
||||
solves=solves,
|
||||
@@ -176,6 +182,8 @@ def private():
|
||||
score=score,
|
||||
place=place,
|
||||
score_frozen=config.is_scoreboard_frozen(),
|
||||
infos=infos,
|
||||
errors=errors,
|
||||
)
|
||||
|
||||
|
||||
@@ -184,6 +192,7 @@ def private():
|
||||
@check_score_visibility
|
||||
@require_team_mode
|
||||
def public(team_id):
|
||||
infos = get_infos()
|
||||
errors = get_errors()
|
||||
team = Teams.query.filter_by(id=team_id, banned=False, hidden=False).first_or_404()
|
||||
solves = team.get_solves()
|
||||
@@ -195,6 +204,9 @@ def public(team_id):
|
||||
if errors:
|
||||
return render_template("teams/public.html", team=team, errors=errors)
|
||||
|
||||
if config.is_scoreboard_frozen():
|
||||
infos.append("Scoreboard has been frozen")
|
||||
|
||||
return render_template(
|
||||
"teams/public.html",
|
||||
solves=solves,
|
||||
@@ -203,4 +215,6 @@ def public(team_id):
|
||||
score=score,
|
||||
place=place,
|
||||
score_frozen=config.is_scoreboard_frozen(),
|
||||
infos=infos,
|
||||
errors=errors,
|
||||
)
|
||||
|
||||
@@ -154,19 +154,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
{% if errors %}
|
||||
<div id='errors' class="row">
|
||||
{% for error in errors %}
|
||||
<h1>{{ error }}</h1>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
{% if score_frozen %}
|
||||
<div class="row">
|
||||
<h1 class="text-center">Scoreboard has been frozen.</h1>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% include "components/errors.html" %}
|
||||
|
||||
<br>
|
||||
|
||||
@@ -287,7 +275,6 @@
|
||||
</h3>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@@ -54,19 +54,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
{% if errors %}
|
||||
<div id='errors' class="row">
|
||||
{% for error in errors %}
|
||||
<h1>{{ error }}</h1>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
{% if score_frozen %}
|
||||
<div class="row">
|
||||
<h1 class="text-center">Scoreboard has been frozen.</h1>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% include "components/errors.html" %}
|
||||
|
||||
<br>
|
||||
|
||||
@@ -184,7 +172,6 @@
|
||||
</h3>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user