Skip to content

Commit 7e55b5f

Browse files
xusheng6claude
andauthored
Add dedicated submission success page for crackme and writeup uploads (#30)
Instead of flashing a message and redirecting to the user profile, uploads now show a dedicated success page that clearly indicates: - The submission was successful - It needs to be reviewed before becoming publicly available This addresses the UX issue where the success message was not very visible on the profile page. Closes #4 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e1f40ff commit 7e55b5f

3 files changed

Lines changed: 44 additions & 4 deletions

File tree

app/controllers/crackme.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ def crackme_view(hexid):
6565
quality=f"{crackme.get('quality', 0):.1f}")
6666

6767

68+
@crackme_bp.route('/lasts')
69+
def last_crackmes_redirect():
70+
"""Redirect /lasts to /lasts/1."""
71+
return redirect('/lasts/1')
72+
73+
6874
@crackme_bp.route('/lasts/<int:page>')
6975
def last_crackmes_page(page):
7076
"""Display latest crackmes with pagination."""
@@ -239,5 +245,7 @@ def upload_crackme_post():
239245
except Exception as e:
240246
print(f"Discord notification error: {e}")
241247

242-
flash('Crackme uploaded! Should be available soon.', FLASH_SUCCESS)
243-
return redirect(f'/user/{username}')
248+
return render_template('submission/success.html',
249+
submission_type='Crackme',
250+
name=crackme['name'],
251+
username=username)

app/controllers/solution.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,7 @@ def upload_solution_post(hexidcrackme):
124124
except Exception as e:
125125
print(f"Notification error: {e}")
126126

127-
flash('Solution uploaded! Should be available soon.', FLASH_SUCCESS)
128-
return redirect(f'/user/{username}')
127+
return render_template('submission/success.html',
128+
submission_type='Writeup',
129+
name=crackme['name'],
130+
username=username)

templates/submission/success.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{% extends "base.html" %}
2+
{% block title %}Submission Successful{% endblock %}
3+
{% block page_title %}Submission Successful{% endblock %}
4+
{% block head %}{% endblock %}
5+
{% block content %}
6+
7+
<div class="container grid-lg wrapper">
8+
<div class="empty">
9+
<div class="empty-icon">
10+
<i class="icon icon-check" style="font-size: 3rem; color: #32b643;"></i>
11+
</div>
12+
<p class="empty-title h3">{{ submission_type }} Uploaded Successfully!</p>
13+
<p class="empty-subtitle">
14+
Your {{ submission_type|lower }} <strong>"{{ name }}"</strong> has been submitted.<br>
15+
It will be reviewed by our team before becoming publicly available.
16+
</p>
17+
<div class="empty-action">
18+
<a href="/user/{{ username }}" class="btn btn-primary">View Your Profile</a>
19+
{% if submission_type == 'Crackme' %}
20+
<a href="/upload/crackme" class="btn btn-primary">Upload Another Crackme</a>
21+
{% else %}
22+
<a href="/lasts/1" class="btn btn-primary">Browse Crackmes</a>
23+
{% endif %}
24+
</div>
25+
</div>
26+
</div>
27+
28+
{% include 'partial/footer.html' %}
29+
{% endblock %}
30+
{% block foot %}{% endblock %}

0 commit comments

Comments
 (0)