Files
devplacepy/devplacepy/templates/leaderboard.html
T
retoor 741d7aade6 docs: add block/mute user relations, emoji-sync CLI, and uid indexes
- Add `/block`, `/mute` endpoints with block/unblock and mute/unmute functionality in `routers/relations.py`, hiding blocked users' content everywhere except their own profile while muting only suppresses notifications
- Introduce `devplace emoji-sync` CLI command to regenerate `static/js/emoji-shortcodes.js` from the emoji library, documented in `CLAUDE.md` and wired in `cli.py`
- Create `get_blocked_uids()` database helper and apply it in `content.py` `load_detail()` to filter blocked users' posts from detail views
- Implement `_uid_index()` and `_drop_index()` helpers in `database.py` for unique uid indexes across tables, with `user_relations` added to `SOFT_DELETE_TABLES`
- Document new routes in `AGENTS.md` and `README.md`, including emoji shortcodes rendering behavior distinct from the emoji picker
2026-06-19 08:06:09 +00:00

80 lines
3.6 KiB
HTML

{% extends "base.html" %}
{% block extra_head %}
<link rel="stylesheet" href="{{ static_url('/static/css/feed.css') }}">
{% endblock %}
{% block content %}
<div class="leaderboard-page">
<aside class="community-stats" aria-label="Community statistics">
<h3>Community</h3>
<div class="stat-row">
<span class="label">Total Members</span>
<span class="value">{{ total_members }}</span>
</div>
<div class="stat-row">
<span class="label">Posts Today</span>
<span class="value">{{ posts_today }}</span>
</div>
<div class="stat-row">
<span class="label">Total Projects</span>
<span class="value">{{ total_projects }}</span>
</div>
<div class="stat-row">
<span class="label">Total Gists</span>
<span class="value">{{ total_gists }}</span>
</div>
<div class="top-authors-section">
<h3 class="top-authors-title">Top Authors</h3>
{% for author in top_authors %}
<div class="stat-row">
<span class="label">
{% set _user = author %}{% set _size = 20 %}{% set _size_class = "xs" %}{% include "_avatar_link.html" %}
{% set _user = author %}{% set _class = "top-author-name" %}{% include "_user_link.html" %}
</span>
<span class="value">{{ author.get('stars', 0) }}</span>
</div>
{% else %}
<div class="no-authors-msg">No top authors yet</div>
{% endfor %}
</div>
</aside>
<div class="leaderboard-main">
<div class="leaderboard-header">
<h1>Leaderboard</h1>
{% if user_rank %}
<span class="leaderboard-you">Your rank: #{{ user_rank }}</span>
{% endif %}
</div>
<p class="leaderboard-intro">Ranked by total stars earned across posts, projects, and gists.</p>
<ol class="leaderboard-list">
{% for entry in entries %}
<li class="leaderboard-row{% if is_self(user, entry['uid']) %} leaderboard-row-self{% endif %}">
<span class="leaderboard-rank">#{{ entry['rank'] }}</span>
{% set _user = entry %}{% set _size = 32 %}{% set _size_class = "sm" %}{% include "_avatar_link.html" %}
{% set _user = entry %}{% set _class = "leaderboard-name" %}{% include "_user_link.html" %}
<span class="leaderboard-level">Level {{ entry.get('level', 1) }}</span>
<span class="leaderboard-stars">{{ entry['stars'] }} <span class="leaderboard-star-icon" aria-hidden="true">&#x2605;</span></span>
</li>
{% else %}
<li class="leaderboard-empty">No ranked contributors yet. Earn stars on your posts, projects, and gists to appear here.</li>
{% endfor %}
</ol>
</div>
<aside class="feed-right" aria-label="Featured news">
<div class="featured-news">
<h3>Featured</h3>
{% for article in featured_news %}
<a class="featured-news-item" href="/news/{{ article['slug'] }}">
<span class="featured-news-title">{{ render_title(article['title']) }}</span>
<span class="featured-news-meta">{{ article['source_name'] }}{% if article['time_ago'] %} &middot; {{ dt_ago(article['synced_at']) if article['synced_at'] else article['time_ago'] }}{% endif %}</span>
</a>
{% else %}
<div class="no-authors-msg">No featured articles yet</div>
{% endfor %}
</div>
</aside>
</div>
{% endblock %}