mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-19 06:54:20 +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
|
@authed_only
|
||||||
@require_team_mode
|
@require_team_mode
|
||||||
def private():
|
def private():
|
||||||
|
infos = get_infos()
|
||||||
|
errors = get_errors()
|
||||||
|
|
||||||
user = get_current_user()
|
user = get_current_user()
|
||||||
if not user.team_id:
|
if not user.team_id:
|
||||||
return render_template("teams/team_enrollment.html")
|
return render_template("teams/team_enrollment.html")
|
||||||
@@ -167,6 +170,9 @@ def private():
|
|||||||
place = team.place
|
place = team.place
|
||||||
score = team.score
|
score = team.score
|
||||||
|
|
||||||
|
if config.is_scoreboard_frozen():
|
||||||
|
infos.append("Scoreboard has been frozen")
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
"teams/private.html",
|
"teams/private.html",
|
||||||
solves=solves,
|
solves=solves,
|
||||||
@@ -176,6 +182,8 @@ def private():
|
|||||||
score=score,
|
score=score,
|
||||||
place=place,
|
place=place,
|
||||||
score_frozen=config.is_scoreboard_frozen(),
|
score_frozen=config.is_scoreboard_frozen(),
|
||||||
|
infos=infos,
|
||||||
|
errors=errors,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -184,6 +192,7 @@ def private():
|
|||||||
@check_score_visibility
|
@check_score_visibility
|
||||||
@require_team_mode
|
@require_team_mode
|
||||||
def public(team_id):
|
def public(team_id):
|
||||||
|
infos = get_infos()
|
||||||
errors = get_errors()
|
errors = get_errors()
|
||||||
team = Teams.query.filter_by(id=team_id, banned=False, hidden=False).first_or_404()
|
team = Teams.query.filter_by(id=team_id, banned=False, hidden=False).first_or_404()
|
||||||
solves = team.get_solves()
|
solves = team.get_solves()
|
||||||
@@ -195,6 +204,9 @@ def public(team_id):
|
|||||||
if errors:
|
if errors:
|
||||||
return render_template("teams/public.html", team=team, errors=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(
|
return render_template(
|
||||||
"teams/public.html",
|
"teams/public.html",
|
||||||
solves=solves,
|
solves=solves,
|
||||||
@@ -203,4 +215,6 @@ def public(team_id):
|
|||||||
score=score,
|
score=score,
|
||||||
place=place,
|
place=place,
|
||||||
score_frozen=config.is_scoreboard_frozen(),
|
score_frozen=config.is_scoreboard_frozen(),
|
||||||
|
infos=infos,
|
||||||
|
errors=errors,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -154,19 +154,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
{% if errors %}
|
{% include "components/errors.html" %}
|
||||||
<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 %}
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
@@ -287,7 +275,6 @@
|
|||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|||||||
@@ -54,19 +54,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
{% if errors %}
|
{% include "components/errors.html" %}
|
||||||
<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 %}
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
@@ -184,7 +172,6 @@
|
|||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user