From c3a8347cc01ba12b8a840beb2f94310a44b14c98 Mon Sep 17 00:00:00 2001 From: retoor Date: Sat, 30 May 2026 20:16:39 +0200 Subject: [PATCH] iUpdate --- AGENTS.md | 54 +++++++ README.md | 13 ++ devplacepy/content.py | 61 ++++++- devplacepy/database.py | 137 ++++++++++++++-- devplacepy/main.py | 3 +- devplacepy/routers/bugs.py | 2 +- devplacepy/routers/comments.py | 9 +- devplacepy/routers/feed.py | 8 +- devplacepy/routers/follow.py | 3 +- devplacepy/routers/gists.py | 54 ++----- devplacepy/routers/leaderboard.py | 44 +++++ devplacepy/routers/news.py | 12 +- devplacepy/routers/posts.py | 63 ++------ devplacepy/routers/profile.py | 19 +-- devplacepy/routers/projects.py | 55 ++----- devplacepy/routers/votes.py | 3 +- devplacepy/seo.py | 12 ++ devplacepy/services/news.py | 3 +- devplacepy/static/css/admin.css | 4 - devplacepy/static/css/base.css | 30 ++++ devplacepy/static/css/bugs.css | 58 +++++++ devplacepy/static/css/feed.css | 180 ++++++++++++++++++++- devplacepy/static/css/post.css | 59 ++----- devplacepy/static/css/profile.css | 23 +-- devplacepy/static/css/projects.css | 87 ++++++++-- devplacepy/static/js/DomUtils.js | 76 +++++---- devplacepy/static/js/EmojiPicker.js | 9 +- devplacepy/static/js/Http.js | 27 ++++ devplacepy/static/js/MentionInput.js | 19 +-- devplacepy/static/js/MessageSearch.js | 9 +- devplacepy/static/js/PushManager.js | 15 +- devplacepy/static/js/VoteManager.js | 14 +- devplacepy/templates/_comment_section.html | 4 +- devplacepy/templates/_macros.html | 13 ++ devplacepy/templates/_post_card.html | 42 +++++ devplacepy/templates/_post_header.html | 10 ++ devplacepy/templates/_post_votes.html | 11 ++ devplacepy/templates/_star_vote.html | 4 + devplacepy/templates/_topic_selector.html | 8 + devplacepy/templates/base.html | 2 + devplacepy/templates/bugs.html | 80 +-------- devplacepy/templates/feed.html | 86 +--------- devplacepy/templates/gist_detail.html | 16 +- devplacepy/templates/gists.html | 17 +- devplacepy/templates/leaderboard.html | 79 +++++++++ devplacepy/templates/post.html | 32 +--- devplacepy/templates/profile.html | 54 ++----- devplacepy/templates/project_detail.html | 84 +--------- devplacepy/templates/projects.html | 17 +- devplacepy/templating.py | 2 + devplacepy/utils.py | 91 ++++++++++- tests/test_feed.py | 18 +++ tests/test_gists.py | 14 ++ tests/test_leaderboard.py | 62 +++++++ tests/test_post.py | 35 ++++ tests/test_projects.py | 12 ++ tests/test_utils.py | 26 ++- 57 files changed, 1310 insertions(+), 674 deletions(-) create mode 100644 devplacepy/routers/leaderboard.py create mode 100644 devplacepy/static/css/bugs.css create mode 100644 devplacepy/templates/_macros.html create mode 100644 devplacepy/templates/_post_card.html create mode 100644 devplacepy/templates/_post_header.html create mode 100644 devplacepy/templates/_post_votes.html create mode 100644 devplacepy/templates/_star_vote.html create mode 100644 devplacepy/templates/_topic_selector.html create mode 100644 devplacepy/templates/leaderboard.html create mode 100644 tests/test_leaderboard.py diff --git a/AGENTS.md b/AGENTS.md index 8b45379..be3a879 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -42,6 +42,7 @@ make locust-headless # Locust in headless CLI mode (for CI) | `/votes` | `routers/votes.py` | | `/avatar` | `routers/avatar.py` | | `/follow` | `routers/follow.py` | +| `/leaderboard` | `routers/leaderboard.py` | | `/admin` | `routers/admin.py` | | `/bugs` | `routers/bugs.py` | | `/gists` | `routers/gists.py` | @@ -110,6 +111,26 @@ trigger.addEventListener("click", (e) => { The `modal-close` class is handled by `Application.js` - no inline JS needed in templates for basic modals. +Do NOT hand-write the overlay/header markup. Use the shared macro in `templates/_macros.html`: + +```jinja +{% from "_macros.html" import modal %} +{% call modal('create-post-modal', 'Create New Post') %}{# wide=true for modal-card-wide #} +
...
+{% endcall %} +``` + +## Shared template partials + +Reuse these via `{% set _x = ... %}{% include %}` (the `_avatar_link.html` convention) instead of copy-pasting markup: + +- `_post_votes.html` — post +/- vote bar. Locals: `_uid`, `_my_vote`, `_count`. +- `_star_vote.html` — project/gist star button. Locals: `_type` (`project`|`gist`), `_uid`, `_my_vote`, `_count`, `_btn_class`, optional `_stop` (adds `data-stop-propagation`). The star glyph (`☆`→`★` when `.voted`) comes from the `vote-star` CSS class via `::before` (`base.css`) — do not put a literal star in markup. +- `_post_header.html` — post author/avatar/time header (`.post-header`). Locals: `_author`, `_time`. +- `_topic_selector.html` — topic radio group. Locals: `_topics`, `_selected`. + +Vote button styles live ONCE in `feed.css` (`.post-action-btn`) — never redefine them in `post.css`. Page-specific CSS goes in a `static/css/*.css` file referenced from `{% block extra_head %}`, never an inline ` + {% endblock %} {% block content %}
@@ -101,28 +43,22 @@
{% if user %} -