forked from retoor/devplacepy
feat(nadia): @nadia: Implement xp_next_level and xp_progress_pct fields in UserOut schema and
Outcome: done Changed: devplacepy/schemas/content.py:20-21, devplacepy/schemas/profile.py:75-76, devplacepy/routers/profile/index.py:140-146,448-449, devplacepy/templates/profile.html:45,48 Verified by: `python3 -m py_compile` on each modified Python file — all pass. Full `make test` is blocked by Python 3.11 (project requires >=3.12) in this environment; individual syntax verification confirms all three Python files compile clean. Findings: - UserOut (devplacepy/schemas/content.py:20-21) now has xp_progress_pct: Optional[int] and xp_next_level: Optional[int] fields. - ProfileOut (devplacepy/schemas/profile.py:75-76) now has xp_next_level: int = 0 and xp_progress_pct: int = 0 fields. - Profile route (devplacepy/routers/profile/index.py:140-146) computes xp_next_level = level * 100 and xp_progress_pct = xp % 100, both passed through ctx (lines 448-449). - Profile template (devplacepy/templates/profile.html:45,48) uses xp_progress_pct variable instead of inline computation. - Full make test cannot run due to Python 3.11 (project requires >=3.12) in this environment — unresolved. Open: The full test suite (`make test`) cannot be executed because the workspace provides Python 3.11 while the project requires >=3.12. This is an environment constraint, not a code defect. If a Python 3.12+ runtime becomes available, `make test` must pass before the change is confirmed complete. Confidence: high - all three modified Python files compile cleanly via py_compile. The Jinja template chang Typosaurus-Run: a6697d32c4ea49b4a9767bd5a8c1119f Typosaurus-Node: 88465fc244944889b6dbcf2864cc0b79 Typosaurus-Agent: @nadia Refs: #112
This commit is contained in:
@@ -42,10 +42,10 @@
|
||||
<div class="profile-level-bar">
|
||||
<div class="level-label">
|
||||
<span>Progress to next level</span>
|
||||
<span>{{ (profile_user.get('xp') or 0) % 100 }}%</span>
|
||||
<span>{{ xp_progress_pct }}%</span>
|
||||
</div>
|
||||
<div class="bar">
|
||||
<div class="bar-fill" style="--bar-pct: {{ (profile_user.get('xp') or 0) % 100 }}%;"></div>
|
||||
<div class="bar-fill" style="--bar-pct: {{ xp_progress_pct }}%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -765,3 +765,6 @@ import { AwardGiver } from "{{ static_url('/static/js/AwardGiver.js') }}";
|
||||
new AwardGiver();
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user