refactor: migrate all inlined HTML to Jinja2 templates; fix discover tests
ui_user_profile.py: - Delete _render_profile_html() (440-line f-string with doubled-brace JS) - Import shared templates object from _templates.py - profile_page() now returns templates.TemplateResponse() pointing to musehub/templates/musehub/pages/user_profile.html
musehub/templates/musehub/pages/user_profile.html (new): - Self-contained page (own <html>, no base.html extension) - Single dynamic variable: {{ username | tojson }} injected into JS - Raw JS block wrapped in {% raw %}...{% endraw %} to avoid Jinja2/JS conflict
ui_new_repo.py: - check_slug_availability(): replace hardcoded <span> strings with templates.TemplateResponse("musehub/fragments/slug_check.html")
musehub/templates/musehub/fragments/slug_check.html (new): - Tiny HTMX fragment: renders ✓ Available / ✗ Already taken based on {{ available }} context variable
tests/test_musehub_discover.py: - test_explore_page_renders: assert on filter-form / name="sort" / name="license" / /musehub/ui/explore (what the template actually renders) - test_trending_page_renders: assert on repo-grid / "Trending Music" (what the template actually renders); drop discover/repos + selected checks that were never in the template
No comments yet. Be the first to start the discussion.