forked from retoor/devplacepy
Introduce a new `/leaderboard` endpoint ranking top 50 members by total stars, wire it into the app router and documentation. Implement `_backfill_gamification()` in `database.py` to compute XP/levels for existing accounts from prior posts, comments, votes, and follows. Extract `is_owner()`, `create_content_item()`, and `detail_context()` into `content.py` to centralize content creation, reward awarding, mention notifications, and attachment linking. Update comment creation/deletion in `comments.py` to use `award_rewards()` with `XP_COMMENT` and the new `is_owner()` helper. Add shared template partials documentation for vote bars, star buttons, post headers, and topic selectors to `AGENTS.md`.
14 lines
510 B
HTML
14 lines
510 B
HTML
{% macro content_url(item, kind) %}/{{ kind }}/{{ item['slug'] or item['uid'] }}{% endmacro %}
|
|
|
|
{% macro modal(modal_id, title, wide=false) %}
|
|
<div class="modal-overlay" id="{{ modal_id }}">
|
|
<div class="card modal-card{% if wide %} modal-card-wide{% endif %}">
|
|
<div class="modal-header">
|
|
<h3>{{ title }}</h3>
|
|
<button type="button" class="modal-close btn-ghost btn-icon modal-close-btn">×</button>
|
|
</div>
|
|
{{ caller() }}
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|