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 %} -