feat: add threaded comments with polymorphic targets and slug-based routing

Introduce `load_comments` helper supporting polymorphic target types (post, project, bug) with nested parent-child threading. Refactor comment creation to use `target_type`/`target_uid` and `resolve_target_redirect` for correct redirects. Replace raw UID-based post/project routes with slug-aware resolution via `resolve_post`/`resolve_project` and `make_combined_slug`. Update SEO, sitemap, and FAB styling to use slugs and hardcoded red accent. Add reusable `_comment_section.html` template.
This commit is contained in:
2026-05-11 18:49:45 +00:00
parent 1e0960e0dd
commit f7ca123cd6
20 changed files with 427 additions and 222 deletions
+6 -1
View File
@@ -1,6 +1,7 @@
{% extends "base.html" %}
{% block extra_head %}
<link rel="stylesheet" href="/static/css/projects.css">
<link rel="stylesheet" href="/static/css/post.css">
<style>
.project-detail-page {
max-width: 720px;
@@ -134,11 +135,15 @@
</form>
{% endif %}
{% if is_owner %}
<form method="POST" action="/projects/delete/{{ project['uid'] }}" style="display:inline;">
<form method="POST" action="/projects/delete/{{ project['slug'] or project['uid'] }}" style="display:inline;">
<button type="submit" class="project-star-btn" onclick="return confirm('Delete this project?')">Delete</button>
</form>
{% endif %}
</div>
</article>
{% with target_uid=project['uid'], target_type="project" %}
{% include "_comment_section.html" %}
{% endwith %}
</div>
{% endblock %}