2024-10-19 23:05:34 +00:00
|
|
|
from django.contrib.staticfiles.storage import staticfiles_storage
|
|
|
|
from django.forms import Textarea
|
|
|
|
|
|
|
|
|
|
|
|
class MarkdownInput(Textarea):
|
|
|
|
template_name = "core/widgets/markdown_textarea.jinja"
|
|
|
|
|
|
|
|
def get_context(self, name, value, attrs):
|
|
|
|
context = super().get_context(name, value, attrs)
|
|
|
|
|
|
|
|
context["statics"] = {
|
2024-11-18 14:36:05 +00:00
|
|
|
"js": staticfiles_storage.url("bundled/core/components/easymde-index.ts"),
|
2024-11-19 15:19:13 +00:00
|
|
|
"css": staticfiles_storage.url("bundled/core/components/easymde-index.css"),
|
2024-10-19 23:05:34 +00:00
|
|
|
}
|
|
|
|
return context
|