third phase of the project management dashboard

This commit is contained in:
Joren de Graaf
2026-10-13 20:50:21 +02:00
parent e4419b4a18
commit 21f3cf09b7
5 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -1 +1 @@
{% extends 'core/base.html' %}{% block content %}<div class="d-flex justify-content-between align-items-center mb-4"><div><h1>Projects</h1><p>Boards and specifications across your workspace.</p></div><a class="btn btn-success" href="{% url 'projects:create' %}">New project</a></div><p><a href="{% url 'projects:list' %}">Active</a> · <a href="{% url 'projects:list' %}?archived=1">Archived</a></p><form method="get" role="search" class="mb-3"><label for="project-search" class="form-label">Search projects and cards</label><input id="project-search" class="form-control" name="q" value="{{ query }}" hx-get="{% url 'projects:list' %}{% if show_archived %}?archived=1{% endif %}" hx-trigger="input changed delay:300ms" hx-target="#project-results" hx-indicator="#search-loading"><span id="search-loading" class="htmx-indicator">Searching…</span></form><div id="project-results">{% include 'projects/_project_list.html' %}</div><script src="https://unpkg.com/htmx.org@2.0.4"></script>{% endblock %}
{% extends 'core/base.html' %}{% block content %}<style>.htmx-indicator{display:none}.htmx-request.htmx-indicator,.htmx-request .htmx-indicator{display:inline}</style><div class="d-flex justify-content-between align-items-center mb-4"><div><h1>Projects</h1><p>Boards and specifications across your workspace.</p></div><a class="btn btn-success" href="{% url 'projects:create' %}">New project</a></div><p><a href="{% url 'projects:list' %}">Active</a> · <a href="{% url 'projects:list' %}?archived=1">Archived</a></p><form method="get" role="search" class="mb-3"><label for="project-search" class="form-label">Search projects and cards</label><input id="project-search" class="form-control" name="q" value="{{ query }}" hx-get="{% url 'projects:list' %}{% if show_archived %}?archived=1{% endif %}" hx-trigger="input changed delay:300ms" hx-target="#project-results" hx-indicator="#search-loading"><span id="search-loading" class="htmx-indicator">Searching…</span></form><div id="project-results">{% include 'projects/_project_list.html' %}</div><script src="https://unpkg.com/htmx.org@2.0.4"></script>{% endblock %}
+1 -1
View File
@@ -8,5 +8,5 @@ register = template.Library()
@register.filter
def safe_markdown(value):
html = markdown.markdown(value or '', extensions=['extra', 'fenced_code', 'tables', 'sane_lists'])
html = markdown.markdown(value or '', extensions=['extra', 'fenced_code', 'tables', 'sane_lists', 'pymdownx.tasklist'])
return mark_safe(nh3.clean(html, tags={'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ul', 'ol', 'li', 'pre', 'code', 'blockquote', 'strong', 'em', 'a', 'table', 'thead', 'tbody', 'tr', 'th', 'td', 'hr', 'br', 'input'}, attributes={'a': {'href', 'title'}, 'input': {'type', 'checked', 'disabled'}}, url_schemes={'https', 'http', 'mailto'}))
+6
View File
@@ -69,6 +69,12 @@ class ProjectWorkflowTests(TestCase):
self.assertIn('<h1>Hello</h1>', response.content.decode())
self.assertNotIn('<script>', response.content.decode())
def test_preview_renders_read_only_checklist(self):
self.client.force_login(self.owner)
response = self.client.post(reverse('projects:preview'), {'description_markdown': '- [ ] Pending\n- [x] Done'})
self.assertContains(response, '<input type="checkbox" disabled="">', html=False)
self.assertContains(response, '<input type="checkbox" disabled="" checked="">', html=False)
def test_existing_dashboard_requires_login(self):
self.assertEqual(self.client.get('/').status_code, 302)
self.client.force_login(self.owner)