Commit d2021ecf authored by Sli's avatar Sli

com: use MarkdownInput for weekmail

parent d53d7254
...@@ -49,7 +49,7 @@ from core.views import ( ...@@ -49,7 +49,7 @@ from core.views import (
CanCreateMixin, CanCreateMixin,
QuickNotifMixin, QuickNotifMixin,
) )
from core.views.forms import SelectDateTime from core.views.forms import SelectDateTime, MarkdownInput
from core.models import Notification, RealGroup, User from core.models import Notification, RealGroup, User
from club.models import Club, Mailing from club.models import Club, Mailing
...@@ -461,6 +461,12 @@ class WeekmailEditView(ComTabsMixin, QuickNotifMixin, CanEditPropMixin, UpdateVi ...@@ -461,6 +461,12 @@ class WeekmailEditView(ComTabsMixin, QuickNotifMixin, CanEditPropMixin, UpdateVi
Weekmail, Weekmail,
fields=["title", "intro", "joke", "protip", "conclusion"], fields=["title", "intro", "joke", "protip", "conclusion"],
help_texts={"title": _("Delete and save to regenerate")}, help_texts={"title": _("Delete and save to regenerate")},
widgets={
"intro": MarkdownInput,
"joke": MarkdownInput,
"protip": MarkdownInput,
"conclusion": MarkdownInput,
},
) )
success_url = reverse_lazy("com:weekmail") success_url = reverse_lazy("com:weekmail")
current_tab = "weekmail" current_tab = "weekmail"
...@@ -533,7 +539,11 @@ class WeekmailArticleEditView( ...@@ -533,7 +539,11 @@ class WeekmailArticleEditView(
"""Edit an article""" """Edit an article"""
model = WeekmailArticle model = WeekmailArticle
fields = ["title", "club", "content"] form_class = modelform_factory(
WeekmailArticle,
fields=["title", "club", "content"],
widgets={"content": MarkdownInput},
)
pk_url_kwarg = "article_id" pk_url_kwarg = "article_id"
template_name = "core/edit.jinja" template_name = "core/edit.jinja"
success_url = reverse_lazy("com:weekmail") success_url = reverse_lazy("com:weekmail")
...@@ -545,7 +555,11 @@ class WeekmailArticleCreateView(QuickNotifMixin, CreateView): ...@@ -545,7 +555,11 @@ class WeekmailArticleCreateView(QuickNotifMixin, CreateView):
"""Post an article""" """Post an article"""
model = WeekmailArticle model = WeekmailArticle
fields = ["title", "club", "content"] form_class = modelform_factory(
WeekmailArticle,
fields=["title", "club", "content"],
widgets={"content": MarkdownInput},
)
template_name = "core/create.jinja" template_name = "core/create.jinja"
success_url = reverse_lazy("core:user_tools") success_url = reverse_lazy("core:user_tools")
quick_notif_url_arg = "qn_weekmail_new_article" quick_notif_url_arg = "qn_weekmail_new_article"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment