Render markdown in gist and project sidebar titles; add content visibility and GIF picker
DevPlace CI / test (push) Failing after 1h5m29s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-05 17:59:21 +01:00
co-authored by Claude Sonnet 5.5
parent bc11475f29
commit 05d6633204
154 changed files with 6394 additions and 289 deletions
+13 -11
View File
@@ -2,6 +2,7 @@
from .core import TTLCache, datetime, db, timedelta, timezone
from .ranking import get_top_authors
from .visibility import listed_clause
_stats_cache = TTLCache(ttl=30, max_size=50)
@@ -16,19 +17,20 @@ def get_site_stats() -> dict:
.replace(hour=0, minute=0, second=0, microsecond=0)
.isoformat()
)
def listed_count(name, **filters):
if name not in db.tables:
return 0
listed = listed_clause(db[name])
clauses = [listed] if listed is not None else []
return db[name].count(*clauses, **filters)
stats = {
"total_members": db["users"].count() if "users" in db.tables else 0,
"posts_today": db["posts"].count(
created_at={">=": today_start}, deleted_at=None
)
if "posts" in db.tables
else 0,
"total_projects": db["projects"].count(deleted_at=None)
if "projects" in db.tables
else 0,
"total_gists": db["gists"].count(deleted_at=None)
if "gists" in db.tables
else 0,
"posts_today": listed_count(
"posts", created_at={">=": today_start}, deleted_at=None
),
"total_projects": listed_count("projects", deleted_at=None),
"total_gists": listed_count("gists", deleted_at=None),
}
_stats_cache.set("site", stats)
return stats