Skip to content

Commit

Permalink
Fix missing tempalte
Browse files Browse the repository at this point in the history
  • Loading branch information
trickeydan committed Feb 26, 2024
1 parent af714fa commit 912f922
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ctff/part.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def render(self) -> str:
class TextSubmissionPart(TemplatePart):
"""Submit a text form."""

template_name = "parts/text_submission.html"
template_name = "challenge_parts/text_submission.html"

def __init__(self, name: str) -> None:
self.name = name
Expand Down
17 changes: 17 additions & 0 deletions ctff/templates/challenge_parts/text_submission.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<form method="POST" enctype="multipart/form-data">
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
{% if category == "flag" %}
<div class="alert alert-primary">{{ message }}</div>
{% else %}
<div class="alert alert-{{ category }}">{{ message }}</div>
{% endif %}
{% endfor %}
{% endif %}
{% endwith %}
<label>Please enter your {{ part.name }} here:</label>
<textarea class="form-control" name="{{ part.name }}"></textarea>
<br>
<input class="btn btn-success" type="submit" value="Submit {{ part.name }}">
</form>

0 comments on commit 912f922

Please sign in to comment.