Add the TODO_COMMENT_CLASSES setting
This commit is contained in:
parent
84d7768854
commit
3cf694f985
3 changed files with 6 additions and 1 deletions
|
@ -127,6 +127,9 @@ TODO_DEFAULT_LIST_SLUG = 'tickets'
|
|||
# Defaults to "/"
|
||||
TODO_PUBLIC_SUBMIT_REDIRECT = 'dashboard'
|
||||
|
||||
# additionnal classes the comment body should hold
|
||||
# adding "text-monospace" makes comment monospace
|
||||
TODO_COMMENT_CLASSES = []
|
||||
```
|
||||
|
||||
The current django-todo version number is available from the [todo package](https://github.com/shacker/django-todo/blob/master/todo/__init__.py):
|
||||
|
|
|
@ -142,7 +142,7 @@
|
|||
{{ comment.date|date:"F d Y P" }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="text-monospace card-body">
|
||||
<div class="{{ comment_classes | join:" " }} card-body">
|
||||
{{ comment.body|safe|urlize|linebreaks }}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2,6 +2,7 @@ import bleach
|
|||
import datetime
|
||||
|
||||
from django import forms
|
||||
from django.conf import settings
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.decorators import login_required, user_passes_test
|
||||
from django.core.exceptions import PermissionDenied
|
||||
|
@ -131,6 +132,7 @@ def task_detail(request, task_id: int) -> HttpResponse:
|
|||
"form": form,
|
||||
"merge_form": merge_form,
|
||||
"thedate": thedate,
|
||||
"comment_classes": getattr(settings, 'TODO_COMMENT_CLASSES', []),
|
||||
}
|
||||
|
||||
return render(request, "todo/task_detail.html", context)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue