modified: app.py new file: templates/admin_dashboard.html.j2 new file: templates/base.html.j2 new file: templates/daily_leaderboard.html.j2 new file: templates/daily_puzzle.html.j2 new file: templates/home.html.j2 new file: templates/invite_admin.html.j2 new file: templates/king_of_the_mountain.html.j2 new file: templates/leaderboard_index.html.j2 new file: templates/login.html.j2 new file: templates/manage_admins.html.j2 new file: templates/profile.html.j2 new file: templates/puzzle_menu.html.j2 new file: templates/upload.html.j2 new file: templates/verify.html.j2
47 lines
1.3 KiB
Django/Jinja
47 lines
1.3 KiB
Django/Jinja
{% extends 'base.html.j2' %}
|
|
{% block content %}
|
|
<h1>Your Profile</h1>
|
|
<p>Username: {{ user.username or "Not set" }}</p>
|
|
{% if user.enable_gravatar %}
|
|
<img src="{{ gravatar_url }}" alt="Gravatar Image">
|
|
{% else %}
|
|
<p>Gravatar is disabled.</p>
|
|
{% endif %}
|
|
<form method="POST">
|
|
<label>
|
|
<input type="checkbox" name="enable_gravatar" {% if user.enable_gravatar %}checked{% endif %}>
|
|
Enable Gravatar
|
|
</label><br><br>
|
|
|
|
<label>
|
|
New Username:
|
|
<input type="text" name="new_username" placeholder="Enter new username">
|
|
</label><br><br>
|
|
|
|
<button type="submit">Update Profile</button>
|
|
</form>
|
|
|
|
<h2>Stats</h2>
|
|
<p>Total Puzzles Solved: {{ total_puzzles_solved }}</p>
|
|
<p>Current Streak: {{ current_streak }} days</p>
|
|
<p>Max Streak: {{ max_streak }} days</p>
|
|
<h2>Your Solves</h2>
|
|
<table>
|
|
<tr>
|
|
<th>Date</th>
|
|
<th>Size</th>
|
|
<th>Moves</th>
|
|
<th>Rotations</th>
|
|
<th>Time (sec)</th>
|
|
</tr>
|
|
{% for attempt in solved_attempts %}
|
|
<tr>
|
|
<td>{{ attempt.puzzle.date }}</td>
|
|
<td>{{ attempt.puzzle.size }}x{{ attempt.puzzle.size }}</td>
|
|
<td>{{ attempt.move_count }}</td>
|
|
<td>{{ attempt.rotation_count }}</td>
|
|
<td>{{ "%.2f"|format((attempt.time_completed - attempt.time_started).total_seconds()) }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
{% endblock %}
|