third phase of the project management dashboard
This commit is contained in:
@@ -35,6 +35,8 @@ TEMPLATES = [{
|
|||||||
WSGI_APPLICATION = "config.wsgi.application"
|
WSGI_APPLICATION = "config.wsgi.application"
|
||||||
ASGI_APPLICATION = "config.asgi.application"
|
ASGI_APPLICATION = "config.asgi.application"
|
||||||
STATIC_URL = "static/"
|
STATIC_URL = "static/"
|
||||||
|
TIME_ZONE = 'Europe/Amsterdam'
|
||||||
|
USE_TZ = True
|
||||||
STATICFILES_DIRS = [BASE_DIR / "dist"] if (BASE_DIR / "dist").exists() else []
|
STATICFILES_DIRS = [BASE_DIR / "dist"] if (BASE_DIR / "dist").exists() else []
|
||||||
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
||||||
DATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3'}}
|
DATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3'}}
|
||||||
|
|||||||
@@ -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 %}
|
||||||
|
|||||||
@@ -8,5 +8,5 @@ register = template.Library()
|
|||||||
|
|
||||||
@register.filter
|
@register.filter
|
||||||
def safe_markdown(value):
|
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'}))
|
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'}))
|
||||||
|
|||||||
@@ -69,6 +69,12 @@ class ProjectWorkflowTests(TestCase):
|
|||||||
self.assertIn('<h1>Hello</h1>', response.content.decode())
|
self.assertIn('<h1>Hello</h1>', response.content.decode())
|
||||||
self.assertNotIn('<script>', 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):
|
def test_existing_dashboard_requires_login(self):
|
||||||
self.assertEqual(self.client.get('/').status_code, 302)
|
self.assertEqual(self.client.get('/').status_code, 302)
|
||||||
self.client.force_login(self.owner)
|
self.client.force_login(self.owner)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
Django>=6.1,<6.2
|
Django>=6.1,<6.2
|
||||||
Markdown>=3.8,<4
|
Markdown>=3.8,<4
|
||||||
|
pymdown-extensions>=10,<11
|
||||||
nh3>=0.2.21,<1
|
nh3>=0.2.21,<1
|
||||||
mcp==2.3.0
|
mcp==2.3.0
|
||||||
django-oauth-toolkit==3.4.1
|
django-oauth-toolkit==3.4.1
|
||||||
|
|||||||
Reference in New Issue
Block a user